diff options
-rw-r--r-- | src/include/usr/ipmi/ipmisensor.H | 22 | ||||
-rw-r--r-- | src/usr/ipmi/ipmisensor.C | 64 | ||||
-rwxr-xr-x | src/usr/targeting/common/genHwsvMrwXml.pl | 17 |
3 files changed, 88 insertions, 15 deletions
diff --git a/src/include/usr/ipmi/ipmisensor.H b/src/include/usr/ipmi/ipmisensor.H index e27ce84b6..4b266e1b5 100644 --- a/src/include/usr/ipmi/ipmisensor.H +++ b/src/include/usr/ipmi/ipmisensor.H @@ -249,6 +249,14 @@ namespace SENSOR setSensorReadingRequest *& io_data, IPMI::completion_code& o_completion_code ); + /** + * @brief return the sensor number + * + * @return sensor_number - sensor number for this sensor + * + */ + uint8_t getSensorNumber(); + protected: /** @@ -298,10 +306,6 @@ namespace SENSOR SensorBase(const SensorBase& thing ); - // helper function to get sensor number attribute - // of passed in target - uint16_t getSensorNumber(); - }; /** @@ -715,6 +719,16 @@ namespace SENSOR }; + /* + * @brief Return the fault sensor number for a target + * Will return either the status sensor or Fault sensor number for a + * given target. If the target passed in does not have either of those + * sensor types, the "System Error" sensor number will be returned. + * + */ + uint8_t getFaultSensorNumber(TARGETING::Target * i_pTarget ); + + /** * @brief Update DIMM/CORE/Processor status sensors on the BMC. * Update the present/functional status on the BMC for status sensors diff --git a/src/usr/ipmi/ipmisensor.C b/src/usr/ipmi/ipmisensor.C index 33105161c..d478869f3 100644 --- a/src/usr/ipmi/ipmisensor.C +++ b/src/usr/ipmi/ipmisensor.C @@ -399,10 +399,10 @@ namespace SENSOR // Helper function to search the sensor data for the correct sensor number // based on the sensor name. // - uint16_t SensorBase::getSensorNumber() + uint8_t SensorBase::getSensorNumber() { - uint16_t l_sensor_number = INVALID_SENSOR; + uint8_t l_sensor_number = INVALID_SENSOR; if( iv_target == NULL ) { @@ -930,6 +930,64 @@ namespace SENSOR updateBMCFaultSensorStatus(); }; -}; // end name space + // returns a sensor number based on input target type + uint8_t getFaultSensorNumber( TARGETING::TargetHandle_t i_pTarget ) + { + + TARGETING::TYPE l_type = i_pTarget->getAttr<TARGETING::ATTR_TYPE>(); + + uint8_t l_sensor_number = INVALID_SENSOR; + + switch( l_type ) + { + case TARGETING::TYPE_PROC: + case TARGETING::TYPE_CORE: + case TARGETING::TYPE_DIMM: + { + l_sensor_number = StatusSensor(i_pTarget).getSensorNumber(); + break; + } + + case TARGETING::TYPE_OSC: + case TARGETING::TYPE_OSCREFCLK: + case TARGETING::TYPE_OSCPCICLK: + { + TARGETING::TargetHandleList parentList; + + // The clock fault sensors are associated with the NODE target + (void)getParentAffinityTargets ( + parentList, i_pTarget, TARGETING::CLASS_ENC, + TARGETING::TYPE_NODE, false); + + assert(parentList.size() == 1 ); + + TARGETING::TargetHandle_t l_node = parentList[0]; + + l_sensor_number = + SENSOR::FaultSensor( l_node, l_type ).getSensorNumber(); + + break; + } + + default: + { + TARGETING::TargetHandle_t l_sys; + + // get the "system error sensor number" associated with the + // system target. + TARGETING::targetService().getTopLevelTarget(l_sys); + + l_sensor_number = SENSOR::FaultSensor( + l_sys, TARGETING::TYPE_NA ).getSensorNumber(); + + break; + } + + } + + return l_sensor_number; + } + +}; // end name space diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl index 54902b7bf..92a3c411d 100755 --- a/src/usr/targeting/common/genHwsvMrwXml.pl +++ b/src/usr/targeting/common/genHwsvMrwXml.pl @@ -2081,9 +2081,9 @@ sub generate_sys 0x0b00,0x09, <!-- Power_Cap --> 0x0c00,0x06, <!-- PCI --> 0x0d00,0x00, <!-- Boot_watchdog --> - 0x0e00,0xFF, <!-- Reboot_Count --> - 0x1000,0xFF, <!-- System_Event --> - 0x1010,0xFF, <!-- APSS Fault --> + 0x0e00,0x85, <!-- Reboot_Count --> + 0x1000,0x82, <!-- System_Event --> + 0x1010,0x83, <!-- APSS Fault --> 0xFFFF,0xFF, 0xFFFF,0xFF, 0xFFFF,0xFF, @@ -4012,8 +4012,8 @@ sub generate_centaur <attribute> <id>IPMI_SENSORS</id> <default> - 0x0100, 0xFF, <!-- Temperature sensor --> - 0x0500, 0xFF, <!-- State sensor --> + 0x0100, 0x12, <!-- Temperature sensor --> + 0x0500, 0x01, <!-- State sensor --> 0xFFFF, 0xFF, 0xFFFF, 0xFF, 0xFFFF, 0xFF, @@ -4289,7 +4289,7 @@ sub generate_is_dimm <attribute> <id>IPMI_SENSORS</id> <default> - 0x0100, 0xFF, <!-- Temperature sensor --> + 0x0100, 0x13, <!-- Temperature sensor --> 0x0500, 0x01, <!-- State sensor --> 0xFFFF, 0xFF, 0xFFFF, 0xFF, @@ -4459,7 +4459,7 @@ sub generate_dimm <attribute> <id>IPMI_SENSORS</id> <default> - 0x0100, 0xFF, <!-- Temperature sensor --> + 0x0100, 0x13, <!-- Temperature sensor --> 0x0500, 0x01, <!-- State sensor --> 0xFFFF, 0xFF, 0xFFFF, 0xFF, @@ -5199,9 +5199,10 @@ sub addI2cBusSpeedArray ($tmp_speed < $speed_array[$tmp_offset] ) ) { $speed_array[$tmp_offset] = $tmp_speed; + } - } + } print " <attribute>\n"; print " <id>I2C_BUS_SPEED_ARRAY</id>\n"; print " <default>\n"; |