1*7269Seschrock /*
2*7269Seschrock  * CDDL HEADER START
3*7269Seschrock  *
4*7269Seschrock  * The contents of this file are subject to the terms of the
5*7269Seschrock  * Common Development and Distribution License (the "License").
6*7269Seschrock  * You may not use this file except in compliance with the License.
7*7269Seschrock  *
8*7269Seschrock  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*7269Seschrock  * or http://www.opensolaris.org/os/licensing.
10*7269Seschrock  * See the License for the specific language governing permissions
11*7269Seschrock  * and limitations under the License.
12*7269Seschrock  *
13*7269Seschrock  * When distributing Covered Code, include this CDDL HEADER in each
14*7269Seschrock  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*7269Seschrock  * If applicable, add the following below this CDDL HEADER, with the
16*7269Seschrock  * fields enclosed by brackets "[]" replaced with your own identifying
17*7269Seschrock  * information: Portions Copyright [yyyy] [name of copyright owner]
18*7269Seschrock  *
19*7269Seschrock  * CDDL HEADER END
20*7269Seschrock  */
21*7269Seschrock 
22*7269Seschrock /*
23*7269Seschrock  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*7269Seschrock  * Use is subject to license terms.
25*7269Seschrock  */
26*7269Seschrock 
27*7269Seschrock #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*7269Seschrock 
29*7269Seschrock /*
30*7269Seschrock  * This module represents the expander on the disk backplane for the X4240 and
31*7269Seschrock  * other Sun platforms.  Its purpose is to set a property indicating this is an
32*7269Seschrock  * internal enclosure.
33*7269Seschrock  */
34*7269Seschrock 
35*7269Seschrock #include <scsi/libses.h>
36*7269Seschrock #include <scsi/libses_plugin.h>
37*7269Seschrock 
38*7269Seschrock /*ARGSUSED*/
39*7269Seschrock static int
lsilogic_parse_node(ses_plugin_t * sp,ses_node_t * np)40*7269Seschrock lsilogic_parse_node(ses_plugin_t *sp, ses_node_t *np)
41*7269Seschrock {
42*7269Seschrock 	int nverr;
43*7269Seschrock 	nvlist_t *props;
44*7269Seschrock 
45*7269Seschrock 	if (ses_node_type(np) != SES_NODE_ENCLOSURE)
46*7269Seschrock 		return (0);
47*7269Seschrock 
48*7269Seschrock 	props = ses_node_props(np);
49*7269Seschrock 
50*7269Seschrock 	SES_NV_ADD(boolean_value, nverr, props, LIBSES_EN_PROP_INTERNAL,
51*7269Seschrock 	    B_TRUE);
52*7269Seschrock 
53*7269Seschrock 	return (0);
54*7269Seschrock }
55*7269Seschrock 
56*7269Seschrock int
_ses_init(ses_plugin_t * sp)57*7269Seschrock _ses_init(ses_plugin_t *sp)
58*7269Seschrock {
59*7269Seschrock 	ses_plugin_config_t config = {
60*7269Seschrock 		.spc_node_parse = lsilogic_parse_node
61*7269Seschrock 	};
62*7269Seschrock 
63*7269Seschrock 	return (ses_plugin_register(sp, LIBSES_PLUGIN_VERSION,
64*7269Seschrock 	    &config) != 0);
65*7269Seschrock }
66