Mercurial > illumos > illumos-gate
changeset 10234:c4cea2ed5803
6839705 libtopo needs updates in order to cope with ILOM 3
6840169 libtopo: topo xml schema and parsing code needs to be extended to support defining array propvals
6840764 fmtopo can't print TOPO_TYPE_INT32_ARRAY and TOPO_TYPE_UINT64_ARRAY propvals
6844530 dimm/cs serial propmethods in chip enumerator needlessly recompute IPMI entity name
6836314 add support for sensor-transport module on ILOM-based X4450 platforms
6844635 libtopo: pull chassis-specific xml out of i86pc-hc-topology.xml into seperate map
6844639 libtopo: add DIMM serial to chip-select nodes on X4140/4240/4440
6845699 libipmi: implementation of ipmi_sunoem_led_get/set interfaces needs to be updated for ILOM 3
6677012 libtopo: small leaks on snapshot creation
6535637 Add Severity level to payload of list.suspects event
6850083 libtopo: need to add JEDEC id for Hyundai Electronics to jedec_tbl in the chip enumerator
6844145 sys/bmc_intf.h should be delivered
6855750 fmadm faulty will fail to expand message tokens that reference event payload
6862378 libtopo: need to register TOPO_METH_SENSOR_FAILURE on ses nodes
line wrap: on
line diff
--- a/usr/src/cmd/fm/fmadm/common/faulty.c Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/cmd/fm/fmadm/common/faulty.c Fri Jul 31 13:25:53 2009 -0700 @@ -182,6 +182,7 @@ ari_list_t *ari_uuid_list; name_list_t *asru; uint64_t sec; + nvlist_t *event; } uurec_t; typedef struct uurec_select { @@ -1052,6 +1053,8 @@ uurec_p->uuid = strdup(uuid); uurec_p->sec = sec; uurec_p->ari_uuid_list = NULL; + uurec_p->event = NULL; + (void) nvlist_dup(nvl, &uurec_p->event, 0); host = find_hostid(nvl); if (not_suppressed && !opt_g) status_rec_p = NULL; @@ -1145,9 +1148,9 @@ } static void -print_dict_info_line(char *msgid, fmd_msg_item_t what, const char *linehdr) +print_dict_info_line(nvlist_t *e, fmd_msg_item_t what, const char *linehdr) { - char *cp = fmd_msg_getitem_id(fmadm_msghdl, NULL, msgid, what); + char *cp = fmd_msg_getitem_nv(fmadm_msghdl, NULL, e, what); if (cp) { print_line(dgettext("FMD", linehdr), cp); @@ -1156,12 +1159,12 @@ } static void -print_dict_info(char *msgid) +print_dict_info(nvlist_t *nvl) { - print_dict_info_line(msgid, FMD_MSG_ITEM_DESC, "Description : "); - print_dict_info_line(msgid, FMD_MSG_ITEM_RESPONSE, "Response : "); - print_dict_info_line(msgid, FMD_MSG_ITEM_IMPACT, "Impact : "); - print_dict_info_line(msgid, FMD_MSG_ITEM_ACTION, "Action : "); + print_dict_info_line(nvl, FMD_MSG_ITEM_DESC, "Description : "); + print_dict_info_line(nvl, FMD_MSG_ITEM_RESPONSE, "Response : "); + print_dict_info_line(nvl, FMD_MSG_ITEM_IMPACT, "Impact : "); + print_dict_info_line(nvl, FMD_MSG_ITEM_ACTION, "Action : "); } static void @@ -1483,7 +1486,7 @@ print_name_list(srp->serial, dgettext("FMD", "Serial ID. :"), NULL, 0, 0, NULL, full); } - print_dict_info(srp->msgid); + print_dict_info(srp->uurec->event); (void) printf("\n"); } @@ -1699,7 +1702,7 @@ if (msgid == NULL || strcmp(msgid, srp->msgid) != 0) { msgid = srp->msgid; - print_dict_info(srp->msgid); + print_dict_info(uurp->event); } slp = slp->next; } while (slp != end); @@ -1817,7 +1820,8 @@ int rt = FMADM_EXIT_SUCCESS; /* - * These calls may fail with Protocol error if message payload is to big + * These calls may fail with Protocol error if message payload is + * too big */ if (fmd_adm_case_iter(adm, NULL, dfault_rec, uurecp) != 0) die("failed to get case list from fmd");
--- a/usr/src/cmd/fm/fmd/Makefile.fmd Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/cmd/fm/fmd/Makefile.fmd Fri Jul 31 13:25:53 2009 -0700 @@ -19,11 +19,9 @@ # CDDL HEADER END # # -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# .KEEP_STATE: @@ -117,7 +115,7 @@ $(PROG) := LDFLAGS += -R/usr/lib/fm $(PROG) := LDLIBS += -L$(ROOTLIB)/fm -ltopo -ldiagcode -lsysevent -lsmbios \ - -luuid -lnvpair -lexacct -lnsl -lumem -ldevinfo + -luuid -lnvpair -lexacct -lnsl -lumem -ldevinfo -lfmd_msg $(DMOD) := CFLAGS += $(CC_PICFLAGS) -G $(XREGSFLAG) $(DMOD) := LDFLAGS += $(ZTEXT) $(ZDEFS) $(MAPFILE-DMOD:%=-M%)
--- a/usr/src/cmd/fm/fmd/common/fmd_protocol.c Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/cmd/fm/fmd/common/fmd_protocol.c Fri Jul 31 13:25:53 2009 -0700 @@ -25,6 +25,7 @@ */ #include <sys/fm/protocol.h> +#include <fm/fmd_msg.h> #include <strings.h> #include <alloca.h> #include <stdio.h> @@ -143,6 +144,8 @@ int64_t tod[2]; nvlist_t *nvl; int err = 0; + fmd_msg_hdl_t *msghdl; + char *severity; tod[0] = tvp->tv_sec; tod[1] = tvp->tv_usec; @@ -170,6 +173,25 @@ FM_SUSPECT_FAULT_STATUS, flagv, argc); } + /* + * Attempt to lookup the severity associated with this diagnosis from + * the portable object file using the diag code. Failure to init + * libfmd_msg or add to the nvlist will be treated as fatal. However, + * we won't treat a fmd_msg_getitem_id failure as fatal since during + * development it's not uncommon to be working with po/dict files that + * haven't yet been updated with newly added diagnoses. + */ + msghdl = fmd_msg_init(fmd.d_rootdir, FMD_MSG_VERSION); + if (msghdl == NULL) + fmd_panic("failed to initialize libfmd_msg\n"); + + if ((severity = fmd_msg_getitem_id(msghdl, NULL, code, + FMD_MSG_ITEM_SEVERITY)) != NULL) { + err |= nvlist_add_string(nvl, FM_SUSPECT_SEVERITY, severity); + free(severity); + } + fmd_msg_fini(msghdl); + if (err != 0) fmd_panic("failed to populate nvlist: %s\n", fmd_strerror(err));
--- a/usr/src/cmd/fm/fmtopo/common/fmtopo.c Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/cmd/fm/fmtopo/common/fmtopo.c Fri Jul 31 13:25:53 2009 -0700 @@ -418,6 +418,16 @@ topo_hdl_strfree(thp, fmri); break; } + case DATA_TYPE_INT32_ARRAY: { + int32_t *val; + + (void) nvpair_value_int32_array(pv_nvp, &val, &nelem); + (void) printf(" [ "); + for (i = 0; i < nelem; i++) + (void) printf("%d ", val[i]); + (void) printf("]"); + break; + } case DATA_TYPE_UINT32_ARRAY: { uint32_t *val; @@ -438,13 +448,23 @@ (void) printf("]"); break; } + case DATA_TYPE_UINT64_ARRAY: { + uint64_t *val; + + (void) nvpair_value_uint64_array(pv_nvp, &val, &nelem); + (void) printf(" [ "); + for (i = 0; i < nelem; i++) + (void) printf("%llu ", val[i]); + (void) printf("]"); + break; + } case DATA_TYPE_STRING_ARRAY: { char **val; (void) nvpair_value_string_array(pv_nvp, &val, &nelem); (void) printf(" [ "); for (i = 0; i < nelem; i++) - (void) printf("%s ", val[i]); + (void) printf("\"%s\" ", val[i]); (void) printf("]"); break; }
--- a/usr/src/lib/fm/topo/libtopo/common/libtopo.h Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/libtopo/common/libtopo.h Fri Jul 31 13:25:53 2009 -0700 @@ -228,6 +228,8 @@ #define TOPO_PROP_ISA "isa" #define TOPO_PROP_MACHINE "machine" +#define TOPO_PGROUP_IPMI "ipmi" + /* * These enum definitions are used to define a set of error tags associated with * libtopo error conditions occuring during the adminstration of
--- a/usr/src/lib/fm/topo/libtopo/common/topo_parse.h Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/libtopo/common/topo_parse.h Fri Jul 31 13:25:53 2009 -0700 @@ -130,21 +130,26 @@ /* * Valid .xml element and attribute names */ +#define Argitem "argitem" #define Argval "argval" #define Children "children" #define Dependents "dependents" #define Facility "facility" #define FMRI "fmri" +#define FMRI_Arr "fmri_array" #define Grouping "grouping" #define Immutable "immutable" #define Indicator "indicator" #define Instance "instance" #define Int32 "int32" +#define Int32_Arr "int32_array" #define Int64 "int64" +#define Int64_Arr "int64_array" #define Ipmi "ipmi" #define Mutable "mutable" #define Name "name" #define Nonvolatile "nonvolatile" +#define Propitem "propitem" #define Propname "propname" #define Proptype "proptype" #define Provider "provider" @@ -156,11 +161,13 @@ #define Siblings "siblings" #define Static "static" #define String "string" +#define String_Arr "string_array" #define Topology "topology" #define Type "type" #define UInt32 "uint32" -#define UInt32_Arr "uint32arr" +#define UInt32_Arr "uint32_array" #define UInt64 "uint64" +#define UInt64_Arr "uint64_array" #define Value "value" #define Verify "verify" #define Version "version"
--- a/usr/src/lib/fm/topo/libtopo/common/topo_xml.c Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/libtopo/common/topo_xml.c Fri Jul 31 13:25:53 2009 -0700 @@ -55,6 +55,16 @@ tf_pad_t **); +static void +strarr_free(topo_mod_t *mod, char **arr, uint_t nelems) +{ + int i; + + for (i = 0; i < nelems; i++) + topo_mod_strfree(mod, arr[i]); + topo_mod_free(mod, arr, (nelems * sizeof (char *))); +} + int xmlattr_to_stab(topo_mod_t *mp, xmlNodePtr n, const char *stabname, topo_stability_t *rs) @@ -159,6 +169,18 @@ rv = TOPO_TYPE_FMRI; } else if (xmlStrcmp(str, (xmlChar *)String) == 0) { rv = TOPO_TYPE_STRING; + } else if (xmlStrcmp(str, (xmlChar *)Int32_Arr) == 0) { + rv = TOPO_TYPE_INT32_ARRAY; + } else if (xmlStrcmp(str, (xmlChar *)UInt32_Arr) == 0) { + rv = TOPO_TYPE_UINT32_ARRAY; + } else if (xmlStrcmp(str, (xmlChar *)Int64_Arr) == 0) { + rv = TOPO_TYPE_INT64_ARRAY; + } else if (xmlStrcmp(str, (xmlChar *)UInt64_Arr) == 0) { + rv = TOPO_TYPE_UINT64_ARRAY; + } else if (xmlStrcmp(str, (xmlChar *)String_Arr) == 0) { + rv = TOPO_TYPE_STRING_ARRAY; + } else if (xmlStrcmp(str, (xmlChar *)FMRI_Arr) == 0) { + rv = TOPO_TYPE_FMRI_ARRAY; } else { topo_dprintf(mp->tm_hdl, TOPO_DBG_ERR, "Unrecognized type attribute value '%s'.\n", str); @@ -176,11 +198,15 @@ { int rv; uint64_t ui; + uint_t i = 0, nelems = 0; nvlist_t *fmri; xmlChar *str; + char **strarrbuf; + void *arrbuf; + nvlist_t **nvlarrbuf; + xmlNodePtr cn; - topo_dprintf(mp->tm_hdl, TOPO_DBG_XML, "xlate_common (name=%s)\n", - name); + topo_dprintf(mp->tm_hdl, TOPO_DBG_XML, "xlate_common(name=%s)\n", name); switch (ptype) { case TOPO_TYPE_INT32: if (xmlattr_to_int(mp, xn, Value, &ui) < 0) @@ -214,11 +240,179 @@ rv = nvlist_add_string(nvl, name, (char *)str); xmlFree(str); break; + case TOPO_TYPE_INT32_ARRAY: + case TOPO_TYPE_UINT32_ARRAY: + case TOPO_TYPE_INT64_ARRAY: + case TOPO_TYPE_UINT64_ARRAY: + for (cn = xn->xmlChildrenNode; cn != NULL; cn = cn->next) + if ((xmlStrcmp(cn->name, (xmlChar *)Propitem) == 0) || + (xmlStrcmp(cn->name, (xmlChar *)Argitem) == 0)) + nelems++; + + if (nelems < 1) { + topo_dprintf(mp->tm_hdl, TOPO_DBG_ERR, "No <propitem> " + "or <argitem> elements found for array val"); + return (-1); + } + if ((arrbuf = topo_mod_alloc(mp, (nelems * sizeof (uint64_t)))) + == NULL) + return (topo_mod_seterrno(mp, ETOPO_NOMEM)); + break; + case TOPO_TYPE_STRING_ARRAY: + for (cn = xn->xmlChildrenNode; cn != NULL; cn = cn->next) + if ((xmlStrcmp(cn->name, (xmlChar *)Propitem) == 0) || + (xmlStrcmp(cn->name, (xmlChar *)Argitem) == 0)) + nelems++; + + if (nelems < 1) { + topo_dprintf(mp->tm_hdl, TOPO_DBG_ERR, "No <propitem> " + "or <argitem> elements found for array val"); + return (-1); + } + if ((strarrbuf = topo_mod_alloc(mp, (nelems * sizeof (char *)))) + == NULL) + return (topo_mod_seterrno(mp, ETOPO_NOMEM)); + break; + case TOPO_TYPE_FMRI_ARRAY: + for (cn = xn->xmlChildrenNode; cn != NULL; cn = cn->next) + if ((xmlStrcmp(cn->name, (xmlChar *)Propitem) == 0) || + (xmlStrcmp(cn->name, (xmlChar *)Argitem) == 0)) + nelems++; + + if (nelems < 1) { + topo_dprintf(mp->tm_hdl, TOPO_DBG_ERR, "No <propitem> " + "elements found for array prop"); + return (-1); + } + if ((nvlarrbuf = topo_mod_alloc(mp, (nelems * + sizeof (nvlist_t *)))) == NULL) + return (topo_mod_seterrno(mp, ETOPO_NOMEM)); + break; default: topo_dprintf(mp->tm_hdl, TOPO_DBG_ERR, - "Unrecognized type attribute.\n"); + "Unrecognized type attribute (ptype = %d)\n", ptype); return (topo_mod_seterrno(mp, ETOPO_PRSR_BADTYPE)); } + + switch (ptype) { + case TOPO_TYPE_INT32_ARRAY: + for (cn = xn->xmlChildrenNode; cn != NULL; cn = cn->next) { + if ((xmlStrcmp(cn->name, (xmlChar *)Propitem) == 0) || + (xmlStrcmp(cn->name, (xmlChar *)Argitem) == 0)) { + + if ((str = xmlGetProp(xn, (xmlChar *)Value)) + == NULL) + return (-1); + + ((int32_t *)arrbuf)[i++] + = atoi((const char *)str); + xmlFree(str); + } + } + + rv = nvlist_add_int32_array(nvl, name, (int32_t *)arrbuf, + nelems); + free(arrbuf); + break; + case TOPO_TYPE_UINT32_ARRAY: + for (cn = xn->xmlChildrenNode; cn != NULL; cn = cn->next) { + if ((xmlStrcmp(cn->name, (xmlChar *)Propitem) == 0) || + (xmlStrcmp(cn->name, (xmlChar *)Argitem) == 0)) { + + if ((str = xmlGetProp(xn, (xmlChar *)Value)) + == NULL) + return (-1); + + ((uint32_t *)arrbuf)[i++] + = atoi((const char *)str); + xmlFree(str); + } + } + + rv = nvlist_add_uint32_array(nvl, name, (uint32_t *)arrbuf, + nelems); + free(arrbuf); + break; + case TOPO_TYPE_INT64_ARRAY: + for (cn = xn->xmlChildrenNode; cn != NULL; cn = cn->next) { + if ((xmlStrcmp(cn->name, (xmlChar *)Propitem) == 0) || + (xmlStrcmp(cn->name, (xmlChar *)Argitem) == 0)) { + + if ((str = xmlGetProp(xn, (xmlChar *)Value)) + == NULL) + return (-1); + + ((int64_t *)arrbuf)[i++] + = atol((const char *)str); + xmlFree(str); + } + } + + rv = nvlist_add_int64_array(nvl, name, (int64_t *)arrbuf, + nelems); + free(arrbuf); + break; + case TOPO_TYPE_UINT64_ARRAY: + for (cn = xn->xmlChildrenNode; cn != NULL; cn = cn->next) { + if ((xmlStrcmp(cn->name, (xmlChar *)Propitem) == 0) || + (xmlStrcmp(cn->name, (xmlChar *)Argitem) == 0)) { + + if ((str = xmlGetProp(xn, (xmlChar *)Value)) + == NULL) + return (-1); + + ((uint64_t *)arrbuf)[i++] + = atol((const char *)str); + xmlFree(str); + } + } + + rv = nvlist_add_uint64_array(nvl, name, arrbuf, + nelems); + free(arrbuf); + break; + case TOPO_TYPE_STRING_ARRAY: + for (cn = xn->xmlChildrenNode; cn != NULL; cn = cn->next) { + if ((xmlStrcmp(cn->name, (xmlChar *)Propitem) == 0) || + (xmlStrcmp(cn->name, (xmlChar *)Argitem) == 0)) { + + if ((str = xmlGetProp(cn, (xmlChar *)Value)) + == NULL) + return (-1); + + strarrbuf[i++] = + topo_mod_strdup(mp, (const char *)str); + xmlFree(str); + } + } + + rv = nvlist_add_string_array(nvl, name, strarrbuf, nelems); + strarr_free(mp, strarrbuf, nelems); + break; + case TOPO_TYPE_FMRI_ARRAY: + for (cn = xn->xmlChildrenNode; cn != NULL; cn = cn->next) { + if ((xmlStrcmp(cn->name, (xmlChar *)Propitem) == 0) || + (xmlStrcmp(cn->name, (xmlChar *)Argitem) == 0)) { + + if ((str = xmlGetProp(xn, (xmlChar *)Value)) + == NULL) + return (-1); + + if (topo_mod_str2nvl(mp, (const char *)str, + &(nvlarrbuf[i++])) < 0) { + xmlFree(str); + return (-1); + } + xmlFree(str); + } + } + + rv = nvlist_add_nvlist_array(nvl, name, nvlarrbuf, + nelems); + free(nvlarrbuf); + break; + } + if (rv != 0) { topo_dprintf(mp->tm_hdl, TOPO_DBG_ERR, "Nvlist construction failed.\n"); @@ -325,12 +519,13 @@ nvlist_t *pfmri, tnode_t *ptn, const char *gnm, const char *pnm, topo_type_t ptype, int flag) { - nvlist_t *fmri; - uint32_t ui32; - uint64_t ui64; - int32_t i32; - int64_t i64; - char *str; + nvlist_t *fmri, **fmriarr; + uint32_t ui32, *ui32arr; + uint64_t ui64, *ui64arr; + int32_t i32, *i32arr; + int64_t i64, *i64arr; + uint_t nelem; + char *str, **strarr; int err, e; topo_dprintf(mp->tm_hdl, TOPO_DBG_XML, "prop_create(pgrp = %s, " @@ -354,6 +549,29 @@ case TOPO_TYPE_STRING: e = nvlist_lookup_string(pfmri, INV_PVAL, &str); break; + case TOPO_TYPE_INT32_ARRAY: + e = nvlist_lookup_int32_array(pfmri, INV_PVAL, &i32arr, &nelem); + break; + case TOPO_TYPE_UINT32_ARRAY: + e = nvlist_lookup_uint32_array(pfmri, INV_PVAL, &ui32arr, + &nelem); + break; + case TOPO_TYPE_INT64_ARRAY: + e = nvlist_lookup_int64_array(pfmri, INV_PVAL, &i64arr, + &nelem); + break; + case TOPO_TYPE_UINT64_ARRAY: + e = nvlist_lookup_uint64_array(pfmri, INV_PVAL, &ui64arr, + &nelem); + break; + case TOPO_TYPE_STRING_ARRAY: + e = nvlist_lookup_string_array(pfmri, INV_PVAL, &strarr, + &nelem); + break; + case TOPO_TYPE_FMRI_ARRAY: + e = nvlist_lookup_nvlist_array(pfmri, INV_PVAL, &fmriarr, + &nelem); + break; default: e = ETOPO_PRSR_BADTYPE; } @@ -381,6 +599,30 @@ case TOPO_TYPE_STRING: e = topo_prop_set_string(ptn, gnm, pnm, flag, str, &err); break; + case TOPO_TYPE_INT32_ARRAY: + e = topo_prop_set_int32_array(ptn, gnm, pnm, flag, i32arr, + nelem, &err); + break; + case TOPO_TYPE_UINT32_ARRAY: + e = topo_prop_set_uint32_array(ptn, gnm, pnm, flag, ui32arr, + nelem, &err); + break; + case TOPO_TYPE_INT64_ARRAY: + e = topo_prop_set_int64_array(ptn, gnm, pnm, flag, i64arr, + nelem, &err); + break; + case TOPO_TYPE_UINT64_ARRAY: + e = topo_prop_set_uint64_array(ptn, gnm, pnm, flag, ui64arr, + nelem, &err); + break; + case TOPO_TYPE_STRING_ARRAY: + e = topo_prop_set_string_array(ptn, gnm, pnm, flag, + (const char **)strarr, nelem, &err); + break; + case TOPO_TYPE_FMRI_ARRAY: + e = topo_prop_set_fmri_array(ptn, gnm, pnm, flag, + (const nvlist_t **)fmriarr, nelem, &err); + break; } if (e != 0 && err != ETOPO_PROP_DEFD) { @@ -1664,12 +1906,19 @@ * If we haven't found a set that contains our product AND a default set * exists, then we'll process it. */ - if (!joined_set && def_set) - if (topo_xml_walk(mp, xinfo, def_set, troot) == NULL) { + if (!joined_set && def_set) { + if ((rdp = topo_xml_walk(mp, xinfo, def_set, troot)) == NULL) { topo_dprintf(mp->tm_hdl, TOPO_DBG_XML, "topo_xml_walk: failed2\n"); } - + if (pr == NULL) { + rr = pr = rdp; + } else { + pr->rd_next = rdp; + pr = rdp; + } + rr->rd_cnt++; + } /* * Now we're interested in children xmlNodes of croot tagged * as 'ranges'. These define what topology nodes may exist, and need
--- a/usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-X4500/Sun-Fire-X4500-disk-hc-topology.xmlgen Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-X4500/Sun-Fire-X4500-disk-hc-topology.xmlgen Fri Jul 31 13:25:53 2009 -0700 @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl -w # # CDDL HEADER START # @@ -20,11 +20,9 @@ # CDDL HEADER END # # -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" -# $num_bays = 48; $bay_label = "HD_ID_"; @@ -84,12 +82,14 @@ data-stability='Private' > <propval name='type' type='uint32' value='1' /> <propmethod name='ipmi_entity' version='0' propname='entity_ref' - proptype='string' > - <argval name='format' type='string' value='hdd\%d.ok2rm.led' /> + proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='hdd\%d.ok2rm.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> - <propmethod name='thumper_locate_mode' version='0' + <propmethod name='bay_locate_mode' version='0' propname='mode' proptype='uint32' mutable='1'> </propmethod> </propgroup> @@ -99,12 +99,14 @@ data-stability='Private' > <propval name='type' type='uint32' value='2' /> <propmethod name='ipmi_entity' version='0' propname='entity_ref' - proptype='string' > - <argval name='format' type='string' value='hdd\%d.state' /> + proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='hdd\%d.state' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> - <propmethod name='thumper_indicator_mode' version='0' + <propmethod name='bay_indicator_mode' version='0' propname='mode' proptype='uint32' mutable='1'> </propmethod> </propgroup> @@ -114,12 +116,14 @@ data-stability='Private' > <propval name='type' type='uint32' value='0' /> <propmethod name='ipmi_entity' version='0' propname='entity_ref' - proptype='string' > - <argval name='format' type='string' value='hdd\%d.state' /> + proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='hdd\%d.state' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> - <propmethod name='thumper_indicator_mode' version='0' propname='mode' + <propmethod name='bay_indicator_mode' version='0' propname='mode' proptype='uint32' mutable='1'> </propmethod> </propgroup> @@ -129,12 +133,14 @@ data-stability='Private' > <propval name='type' type='uint32' value='3' /> <propmethod name='ipmi_entity' version='0' propname='entity_ref' - proptype='string' > - <argval name='format' type='string' value='hdd\%d.state' /> + proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='hdd\%d.state' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> - <propmethod name='thumper_indicator_mode' version='0' propname='mode' + <propmethod name='x4500_present_mode' version='0' propname='mode' proptype='uint32' mutable='1'> </propmethod> </propgroup>
--- a/usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-X4540/Sun-Fire-X4540-disk-hc-topology.xmlgen Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-X4540/Sun-Fire-X4540-disk-hc-topology.xmlgen Fri Jul 31 13:25:53 2009 -0700 @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl -w # # CDDL HEADER START # @@ -20,7 +20,7 @@ # CDDL HEADER END # # -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -82,12 +82,15 @@ data-stability='Private' > <propval name='type' type='uint32' value='1' /> <propmethod name='ipmi_entity' version='0' propname='entity_ref' - proptype='string' > - <argval name='format' type='string' value='hdd\%d.ok2rm.led' /> + proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='DBP/HDD\%d/OK2RM' /> + <argitem value='hdd\%d.ok2rm.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> - <propmethod name='thumper_locate_mode' version='0' + <propmethod name='bay_locate_mode' version='0' propname='mode' proptype='uint32' mutable='1'> </propmethod> </propgroup> @@ -97,12 +100,17 @@ data-stability='Private' > <propval name='type' type='uint32' value='2' /> <propmethod name='ipmi_entity' version='0' propname='entity_ref' - proptype='string' > - <argval name='format' type='string' value='hdd\%d.state' /> + proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='DBP/HDD\%d/STATE' /> + <argitem value='hdd\%d.state' /> + <argitem value='DBP/HDD\%d/OK2RM' /> + <argitem value='hdd\%d.ok2rm.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> - <propmethod name='thumper_indicator_mode' version='0' + <propmethod name='bay_indicator_mode' version='0' propname='mode' proptype='uint32' mutable='1'> </propmethod> </propgroup> @@ -112,31 +120,21 @@ data-stability='Private' > <propval name='type' type='uint32' value='0' /> <propmethod name='ipmi_entity' version='0' propname='entity_ref' - proptype='string' > - <argval name='format' type='string' value='hdd\%d.state' /> + proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='DBP/HDD\%d/STATE' /> + <argitem value='hdd\%d.state' /> + <argitem value='DBP/HDD\%d/SVC' /> + <argitem value='hdd\%d.fail.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> - <propmethod name='thumper_indicator_mode' version='0' propname='mode' + <propmethod name='bay_indicator_mode' version='0' propname='mode' proptype='uint32' mutable='1'> </propmethod> </propgroup> </facility> - <facility name='present' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' - data-stability='Private' > - <propval name='type' type='uint32' value='3' /> - <propmethod name='ipmi_entity' version='0' propname='entity_ref' - proptype='string' > - <argval name='format' type='string' value='hdd\%d.state' /> - <argval name='offset' type='uint32' value='0' /> - <argval name='nparams' type='uint32' value='1' /> - </propmethod> - <propmethod name='thumper_indicator_mode' version='0' propname='mode' - proptype='uint32' mutable='1'> - </propmethod> - </propgroup> - </facility> EOF my @pci0=(0, 0, 0, 0x3c, 0x3c, 0x3c);
--- a/usr/src/lib/fm/topo/maps/common/topology.dtd.1 Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/maps/common/topology.dtd.1 Fri Jul 31 13:25:53 2009 -0700 @@ -36,7 +36,7 @@ XInclude support Topologies may be composed via the xi:include tag. - libtopo(3LIB) interfaces enforce that all composed topologies be of the + libtopo interfaces enforce that all composed topologies be of the same scheme. --> @@ -69,19 +69,42 @@ name The name of this property. type The data type for this property. - + value The value for this property. Must match type restriction of type attribute. + + This is optional for array types + --> -<!ELEMENT propval EMPTY > +<!ELEMENT propval (propitem*) > <!ATTLIST propval name CDATA #REQUIRED type ( int32 | uint32 | int64 | uint64 | - string | fmri ) #REQUIRED + string | fmri | int32_array | uint32_array | + int64_array | uint64_array | string_array | + fmri_array ) #REQUIRED + value CDATA "" > +<!-- + propitem + + This element is an optional child element of propval and is used to + specify the values for array elements + + Its attributes are + + value The value for this property. Must match type + restriction of type attribute. + +--> + +<!ELEMENT propitem EMPTY > + +<!ATTLIST propitem value CDATA #REQUIRED > + <!-- propgroup @@ -154,15 +177,40 @@ name The name of the argument. type The data type of the argument. - value The value of the arg + value The value for this argument. Must match type + restriction of type attribute. + + This attribute is optional for array types --> -<!ELEMENT argval EMPTY> +<!ELEMENT argval (argitem*) > <!ATTLIST argval name CDATA #REQUIRED - type CDATA #REQUIRED - value CDATA #REQUIRED > + type ( int32 | uint32 | int64 | uint64 | + string | fmri | int32_array | uint32_array | + int64_array | uint64_array | string_array | + fmri_array ) #REQUIRED + value CDATA ""> + +<!-- + argitem + + This element is an optional child element of argval and is used to + specify the values for array elements + + Its attributes are + + value The value for this property. Must match type + restriction of type attribute. + +--> + +<!ELEMENT argitem EMPTY > + +<!ATTLIST argitem + value CDATA #REQUIRED > + <!-- propmethod
--- a/usr/src/lib/fm/topo/maps/common/xmlgen-header.xml Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/maps/common/xmlgen-header.xml Fri Jul 31 13:25:53 2009 -0700 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE topology SYSTEM "/usr/share/lib/xml/dtd/topology.dtd.1"> <!-- - Copyright 2008 Sun Microsystems, Inc. All rights reserved. + Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. CDDL HEADER START @@ -23,6 +23,5 @@ CDDL HEADER END - ident "%Z%%M% %I% %E% SMI" -->
--- a/usr/src/lib/fm/topo/maps/i86pc/Makefile Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/maps/i86pc/Makefile Fri Jul 31 13:25:53 2009 -0700 @@ -19,16 +19,15 @@ # CDDL HEADER END # # -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" ARCH = i86pc CLASS = arch DTDFILE = topology.dtd.1 TOPOFILE = i86pc-hc-topology.xml chip-hc-topology.xml psu-hc-topology.xml \ -fan-hc-topology.xml +fan-hc-topology.xml chassis-hc-topology.xml SRCDIR = ../i86pc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usr/src/lib/fm/topo/maps/i86pc/chassis-hc-topology.xml Fri Jul 31 13:25:53 2009 -0700 @@ -0,0 +1,243 @@ +<?xml version="1.0"?> +<!DOCTYPE topology SYSTEM "/usr/share/lib/xml/dtd/topology.dtd.1"> +<!-- + Copyright 2009 Sun Microsystems, Inc. All rights reserved. + Use is subject to license terms. + + 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 + or http://www.opensolaris.org/os/licensing. + 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 + +--> + +<topology name='chassis' scheme='hc'> + <range name='chassis' min='0' max='0'> + <node instance='0'> + <set type='product' setlist='Sun-Fire-X4140|Sun-Fire-X4240|Sun-Fire-X4440'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='INTSW' /> + <propitem value='sys.intsw' /> + </propval> + </propgroup> + <!-- + chassis service LED for X4140/X4240/X4440 + --> + <facility name='service' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='SERVICE' /> + <propitem value='fp.alert.led' /> + </propval> + <propval name='type' type='uint32' value='0' /> + <propmethod name='chassis_service_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + </set> + <set type='product' setlist='SUN-FIRE-X4150|SUN-FIRE-X4250|SUN-FIRE-X4450'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='/SYS/VPS' /> + </propval> + </propgroup> + </set> + <set type='product' setlist='Sun-Fire-X4100-Server|Sun-Fire-X4200-Server|Sun-Fire-X4100-M2|Sun-Fire-X4200-M2'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='sys.intsw' /> + </propval> + </propgroup> + <!-- + chassis back-panel and front-panel locate and service LED's + for X4100/X4200/X4100M2/X4200M2 + --> + <facility name='fp.locate' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='fp.locate.led' /> + </propval> + <propval name='type' type='uint32' value='1' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + <facility name='bp.locate' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='bp.locate.led' /> + </propval> + <propval name='type' type='uint32' value='1' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + <facility name='fp.service' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='fp.alert.led' /> + </propval> + <propval name='type' type='uint32' value='0' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + <facility name='bp.service' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='bp.alert.led' /> + </propval> + <propval name='type' type='uint32' value='0' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + </set> + <set type='product' setlist='Sun-Fire-X4500|Sun-Fire-X4540'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array'> + <propitem value='sys.intsw' /> + <propitem value='INTRUSION' /> + </propval> + </propgroup> + <!-- + chassis back-panel and front-panel locate and service LED's for X4500/X4540 + --> + <facility name='fp.locate' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='fp.locate.led' /> + <propitem value='LOCATE' /> + </propval> + <propval name='type' type='uint32' value='1' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + <facility name='bp.locate' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='bp.locate.led' /> + <propitem value='LOCATE' /> + </propval> + <propval name='type' type='uint32' value='1' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + <facility name='fp.service' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='fp.alert.led' /> + <propitem value='SERVICE' /> + </propval> + <propval name='type' type='uint32' value='0' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + <facility name='bp.service' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='bp.alert.led' /> + <propitem value='SERVICE' /> + </propval> + <propval name='type' type='uint32' value='0' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + <facility name='sys.top_svc.led' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='sys.top_svc.led' /> + <propitem value='TOP_SVC' /> + </propval> + <propval name='type' type='uint32' value='0' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + <facility name='sys.rear_svc.led' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='sys.rear_svc.led' /> + <propitem value='REAR_SVC' /> + </propval> + <propval name='type' type='uint32' value='0' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + </set> + <set type='product' setlist='Sun-Fire-X4600-M2'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='sys.intsw' /> + </propval> + </propgroup> + <!-- + chassis locate and service LED's for X4600M2 + --> + <facility name='locate' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='sys.locate.led' /> + </propval> + <propval name='type' type='uint32' value='1' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + <facility name='service' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > + <propval name='entity_ref' type='string_array' > + <propitem value='sys.alert.led' /> + </propval> + <propval name='type' type='uint32' value='0' /> + <propmethod name='ipmi_indicator_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + </set> + </node> + </range> +</topology>
--- a/usr/src/lib/fm/topo/maps/i86pc/chip-hc-topology.xml Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/maps/i86pc/chip-hc-topology.xml Fri Jul 31 13:25:53 2009 -0700 @@ -64,9 +64,11 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' value='MB/P%d' /> + <argval name='format' type='string_array'> + <argitem value='MB/P%d' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> @@ -92,9 +94,11 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' value='cpu%d.vpd' /> + <argval name='format' type='string_array'> + <argitem value='cpu%d.vpd' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> @@ -119,9 +123,11 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' value='p%d.fru' /> + <argval name='format' type='string_array'> + <argitem value='p%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> @@ -150,9 +156,12 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' value='p%d.fru' /> + <argval name='format' type='string_array'> + <argitem value='MB/P%d' /> + <argitem value='p%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> @@ -164,8 +173,13 @@ <facility name='service' type='indicator' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_entity' version='0' propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='p%d.led' /> + <propmethod name='ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='p%d.led' /> + <argitem value='MB/P%d/SVC' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -195,9 +209,11 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' value='p%d.fru' /> + <argval name='format' type='string_array'> + <argitem value='p%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> @@ -209,8 +225,12 @@ <facility name='service' type='indicator' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_entity' version='0' propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='p%d.fail.led' /> + <propmethod name='ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='p%d.fail.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -241,9 +261,12 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' value='p%d.fru' /> + <argval name='format' type='string_array'> + <argitem value='MB/P%d' /> + <argitem value='p%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> @@ -255,8 +278,13 @@ <facility name='service' type='indicator' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_entity' version='0' propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='p%d.led' /> + <propmethod name='ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='P%d/SVC' /> + <argitem value='p%d.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -286,9 +314,11 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' value='p%d.fru' /> + <argval name='format' type='string_array'> + <argitem value='p%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> @@ -300,8 +330,12 @@ <facility name='service' type='indicator' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_entity' version='0' propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='p%d.led' /> + <propmethod name='ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='p%d.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -327,6 +361,19 @@ </propmethod> </propgroup> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propmethod name='ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='MB/P%d' /> + </argval> + <argval name='offset' type='uint32' value='0' /> + <argval name='nparams' type='uint32' value='1' /> + + </propmethod> + </propgroup> </set> <set type='product' setlist='Sun-Blade-X6450-Server-Module|SUN-BLADE-X6450-SERVER-MODULE|Sun-Blade-X6450|SUN-BLADE-X6450'> @@ -383,9 +430,11 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' value='p%d.fru' /> + <argval name='format' type='string_array'> + <argitem value='p%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> @@ -397,8 +446,11 @@ <facility name='service' type='indicator' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_entity' version='0' propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='p%d.led' /> + <propmethod name='ipmi_entity' version='0' propname='entity_ref' + proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='p%d.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -461,6 +513,49 @@ --> <set type='product' setlist='SUN-BLADE-X6240-SERVER-MODULE|Sun-Blade-X6240-Server-Module'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='protocol' version='1' + name-stability='Private' + data-stability='Private' > + + <propmethod name='simple_cs_label_mp' version='0' + propname='label' proptype='string' > + + <argval name='format' type='string' + value='CPU %d D%d' /> + <argval name='offset' type='uint32' value='0' /> + </propmethod> + + <propmethod name='get_dimm_serial' version='0' + propname='serial' proptype='string' + nonvolatile='1' /> + + </propgroup> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + + <propmethod name='cs_ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='MB/P%d/D%d' /> + <argitem value='p%d.d%d.fru' /> + </argval> + <argval name='offset' type='uint32' value='0' /> + + </propmethod> + </propgroup> + + </set> + + <!-- + Lets consider both upper and lower case formats for the product name + Since few X6440 test systems had SMB_TYPE_SYSTEM set to + all upper case characters in SMBIOS + --> + <set type='product' setlist='SUN-BLADE-X6440-SERVER-MODULE|Sun-Blade-X6440-Server-Module'> + + <fac-enum provider='fac_prov_ipmi' /> <propgroup name='protocol' version='1' name-stability='Private' data-stability='Private' > @@ -473,49 +568,24 @@ <argval name='offset' type='uint32' value='0' /> </propmethod> - <propmethod name='get_cs_serial' version='0' + <propmethod name='get_dimm_serial' version='0' propname='serial' proptype='string' - nonvolatile='1' > + nonvolatile='1' /> - <argval name='format' type='string' - value='P%d/D%d' /> + </propgroup> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + + <propmethod name='cs_ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='MB/P%d/D%d' /> + <argitem value='p%d.d%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> </propmethod> - - </propgroup> - - </set> - - <!-- - Lets consider both upper and lower case formats for the product name - Since few X6440 test systems had SMB_TYPE_SYSTEM set to - all upper case characters in SMBIOS - --> - <set type='product' setlist='SUN-BLADE-X6440-SERVER-MODULE|Sun-Blade-X6440-Server-Module'> - - <propgroup name='protocol' version='1' - name-stability='Private' - data-stability='Private' > - - <propmethod name='simple_cs_label_mp' version='0' - propname='label' proptype='string' > - - <argval name='format' type='string' - value='CPU %d D%d' /> - <argval name='offset' type='uint32' value='0' /> - </propmethod> - - <propmethod name='get_cs_serial' version='0' - propname='serial' proptype='string' - nonvolatile='1' > - - <argval name='format' type='string' - value='P%d/D%d' /> - <argval name='offset' type='uint32' value='0' /> - - </propmethod> - </propgroup> </set> @@ -523,6 +593,7 @@ <set type='product' setlist='Sun-Fire-X4140|Sun-Fire-X4240|Sun-Fire-X4440'> + <fac-enum provider='fac_prov_ipmi' /> <propgroup name='protocol' version='1' name-stability='Private' data-stability='Private' > @@ -535,7 +606,23 @@ <argval name='offset' type='uint32' value='0' /> </propmethod> + <propmethod name='get_dimm_serial' version='0' + propname='serial' proptype='string' + nonvolatile='1' /> + </propgroup> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + + <propmethod name='cs_ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='MB/P%d/D%d' /> + <argitem value='p%d.d%d.fru' /> + </argval> + <argval name='offset' type='uint32' value='0' /> + </propmethod> </propgroup> </set> @@ -583,14 +670,21 @@ </propmethod> <propmethod name='get_dimm_serial' version='0' propname='serial' proptype='string' - nonvolatile='1' > + nonvolatile='1' /> + + </propgroup> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + + <propmethod name='dimm_ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' - value='cpu%d.mem%d.vpd' /> + <argval name='format' type='string_array'> + <argitem value='cpu%d.mem%d.vpd' /> + </argval> <argval name='offset' type='uint32' value='0' /> </propmethod> - </propgroup> </set> <set type='product' setlist='Sun-Fire-X4100-Server|Sun-Fire-X4200-Server|Sun-Fire-X4200E'> @@ -614,22 +708,17 @@ </propmethod> <propmethod name='get_dimm_serial' version='0' propname='serial' proptype='string' - nonvolatile='1' > - - <argval name='format' type='string' - value='p%d.d%d.fru' /> - <argval name='offset' type='uint32' value='0' /> - - </propmethod> + nonvolatile='1' /> </propgroup> <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='dimm_ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' - value='p%d.d%d.fru' /> + <argval name='format' type='string_array'> + <argitem value='p%d.d%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> </propmethod> @@ -637,8 +726,12 @@ <facility name='service' type='indicator' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='0' /> - <propmethod name='dimm_ipmi_entity' version='0' propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='p%d.d%d.led' /> + <propmethod name='dimm_ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='p%d.d%d.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> </propmethod> <propmethod name='ipmi_indicator_mode' version='0' @@ -668,22 +761,17 @@ </propmethod> <propmethod name='get_dimm_serial' version='0' propname='serial' proptype='string' - nonvolatile='1' > - - <argval name='format' type='string' - value='p%d.d%d.fru' /> - <argval name='offset' type='uint32' value='0' /> - - </propmethod> + nonvolatile='1' /> </propgroup> <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='dimm_ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' - value='p%d.d%d.fru' /> + <argval name='format' type='string_array'> + <argitem value='p%d.d%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> </propmethod> @@ -691,8 +779,12 @@ <facility name='service' type='indicator' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='0' /> - <propmethod name='dimm_ipmi_entity' version='0' propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='p%d.d%d.fail.led' /> + <propmethod name='dimm_ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='p%d.d%d.fail.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> </propmethod> <propmethod name='ipmi_indicator_mode' version='0' @@ -717,23 +809,18 @@ </propmethod> <propmethod name='get_dimm_serial' version='0' propname='serial' proptype='string' - nonvolatile='1' > - - <argval name='format' type='string' - value='p%d.d%d.fru' /> - <argval name='offset' type='uint32' value='0' /> - - </propmethod> + nonvolatile='1' /> </propgroup> <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='dimm_ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' - value='p%d.d%d.fru' /> + <argval name='format' type='string_array'> + <argitem value='p%d.d%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> </propmethod> @@ -744,8 +831,12 @@ <facility name='service' type='indicator' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='0' /> - <propmethod name='dimm_ipmi_entity' version='0' propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='p%d.d%d.led' /> + <propmethod name='dimm_ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='p%d.d%d.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> </propmethod> <propmethod name='ipmi_indicator_mode' version='0' @@ -771,23 +862,18 @@ </propmethod> <propmethod name='get_dimm_serial' version='0' propname='serial' proptype='string' - nonvolatile='1' > - - <argval name='format' type='string' - value='p%d.d%d.fru' /> - <argval name='offset' type='uint32' value='0' /> - - </propmethod> + nonvolatile='1' /> </propgroup> <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > <propmethod name='dimm_ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' - value='p%d.d%d.fru' /> + <argval name='format' type='string_array'> + <argitem value='p%d.d%d.fru' /> + </argval> <argval name='offset' type='uint32' value='0' /> </propmethod> @@ -798,8 +884,12 @@ <facility name='service' type='indicator' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='0' /> - <propmethod name='dimm_ipmi_entity' version='0' propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='p%d.d%d.led' /> + <propmethod name='dimm_ipmi_entity' version='0' + propname='entity_ref' proptype='string_array' > + + <argval name='format' type='string_array'> + <argitem value='p%d.d%d.led' /> + </argval> <argval name='offset' type='uint32' value='0' /> </propmethod> <propmethod name='ipmi_indicator_mode' version='0'
--- a/usr/src/lib/fm/topo/maps/i86pc/fan-hc-topology.xmlgen Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/maps/i86pc/fan-hc-topology.xmlgen Fri Jul 31 13:25:53 2009 -0700 @@ -80,15 +80,15 @@ label => "FT %d", count => 5, fru => "self", - entity_ref => "ft%d.prsnt", + entity_ref => "FT%d/PRSNT,ft%d.prsnt", entity_ref_nparams => 1, - fm_service_indctr => "ft%d.service.led", - fm_ok2rm_indctr => "ft%d.ok2rm.led", + fm_service_indctr => "FT%d/SVC,ft%d.service.led", + fm_ok2rm_indctr => "FT%d/OK,ft%d.ok2rm.led", }, { fac_enum => 1, provider => "fac_prov_ipmi", count => 2, - entity_ref => "ft%d.f%d.speed", + entity_ref => "FT%d/FAN%d/TACH,ft%d.f%d.speed", entity_ref_nparams => 2, fru => "parent" } @@ -120,16 +120,16 @@ count => 3, fru => "self", provider => "fac_prov_ipmi", - entity_present => "fb%d.fm%d.prsnt", - fm_service_indctr=> "fb%d.fm%d.led", + entity_present => "FB%d/FM%d/PRSNT,fb%d.fm%d.prsnt", + fm_service_indctr=> "FB%d/FM%d/SERVICE,fb%d.fm%d.led", entity_ref_nparams => 2 }, { fac_enum => 1, count => 2, fru => "parent", provider => "fac_prov_ipmi", - entity_ref => "fb%d.fm%d.f%d.speed", - entity_present => "fb%d.fm%d.prsnt", + entity_ref => "FB%d/FM%d/F%d/TACH,fb%d.fm%d.f%d.speed", + entity_present => "FB%d/FM%d/PRSNT,fb%d.fm%d.prsnt", entity_ref_nparams => 3 } @@ -137,7 +137,7 @@ }, # - # Fan Module/Fan topology for G4F platforms. + # Fan Module/Fan topology for the Sun Fire X4600/X4600 M2 platforms. # # These systems have 4 fan assemblies with a single fan per assembly. # Each fan assembly is a FRU. The fan assemblies have a service LED @@ -160,7 +160,7 @@ }, # - # Fan Module/Fan topology for Durado 1U. + # Fan Module/Fan topology for Sun Fire X4140. # # There are two fan boards, which are FRU's. The first fanboard has 4 # fanmodules (which are also FRU's). The second fan board has 3 fan @@ -179,21 +179,21 @@ label => "FANBD%d FM%d", count => 4, fru => "self", - fm_service_indctr=> "fb%d.fm%d.led", + fm_service_indctr=> "FB%d/FM%d/SERVICE,fb%d.fm%d.led", entity_ref_nparams => 2 }, { fac_enum => 1, provider => "fac_prov_ipmi", count => 2, fru => "parent", - entity_ref => "fb%d.fm%d.f%d.speed", + entity_ref => "FB%d/FM%d/F%d/TACH,fb%d.fm%d.f%d.speed", entity_ref_nparams => 3 } ] }, # - # Fan Module/Fan topology for Duradi 1U. + # Fan Module/Fan topology for the Sun Fire X4150. # # There are two fan boards, which are FRU's. The first fanboard has 4 # fanmodules (which are also FRU's). The second fan board has 3 fan @@ -233,7 +233,7 @@ # fanmodules (which are also FRU's). Each fanmodule contains two fans. # { - set => "SUN-FIRE-X4250", + set => "SUN-FIRE-X4250|SUN-FIRE-X4450", topology => [ { count => 2, @@ -310,11 +310,19 @@ printf("%*s<propval name='type' type='uint32' ". "value='0' />\n", $indent+6, ""); printf("%*s<propmethod name='ipmi_entity' version='0' ". - "propname='entity_ref' proptype='string' >\n", + "propname='entity_ref' proptype='string_array' >\n", $indent+6, ""); - printf("%*s<argval name='format' type='string' ". - "value='%s' />\n", $indent+8, "", - $level->{fm_service_indctr}); + + printf("%*s<argval name='format' type='string_array'>\n", + $indent+8, ""); + my @refs = split(/\,/, $level->{fm_service_indctr}); + foreach my $ref (@refs) { + printf("%*s<argitem value='", $indent+10, ""); + printf($ref, @indices); + printf("' />\n"); + } + + printf("%*s</argval>\n", $indent+8, ""); printf("%*s<argval name='offset' type='uint32' ". "value='0' />\n", $indent+8, ""); printf("%*s<argval name='nparams' type='uint32' ". @@ -337,11 +345,18 @@ printf("%*s<propval name='type' type='uint32' ". "value='2' />\n", $indent+6, ""); printf("%*s<propmethod name='ipmi_entity' version='0' ". - "propname='entity_ref' proptype='string' >\n", + "propname='entity_ref' proptype='string_array' >\n", $indent+6, ""); - printf("%*s<argval name='format' type='string' ". - "value='%s' />\n", $indent+8, "", - $level->{fm_ok2rm_indctr}); + + printf("%*s<argval name='format' type='string_array'>\n", + $indent+8, ""); + my @refs = split(/\,/, $level->{fm_ok2rm_indctr}); + foreach my $ref (@refs) { + printf("%*s<argitem value='", $indent+10, ""); + printf($ref, @indices); + printf("' />\n"); + } + printf("%*s</argval>\n", $indent+8, ""); printf("%*s<argval name='offset' type='uint32' ". "value='0' />\n", $indent+8, ""); printf("%*s<argval name='nparams' type='uint32' ". @@ -389,10 +404,16 @@ printf("%*s<propgroup name='ipmi' version='1' " . "name-stability='Private' " . "data-stability='Private' >\n", $indent, ""); - printf("%*s<propval name='entity_ref' " . - "type='string' value='", $indent + 2, ""); - printf($val, @indices); - printf("' />\n"); + + printf("%*s<propval name='entity_ref' ". + "type='string_array'>\n", $indent + 2, ""); + my @refs = split(/\,/, $val); + foreach my $ref (@refs) { + printf("%*s<propitem value='", $indent+4, ""); + printf($ref, @indices); + printf("' />\n"); + } + printf("%*s</propval>\n", $indent+2, ""); printf("%*s</propgroup>\n", $indent, ""); } if ($level->{entity_present}) { @@ -400,10 +421,16 @@ printf("%*s<propgroup name='ipmi' version='1' " . "name-stability='Private' " . "data-stability='Private' >\n", $indent, ""); + printf("%*s<propval name='entity_present' " . - "type='string' value='", $indent + 2, ""); - printf($val, @indices); - printf("' />\n"); + "type='string_array'>\n", $indent + 2, ""); + my @refs = split(/\,/, $val); + foreach my $ref (@refs) { + printf("%*s<propitem value='", $indent+4, ""); + printf($ref, @indices); + printf("' />\n"); + } + printf("%*s</propval>\n", $indent+4, ""); printf("%*s</propgroup>\n", $indent, ""); }
--- a/usr/src/lib/fm/topo/maps/i86pc/i86pc-hc-topology.xml Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/maps/i86pc/i86pc-hc-topology.xml Fri Jul 31 13:25:53 2009 -0700 @@ -37,11 +37,14 @@ </propgroup> <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='mb.fru' /> + <propval name='entity_ref' type='string_array' > + <propitem value='MB' /> + <propitem value='mb.fru' /> + </propval> </propgroup> </set> - <set type='product' setlist='SUN-FIRE-X4150|SUN-FIRE-X4250'> + <set type='product' setlist='SUN-FIRE-X4150|SUN-FIRE-X4250|SUN-FIRE-X4450'> <fac-enum provider='fac_prov_ipmi' /> <propgroup name='protocol' version='1' name-stability='Private' data-stability='Private' > @@ -74,160 +77,8 @@ </range> <range name='chassis' min='0' max='0'> - <node instance='0'> - <set type='product' setlist='Sun-Fire-X4140|Sun-Fire-X4240|Sun-Fire-X4440'> - <fac-enum provider='fac_prov_ipmi' /> - <propgroup name='ipmi' version='1' - name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='sys.intsw' /> - </propgroup> - </set> - <set type='product' setlist='SUN-FIRE-X4150|SUN-FIRE-X4250'> - <fac-enum provider='fac_prov_ipmi' /> - <propgroup name='ipmi' version='1' - name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='/SYS/VPS' /> - </propgroup> - </set> - <set type='product' setlist='Sun-Fire-X4100-Server|Sun-Fire-X4200-Server|Sun-Fire-X4100-M2|Sun-Fire-X4200-M2'> - <fac-enum provider='fac_prov_ipmi' /> - <propgroup name='ipmi' version='1' - name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='sys.intsw' /> - </propgroup> - <!-- - chassis locate and service LED's for Galaxy 1/2 - --> - <facility name='fp.locate.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='fp.locate.led' /> - <propval name='type' type='uint32' value='1' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - <facility name='bp.locate.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='bp.locate.led' /> - <propval name='type' type='uint32' value='1' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - <facility name='fp.alert.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='fp.alert.led' /> - <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - <facility name='bp.alert.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='bp.alert.led' /> - <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - </set> - <set type='product' setlist='Sun-Fire-X4500|Sun-Fire-X4540'> - <fac-enum provider='fac_prov_ipmi' /> - <propgroup name='ipmi' version='1' - name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='sys.intsw' /> - </propgroup> - <!-- - chassis locate and service LED's for X4500/X4540 - --> - <facility name='fp.locate.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='fp.locate.led' /> - <propval name='type' type='uint32' value='1' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - <facility name='bp.locate.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='bp.locate.led' /> - <propval name='type' type='uint32' value='1' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - <facility name='fp.alert.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='fp.alert.led' /> - <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - <facility name='bp.alert.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='bp.alert.led' /> - <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - <facility name='sys.top_svc.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='sys.top_svc.led' /> - <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - <facility name='sys.rear_svc.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='sys.rear_svc.led' /> - <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - </set> - <set type='product' setlist='Sun-Fire-X4600-M2'> - <fac-enum provider='fac_prov_ipmi' /> - <propgroup name='ipmi' version='1' - name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='sys.intsw' /> - </propgroup> - <!-- - chassis locate and service LED's for X4600M2 - --> - <facility name='sys.locate.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='sys.locate.led' /> - <propval name='type' type='uint32' value='1' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - <facility name='sys.alert.led' type='indicator' provider='fac_prov_ipmi' > - <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='sys.alert.led' /> - <propval name='type' type='uint32' value='0' /> - <propmethod name='ipmi_indicator_mode' version='0' - propname='mode' proptype='uint32' mutable='1' > - </propmethod> - </propgroup> - </facility> - </set> - </node> + <propmap name='chassis' /> + <dependents grouping='children'> <set type='product' setlist='Sun-Fire-X4100-Server|Sun-Fire-X4200-Server|Sun-Fire-X4100-M2|Sun-Fire-X4200-M2|Sun-Fire-X4140|Sun-Fire-X4240|Sun-Fire-X4440'> @@ -255,7 +106,7 @@ </set> </set> - <set type='product' setlist='Sun-Fire-X4500|Sun-Fire-X4540|SUN-FIRE-X4150|SUN-FIRE-X4250'> + <set type='product' setlist='Sun-Fire-X4500|Sun-Fire-X4540|SUN-FIRE-X4150|SUN-FIRE-X4250|SUN-FIRE-X4450'> <range name='psu' min='0' max='100'> <propmap name='psu' /> </range>
--- a/usr/src/lib/fm/topo/maps/i86pc/psu-hc-topology.xml Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/maps/i86pc/psu-hc-topology.xml Fri Jul 31 13:25:53 2009 -0700 @@ -29,9 +29,12 @@ <set type='product' setlist='Sun-Fire-X4100-Server|Sun-Fire-X4200-Server|Sun-Fire-X4100-M2|Sun-Fire-X4200-M2|Sun-Fire-X4140|Sun-Fire-X4240|Sun-Fire-X4440|Sun-Fire-X4600|Sun-Fire-X4600-M2'> <range name='psu' min='0' max='100'> - <facility name='sys.psfail.led' type='indicator' provider='fac_prov_ipmi' > + <facility name='service' type='indicator' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='sys.psfail.led' /> + <propval name='entity_ref' type='string_array' > + <propitem value='PS_FAULT' /> + <propitem value='sys.psfail.led' /> + </propval> <propval name='type' type='uint32' value='0' /> <propmethod name='ipmi_indicator_mode' version='0' propname='mode' proptype='uint32' mutable='1' > @@ -46,10 +49,13 @@ <facility name='ps.vinok' type='sensor' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='270' /> - <propval name='sensor-type' type='string' value='discrete' /> + <propval name='sensor-class' type='string' value='discrete' /> <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='ps%d.vinok' /> + propname='entity_ref' proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='PS%d/VINOK' /> + <argitem value='ps%d.vinok' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -61,10 +67,13 @@ <facility name='ps.pwrok' type='sensor' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='270' /> - <propval name='sensor-type' type='string' value='discrete' /> + <propval name='sensor-class' type='string' value='discrete' /> <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='ps%d.pwrok' /> + propname='entity_ref' proptype='string_array' > + <argval name='format' type='string_array' > + <argitem value='PS%d/PWROK' /> + <argitem value='ps%d.pwrok' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -88,9 +97,12 @@ name-stability='Private' data-stability='Private' > <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > + propname='entity_ref' proptype='string_array' > - <argval name='format' type='string' value='ps%d.prsnt' /> + <argval name='format' type='string_array'> + <argitem value='PS%d/PRSNT' /> + <argitem value='ps%d.prsnt' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> @@ -110,10 +122,13 @@ <facility name='ps0.vinok' type='sensor' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='270' /> - <propval name='sensor-type' type='string' value='discrete' /> + <propval name='sensor-class' type='string' value='discrete' /> <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='ps%d.vinok' /> + propname='entity_ref' proptype='string_array' > + <argval name='format' type='string_array' > + <argitem value='PS%d/VINOK' /> + <argitem value='ps%d.vinok' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -125,10 +140,13 @@ <facility name='ps0.pwrok' type='sensor' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='270' /> - <propval name='sensor-type' type='string' value='discrete' /> + <propval name='sensor-class' type='string' value='discrete' /> <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='ps%d.pwrok' /> + propname='entity_ref' proptype='string_array' > + <argval name='format' type='string_array' > + <argitem value='PS%d/PWROK' /> + <argitem value='ps%d.pwrok' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -148,7 +166,10 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='ps0.prsnt' /> + <propval name='entity_ref' type='string_array'> + <propitem value='PS0/PRSNT' /> + <propitem value='ps0.prsnt' /> + </propval> </propgroup> <enum-method name='ipmi' version='1' /> </node> @@ -156,10 +177,13 @@ <facility name='ps1.vinok' type='sensor' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='270' /> - <propval name='sensor-type' type='string' value='discrete' /> + <propval name='sensor-class' type='string' value='discrete' /> <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='ps%d.vinok' /> + propname='entity_ref' proptype='string_array' > + <argval name='format' type='string_array' > + <argitem value='PS%d/VINOK' /> + <argitem value='ps%d.vinok' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -171,10 +195,13 @@ <facility name='ps1.pwrok' type='sensor' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='270' /> - <propval name='sensor-type' type='string' value='discrete' /> + <propval name='sensor-class' type='string' value='discrete' /> <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='ps%d.pwrok' /> + propname='entity_ref' proptype='string_array' > + <argval name='format' type='string_array' > + <argitem value='PS%d/PWROK' /> + <argitem value='ps%d.pwrok' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -194,23 +221,28 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='ps1.prsnt' /> + <propval name='entity_ref' type='string_array'> + <propitem value='PS1/PRSNT' /> + <propitem value='ps1.prsnt' /> + </propval> </propgroup> <enum-method name='ipmi' version='1' /> </node> </range> </set> - <set type='product' setlist='SUN-FIRE-X4150|SUN-FIRE-X4250'> + <set type='product' setlist='SUN-FIRE-X4150|SUN-FIRE-X4250|SUN-FIRE-X4450'> <range name='psu' min='0' max='1'> <fac-enum provider='fac_prov_ipmi' /> <node instance='0'> <facility name='PS0.VINOK' type='sensor' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='270' /> - <propval name='sensor-type' type='string' value='discrete' /> + <propval name='sensor-class' type='string' value='discrete' /> <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='PS%d/VINOK' /> + propname='entity_ref' proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='PS%d/VINOK' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -222,10 +254,12 @@ <facility name='PS0.PWROK' type='sensor' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='270' /> - <propval name='sensor-type' type='string' value='discrete' /> + <propval name='sensor-class' type='string' value='discrete' /> <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='PS%d/PWROK' /> + propname='entity_ref' proptype='string_array' > + <argval name='format' type='string_array'> + <argitem value='PS%d/PWROK' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -245,7 +279,9 @@ <propgroup name='ipmi' version='1' name-stability='Private' data-stability='Private' > - <propval name='entity_ref' type='string' value='PS0/PRSNT' /> + <propval name='entity_ref' type='string_array'> + <propitem value='PS0/PRSNT' /> + </propval> </propgroup> <enum-method name='ipmi' version='1' /> </node> @@ -253,10 +289,12 @@ <facility name='PS1.VINOK' type='sensor' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='270' /> - <propval name='sensor-type' type='string' value='discrete' /> + <propval name='sensor-class' type='string' value='discrete' /> <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='PS%d/VINOK' /> + propname='entity_ref' proptype='string_array' > + <argval name='format' type='string_array' > + <argitem value='PS%d/VINOK' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod> @@ -268,10 +306,12 @@ <facility name='PS1.PWROK' type='sensor' provider='fac_prov_ipmi' > <propgroup name='facility' version='1' name-stability='Private' data-stability='Private' > <propval name='type' type='uint32' value='270' /> - <propval name='sensor-type' type='string' value='discrete' /> + <propval name='sensor-class' type='string' value='discrete' /> <propmethod name='ipmi_entity' version='0' - propname='entity_ref' proptype='string' > - <argval name='format' type='string' value='PS%d/PWROK' /> + propname='entity_ref' proptype='string_array' > + <argval name='format' type='string_array' > + <argitem value='PS%d/PWROK' /> + </argval> <argval name='offset' type='uint32' value='0' /> <argval name='nparams' type='uint32' value='1' /> </propmethod>
--- a/usr/src/lib/fm/topo/modules/common/fac_prov_ipmi/fac_prov_ipmi.c Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/modules/common/fac_prov_ipmi/fac_prov_ipmi.c Fri Jul 31 13:25:53 2009 -0700 @@ -40,11 +40,8 @@ #include <libipmi.h> #define BUFSZ 128 -#define TOPO_PGROUP_IPMI "ipmi" -#define THUMPER_PRESENT_LED_MASK 0x01 -#define THUMPER_SERVICE_LED_MASK 0x02 -#define THUMPER_OK2RM_LED_MASK 0x08 +#define BAY_PRESENT_LED_MASK 0x01 /* * The largest possible SDR ID length is 2^5+1 @@ -54,8 +51,10 @@ #define TOPO_METH_IPMI_READING_VERSION 0 #define TOPO_METH_IPMI_STATE_VERSION 0 #define TOPO_METH_IPMI_MODE_VERSION 0 -#define TOPO_METH_THUMPER_LOCATE_VERSION 0 -#define TOPO_METH_THUMPER_MODE_VERSION 0 +#define TOPO_METH_X4500_MODE_VERSION 0 +#define TOPO_METH_BAY_LOCATE_VERSION 0 +#define TOPO_METH_BAY_MODE_VERSION 0 +#define TOPO_METH_CHASSIS_SERVICE_VERSION 0 #define TOPO_METH_IPMI_ENTITY_VERSION 0 #define TOPO_METH_DIMM_IPMI_ENTITY_VERSION 0 @@ -71,15 +70,21 @@ nvlist_t **); static int dimm_ipmi_entity(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *, nvlist_t **); +static int cs_ipmi_entity(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *, + nvlist_t **); static int ipmi_sensor_reading(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *, nvlist_t **); static int ipmi_sensor_state(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *, nvlist_t **); static int ipmi_indicator_mode(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *, nvlist_t **); -static int thumper_locate_mode(topo_mod_t *, tnode_t *, topo_version_t, +static int bay_locate_mode(topo_mod_t *, tnode_t *, topo_version_t, + nvlist_t *, nvlist_t **); +static int x4500_present_mode(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *, nvlist_t **); -static int thumper_indicator_mode(topo_mod_t *, tnode_t *, topo_version_t, +static int bay_indicator_mode(topo_mod_t *, tnode_t *, topo_version_t, + nvlist_t *, nvlist_t **); +static int chassis_service_mode(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *, nvlist_t **); const topo_modops_t ipmi_ops = { fac_prov_ipmi_enum, NULL }; @@ -97,6 +102,9 @@ { "dimm_ipmi_entity", TOPO_PROP_METH_DESC, TOPO_METH_DIMM_IPMI_ENTITY_VERSION, TOPO_STABILITY_INTERNAL, dimm_ipmi_entity }, + { "cs_ipmi_entity", TOPO_PROP_METH_DESC, + TOPO_METH_DIMM_IPMI_ENTITY_VERSION, + TOPO_STABILITY_INTERNAL, cs_ipmi_entity }, { NULL } }; @@ -110,18 +118,27 @@ { "ipmi_indicator_mode", TOPO_PROP_METH_DESC, TOPO_METH_IPMI_MODE_VERSION, TOPO_STABILITY_INTERNAL, ipmi_indicator_mode }, - { "thumper_locate_mode", TOPO_PROP_METH_DESC, - TOPO_METH_THUMPER_LOCATE_VERSION, - TOPO_STABILITY_INTERNAL, thumper_locate_mode }, - { "thumper_indicator_mode", TOPO_PROP_METH_DESC, - TOPO_METH_THUMPER_MODE_VERSION, - TOPO_STABILITY_INTERNAL, thumper_indicator_mode }, + { "bay_locate_mode", TOPO_PROP_METH_DESC, + TOPO_METH_BAY_LOCATE_VERSION, + TOPO_STABILITY_INTERNAL, bay_locate_mode }, + { "bay_indicator_mode", TOPO_PROP_METH_DESC, + TOPO_METH_BAY_MODE_VERSION, + TOPO_STABILITY_INTERNAL, bay_indicator_mode }, + { "chassis_service_mode", TOPO_PROP_METH_DESC, + TOPO_METH_CHASSIS_SERVICE_VERSION, + TOPO_STABILITY_INTERNAL, chassis_service_mode }, + { "x4500_present_mode", TOPO_PROP_METH_DESC, + TOPO_METH_CHASSIS_SERVICE_VERSION, + TOPO_STABILITY_INTERNAL, x4500_present_mode }, { TOPO_METH_IPMI_ENTITY, TOPO_PROP_METH_DESC, TOPO_METH_IPMI_ENTITY_VERSION, TOPO_STABILITY_INTERNAL, ipmi_entity }, { "dimm_ipmi_entity", TOPO_PROP_METH_DESC, TOPO_METH_DIMM_IPMI_ENTITY_VERSION, TOPO_STABILITY_INTERNAL, dimm_ipmi_entity }, + { "cs_ipmi_entity", TOPO_PROP_METH_DESC, + TOPO_METH_DIMM_IPMI_ENTITY_VERSION, + TOPO_STABILITY_INTERNAL, dimm_ipmi_entity }, { NULL } }; @@ -156,25 +173,12 @@ topo_mod_unregister(mod); } -static char * -get_fmtstr(topo_mod_t *mod, nvlist_t *in) +static void +strarr_free(topo_mod_t *mod, char **arr, uint_t nelems) { - char *fmtstr; - nvlist_t *args; - - if (nvlist_lookup_nvlist(in, TOPO_PROP_ARGS, &args) != 0) { - topo_mod_dprintf(mod, "Failed to lookup 'args' list (%s)\n", - strerror(errno)); - (void) topo_mod_seterrno(mod, EMOD_NVL_INVAL); - return (NULL); - } - if (nvlist_lookup_string(args, "format", &fmtstr) != 0) { - topo_mod_dprintf(mod, "Failed to lookup 'format' arg (%s)\n", - strerror(errno)); - (void) topo_mod_seterrno(mod, EMOD_NVL_INVAL); - return (NULL); - } - return (fmtstr); + for (int i = 0; i < nelems; i++) + topo_mod_strfree(mod, arr[i]); + topo_mod_free(mod, arr, (nelems * sizeof (char *))); } /*ARGSUSED*/ @@ -182,36 +186,45 @@ ipmi_sensor_state(topo_mod_t *mod, tnode_t *node, topo_version_t vers, nvlist_t *in, nvlist_t **out) { - char *entity_ref; + char **entity_refs; + uint_t nelems; ipmi_sdr_t *sdr = NULL; ipmi_sensor_reading_t *reading; ipmi_handle_t *hdl; - int err; + int err, i; uint8_t sensor_num; ipmi_sdr_full_sensor_t *fsensor; ipmi_sdr_compact_sensor_t *csensor; nvlist_t *nvl; + boolean_t found_sdr = B_FALSE; if (vers > TOPO_METH_IPMI_STATE_VERSION) return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); - if (topo_prop_get_string(node, TOPO_PGROUP_FACILITY, "entity_ref", - &entity_ref, &err) != 0) { - topo_mod_dprintf(mod, "Failed to lookup entity_ref property " - "(%s)", topo_strerror(err)); + if (topo_prop_get_string_array(node, TOPO_PGROUP_FACILITY, "entity_ref", + &entity_refs, &nelems, &err) != 0) { + topo_mod_dprintf(mod, "%s: Failed to lookup entity_ref " + "property (%s)", __func__, topo_strerror(err)); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } if ((hdl = topo_mod_ipmi_hold(mod)) == NULL) { topo_mod_dprintf(mod, "Failed to get IPMI handle\n"); - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); return (-1); } - if ((sdr = ipmi_sdr_lookup(hdl, entity_ref)) == NULL) { - topo_mod_dprintf(mod, "Failed to lookup SDR for %s (%s)\n", - entity_ref, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + for (i = 0; i < nelems; i++) { + if ((sdr = ipmi_sdr_lookup(hdl, entity_refs[i])) != NULL) { + found_sdr = B_TRUE; + break; + } else + topo_mod_dprintf(mod, "Failed to lookup SDR for %s " + "(%s)\n", entity_refs[i], ipmi_errmsg(hdl)); + } + + if (! found_sdr) { + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } @@ -227,21 +240,21 @@ break; default: topo_mod_dprintf(mod, "%s does not refer to a full or " - "compact SDR\n", entity_ref); - topo_mod_strfree(mod, entity_ref); + "compact SDR\n", entity_refs[i]); topo_mod_ipmi_rele(mod); + strarr_free(mod, entity_refs, nelems); return (-1); } if ((reading = ipmi_get_sensor_reading(hdl, sensor_num)) == NULL) { topo_mod_dprintf(mod, "Failed to get sensor reading for sensor " - "%s, sensor_num=%d (%s)\n", entity_ref, sensor_num, + "%s, sensor_num=%d (%s)\n", entity_refs[i], sensor_num, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); if (topo_mod_nvalloc(mod, &nvl, NV_UNIQUE_NAME) != 0 || @@ -264,19 +277,21 @@ ipmi_sensor_reading(topo_mod_t *mod, tnode_t *node, topo_version_t vers, nvlist_t *in, nvlist_t **out) { - char *entity_ref, reading_str[BUFSZ]; - int err = 0; + char **entity_refs, reading_str[BUFSZ]; + uint_t nelems; + int err = 0, i; ipmi_sdr_full_sensor_t *sensor; ipmi_sensor_reading_t *reading; double conv_reading; ipmi_handle_t *hdl; nvlist_t *nvl; + boolean_t found_sdr = B_FALSE; if (vers > TOPO_METH_IPMI_READING_VERSION) return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); - if (topo_prop_get_string(node, TOPO_PGROUP_FACILITY, "entity_ref", - &entity_ref, &err) != 0) { + if (topo_prop_get_string_array(node, TOPO_PGROUP_FACILITY, "entity_ref", + &entity_refs, &nelems, &err) != 0) { topo_mod_dprintf(mod, "Failed to lookup entity_ref property " "(%s)", topo_strerror(err)); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); @@ -284,15 +299,22 @@ if ((hdl = topo_mod_ipmi_hold(mod)) == NULL) { topo_mod_dprintf(mod, "Failed to get IPMI handle\n"); - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); return (-1); } - if ((sensor = ipmi_sdr_lookup_full_sensor(hdl, entity_ref)) - == NULL) { - topo_mod_dprintf(mod, "Failed to lookup SDR for %s (%s)\n", - entity_ref, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + for (i = 0; i < nelems; i++) { + if ((sensor = ipmi_sdr_lookup_full_sensor(hdl, entity_refs[i])) + != NULL) { + found_sdr = B_TRUE; + break; + } else + topo_mod_dprintf(mod, "Failed to lookup SDR for %s " + "(%s)\n", entity_refs[i], ipmi_errmsg(hdl)); + } + + if (! found_sdr) { + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } @@ -300,9 +322,9 @@ if ((reading = ipmi_get_sensor_reading(hdl, sensor->is_fs_number)) == NULL) { topo_mod_dprintf(mod, "Failed to get sensor reading for sensor " - "%s, sensor_num=%d (%s)\n", entity_ref, + "%s, sensor_num=%d (%s)\n", entity_refs[i], sensor->is_fs_number, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } @@ -311,11 +333,11 @@ if (ipmi_sdr_conv_reading(sensor, reading->isr_reading, &conv_reading) != 0) { topo_mod_dprintf(mod, "Failed to convert sensor reading for " - "sensor %s (%s)\n", entity_ref, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + "sensor %s (%s)\n", entity_refs[i], ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); return (-1); } - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); (void) snprintf(reading_str, BUFSZ, "%f", conv_reading); if (topo_mod_nvalloc(mod, &nvl, NV_UNIQUE_NAME) != 0 || @@ -336,13 +358,15 @@ ipmi_indicator_mode(topo_mod_t *mod, tnode_t *node, topo_version_t vers, nvlist_t *in, nvlist_t **out) { - char *entity_ref; + char **entity_refs; + uint_t nelems; ipmi_sdr_generic_locator_t *gdl = NULL; ipmi_handle_t *hdl; - int err, ret; + int err, ret, i; uint8_t ledmode; uint32_t mode_in; nvlist_t *pargs, *nvl; + boolean_t found_sdr = B_FALSE; if (vers > TOPO_METH_IPMI_MODE_VERSION) return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); @@ -356,19 +380,26 @@ return (-1); } - if (topo_prop_get_string(node, TOPO_PGROUP_FACILITY, "entity_ref", - &entity_ref, &err) != 0) { + if (topo_prop_get_string_array(node, TOPO_PGROUP_FACILITY, "entity_ref", + &entity_refs, &nelems, &err) != 0) { topo_mod_dprintf(mod, "Failed to lookup entity_ref property " "(%s)", topo_strerror(err)); topo_mod_ipmi_rele(mod); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } - if ((gdl = ipmi_sdr_lookup_generic(hdl, entity_ref)) - == NULL) { - topo_mod_dprintf(mod, "Failed to lookup SDR for %s (%s)\n", - entity_ref, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + for (i = 0; i < nelems; i++) { + if ((gdl = ipmi_sdr_lookup_generic(hdl, entity_refs[i])) + != NULL) { + found_sdr = B_TRUE; + break; + } else + topo_mod_dprintf(mod, "Failed to lookup SDR for %s " + "(%s)\n", entity_refs[i], ipmi_errmsg(hdl)); + } + + if (! found_sdr) { + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } @@ -386,7 +417,7 @@ &mode_in)) != 0) { topo_mod_dprintf(mod, "Failed to lookup %s nvpair " "(%s)\n", TOPO_PROP_VAL_VAL, strerror(ret)); - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } @@ -394,17 +425,16 @@ mode_in != TOPO_LED_STATE_ON) { topo_mod_dprintf(mod, "Invalid property value: %d\n", mode_in); - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } ledmode = (uint8_t)mode_in; - topo_mod_dprintf(mod, "Setting LED mode to %s\n", - ledmode ? "ON" : "OFF"); if (ipmi_sunoem_led_set(hdl, gdl, ledmode) < 0) { - topo_mod_dprintf(mod, "Failed to set LED mode for %s " - "(%s)\n", entity_ref, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + topo_mod_dprintf(mod, "%s: Failed to set LED mode for " + "%s (%s) to %s\n", __func__, entity_refs[i], + ipmi_errmsg(hdl), ledmode ? "ON" : "OFF"); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } @@ -412,16 +442,16 @@ /* * Get the LED mode */ - topo_mod_dprintf(mod, "Getting LED mode\n"); if (ipmi_sunoem_led_get(hdl, gdl, &ledmode) < 0) { - topo_mod_dprintf(mod, "Failed to get LED mode for %s " - "(%s)\n", entity_ref, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + topo_mod_dprintf(mod, "%s: Failed to get LED mode for " + "%s (%s)\n", __func__, entity_refs[i], + ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } } - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); if (topo_mod_nvalloc(mod, &nvl, NV_UNIQUE_NAME) != 0 || @@ -438,22 +468,28 @@ } /* - * On thumper platforms these is no seperate locate LED for the drive bays. - * Therefore we simulate a locate LED by blinking the ok2rm LED. + * On most Sun platforms there is no seperate locate LED for the drive bays. + * This propmethod simulates a locate LED by blinking the ok2rm LED. + * + * LED control is through a the Sun OEM led/get commands. This propmethod can + * work on X4500/X4540 with ILOM 2.x and on + * X4140/X4240/X4440/X4500/X4540/X4150/X4250 and X4450 platforms with ILOM 3.x. */ static int -thumper_locate_mode(topo_mod_t *mod, tnode_t *node, topo_version_t vers, +bay_locate_mode(topo_mod_t *mod, tnode_t *node, topo_version_t vers, nvlist_t *in, nvlist_t **out) { - char *entity_ref; + char **entity_refs; + uint_t nelems; ipmi_sdr_generic_locator_t *gdl = NULL; ipmi_handle_t *hdl; - int err, ret; + int err, ret, i; uint8_t ledmode; uint32_t mode_in; nvlist_t *pargs, *nvl; + boolean_t found_sdr = B_FALSE; - if (vers > TOPO_METH_THUMPER_LOCATE_VERSION) + if (vers > TOPO_METH_BAY_LOCATE_VERSION) return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); /* @@ -465,19 +501,26 @@ return (-1); } - if (topo_prop_get_string(node, TOPO_PGROUP_FACILITY, "entity_ref", - &entity_ref, &err) != 0) { + if (topo_prop_get_string_array(node, TOPO_PGROUP_FACILITY, "entity_ref", + &entity_refs, &nelems, &err) != 0) { topo_mod_dprintf(mod, "Failed to lookup entity_ref property " "(%s)", topo_strerror(err)); topo_mod_ipmi_rele(mod); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } - if ((gdl = ipmi_sdr_lookup_generic(hdl, entity_ref)) - == NULL) { - topo_mod_dprintf(mod, "Failed to lookup SDR for %s (%s)\n", - entity_ref, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + for (i = 0; i < nelems; i++) { + if ((gdl = ipmi_sdr_lookup_generic(hdl, entity_refs[i])) + != NULL) { + found_sdr = B_TRUE; + break; + } else + topo_mod_dprintf(mod, "Failed to lookup SDR for %s " + "(%s)\n", entity_refs[i], ipmi_errmsg(hdl)); + } + + if (! found_sdr) { + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } @@ -495,7 +538,7 @@ &mode_in)) != 0) { topo_mod_dprintf(mod, "Failed to lookup %s nvpair " "(%s)\n", TOPO_PROP_VAL_VAL, strerror(ret)); - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } @@ -503,18 +546,18 @@ mode_in != TOPO_LED_STATE_ON) { topo_mod_dprintf(mod, "Invalid property value: %d\n", mode_in); - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } if (mode_in == TOPO_LED_STATE_ON) - ledmode = IPMI_SUNOEM_LED_MODE_SLOW; + ledmode = IPMI_SUNOEM_LED_MODE_FAST; else - ledmode = (uint8_t)mode_in; + ledmode = IPMI_SUNOEM_LED_MODE_OFF; if (ipmi_sunoem_led_set(hdl, gdl, ledmode) < 0) { topo_mod_dprintf(mod, "Failed to set LED mode for %s " - "(%s)\n", entity_ref, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + "(%s)\n", entity_refs[i], ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } @@ -524,13 +567,13 @@ */ if (ipmi_sunoem_led_get(hdl, gdl, &ledmode) < 0) { topo_mod_dprintf(mod, "Failed to get LED mode for %s " - "(%s)\n", entity_ref, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + "(%s)\n", entity_refs[i], ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } } - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); if (ledmode == IPMI_SUNOEM_LED_MODE_SLOW || @@ -552,30 +595,40 @@ return (0); } - /* - * This is a method for the "mode" property that is specific for the drive bay - * LED's on thumper platforms. On thumper, the drive bay LED's are manipulated - * by asserting the right state bits in the hdd#.state compact SDR. + * This is a method for the "mode" property that is specific for the ok2rm and + * service drive bay LED's on the X4500/X4540 platforms running ILOM 2.x and + * for X4140/X4240/X4440/X4500/X4540/X4150/X4250 and X4450 platforms running + * ILOM 3.x. + * + * For ILOM 2.x, the LED's are controlled by a Sun OEM led set command + * + * For ILOM 3.x platforms the LED's are controlled by sending a platform event + * message for the appropriate DBP/HDD##/STATE compact SDR. + * + * For both ILOM 2 and ILOM 3, the current LED mode can be obtained by a + * Sun OEM led get command. */ static int -thumper_indicator_mode(topo_mod_t *mod, tnode_t *node, topo_version_t vers, +bay_indicator_mode(topo_mod_t *mod, tnode_t *node, topo_version_t vers, nvlist_t *in, nvlist_t **out) { - char *entity_ref; + char **entity_refs; + uint_t nelems; ipmi_sdr_compact_sensor_t *cs = NULL; + ipmi_sdr_generic_locator_t *gdl = NULL; + ipmi_deviceid_t *sp_devid; + ipmi_platform_event_message_t pem; ipmi_handle_t *hdl; - int err, ret; - uint32_t mask, type, ledmode; + int err, ret, i; + uint32_t type, ledmode; + uint8_t mode_in, ev_off; nvlist_t *pargs, *nvl; + boolean_t found_sdr = B_FALSE; - if (vers > TOPO_METH_THUMPER_MODE_VERSION) + if (vers > TOPO_METH_BAY_MODE_VERSION) return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); - /* - * Figure out which sensor state mask to use based on the indicator - * node's type prop val - */ if (topo_prop_get_uint32(node, TOPO_PGROUP_FACILITY, TOPO_FACILITY_TYPE, &type, &err) != 0) { topo_mod_dprintf(mod, "Failed to lookup %s property " @@ -584,41 +637,36 @@ } switch (type) { case (TOPO_LED_TYPE_SERVICE): - mask = THUMPER_SERVICE_LED_MASK; - break; - case (TOPO_LED_TYPE_PRESENT): - mask = THUMPER_PRESENT_LED_MASK; + ev_off = 0x01; break; case (TOPO_LED_TYPE_OK2RM): - mask = THUMPER_OK2RM_LED_MASK; + ev_off = 0x03; break; default: topo_mod_dprintf(mod, "Invalid LED type: 0x%x\n", type); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } + if (topo_prop_get_string_array(node, TOPO_PGROUP_FACILITY, "entity_ref", + &entity_refs, &nelems, &err) != 0) { + topo_mod_dprintf(mod, "Failed to lookup entity_ref property " + "(%s)", topo_strerror(err)); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } + /* - * Get an IPMI handle and then lookup the compact sensor data record - * referenced by the entity_ref prop val + * Figure out whether the SP is running ILOM 2.x or ILOM 3.x */ if ((hdl = topo_mod_ipmi_hold(mod)) == NULL) { topo_mod_dprintf(mod, "Failed to get IPMI handle\n"); + strarr_free(mod, entity_refs, nelems); return (-1); } - if (topo_prop_get_string(node, TOPO_PGROUP_FACILITY, "entity_ref", - &entity_ref, &err) != 0) { - topo_mod_dprintf(mod, "Failed to lookup entity_ref property " - "(%s)", topo_strerror(err)); - topo_mod_ipmi_rele(mod); - return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); - } - - if ((cs = ipmi_sdr_lookup_compact_sensor(hdl, entity_ref)) - == NULL) { - topo_mod_dprintf(mod, "Failed to lookup SDR for %s (%s)\n", - entity_ref, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + if ((sp_devid = ipmi_get_deviceid(hdl)) == NULL) { + topo_mod_dprintf(mod, "%s: GET DEVICEID command failed (%s)\n", + __func__, ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } @@ -632,37 +680,223 @@ /* * Set the LED mode */ - ipmi_set_sensor_reading_t sr_out = { 0 }; - if ((ret = nvlist_lookup_uint32(pargs, TOPO_PROP_VAL_VAL, &ledmode)) != 0) { topo_mod_dprintf(mod, "Failed to lookup %s nvpair " "(%s)\n", TOPO_PROP_VAL_VAL, strerror(ret)); - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } + topo_mod_dprintf(mod, "%s: Setting LED mode to %s\n", __func__, + ledmode ? "ON" : "OFF"); + + if (sp_devid->id_firm_major == 2) { + for (i = 0; i < nelems; i++) { + if ((gdl = ipmi_sdr_lookup_generic(hdl, + entity_refs[i])) != NULL) { + found_sdr = B_TRUE; + break; + } else + topo_mod_dprintf(mod, + "Failed to lookup SDR for %s(%s)\n", + entity_refs[i], ipmi_errmsg(hdl)); + } + + if (! found_sdr) { + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + + if (ipmi_sunoem_led_set(hdl, gdl, (uint8_t)ledmode) + < 0) { + topo_mod_dprintf(mod, + "Failed to set LED mode for %s (%s)\n", + entity_refs[i], ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + } else { + for (i = 0; i < nelems; i++) { + if ((cs = ipmi_sdr_lookup_compact_sensor(hdl, + entity_refs[i])) != NULL) { + found_sdr = B_TRUE; + break; + } else + topo_mod_dprintf(mod, + "Failed to lookup SDR for %s(%s)\n", + entity_refs[i], ipmi_errmsg(hdl)); + } + + if (! found_sdr) { + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + + pem.ipem_generator = IPMI_SEL_SYSTEM; + pem.ipem_rev = IPMI_EV_REV15; + pem.ipem_sensor_type = IPMI_ST_BAY; + pem.ipem_sensor_num = cs->is_cs_number; + pem.ipem_event_type = IPMI_RT_SPECIFIC; + if (ledmode == TOPO_LED_STATE_ON) + pem.ipem_event_dir = 0; + else + pem.ipem_event_dir = 1; + + pem.ipem_event_data[0] = ev_off; + pem.ipem_event_data[1] = 0xff; + pem.ipem_event_data[2] = 0xff; + + if (ipmi_event_platform_message(hdl, &pem) != 0) { + topo_mod_dprintf(mod, "%s: Failed to send " + "platform event mesg for %s (%s)\n", + __func__, entity_refs[i], ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + } + } else { + /* + * Get the LED mode + */ + for (i = 0; i < nelems; i++) { + if ((gdl = ipmi_sdr_lookup_generic(hdl, entity_refs[i])) + != NULL) { + found_sdr = B_TRUE; + break; + } else + topo_mod_dprintf(mod, "%s: Failed to lookup " + "SDR for %s (%s)\n", __func__, + entity_refs[i], ipmi_errmsg(hdl)); + } + + if (! found_sdr) { + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + if (ipmi_sunoem_led_get(hdl, gdl, &mode_in) < 0) { + topo_mod_dprintf(mod, "%s: Failed to get LED mode for " + "%s (%s)\n", __func__, entity_refs[i], + ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + ledmode = mode_in; + } + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + + if (topo_mod_nvalloc(mod, &nvl, NV_UNIQUE_NAME) != 0 || + nvlist_add_string(nvl, TOPO_PROP_VAL_NAME, TOPO_LED_MODE) != 0 || + nvlist_add_uint32(nvl, TOPO_PROP_VAL_TYPE, TOPO_TYPE_UINT32) != 0 || + nvlist_add_uint32(nvl, TOPO_PROP_VAL_VAL, ledmode) != 0) { + topo_mod_dprintf(mod, "Failed to allocate 'out' nvlist\n"); + nvlist_free(nvl); + return (topo_mod_seterrno(mod, EMOD_NOMEM)); + } + *out = nvl; + return (0); +} + +/* + * This propmethod is for controlling the present LED on the drive bays for + * the X4500 platform. + */ +static int +x4500_present_mode(topo_mod_t *mod, tnode_t *node, topo_version_t vers, + nvlist_t *in, nvlist_t **out) +{ + char **entity_refs; + uint_t nelems; + ipmi_sdr_compact_sensor_t *cs = NULL; + ipmi_set_sensor_reading_t sr_out = { 0 }; + ipmi_handle_t *hdl; + int err, ret, i; + uint32_t ledmode; + nvlist_t *pargs, *nvl; + boolean_t found_sdr = B_FALSE; + + if (vers > TOPO_METH_X4500_MODE_VERSION) + return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); + + if (topo_prop_get_string_array(node, TOPO_PGROUP_FACILITY, "entity_ref", + &entity_refs, &nelems, &err) != 0) { + topo_mod_dprintf(mod, "Failed to lookup entity_ref property " + "(%s)", topo_strerror(err)); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } + + if ((hdl = topo_mod_ipmi_hold(mod)) == NULL) { + topo_mod_dprintf(mod, "Failed to get IPMI handle\n"); + strarr_free(mod, entity_refs, nelems); + return (-1); + } + for (i = 0; i < nelems; i++) { + if ((cs = ipmi_sdr_lookup_compact_sensor(hdl, entity_refs[i])) + != NULL) { + found_sdr = B_TRUE; + break; + } else + topo_mod_dprintf(mod, "Failed to lookup SDR for %s " + "(%s)\n", entity_refs[i], + ipmi_errmsg(hdl)); + } + + if (! found_sdr) { + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + + /* + * Now lookup the propmethod argument list and figure out whether we're + * doing a get or a set operation, and then do it. + */ + if ((nvlist_lookup_nvlist(in, TOPO_PROP_PARGS, &pargs) == 0) && + nvlist_exists(pargs, TOPO_PROP_VAL_VAL)) { + /* + * Set the LED mode + */ + if ((ret = nvlist_lookup_uint32(pargs, TOPO_PROP_VAL_VAL, + &ledmode)) != 0) { + topo_mod_dprintf(mod, "Failed to lookup %s nvpair " + "(%s)\n", TOPO_PROP_VAL_VAL, strerror(ret)); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } + + topo_mod_dprintf(mod, "%s: Setting LED mode to %s\n", __func__, + ledmode ? "ON" : "OFF"); + if (ledmode == TOPO_LED_STATE_OFF) { - sr_out.iss_deassert_state = mask; + sr_out.iss_deassert_state = BAY_PRESENT_LED_MASK; sr_out.iss_deassrt_op = IPMI_SENSOR_OP_SET; } else if (ledmode == TOPO_LED_STATE_ON) { - sr_out.iss_assert_state = mask; + sr_out.iss_assert_state = BAY_PRESENT_LED_MASK; sr_out.iss_assert_op = IPMI_SENSOR_OP_SET; } else { - topo_mod_dprintf(mod, "Invalid LED mode: %d 0x%x\n", - ledmode); - topo_mod_strfree(mod, entity_ref); + topo_mod_dprintf(mod, "%s: Invalid LED mode: " + "%d\n", __func__, ledmode); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } sr_out.iss_id = cs->is_cs_number; - topo_mod_dprintf(mod, "Setting LED mode (mask = 0x%x)\n", mask); + topo_mod_dprintf(mod, "Setting LED mode (mask=0x%x)\n", + BAY_PRESENT_LED_MASK); if (ipmi_set_sensor_reading(hdl, &sr_out) != 0) { - topo_mod_dprintf(mod, "Failed to set sensor reading " - "for sensor %s (%s)\n", entity_ref, - ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + topo_mod_dprintf(mod, "%s: Failed to set " + "sensor reading for %s (%s)\n", __func__, + entity_refs[i], ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } @@ -677,17 +911,177 @@ == NULL) { topo_mod_dprintf(mod, "Failed to get sensor reading " "for sensor %s (sensor num: %d) (error: %s)\n", - entity_ref, cs->is_cs_number, ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + entity_refs[i], cs->is_cs_number, ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); return (-1); } - if (sr_in->isr_state & (uint16_t)mask) + if (sr_in->isr_state & (uint16_t)BAY_PRESENT_LED_MASK) ledmode = TOPO_LED_STATE_ON; else ledmode = TOPO_LED_STATE_OFF; } - topo_mod_strfree(mod, entity_ref); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + + if (topo_mod_nvalloc(mod, &nvl, NV_UNIQUE_NAME) != 0 || + nvlist_add_string(nvl, TOPO_PROP_VAL_NAME, TOPO_LED_MODE) != 0 || + nvlist_add_uint32(nvl, TOPO_PROP_VAL_TYPE, TOPO_TYPE_UINT32) != 0 || + nvlist_add_uint32(nvl, TOPO_PROP_VAL_VAL, ledmode) != 0) { + topo_mod_dprintf(mod, "Failed to allocate 'out' nvlist\n"); + nvlist_free(nvl); + return (topo_mod_seterrno(mod, EMOD_NOMEM)); + } + *out = nvl; + return (0); +} + +/* + * This is a property method for controlling the chassis service LED on + * ILOM 3.x based platforms. + */ +static int +chassis_service_mode(topo_mod_t *mod, tnode_t *node, topo_version_t vers, + nvlist_t *in, nvlist_t **out) +{ + char **entity_refs; + uint_t nelems; + ipmi_sdr_generic_locator_t *gdl = NULL; + ipmi_deviceid_t *sp_devid; + ipmi_platform_event_message_t pem; + ipmi_handle_t *hdl; + int err, ret, i; + uint8_t ledmode; + uint32_t mode_in; + nvlist_t *pargs, *nvl; + boolean_t found_sdr = B_FALSE; + + if (vers > TOPO_METH_CHASSIS_SERVICE_VERSION) + return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); + + /* + * Get an IPMI handle and then lookup the generic device locator record + * referenced by the entity_ref prop val + */ + if ((hdl = topo_mod_ipmi_hold(mod)) == NULL) { + topo_mod_dprintf(mod, "Failed to get IPMI handle\n"); + return (-1); + } + + if (topo_prop_get_string_array(node, TOPO_PGROUP_FACILITY, "entity_ref", + &entity_refs, &nelems, &err) != 0) { + topo_mod_dprintf(mod, "Failed to lookup entity_ref property " + "(%s)", topo_strerror(err)); + topo_mod_ipmi_rele(mod); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } + + for (i = 0; i < nelems; i++) { + if ((gdl = ipmi_sdr_lookup_generic(hdl, entity_refs[i])) + != NULL) { + found_sdr = B_TRUE; + break; + } else + topo_mod_dprintf(mod, "Failed to lookup SDR for %s " + "(%s)\n", entity_refs[i], ipmi_errmsg(hdl)); + } + + if (! found_sdr) { + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + + /* + * Now lookup the propmethod argument list and figure out whether we're + * doing a get or a set operation, and then do it. + */ + if ((nvlist_lookup_nvlist(in, TOPO_PROP_PARGS, &pargs) == 0) && + nvlist_exists(pargs, TOPO_PROP_VAL_VAL)) { + /* + * Set the LED mode + */ + if ((ret = nvlist_lookup_uint32(pargs, TOPO_PROP_VAL_VAL, + &mode_in)) != 0) { + topo_mod_dprintf(mod, "Failed to lookup %s nvpair " + "(%s)\n", TOPO_PROP_VAL_VAL, strerror(ret)); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } + + /* + * Determine which IPMI mechanism to use to set the LED mode + * based on whether the SP is running ILOM 2 or later. + */ + if ((sp_devid = ipmi_get_deviceid(hdl)) == NULL) { + topo_mod_dprintf(mod, "%s: GET DEVICEID command failed " + "(%s)\n", __func__, ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + + topo_mod_dprintf(mod, "%s: Setting LED mode to %s\n", __func__, + mode_in ? "ON" : "OFF"); + + if (sp_devid->id_firm_major == 2) { + if (mode_in != TOPO_LED_STATE_OFF && + mode_in != TOPO_LED_STATE_ON) { + topo_mod_dprintf(mod, "Invalid property value: " + "%d\n", mode_in); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } + if (ipmi_sunoem_led_set(hdl, gdl, (uint8_t)mode_in) + < 0) { + topo_mod_dprintf(mod, "Failed to set LED mode " + "for %s (%s)\n", entity_refs[i], + ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + } else { + pem.ipem_generator = IPMI_SEL_SYSTEM; + pem.ipem_rev = IPMI_EV_REV15; + pem.ipem_sensor_type = IPMI_ST_SYSTEM; + pem.ipem_sensor_num = 0x00; + pem.ipem_event_type = IPMI_RT_SPECIFIC; + if (mode_in == TOPO_LED_STATE_ON) + pem.ipem_event_dir = 0; + else + pem.ipem_event_dir = 1; + + pem.ipem_event_data[0] = 0x02; + pem.ipem_event_data[1] = 0xff; + pem.ipem_event_data[2] = 0xff; + + topo_mod_dprintf(mod, "Sending platform event\n"); + if (ipmi_event_platform_message(hdl, &pem) != 0) { + topo_mod_dprintf(mod, "%s: Failed to send " + "platform event mesg for sensor 0 (%s)\n", + __func__, ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + } + } else { + /* + * Get the LED mode + */ + if (ipmi_sunoem_led_get(hdl, gdl, &ledmode) < 0) { + topo_mod_dprintf(mod, "%s: Failed to get LED mode for " + "%s (%s)\n", __func__, entity_refs[i], + ipmi_errmsg(hdl)); + strarr_free(mod, entity_refs, nelems); + topo_mod_ipmi_rele(mod); + return (-1); + } + } + strarr_free(mod, entity_refs, nelems); topo_mod_ipmi_rele(mod); if (topo_mod_nvalloc(mod, &nvl, NV_UNIQUE_NAME) != 0 || @@ -707,7 +1101,7 @@ { int err, ret, i; tnode_t *fnode; - char *ftype = "sensor", facname[MAX_ID_LEN]; + char *ftype = "sensor", facname[MAX_ID_LEN], **entity_refs; topo_pgroup_info_t pgi; nvlist_t *arg_nvl = NULL; @@ -755,13 +1149,22 @@ * getting the converted sensor reading and property for the base * unit type */ - if (topo_prop_set_string(fnode, TOPO_PGROUP_FACILITY, "entity_ref", - TOPO_PROP_IMMUTABLE, sd->sd_entity_ref, &err) != 0) { - topo_mod_dprintf(mod, "Failed to set entity_ref property on " - "node: %s=%d (%s)\n", topo_node_name(fnode), + if ((entity_refs = topo_mod_alloc(mod, sizeof (char *))) == NULL) + return (topo_mod_seterrno(mod, EMOD_NOMEM)); + + entity_refs[0] = topo_mod_strdup(mod, sd->sd_entity_ref); + + if (topo_prop_set_string_array(fnode, TOPO_PGROUP_FACILITY, + "entity_ref", TOPO_PROP_IMMUTABLE, (const char **)entity_refs, 1, + &err) != 0) { + topo_mod_dprintf(mod, "%s: Failed to set entity_ref property " + "on node: %s=%d (%s)\n", __func__, topo_node_name(fnode), topo_node_instance(fnode), topo_strerror(err)); + strarr_free(mod, entity_refs, 1); return (-1); } + strarr_free(mod, entity_refs, 1); + if (topo_prop_set_string(fnode, TOPO_PGROUP_FACILITY, TOPO_SENSOR_CLASS, TOPO_PROP_IMMUTABLE, sd->sd_class, &err) != 0) { topo_mod_dprintf(mod, "Failed to set %s property on node: " @@ -845,7 +1248,6 @@ f_sensor->is_fs_idstring, f_sensor->is_fs_idlen); sd.sd_entity_ref[sensor_idlen] = '\0'; - sd.sd_class = TOPO_SENSOR_CLASS_THRESHOLD; sd.sd_units = f_sensor->is_fs_unit2; sd.sd_stype = f_sensor->is_fs_type; sd.sd_rtype = f_sensor->is_fs_reading_type; @@ -860,7 +1262,6 @@ c_sensor->is_cs_idstring, sensor_idlen); sd.sd_entity_ref[sensor_idlen] = '\0'; - sd.sd_class = TOPO_SENSOR_CLASS_DISCRETE; sd.sd_units = c_sensor->is_cs_unit2; sd.sd_stype = c_sensor->is_cs_type; sd.sd_rtype = c_sensor->is_cs_reading_type; @@ -868,6 +1269,11 @@ default: return (0); } + if (sd.sd_rtype == IPMI_RT_THRESHOLD) + sd.sd_class = TOPO_SENSOR_CLASS_THRESHOLD; + else + sd.sd_class = TOPO_SENSOR_CLASS_DISCRETE; + /* * We offset the threshold and generic sensor reading types by 0x100 */ @@ -889,8 +1295,9 @@ ipmi_sensor_enum(topo_mod_t *mod, tnode_t *node, topo_version_t vers, nvlist_t *in, nvlist_t **out) { - char *entity_ref; + char **entity_refs; int err; + uint_t nelems; struct entity_info ei; ipmi_sdr_t *ref_sdr; ipmi_handle_t *hdl; @@ -898,6 +1305,7 @@ ipmi_sdr_compact_sensor_t *csensor; ipmi_sdr_fru_locator_t *floc; ipmi_sdr_generic_locator_t *gloc; + boolean_t found_sdr = B_FALSE; if ((hdl = topo_mod_ipmi_hold(mod)) == NULL) { topo_mod_dprintf(mod, "Failed to get IPMI handle\n"); @@ -908,24 +1316,29 @@ * Use the entity ref to lookup the SDR, which will have the entity ID * and instance. */ - if (topo_prop_get_string(node, TOPO_PGROUP_IPMI, - "entity_ref", &entity_ref, &err) != 0) { - topo_mod_dprintf(mod, "Failed to lookup entity_ref " - "property (%s)\n", topo_strerror(err)); + if (topo_prop_get_string_array(node, TOPO_PGROUP_IPMI, + "entity_ref", &entity_refs, &nelems, &err) != 0) { + topo_mod_dprintf(mod, "%s: Failed to lookup entity_ref " + "property on %s=%d (%s)\n", __func__, topo_node_name(node), + topo_node_instance(node), topo_strerror(err)); topo_mod_ipmi_rele(mod); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } - topo_mod_dprintf(mod, "Looking up SDR for %s ...\n", - entity_ref); - if ((ref_sdr = ipmi_sdr_lookup(hdl, entity_ref)) == NULL) { - topo_mod_dprintf(mod, "Failed to lookup SDR (%s)\n", - ipmi_errmsg(hdl)); - topo_mod_strfree(mod, entity_ref); + for (int i = 0; i < nelems; i++) { + if ((ref_sdr = ipmi_sdr_lookup(hdl, entity_refs[i])) != NULL) { + found_sdr = B_TRUE; + break; + } else + topo_mod_dprintf(mod, "%s: Failed to lookup SDR for %s " + "(%s)\n", __func__, entity_refs[i], + ipmi_errmsg(hdl)); + } + strarr_free(mod, entity_refs, nelems); + if (! found_sdr) { topo_mod_ipmi_rele(mod); - return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + return (-1); } - topo_mod_strfree(mod, entity_ref); switch (ref_sdr->is_type) { case IPMI_SDR_TYPE_FULL_SENSOR: @@ -955,9 +1368,6 @@ topo_mod_ipmi_rele(mod); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } - topo_mod_dprintf(mod, "Entity ID = 0x%x, Entity Instance = 0x%x\n", - ei.ei_id, ei.ei_inst); - ei.ei_node = node; ei.ei_mod = mod; @@ -981,8 +1391,9 @@ ipmi_entity(topo_mod_t *mod, tnode_t *node, topo_version_t vers, nvlist_t *in, nvlist_t **out) { - char *fmtstr, buf[BUFSZ]; + char **fmtarr, **entity_refs, buf[BUFSZ]; tnode_t *refnode; + uint_t nelems; int ret, inst1, inst2; uint32_t offset, nparams; nvlist_t *args, *nvl; @@ -1005,44 +1416,56 @@ strerror(ret)); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } + if (nvlist_lookup_string_array(args, "format", &fmtarr, &nelems) != 0) { + topo_mod_dprintf(mod, "Failed to lookup 'format' arg (%s)\n", + strerror(errno)); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } - if ((fmtstr = get_fmtstr(mod, in)) == NULL) { - topo_mod_dprintf(mod, "Failed to retrieve 'format' arg\n"); - /* topo errno already set */ - return (-1); - } + if ((entity_refs = topo_mod_alloc(mod, (nelems * sizeof (char *)))) + == NULL) + return (topo_mod_seterrno(mod, EMOD_NOMEM)); if (topo_node_flags(node) & TOPO_NODE_FACILITY) refnode = topo_node_parent(node); else refnode = node; - switch (nparams) { - case 1: - /* LINTED: E_SEC_PRINTF_VAR_FMT */ - (void) snprintf(buf, BUFSZ, fmtstr, - (topo_node_instance(refnode) + offset)); - break; - case 2: - inst1 = topo_node_instance(topo_node_parent(refnode)) + offset; - inst2 = topo_node_instance(refnode) + offset; - /* LINTED: E_SEC_PRINTF_VAR_FMT */ - (void) snprintf(buf, BUFSZ, fmtstr, inst1, inst2); - break; - default: - topo_mod_dprintf(mod, "Invalid 'nparams' argval (%d)\n", - nparams); - return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + for (int i = 0; i < nelems; i++) { + switch (nparams) { + case 1: + /* LINTED: E_SEC_PRINTF_VAR_FMT */ + (void) snprintf(buf, BUFSZ, fmtarr[i], + (topo_node_instance(refnode) + offset)); + break; + case 2: + inst1 = topo_node_instance(topo_node_parent(refnode)) + + offset; + inst2 = topo_node_instance(refnode) + offset; + /* LINTED: E_SEC_PRINTF_VAR_FMT */ + (void) snprintf(buf, BUFSZ, fmtarr[i], inst1, inst2); + break; + default: + topo_mod_dprintf(mod, "Invalid 'nparams' argval (%d)\n", + nparams); + strarr_free(mod, entity_refs, nelems); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } + entity_refs[i] = topo_mod_strdup(mod, buf); } - if (topo_mod_nvalloc(mod, &nvl, NV_UNIQUE_NAME) != 0 || nvlist_add_string(nvl, TOPO_PROP_VAL_NAME, "entity_ref") != 0 || - nvlist_add_uint32(nvl, TOPO_PROP_VAL_TYPE, TOPO_TYPE_STRING) != 0 || - nvlist_add_string(nvl, TOPO_PROP_VAL_VAL, buf) != 0) { + nvlist_add_uint32(nvl, TOPO_PROP_VAL_TYPE, + TOPO_TYPE_STRING_ARRAY) != 0 || + nvlist_add_string_array(nvl, TOPO_PROP_VAL_VAL, entity_refs, + nelems) != 0) { + topo_mod_dprintf(mod, "Failed to allocate 'out' nvlist\n"); + strarr_free(mod, entity_refs, nelems); nvlist_free(nvl); return (topo_mod_seterrno(mod, EMOD_NOMEM)); } + strarr_free(mod, entity_refs, nelems); *out = nvl; return (0); @@ -1053,9 +1476,10 @@ dimm_ipmi_entity(topo_mod_t *mod, tnode_t *node, topo_version_t vers, nvlist_t *in, nvlist_t **out) { - char *fmtstr, buf[BUFSZ]; + char **fmtarr, **entity_refs, buf[BUFSZ]; tnode_t *chip, *dimm; int ret; + uint_t nelems; uint32_t offset; nvlist_t *args, *nvl; @@ -1069,12 +1493,15 @@ strerror(ret)); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } + if (nvlist_lookup_string_array(args, "format", &fmtarr, &nelems) != 0) { + topo_mod_dprintf(mod, "Failed to lookup 'format' arg (%s)\n", + strerror(errno)); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } - if ((fmtstr = get_fmtstr(mod, in)) == NULL) { - topo_mod_dprintf(mod, "Failed to retrieve 'format' arg\n"); - /* topo errno already set */ - return (-1); - } + if ((entity_refs = topo_mod_alloc(mod, (nelems * sizeof (char *)))) + == NULL) + return (topo_mod_seterrno(mod, EMOD_NOMEM)); if (topo_node_flags(node) & TOPO_NODE_FACILITY) dimm = topo_node_parent(node); @@ -1083,18 +1510,97 @@ chip = topo_node_parent(topo_node_parent(dimm)); - /* LINTED: E_SEC_PRINTF_VAR_FMT */ - (void) snprintf(buf, BUFSZ, fmtstr, topo_node_instance(chip), - (topo_node_instance(dimm) + offset)); + for (int i = 0; i < nelems; i++) { + /* LINTED: E_SEC_PRINTF_VAR_FMT */ + (void) snprintf(buf, BUFSZ, fmtarr[i], topo_node_instance(chip), + (topo_node_instance(dimm) + offset)); + entity_refs[i] = topo_mod_strdup(mod, buf); + } if (topo_mod_nvalloc(mod, &nvl, NV_UNIQUE_NAME) != 0 || nvlist_add_string(nvl, TOPO_PROP_VAL_NAME, "entity_ref") != 0 || - nvlist_add_uint32(nvl, TOPO_PROP_VAL_TYPE, TOPO_TYPE_STRING) != 0 || - nvlist_add_string(nvl, TOPO_PROP_VAL_VAL, buf) != 0) { + nvlist_add_uint32(nvl, TOPO_PROP_VAL_TYPE, + TOPO_TYPE_STRING_ARRAY) != 0 || + nvlist_add_string_array(nvl, TOPO_PROP_VAL_VAL, entity_refs, nelems) + != 0) { topo_mod_dprintf(mod, "Failed to allocate 'out' nvlist\n"); + strarr_free(mod, entity_refs, nelems); nvlist_free(nvl); return (topo_mod_seterrno(mod, EMOD_NOMEM)); } + strarr_free(mod, entity_refs, nelems); + *out = nvl; + + return (0); +} + +/* ARGSUSED */ +static int +cs_ipmi_entity(topo_mod_t *mod, tnode_t *node, topo_version_t vers, + nvlist_t *in, nvlist_t **out) +{ + char **fmtarr, **entity_refs, buf[BUFSZ]; + tnode_t *chip, *chan, *cs; + int ret, dimm_num; + uint_t nelems; + uint32_t offset; + nvlist_t *args, *nvl; + + if ((ret = nvlist_lookup_nvlist(in, TOPO_PROP_ARGS, &args)) != 0) { + topo_mod_dprintf(mod, "Failed to lookup 'args' list (%s)\n", + strerror(ret)); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } + if ((ret = nvlist_lookup_uint32(args, "offset", &offset)) != 0) { + topo_mod_dprintf(mod, "Failed to lookup 'offset' arg (%s)\n", + strerror(ret)); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } + if (nvlist_lookup_string_array(args, "format", &fmtarr, &nelems) != 0) { + topo_mod_dprintf(mod, "Failed to lookup 'format' arg (%s)\n", + strerror(errno)); + return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + } + + if ((entity_refs = topo_mod_alloc(mod, (nelems * sizeof (char *)))) + == NULL) + return (topo_mod_seterrno(mod, EMOD_NOMEM)); + + if (topo_node_flags(node) & TOPO_NODE_FACILITY) { + cs = topo_node_parent(node); + chip = topo_node_parent(topo_node_parent(topo_node_parent(cs))); + chan = topo_node_parent(cs); + + dimm_num = topo_node_instance(cs) - (topo_node_instance(cs) % 2) + + topo_node_instance(cs) + offset; + } else { + cs = node; + chip = topo_node_parent(topo_node_parent(topo_node_parent(cs))); + chan = topo_node_parent(cs); + + dimm_num = topo_node_instance(cs) - (topo_node_instance(cs) % 2) + + topo_node_instance(chan) + offset; + } + + for (int i = 0; i < nelems; i++) { + /* LINTED: E_SEC_PRINTF_VAR_FMT */ + (void) snprintf(buf, BUFSZ, fmtarr[i], topo_node_instance(chip), + dimm_num); + entity_refs[i] = topo_mod_strdup(mod, buf); + } + + if (topo_mod_nvalloc(mod, &nvl, NV_UNIQUE_NAME) != 0 || + nvlist_add_string(nvl, TOPO_PROP_VAL_NAME, "entity_ref") != 0 || + nvlist_add_uint32(nvl, TOPO_PROP_VAL_TYPE, + TOPO_TYPE_STRING_ARRAY) != 0 || + nvlist_add_string_array(nvl, TOPO_PROP_VAL_VAL, entity_refs, nelems) + != 0) { + topo_mod_dprintf(mod, "Failed to allocate 'out' nvlist\n"); + strarr_free(mod, entity_refs, nelems); + nvlist_free(nvl); + return (topo_mod_seterrno(mod, EMOD_NOMEM)); + } + strarr_free(mod, entity_refs, nelems); *out = nvl; return (0);
--- a/usr/src/lib/fm/topo/modules/common/ses/ses.c Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/modules/common/ses/ses.c Fri Jul 31 13:25:53 2009 -0700 @@ -101,6 +101,9 @@ TOPO_METH_PRESENT_VERSION0, TOPO_STABILITY_INTERNAL, ses_present }, { TOPO_METH_FAC_ENUM, TOPO_METH_FAC_ENUM_DESC, 0, TOPO_STABILITY_INTERNAL, ses_node_enum_facility }, + { TOPO_METH_SENSOR_FAILURE, TOPO_METH_SENSOR_FAILURE_DESC, + TOPO_METH_SENSOR_FAILURE_VERSION, TOPO_STABILITY_INTERNAL, + topo_method_sensor_failure }, { NULL } };
--- a/usr/src/lib/fm/topo/modules/i86pc/chip/chip.h Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/modules/i86pc/chip/chip.h Fri Jul 31 13:25:53 2009 -0700 @@ -88,7 +88,6 @@ * DIMM serial number property methods */ #define GET_DIMM_SERIAL "get_dimm_serial" -#define GET_CS_SERIAL "get_cs_serial" extern int simple_dimm_label(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *, nvlist_t **); @@ -110,8 +109,6 @@ nvlist_t *, nvlist_t **); extern int simple_cs_label_mp(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *, nvlist_t **); -extern int get_cs_serial(topo_mod_t *, tnode_t *, topo_version_t, - nvlist_t *, nvlist_t **); extern int get_dimm_serial(topo_mod_t *, tnode_t *, topo_version_t, nvlist_t *, nvlist_t **); extern int fsb2_chip_label(topo_mod_t *, tnode_t *, topo_version_t,
--- a/usr/src/lib/fm/topo/modules/i86pc/chip/chip_amd.c Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/modules/i86pc/chip/chip_amd.c Fri Jul 31 13:25:53 2009 -0700 @@ -104,8 +104,8 @@ mem_asru_compute }, { SIMPLE_CS_LBL_MP, "Property method", 0, TOPO_STABILITY_INTERNAL, simple_cs_label_mp}, - { GET_CS_SERIAL, "Property method", 0, - TOPO_STABILITY_INTERNAL, get_cs_serial}, + { GET_DIMM_SERIAL, "Property method", 0, + TOPO_STABILITY_INTERNAL, get_dimm_serial}, { NULL } };
--- a/usr/src/lib/fm/topo/modules/i86pc/chip/chip_serial.c Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/fm/topo/modules/i86pc/chip/chip_serial.c Fri Jul 31 13:25:53 2009 -0700 @@ -37,7 +37,7 @@ #include "chip.h" #define BUFSZ 128 -#define JEDEC_TBL_SZ 4 +#define JEDEC_TBL_SZ 5 /* * The following table maps DIMM manufacturer names to a JEDEC ID as sourced @@ -47,6 +47,7 @@ */ static const char *jedec_tbl[JEDEC_TBL_SZ][2] = { + { "HYUNDAI ELECTRONICS", "00AD" }, { "INFINEON", "00C1" }, { "MICRON TECHNOLOGY", "002C" }, { "QIMONDA", "7F51" }, @@ -204,97 +205,37 @@ get_dimm_serial(topo_mod_t *mod, tnode_t *node, topo_version_t vers, nvlist_t *in, nvlist_t **out) { - char *fmtstr, ipmi_tag[BUFSZ], fru_serial[FRU_INFO_MAXLEN]; - tnode_t *chip; - int ret; - uint32_t offset; - nvlist_t *args; + char **entity_refs, fru_serial[FRU_INFO_MAXLEN]; + int err, rv = 0, i; + uint_t nelems; + boolean_t found_serial = B_FALSE; - topo_mod_dprintf(mod, "get_dimm_serial() called\n"); - if ((ret = nvlist_lookup_nvlist(in, "args", &args)) != 0) { - topo_mod_dprintf(mod, "Failed to lookup 'args' list (%s)\n", - strerror(ret)); - return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); - } - if ((ret = nvlist_lookup_uint32(args, "offset", &offset)) != 0) { - topo_mod_dprintf(mod, "Failed to lookup 'offset' arg (%s)\n", - strerror(ret)); + if (topo_prop_get_string_array(node, TOPO_PGROUP_IPMI, "entity_ref", + &entity_refs, &nelems, &err) != 0) { + topo_mod_dprintf(mod, "%s: Failed to lookup entity_ref property" + " (%s)", __func__, topo_strerror(err)); return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); } - if ((fmtstr = get_fmtstr(mod, in)) == NULL) { - /* topo errno set */ - topo_mod_dprintf(mod, "Failed to retrieve format arg\n"); - return (-1); + + for (i = 0; i < nelems; i++) { + if (ipmi_serial_lookup(mod, entity_refs[i], fru_serial) == 0) { + found_serial = B_TRUE; + break; + } else + topo_mod_dprintf(mod, "Failed to lookup serial for " + "%s\n", entity_refs[i]); } - - chip = topo_node_parent(topo_node_parent(node)); - - /* LINTED: E_SEC_PRINTF_VAR_FMT */ - (void) snprintf(ipmi_tag, BUFSZ, fmtstr, topo_node_instance(chip), - (topo_node_instance(node) + offset)); - - if (ipmi_serial_lookup(mod, ipmi_tag, fru_serial) != 0) { - topo_mod_dprintf(mod, "Failed to lookup serial for %s\n", - ipmi_tag); + if (! found_serial) (void) strcpy(fru_serial, ""); - } if (store_prop_val(mod, fru_serial, "serial", out) != 0) { topo_mod_dprintf(mod, "Failed to set serial\n"); /* topo errno already set */ - return (-1); - } - return (0); -} - -/* ARGSUSED */ -int -get_cs_serial(topo_mod_t *mod, tnode_t *node, topo_version_t vers, - nvlist_t *in, nvlist_t **out) -{ - char *fmtstr, ipmi_tag[BUFSZ], fru_serial[FRU_INFO_MAXLEN]; - tnode_t *chip, *chan; - int ret, dimm_num; - uint32_t offset; - nvlist_t *args; - - topo_mod_dprintf(mod, "get_cs_serial() called\n"); - if ((ret = nvlist_lookup_nvlist(in, "args", &args)) != 0) { - topo_mod_dprintf(mod, "Failed to lookup 'args' list (%s)\n", - strerror(ret)); - return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); - } - if ((ret = nvlist_lookup_uint32(args, "offset", &offset)) != 0) { - topo_mod_dprintf(mod, "Failed to lookup 'offset' arg (%s)\n", - strerror(ret)); - return (topo_mod_seterrno(mod, EMOD_NVL_INVAL)); + rv = -1; } - if ((fmtstr = get_fmtstr(mod, in)) == NULL) { - /* topo errno set */ - topo_mod_dprintf(mod, "Failed to retrieve format arg\n"); - return (-1); - } - - chip = topo_node_parent(topo_node_parent(topo_node_parent(node))); - chan = topo_node_parent(node); - - dimm_num = topo_node_instance(node) - (topo_node_instance(node) % 2) - + topo_node_instance(chan) + offset; + for (i = 0; i < nelems; i++) + topo_mod_strfree(mod, entity_refs[i]); + topo_mod_free(mod, entity_refs, (nelems * sizeof (char *))); - /* LINTED: E_SEC_PRINTF_VAR_FMT */ - (void) snprintf(ipmi_tag, BUFSZ, fmtstr, topo_node_instance(chip), - dimm_num); - - if (ipmi_serial_lookup(mod, ipmi_tag, fru_serial) != 0) { - topo_mod_dprintf(mod, "Failed to lookup serial for %s\n", - ipmi_tag); - (void) strcpy(fru_serial, ""); - } - - if (store_prop_val(mod, fru_serial, "serial", out) != 0) { - topo_mod_dprintf(mod, "Failed to set serial\n"); - /* topo errno already set */ - return (-1); - } - return (0); + return (rv); }
--- a/usr/src/lib/libipmi/common/ipmi_sunoem.c Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/lib/libipmi/common/ipmi_sunoem.c Fri Jul 31 13:25:53 2009 -0700 @@ -20,12 +20,10 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <libipmi.h> #include <stddef.h> @@ -44,6 +42,8 @@ ic_sls_accessaddr :7); /* (from SDR record */ uint8_t ic_sls_hwinfo; /* OEM hardware info */ uint8_t ic_sls_mode; /* LED mode */ + uint8_t ic_sls_eid; /* entity ID */ + uint8_t ic_sls_einst; /* entity instance */ uint8_t ic_sls_force; /* force direct access */ uint8_t ic_sls_role; /* BMC authorization */ } ipmi_cmd_sunoem_led_set_t; @@ -57,6 +57,8 @@ __reserved :1, /* device access address */ ic_slg_accessaddr :7); /* (from SDR record */ uint8_t ic_slg_hwinfo; /* OEM hardware info */ + uint8_t ic_slg_eid; /* entity ID */ + uint8_t ic_slg_einst; /* entity instance */ uint8_t ic_slg_force; /* force direct access */ } ipmi_cmd_sunoem_led_get_t; @@ -144,6 +146,8 @@ cmd.ic_sls_accessaddr = dev->is_gl_accessaddr; cmd.ic_sls_hwinfo = dev->is_gl_oem; cmd.ic_sls_mode = mode; + cmd.ic_sls_eid = dev->is_gl_entity; + cmd.ic_sls_einst = dev->is_gl_instance; return (ipmi_send_sunoem_led_set(ihp, &cmd)); } @@ -162,6 +166,8 @@ cmd.ic_slg_type = dev->is_gl_oem; cmd.ic_slg_accessaddr = dev->is_gl_accessaddr; cmd.ic_slg_hwinfo = dev->is_gl_oem; + cmd.ic_slg_eid = dev->is_gl_entity; + cmd.ic_slg_einst = dev->is_gl_instance; return (ipmi_send_sunoem_led_get(ihp, &cmd, mode)); }
--- a/usr/src/pkgdefs/SUNWfmd/prototype_i386 Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/pkgdefs/SUNWfmd/prototype_i386 Fri Jul 31 13:25:53 2009 -0700 @@ -83,6 +83,7 @@ f none usr/platform/i86pc/lib/fm/topo/plugins/hostbridge.so 555 root bin f none usr/platform/i86pc/lib/fm/topo/plugins/pcibus.so 555 root bin d none usr/platform/i86pc/lib/fm/topo/maps 755 root bin +f none usr/platform/i86pc/lib/fm/topo/maps/chassis-hc-topology.xml 444 root bin f none usr/platform/i86pc/lib/fm/topo/maps/chip-hc-topology.xml 444 root bin f none usr/platform/i86pc/lib/fm/topo/maps/fan-hc-topology.xml 444 root bin f none usr/platform/i86pc/lib/fm/topo/maps/i86pc-hc-topology.xml 444 root bin
--- a/usr/src/pkgdefs/SUNWhea/prototype_com Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/pkgdefs/SUNWhea/prototype_com Fri Jul 31 13:25:53 2009 -0700 @@ -667,6 +667,7 @@ f none usr/include/sys/bitmap.h 644 root bin f none usr/include/sys/bitset.h 644 root bin f none usr/include/sys/bl.h 644 root bin +f none usr/include/sys/bmc_intf.h 644 root bin f none usr/include/sys/bofi.h 644 root bin f none usr/include/sys/bofi_impl.h 644 root bin f none usr/include/sys/bootconf.h 644 root bin
--- a/usr/src/uts/common/sys/fm/protocol.h Fri Jul 31 13:13:39 2009 -0700 +++ b/usr/src/uts/common/sys/fm/protocol.h Fri Jul 31 13:25:53 2009 -0700 @@ -86,6 +86,7 @@ #define FM_SUSPECT_MESSAGE "message" #define FM_SUSPECT_RETIRE "retire" #define FM_SUSPECT_RESPONSE "response" +#define FM_SUSPECT_SEVERITY "severity" #define FM_SUSPECT_VERS0 0 #define FM_SUSPECT_VERSION FM_SUSPECT_VERS0