diff options
author | Elizabeth Liner <eliner@us.ibm.com> | 2016-01-18 11:27:52 -0600 |
---|---|---|
committer | Stephen Cprek <smcprek@us.ibm.com> | 2016-02-19 17:06:15 -0600 |
commit | 6e1541d8bb6fbdbccf963941db9ab79bae2365e9 (patch) | |
tree | 3ca32ba7752a048e8775fe5074c4b539ac0dc71f /src/usr/ipmi/ipmisensor.C | |
parent | ecb3640364de919e9a22683338cb46b8858073ca (diff) | |
download | talos-hostboot-6e1541d8bb6fbdbccf963941db9ab79bae2365e9.tar.gz talos-hostboot-6e1541d8bb6fbdbccf963941db9ab79bae2365e9.zip |
Set watchdog and set sensors are now asynchronous sends
Backport: master-p8
Change-Id: If8741e67986c6d6df95a655fb5669df764649e82
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/18993
Tested-by: Jenkins Server
Reviewed-by: Brian Silver <bsilver@us.ibm.com>
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: WILLIAM G. HOFFA <wghoffa@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi/ipmisensor.C')
-rw-r--r-- | src/usr/ipmi/ipmisensor.C | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/src/usr/ipmi/ipmisensor.C b/src/usr/ipmi/ipmisensor.C index 621aa7cf1..69a58dd95 100644 --- a/src/usr/ipmi/ipmisensor.C +++ b/src/usr/ipmi/ipmisensor.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2015 */ +/* Contributors Listed Below - COPYRIGHT 2014,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -58,13 +58,9 @@ namespace SENSOR SensorBase::~SensorBase() { // The memory allocated for the set sensor reading command is deleted - // by the IPMI transport layer, this delete will get delete the memory - // allocated by the IPMI transport layer which contains the response - // to the set sensor reading command. - if( iv_msg ) - { - delete[] iv_msg; - } + // by the IPMI transport layer. Since we are sending messages + // asynchronously, the IPMI resource provider deletes the message + // and there is nothing to delete here. }; // @@ -208,24 +204,14 @@ namespace SENSOR if( iv_msg->iv_sensor_number != TARGETING::UTIL::INVALID_IPMI_SENSOR ) { - IPMI::completion_code l_rc = IPMI::CC_UNKBAD; - - // iv_msg is deleted by the destructor - l_err = sendSetSensorReading( iv_msg, l_rc); + // iv_msg is deleted by the IPMI resource provider. + l_err = sendSetSensorReading( iv_msg); if( l_err ) { TRACFCOMP(g_trac_ipmi,"error returned from " "sendSetSensorReading() for sensor number 0x%x", getSensorNumber()); - - // return error log to caller - } - else - { - // check the completion code to see if we need to generate a - // PEL. - l_err = processCompletionCode( l_rc ); } } else @@ -369,21 +355,17 @@ namespace SENSOR }; // - // Synchronously send a set sensor reading command to the BMC, - // the response is returned with the io_data pointer + // Asynchronously send a set sensor reading command to the BMC. // errlHndl_t SensorBase::sendSetSensorReading( - setSensorReadingRequest *& io_data, - IPMI::completion_code& o_completion_code ) + setSensorReadingRequest * i_data) { size_t l_len = sizeof( setSensorReadingRequest ); - o_completion_code = IPMI::CC_UNKBAD; - // i_data will hold the response when this returns - errlHndl_t l_err = sendrecv(IPMI::set_sensor_reading(), - o_completion_code, l_len, (uint8_t *&)io_data); + errlHndl_t l_err = send(IPMI::set_sensor_reading(), + l_len, (uint8_t *)i_data); return l_err; } |