Mercurial > illumos > illumos-gate
changeset 12601:3fd4339427c7
6950333 fan tray removal not correctly implemented on Netra-440
6929846 prtpicl and prtdiag not updating after hot inserting fan tray on Netra-440
author | Justin Frank <Justin.Frank@Sun.COM> |
---|---|
date | Thu, 10 Jun 2010 13:05:14 -0700 |
parents | 25763e25fe19 |
children | cee34dc4a570 |
files | usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/Makefile usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/fru_FT0.info usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/fru_FT1.info usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/fru_FT2.info usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/fru_FT3.info usr/src/cmd/picl/plugins/sun4u/mpxu/frudr/piclfrudr.c usr/src/pkg/manifests/service-picl.mf |
diffstat | 7 files changed, 517 insertions(+), 78 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/Makefile Thu Jun 10 11:29:20 2010 -0700 +++ b/usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/Makefile Thu Jun 10 13:05:14 2010 -0700 @@ -18,8 +18,7 @@ # # CDDL HEADER END # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. # # cmd/picl/plugins/sun4u/chalupa/frudr/Makefile # @@ -38,6 +37,7 @@ CONFS += fru_PSU0.conf fru_PSU1.conf fru_PSU2.conf fru_PSU3.conf CONFS += fru_HDD0.conf fru_HDD1.conf fru_HDD2.conf CONFS += fru_HDD3.conf +CONFS += fru_FT0.conf fru_FT1.conf fru_FT2.conf fru_FT3.conf CONFS += fru_SC.conf ROOTCONF= $(CONFS:%=$(ROOTLIBDIR)/%) $(ROOTCONF) := FILEMODE = 0644 @@ -66,9 +66,8 @@ $(CONFS): $(MAININFO) $(OTHERINFOS) @$(RM) -f $@ - @echo "# Copyright 2002 Sun Microsystems, Inc. All rights reserved." \ + @echo "# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved." \ > $@ - @echo "# Use is subject to license terms." >> $@ @echo "# This is a generated file. #ident lines identify sources" >> $@ $(CPP) -P $(@:%.conf=%.info) | \ $(SED) -e '/^[ ]*$$/d' >> $@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/fru_FT0.info Thu Jun 10 13:05:14 2010 -0700 @@ -0,0 +1,88 @@ +/* + * 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 + */ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * + * This configuration file is parsed by PICL plugin envmon in response + * to a PICL_FRU_ADDED event for FT0 + * + * supported prop types: void, int, uint, float, string + * supported prop access_modes: r, w, rw + * + * VERSION <version_number> -- supported version number is 1.0 + * + * name:<namepath> -- gives the anchor node + * where <namepath> is <nodename>[@<bus-addr>][?<prop>=<val>] + * + * _class:<classpath> -- gives the anchor node + * where <classpath> is <classname>[@<bus-addr>][?<prop>=<val>] + * + * NODE <name> <class> + * {describes a subtree} + * ENDNODE + * + * PROP <name> <type> <access_mode> [<size> <value>] -- per property + * + * REFPROP <name> <dstnode> + * + * REFNODE <name> <class> with <destnode> -- Associates a new node + * with <destnode> if exists + * where + * <name> is the nodename + * <class> is the picl class. + * <destnode> is name:<namepath> or _class:<classpath> + * + * If "name:" or "_class:" is not specified in the <path>, + * the default is "name:" + * + */ + +VERSION 1.1 +VERBOSE 1 + +name:/frutree/chassis/FT0 + Node F0 location + PROP SlotType string r 0 "fan-unit" + Prop Label string r 0 "F0" + NODE fan fru + ENDNODE + ENDNODE +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft0_f0_tach + REFPROP _location_parent name:/frutree/chassis/FT0/F0 +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft0_f0_act + REFPROP _location_parent name:/frutree/chassis/FT0/F0 +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft0_f0_fault + REFPROP _location_parent name:/frutree/chassis/FT0/F0 +name:/frutree/chassis/FT0/F0/fan + TABLE Devices + ROW + PROP Class string r 0 "fan" + REFPROP _fan_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft0_f0_tach + ENDROW + ROW + PROP Class string r 0 "led" + REFPROP _led_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft0_f0_act + ENDROW + ROW + PROP Class string r 0 "led" + REFPROP _led_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft0_f0_fault + ENDROW + ENDTABLE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/fru_FT1.info Thu Jun 10 13:05:14 2010 -0700 @@ -0,0 +1,103 @@ +/* + * 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 + */ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * + * This configuration file is parsed by PICL plugin envmon in response + * to a PICL_FRU_ADDED event for FT1 + * + * supported prop types: void, int, uint, float, string + * supported prop access_modes: r, w, rw + * + * VERSION <version_number> -- supported version number is 1.0 + * + * name:<namepath> -- gives the anchor node + * where <namepath> is <nodename>[@<bus-addr>][?<prop>=<val>] + * + * _class:<classpath> -- gives the anchor node + * where <classpath> is <classname>[@<bus-addr>][?<prop>=<val>] + * + * NODE <name> <class> + * {describes a subtree} + * ENDNODE + * + * PROP <name> <type> <access_mode> [<size> <value>] -- per property + * + * REFPROP <name> <dstnode> + * + * REFNODE <name> <class> with <destnode> -- Associates a new node + * with <destnode> if exists + * where + * <name> is the nodename + * <class> is the picl class. + * <destnode> is name:<namepath> or _class:<classpath> + * + * If "name:" or "_class:" is not specified in the <path>, + * the default is "name:" + * + */ + +VERSION 1.1 +VERBOSE 1 + +name:/frutree/chassis/FT1 + Node F0 location + PROP SlotType string r 0 "fan-unit" + Prop Label string r 0 "F0" + NODE fan fru + ENDNODE + ENDNODE + Node F1 location + PROP SlotType string r 0 "fan-unit" + Prop Label string r 0 "F1" + NODE fan fru + ENDNODE + ENDNODE +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft1_f0_tach + REFPROP _location_parent name:/frutree/chassis/FT1/F0 +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft1_f1_tach + REFPROP _location_parent name:/frutree/chassis/FT1/F1 +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft1_f0_act + REFPROP _location_parent name:/frutree/chassis/FT1/F0 +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft1_f0_fault + REFPROP _location_parent name:/frutree/chassis/FT1/F0 +name:/frutree/chassis/FT1/F0/fan + TABLE Devices + ROW + PROP Class string r 0 "fan" + REFPROP _fan_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft1_f0_tach + ENDROW + ROW + PROP Class string r 0 "led" + REFPROP _led_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft1_f0_act + ENDROW + ROW + PROP Class string r 0 "led" + REFPROP _led_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft1_f0_fault + ENDROW + ENDTABLE +name:/frutree/chassis/FT1/F1/fan + TABLE Devices + ROW + PROP Class string r 0 "fan" + REFPROP _fan_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft1_f1_tach + ENDROW + ENDTABLE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/fru_FT2.info Thu Jun 10 13:05:14 2010 -0700 @@ -0,0 +1,90 @@ +/* + * 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 + */ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * + * This configuration file is parsed by PICL plugin envmon in response + * to a PICL_FRU_ADDED event for FT2 + * + * supported prop types: void, int, uint, float, string + * supported prop access_modes: r, w, rw + * + * VERSION <version_number> -- supported version number is 1.0 + * + * name:<namepath> -- gives the anchor node + * where <namepath> is <nodename>[@<bus-addr>][?<prop>=<val>] + * + * _class:<classpath> -- gives the anchor node + * where <classpath> is <classname>[@<bus-addr>][?<prop>=<val>] + * + * NODE <name> <class> + * {describes a subtree} + * ENDNODE + * + * PROP <name> <type> <access_mode> [<size> <value>] -- per property + * + * REFPROP <name> <dstnode> + * + * REFNODE <name> <class> with <destnode> -- Associates a new node + * with <destnode> if exists + * where + * <name> is the nodename + * <class> is the picl class. + * <destnode> is name:<namepath> or _class:<classpath> + * + * If "name:" or "_class:" is not specified in the <path>, + * the default is "name:" + * + */ + +VERSION 1.1 +VERBOSE 1 + +name:/frutree/chassis/FT2 + PROP SlotType string r 0 "fan-tray" + PROP Label string r 0 "FT2" + Node F0 location + PROP SlotType string r 0 "fan-unit" + Prop Label string r 0 "F0" + NODE fan fru + ENDNODE + ENDNODE +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft2_f0_tach + REFPROP _location_parent name:/frutree/chassis/FT2/F0 +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft2_f0_act + REFPROP _location_parent name:/frutree/chassis/FT2/F0 +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft2_f0_fault + REFPROP _location_parent name:/frutree/chassis/FT2/F0 +name:/frutree/chassis/FT2/F0/fan + TABLE Devices + ROW + PROP Class string r 0 "fan" + REFPROP _fan_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft2_f0_tach + ENDROW + ROW + PROP Class string r 0 "led" + REFPROP _led_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft2_f0_act + ENDROW + ROW + PROP Class string r 0 "led" + REFPROP _led_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft2_f0_fault + ENDROW + ENDTABLE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usr/src/cmd/picl/plugins/sun4u/chalupa/frudr/fru_FT3.info Thu Jun 10 13:05:14 2010 -0700 @@ -0,0 +1,78 @@ +/* + * 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 + */ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * + * This configuration file is parsed by PICL plugin envmon in response + * to a PICL_FRU_ADDED event for FT2 + * + * supported prop types: void, int, uint, float, string + * supported prop access_modes: r, w, rw + * + * VERSION <version_number> -- supported version number is 1.0 + * + * name:<namepath> -- gives the anchor node + * where <namepath> is <nodename>[@<bus-addr>][?<prop>=<val>] + * + * _class:<classpath> -- gives the anchor node + * where <classpath> is <classname>[@<bus-addr>][?<prop>=<val>] + * + * NODE <name> <class> + * {describes a subtree} + * ENDNODE + * + * PROP <name> <type> <access_mode> [<size> <value>] -- per property + * + * REFPROP <name> <dstnode> + * + * REFNODE <name> <class> with <destnode> -- Associates a new node + * with <destnode> if exists + * where + * <name> is the nodename + * <class> is the picl class. + * <destnode> is name:<namepath> or _class:<classpath> + * + * If "name:" or "_class:" is not specified in the <path>, + * the default is "name:" + * + */ + +VERSION 1.1 +VERBOSE 1 + +name:/frutree/chassis/FT3 + PROP SlotType string r 0 "fan-tray" + PROP Label string r 0 "FT3" + Node F0 location + PROP SlotType string r 0 "fan-unit" + Prop Label string r 0 "F0" + NODE fan fru + ENDNODE + ENDNODE +name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft3_f0 + REFPROP _location_parent name:/frutree/chassis/FT3/F0 +name:/frutree/chassis/FT3/F0/fan + TABLE Devices + ROW + PROP Class string r 0 "fan" + REFPROP _fan_ name:/platform/pci@1e,600000/isa@7/rmc-comm@0,3e8/SUNW,rmclomv/ft3_f0 + ENDROW + ENDTABLE
--- a/usr/src/cmd/picl/plugins/sun4u/mpxu/frudr/piclfrudr.c Thu Jun 10 11:29:20 2010 -0700 +++ b/usr/src/cmd/picl/plugins/sun4u/mpxu/frudr/piclfrudr.c Thu Jun 10 13:05:14 2010 -0700 @@ -20,12 +20,9 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stddef.h> #include <syslog.h> @@ -131,7 +128,12 @@ #define RMC_FRU_NAME "sc" #define FT_NAME "FT" #define FT_NAME_LEN 2 +#define F0_NAME "F0" +#define F0_NAME_LEN 2 +#define F1_NAME "F1" +#define F1_NAME_LEN 2 #define FT_FRU_NAME "fan-tray" +#define FT_FRU_NAME_LEN 8 #define FT_ID_BUFSZ (FT_NAME_LEN + 2) #define DEV_PREFIX "/devices" #define ENXS_FRONT_SRVC_LED 0x20 @@ -483,7 +485,7 @@ */ if ((sys_platform == PLAT_CHALUPA) || - (sys_platform == PLAT_CHALUPA19)) { + (sys_platform == PLAT_CHALUPA19)) { sprintf_buf2(namebuf, CHASSIS_LOC_PATH, RMC_NAME); } else { sprintf_buf2(namebuf, SYS_BOARD_PATH, RMC_NAME); @@ -1041,6 +1043,27 @@ return (-1); } +/* + * This helper function for Netra-440 fan tray removal removes + * the rmclomv-rooted nodes and their properties. + */ +static void +delete_node_and_props(picl_nodehdl_t hdl) +{ + picl_prophdl_t prop; + int err; + + do { + err = ptree_get_first_prop(hdl, &prop); + if (err == PICL_SUCCESS) { + if (ptree_delete_prop(prop) == PICL_SUCCESS) + (void) ptree_destroy_prop(prop); + } + } while (err == PICL_SUCCESS); + if (ptree_delete_node(hdl) == PICL_SUCCESS) + (void) ptree_destroy_node(hdl); +} + static void remove_fru_parents(picl_nodehdl_t fruh) { @@ -1051,7 +1074,7 @@ picl_prophdl_t tblh; picl_prophdl_t fruph; picl_nodehdl_t childh; - int seabos_fanfru = 0; + int fanfru = 0; retval = ptree_get_propval_by_name(fruh, PICL_PROP_NAME, name, sizeof (name)); @@ -1063,9 +1086,10 @@ retval = ptree_get_prop_by_name(fruh, PICL_PROP_DEVICES, &tableh); if (retval != PICL_SUCCESS) { /* - * No Devices table. However on Seattle and Boston (which - * support fan fru hotplug), the Devices table will be - * found under the child node (Fn) of the fru (fan-tray). + * No Devices table. However on Seattle, Boston and + * Netra-440 (Chalupa19) (which support fan fru hotplug), + * the Devices table will be found under the child node (Fn) + * of the fru (fan-tray). * Therefore, check the first child of the fru for the * Devices table on these platforms before returning. */ @@ -1075,24 +1099,26 @@ case PLAT_BOSTON: if (strcmp(name, FT_FRU_NAME) != 0) return; - - retval = ptree_get_propval_by_name(fruh, - PICL_PROP_CHILD, &childh, sizeof (picl_nodehdl_t)); - if (retval != PICL_SUCCESS) + fanfru = 1; + break; + case PLAT_CHALUPA19: + if (strncmp(name, F0_NAME, F0_NAME_LEN) && + strncmp(name, F1_NAME, F1_NAME_LEN)) return; - - retval = ptree_get_prop_by_name(childh, - PICL_PROP_DEVICES, &tableh); - if (retval != PICL_SUCCESS) - return; - - seabos_fanfru = 1; + fanfru = 1; break; - default: /* nothing to do */ return; } + retval = ptree_get_propval_by_name(fruh, + PICL_PROP_CHILD, &childh, sizeof (picl_nodehdl_t)); + if (retval != PICL_SUCCESS) + return; + retval = ptree_get_prop_by_name(childh, + PICL_PROP_DEVICES, &tableh); + if (retval != PICL_SUCCESS) + return; } /* @@ -1103,14 +1129,14 @@ retval = ptree_get_propval(tableh, &tblh, sizeof (tblh)); if (retval != PICL_SUCCESS) { /* can't get value of table property */ - return; + goto afterloop; } /* get first col, first row */ retval = ptree_get_next_by_col(tblh, &tblh); if (retval != PICL_SUCCESS) { /* no rows? */ - return; + goto afterloop; } /* @@ -1136,13 +1162,13 @@ PICL_REFPROP_FRU_PARENT, &fruph); if (retval != PICL_SUCCESS) { /* - * on Boston and Seattle, we should actually be - * looking for the _location_parent property - * for fan frus + * on Boston, Seattle and Netra-440 we should + * actually be looking for the _location_parent + * property for fan frus */ - if (seabos_fanfru) { - retval = ptree_get_prop_by_name(nodeh, - PICL_REFPROP_LOC_PARENT, &fruph); + if (fanfru) { + retval = ptree_get_prop_by_name(nodeh, + PICL_REFPROP_LOC_PARENT, &fruph); } if (retval != PICL_SUCCESS) continue; @@ -1150,14 +1176,24 @@ /* * got a _fru_parent node reference delete it */ - retval = ptree_delete_prop(fruph); - if (retval != PICL_SUCCESS) { - continue; + if (ptree_delete_prop(fruph) == PICL_SUCCESS) + (void) ptree_destroy_prop(fruph); + + /* On Netra-440, extra clean-up is required for fan trays */ + if ((sys_platform == PLAT_CHALUPA19) && (fanfru)) { + /* remove the rmclomv node and its properties */ + delete_node_and_props(nodeh); } - retval = ptree_destroy_prop(fruph); - if (retval != PICL_SUCCESS) { - continue; - } + } +afterloop: + /* More Netra-440 fan tray clean-up */ + if ((sys_platform == PLAT_CHALUPA19) && (fanfru)) { + /* remove the fru's child's table */ + if (ptree_delete_prop(tableh) == PICL_SUCCESS) + (void) ptree_destroy_prop(tableh); + /* remove the child */ + if (ptree_delete_node(childh) == PICL_SUCCESS) + (void) ptree_destroy_node(childh); } } @@ -1199,12 +1235,14 @@ /* * Event completion handler for PICL_FRU_ADDED/PICL_FRU_REMOVED events */ +/* ARGSUSED */ static void frudr_completion_handler(char *ename, void *earg, size_t size) { picl_nodehdl_t fruh; picl_nodehdl_t parh; - char nodename[PICL_PROPNAMELEN_MAX]; + picl_nodehdl_t peerh = NULL; + char nodename[PICL_PROPNAMELEN_MAX] = { '\0' }; int err; if (strcmp(ename, PICL_FRU_REMOVED) == 0) { @@ -1216,6 +1254,9 @@ (void) nvlist_lookup_uint64(earg, PICLEVENTARG_FRUHANDLE, &fruh); if (fruh != NULL) { + (void) ptree_get_propval_by_name(fruh, PICL_PROP_PEER, + &peerh, sizeof (peerh)); + /* * first find name of the fru */ @@ -1257,6 +1298,26 @@ } else { syslog(LOG_ERR, DELETE_PROP_FAIL, err); } + + if ((sys_platform == PLAT_CHALUPA19) && + (strncmp(nodename, FT_NAME, FT_NAME_LEN) == 0) && + (peerh != NULL)) { + /* + * On Netra-440 platforms, a fan tray + * may contain 2 fans (F0 and F1) but + * we only receive a single notification + * for removal of F0. If F1 is present, + * peerh will be valid and we need to + * process it as well. + */ + remove_fru_parents(peerh); + err = ptree_delete_node(peerh); + if (err == PICL_SUCCESS) { + (void) ptree_destroy_node(peerh); + } else { + syslog(LOG_ERR, DELETE_PROP_FAIL, err); + } + } } } @@ -1335,9 +1396,9 @@ res = ptree_get_propval_by_name(child_hdl, PICL_PROP_PEER, &child_hdl, sizeof (picl_nodehdl_t)); if ((res == PICL_SUCCESS) && - ptree_get_propval_by_name(child_hdl, - PICL_PROP_UNIT_ADDRESS, unit_addr, - sizeof (unit_addr)) == PICL_SUCCESS) { + ptree_get_propval_by_name(child_hdl, + PICL_PROP_UNIT_ADDRESS, unit_addr, + sizeof (unit_addr)) == PICL_SUCCESS) { unit_addr[sizeof (unit_addr) - 1] = '\0'; if (strcmp(unit_addr, unit) == 0) return; /* unit address exists already */ @@ -1474,13 +1535,13 @@ * OK - so this is an EC_DR event - let's handle it. */ if (rmc_flag && (sys_platform != PLAT_CHALUPA) && - (sys_platform != PLAT_CHALUPA19)) + (sys_platform != PLAT_CHALUPA19)) sprintf_buf2(path, SYS_BOARD_PATH, ap_id); else { if ((sys_platform == PLAT_CHALUPA19) && - (strncmp(ap_id, PS_NAME, PS_NAME_LEN) == 0)) { + (strncmp(ap_id, PS_NAME, PS_NAME_LEN) == 0)) { sprintf_buf2(path, CHASSIS_LOC_PATH, - ps_apid_to_nodename(ap_id)); + ps_apid_to_nodename(ap_id)); } else if (strncmp(ap_id, DISK_NAME, DISK_NAME_LEN) == 0) { switch (sys_platform) { case PLAT_SEATTLE1U: @@ -1543,14 +1604,23 @@ } /* - * create requested fru node + * On Netra-440, the fan-tray location nodes are + * not deleted when fan-trays are physically + * removed, so we do not need to create another + * fru node. */ - err = ptree_create_and_add_node(locnodeh, fru_name, - PICL_CLASS_FRU, &childh); - if (err != PICL_SUCCESS) { - syslog(LOG_ERR, ADD_NODE_FAIL, ap_id, err); - nvlist_free(nvlp); - return; + if ((sys_platform != PLAT_CHALUPA19) || + (strncmp(fru_name, FT_FRU_NAME, FT_FRU_NAME_LEN) != 0)) { + /* + * create requested fru node + */ + err = ptree_create_and_add_node(locnodeh, fru_name, + PICL_CLASS_FRU, &childh); + if (err != PICL_SUCCESS) { + syslog(LOG_ERR, ADD_NODE_FAIL, ap_id, err); + nvlist_free(nvlp); + return; + } } /* @@ -1560,7 +1630,7 @@ */ if (strncmp(ap_id, PS_NAME, PS_NAME_LEN) == 0) { index = find_vol_prop_by_name( - ps_apid_to_nodename(ap_id)); + ps_apid_to_nodename(ap_id)); if (index >= 0) add_op_status_to_node(childh, &idprop->idp[index].volprop); @@ -2349,7 +2419,7 @@ case RAID_DISKSTATUS_FAILED: if (disk_ready[d] != B_FALSE) { if (set_led(disk_name[d], REMOK_LED, - PICL_PROPVAL_ON) == PICL_SUCCESS) { + PICL_PROPVAL_ON) == PICL_SUCCESS) { disk_ready[d] = B_FALSE; } } @@ -2382,9 +2452,9 @@ break; case PLAT_BOSTON: if (boston_1068e_flag) { - fd = open(BOSTON_DISK_DEVCTL_1068E, O_RDONLY); + fd = open(BOSTON_DISK_DEVCTL_1068E, O_RDONLY); } else { - fd = open(BOSTON_DISK_DEVCTL_1068X, O_RDONLY); + fd = open(BOSTON_DISK_DEVCTL_1068X, O_RDONLY); } break; default: @@ -2429,8 +2499,8 @@ devctl_hdl_t dhdl; int n_disks = 0, - do_raid = 0, - err = 0; + do_raid = 0, + err = 0; uint_t statep = 0; static char *mpxu_devs[] = { @@ -2518,7 +2588,7 @@ do_raid = 1; disk_dev = seattle_devs; n_disks = (sys_platform == PLAT_SEATTLE1U) ? - N_SEATTLE1U_DISKS : N_SEATTLE2U_DISKS; + N_SEATTLE1U_DISKS : N_SEATTLE2U_DISKS; break; case PLAT_BOSTON: @@ -2547,7 +2617,7 @@ default: /* PLAT_ENXS/PLAT_EN19 */ disk_dev = mpxu_devs; n_disks = (sys_platform == PLAT_EN19) ? - N_EN19_DISKS : N_MPXU_DISKS; + N_EN19_DISKS : N_MPXU_DISKS; } /* @@ -2633,7 +2703,7 @@ { int ps_addr = 0; if ((strcmp(name, PS0_NAME) == 0) || - (strcmp(name, PSU0_NAME) == 0)) { + (strcmp(name, PSU0_NAME) == 0)) { switch (sys_platform) { case PLAT_SEATTLE1U: case PLAT_SEATTLE2U: @@ -2647,7 +2717,7 @@ break; } } else if ((strcmp(name, PS1_NAME) == 0) || - (strcmp(name, PSU1_NAME) == 0)) { + (strcmp(name, PSU1_NAME) == 0)) { switch (sys_platform) { case PLAT_SEATTLE1U: case PLAT_SEATTLE2U: @@ -2661,7 +2731,7 @@ break; } } else if ((strcmp(name, PS2_NAME) == 0) || - (strcmp(name, PSU2_NAME) == 0)) { + (strcmp(name, PSU2_NAME) == 0)) { switch (sys_platform) { case PLAT_BOSTON: ps_addr = BOSTON_PS2_ADDR; @@ -2671,7 +2741,7 @@ break; } } else if ((strcmp(name, PS3_NAME) == 0) || - (strcmp(name, PSU3_NAME) == 0)) { + (strcmp(name, PSU3_NAME) == 0)) { switch (sys_platform) { case PLAT_BOSTON: ps_addr = BOSTON_PS3_ADDR; @@ -2875,19 +2945,19 @@ rmc_flag = (strcmp(hpu->id.name, RMC_NAME) == 0); ps_flag = (strncmp(hpu->id.name, PS_NAME, - PS_NAME_LEN) == 0); + PS_NAME_LEN) == 0); disk_flag = (strncmp(hpu->id.name, DISK_NAME, - DISK_NAME_LEN) == 0); + DISK_NAME_LEN) == 0); if (rmc_flag || ps_flag) { idprop->idp[*index].envhandle = hpu->id; flag = rmc_flag && ((sys_platform != PLAT_CHALUPA) && - (sys_platform != PLAT_CHALUPA19)); + (sys_platform != PLAT_CHALUPA19)); sprintf_buf2(node_name, - flag ? SYS_BOARD_PATH : CHASSIS_LOC_PATH, ps_flag ? - ps_apid_to_nodename(hpu->id.name) : hpu->id.name); + flag ? SYS_BOARD_PATH : CHASSIS_LOC_PATH, ps_flag ? + ps_apid_to_nodename(hpu->id.name) : hpu->id.name); add_op_status_by_name(node_name, ps_flag ? PS_FRU_NAME : NULL, - &idprop->idp[(*index)++].volprop); + &idprop->idp[(*index)++].volprop); } else if (disk_flag) { idprop->idp[*index].envhandle = hpu->id; switch (sys_platform) { @@ -2897,21 +2967,21 @@ break; case PLAT_SEATTLE1U: sprintf_buf2(node_name, SEATTLE1U_HDDBP_PATH, \ - hpu->id.name); + hpu->id.name); break; case PLAT_SEATTLE2U: sprintf_buf2(node_name, SEATTLE2U_HDDBP_PATH, \ - hpu->id.name); + hpu->id.name); break; case PLAT_BOSTON: sprintf_buf2(node_name, BOSTON_HDDBP_PATH, \ - hpu->id.name); + hpu->id.name); break; default: sprintf_buf2(node_name, SYS_BOARD_PATH, hpu->id.name); break; } add_op_status_by_name(node_name, DISK_FRU_NAME, - &idprop->idp[(*index)++].volprop); + &idprop->idp[(*index)++].volprop); } }
--- a/usr/src/pkg/manifests/service-picl.mf Thu Jun 10 11:29:20 2010 -0700 +++ b/usr/src/pkg/manifests/service-picl.mf Thu Jun 10 13:05:14 2010 -0700 @@ -20,8 +20,7 @@ # # -# Copyright 2010 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. # set name=pkg.fmri value=pkg:/service/picl@$(PKGVERS) @@ -497,6 +496,18 @@ path=usr/platform/SUNW,Sun-Fire-V440/lib/picl/plugins/fru_PSU3.conf \ group=sys $(sparc_ONLY)file \ + path=usr/platform/SUNW,Sun-Fire-V440/lib/picl/plugins/fru_FT0.conf \ + group=sys +$(sparc_ONLY)file \ + path=usr/platform/SUNW,Sun-Fire-V440/lib/picl/plugins/fru_FT1.conf \ + group=sys +$(sparc_ONLY)file \ + path=usr/platform/SUNW,Sun-Fire-V440/lib/picl/plugins/fru_FT2.conf \ + group=sys +$(sparc_ONLY)file \ + path=usr/platform/SUNW,Sun-Fire-V440/lib/picl/plugins/fru_FT3.conf \ + group=sys +$(sparc_ONLY)file \ path=usr/platform/SUNW,Sun-Fire-V440/lib/picl/plugins/fru_SC.conf group=sys $(sparc_ONLY)file \ path=usr/platform/SUNW,Sun-Fire-V440/lib/picl/plugins/picldevtree.conf \