summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2015-01-13 09:59:14 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-02-16 14:56:50 -0600
commit83420f9f902fe439747dd291034ad0df26187e99 (patch)
tree531971b2a8a1dd071c7bd3adc2050a9135506241 /src/include/usr
parent7ff96947e3424a8d8909f7de37c1442b6e8d7a18 (diff)
downloadtalos-hostboot-83420f9f902fe439747dd291034ad0df26187e99.tar.gz
talos-hostboot-83420f9f902fe439747dd291034ad0df26187e99.zip
Make OCC_Active sensor readable
- add support to base sensor object to read sensors - add is_active method to OCC_Active sensor - add static method to get sensor number from base object - add write support to Boot_count sensor Change-Id: I82685207e374766f56a4788607c71a93be5d976e RTC:120588 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15149 Tested-by: Jenkins Server Reviewed-by: Brian Silver <bsilver@us.ibm.com> Reviewed-by: WILLIAM G. HOFFA <wghoffa@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/ipmi/ipmi_reasoncodes.H1
-rw-r--r--src/include/usr/ipmi/ipmisensor.H98
2 files changed, 85 insertions, 14 deletions
diff --git a/src/include/usr/ipmi/ipmi_reasoncodes.H b/src/include/usr/ipmi/ipmi_reasoncodes.H
index 2df631f42..6244b2d00 100644
--- a/src/include/usr/ipmi/ipmi_reasoncodes.H
+++ b/src/include/usr/ipmi/ipmi_reasoncodes.H
@@ -51,6 +51,7 @@ namespace IPMI
RC_SET_SENSOR_FAILURE = IPMI_COMP_ID | 0x0a,
RC_READ_EVENT_FAILURE = IPMI_COMP_ID | 0x0b,
RC_DCMI_CMD_FAILED = IPMI_COMP_ID | 0x0c,
+ RC_SENSOR_READING_NOT_AVAIL = IPMI_COMP_ID | 0x0d,
};
};
diff --git a/src/include/usr/ipmi/ipmisensor.H b/src/include/usr/ipmi/ipmisensor.H
index dfbfcb8ee..13a2532ea 100644
--- a/src/include/usr/ipmi/ipmisensor.H
+++ b/src/include/usr/ipmi/ipmisensor.H
@@ -137,6 +137,28 @@ namespace SENSOR
}PACKED;
/**
+ * @struct getSensorReadingData
+ * structure holding the data returned by the get sensor reading
+ * command.
+ *
+ */
+ struct getSensorReadingData
+ {
+ uint8_t completion_code;
+ uint8_t sensor_status;
+ uint8_t sensor_reading;
+ uint16_t event_status;
+
+ // constructor for our data set
+ getSensorReadingData()
+ :completion_code(0),sensor_status(0),
+ sensor_reading(0), event_status(0)
+ {
+
+ };
+ }PACKED;
+
+ /**
* @enum completionCode
* Sensor specific completion codes, defined in IPMI Spec.
*
@@ -146,6 +168,18 @@ namespace SENSOR
CC_SENSOR_READING_NOT_SETTABLE = 0x80,
CC_EVENT_DATA_BYTES_NOT_SETTABLE = 0x81
};
+ /**
+ * @enum SensorReadingValidEnum
+ *
+ * enum defining masks used when reading a sensor
+ *
+ */
+ enum SensorReadingValidEnum
+ {
+ SENSOR_DISABLED = 0x80,
+ SENSOR_SCANNING_DISABLED = 0x40,
+ READING_UNAVAILABLE = 0x20,
+ };
@@ -212,7 +246,7 @@ namespace SENSOR
* @return Errorlog handle
*
*/
- virtual errlHndl_t readSensorData(uint8_t *& o_data);
+ virtual errlHndl_t readSensorData(getSensorReadingData& o_data);
/**
@@ -251,12 +285,23 @@ namespace SENSOR
IPMI::completion_code& o_completion_code );
/**
+ * @brief helper function to get the sensor nubmer
+ */
+ inline uint8_t getSensorNumber( )
+ {
+ return getSensorNumber(iv_target, iv_name );
+ };
+
+
+ /**
* @brief return the sensor number
*
* @return sensor_number - sensor number for this sensor
*
*/
- uint8_t getSensorNumber();
+ static uint8_t getSensorNumber(TARGETING::Target * i_targ,
+ TARGETING::SENSOR_NAME i_name );
+
protected:
@@ -267,12 +312,16 @@ namespace SENSOR
* as an assertion or deassertion mask.
*
* @param[in] = i_offset - offset for event do be signaled
+ * @param[in] = i_swap - indicates if mask should be
+ * byteswapped before returning
+ * true = byte swap mask
+ * false = do not byte swap the mask
*
* @return eventMask - event status mask with correctly set bit
* matching the offset passed in.
*
*/
- static uint16_t setMask( uint8_t i_offset );
+ static uint16_t setMask( uint8_t i_offset, bool i_swap = true );
/**
* @brief return the event offset from an assertion/deassertion mask
@@ -448,9 +497,6 @@ namespace SENSOR
class RebootCountSensor : public SensorBase
{
- //< reboot count type
- typedef uint8_t rebootCount_t;
-
public:
/**
@@ -471,14 +517,25 @@ namespace SENSOR
~RebootCountSensor();
/**
- * @brief Sent a value for the reboot count to the BMC.
+ * @brief Set the value for the reboot count to the BMC.
*
* @param[in] i_count - new reboot count value.
*
* @return Errorlog handle
*
*/
- errlHndl_t setRebootCount( rebootCount_t i_count );
+ errlHndl_t setRebootCount( uint16_t i_count );
+
+ /**
+ * @brief get the value of the reboot count from the BMC.
+ *
+ * @param[o] o_rebootCount - new reboot count value.
+ *
+ * @return Errorlog handle
+ *
+ */
+ errlHndl_t getRebootCount( uint16_t& o_rebootCount );
+
};
@@ -668,16 +725,17 @@ namespace SENSOR
public:
/**
- * @enum stateEnum
+ * @enum OccStateEnum
*
* enum defining the state of the OCC sensor
*/
enum OccStateEnum
{
- OCC_ACTIVE = 0x0001,
- OCC_NOT_ACTIVE = 0x0002
+ OCC_NOT_ACTIVE = 0x00,
+ OCC_ACTIVE = 0x01
};
+
/**
* @brief Constructor for an OccActive sensor
*
@@ -695,14 +753,24 @@ namespace SENSOR
*/
~OCCActiveSensor();
+ /**
+ * @brief Interface to set the state of the OCC
+ * active sensor.
+ *
+ */
errlHndl_t setState( OccStateEnum i_state );
+ /**
+ * @brief Interface to determine if the OCC associated
+ * with the passed in target is active.
+ *
+ */
+ bool isActive();
+
private:
// disable the default constructor
OCCActiveSensor();
- uint8_t iv_functionalOffset;
-
};
/*
@@ -745,6 +813,7 @@ namespace SENSOR
* using the dcmi "activate power limit"
* command.
*
+ * @return Errorlog handle
*/
errlHndl_t getUserPowerLimit( uint16_t &o_powerLimit,
bool &o_activeActive );
@@ -758,7 +827,8 @@ namespace SENSOR
* the sensor numbers for each of the 16
* apss channels
*
- * const uint16_t (*array)[16] = NULL;
+ * @return Errorlog handle
+ *
*/
errlHndl_t getAPSSChannelSensorNumbers(
const uint16_t (* &o_sensor_numbers)[16]);
OpenPOWER on IntegriCloud