riverwalk.c revision 275c9da86e89f8abf71135cf63d9fc23671b2e60
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <string.h>
#include <strings.h>
#include <scsi/libses_plugin.h>
#pragma pack(1)
typedef struct ses_riverwalk_stringin {
char rws_sim0_id[4];
char rws_sim0_pn[15];
char rws_sim0_sn[20];
char rws_sim1_id[4];
char rws_sim1_pn[15];
char rws_sim1_sn[20];
char rws_mid_id[4];
char rws_mid_pn[15];
char rws_mid_sn[20];
char rws_ps0_id[4];
char rws_ps0_pn[15];
char rws_ps0_sn[20];
char rws_ps1_id[4];
char rws_ps1_pn[15];
char rws_ps1_sn[20];
char __reserved1[29];
char rws_port0[16];
char rws_port1[16];
char rws_port2[16];
#pragma pack()
/*ARGSUSED*/
static int
{
int nverr;
char buf[32];
return (0);
/*
* Find the containing enclosure node and extract the STRING IN
* information.
*/
;
return (0);
if (len < sizeof (ses_riverwalk_stringin_t))
return (0);
switch (ses_node_type(np)) {
case SES_NODE_ELEMENT:
/*
* We can get part and serial information for power supplies and
* the SIM cards (ESC_ELECTRONICS elements).
*/
&type) == 0);
&index) == 0);
switch (type) {
case SES_ET_POWER_SUPPLY:
switch (index) {
case 0:
break;
break;
case 1:
break;
break;
}
break;
case SES_ET_ESC_ELECTRONICS:
switch (index) {
case 0:
break;
break;
case 1:
break;
break;
}
break;
}
return (0);
if (pn[0] != '\0') {
buf);
}
if (sn[0] != '\0') {
sn);
}
break;
case SES_NODE_ENCLOSURE:
/*
* The chassis serial number is derived from the MID FRU
* descriptor.
*/
sizeof (strp->rws_mid_sn));
buf);
}
break;
}
return (0);
}
int
{
};
&config) != 0);
}