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