diff options
| author | Brian Silver <bsilver@us.ibm.com> | 2014-12-22 10:41:03 -0600 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-01-16 14:53:56 -0600 |
| commit | 740885df9ac6bcb67792912086ed853751b43a9b (patch) | |
| tree | 49cfe443729e5b082e215c0c86cbccfd9aa8616a /src/usr/ipmi/ipmibt.C | |
| parent | dde72377760a5b03d1c143f42dcf2635cca46b91 (diff) | |
| download | talos-hostboot-740885df9ac6bcb67792912086ed853751b43a9b.tar.gz talos-hostboot-740885df9ac6bcb67792912086ed853751b43a9b.zip | |
IPMI SMS support and initial event handlers
Change-Id: Idf8f4f251b76be9bc253691098bd3bd376b64ca6
RTC: 116600
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14994
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi/ipmibt.C')
| -rw-r--r-- | src/usr/ipmi/ipmibt.C | 69 |
1 files changed, 64 insertions, 5 deletions
diff --git a/src/usr/ipmi/ipmibt.C b/src/usr/ipmi/ipmibt.C index 57de5d8cc..f5cba4d1c 100644 --- a/src/usr/ipmi/ipmibt.C +++ b/src/usr/ipmi/ipmibt.C @@ -36,6 +36,7 @@ #include "ipmibt.H" #include "ipmirp.H" +#include <ipmi/ipmiif.H> #include <errno.h> #include <config.h> @@ -167,7 +168,7 @@ namespace IPMI } /// - /// @brief BTSyncMessage ctor + /// @brief BTAsyncMessage ctor /// @param[in] i_cmd, the network function & command /// @param[in] i_len, the length of the data /// @param[in] i_data, the data (new'd space) @@ -180,6 +181,19 @@ namespace IPMI } /// + /// @brief BTAsyncReadEventMessage ctor + /// @param[in] i_cmd, the network function & command + /// @param[in] i_len, the length of the data + /// @param[in] i_data, the data (new'd space) + /// + BTAsyncReadEventMessage::BTAsyncReadEventMessage(const command_t& i_cmd, + const uint8_t i_len, + uint8_t* i_data): + BTAsyncMessage(i_cmd, i_len, i_data) + { + } + + /// /// @brief sync msg transmit /// bool BTSyncMessage::xmit(void) @@ -227,9 +241,7 @@ namespace IPMI // If we had an i/o error we want the idle loop to stop. // If we got EAGAIN we want the idle loop to stop as we just - // put a message on the queue which couldn't be sent. Note - // we need to use this mechanism rather than letting the caller - // check iv_state as we may have just deleted ourselves. + // put a message on the queue which couldn't be sent. return (iv_state != 0); } @@ -272,7 +284,7 @@ namespace IPMI } /// - /// @brief async msg transmit + /// @brief async msg response /// void BTAsyncMessage::response(msg_q_t) { @@ -309,4 +321,51 @@ namespace IPMI delete this; } + /// + /// @brief handle the read of an event (OEM SEL) + /// + void BTAsyncReadEventMessage::response(msg_q_t) + { + do { + // If our completion code isn't CC_OK, lets log that fact. There's + // not much we can do, but at least this might give a hint that + // something is awry. + if (iv_cc != IPMI::CC_OK) + { + IPMI_TRAC(ERR_MRK "read event message (%x:%x seq %d) " + "completion code %x", + iv_netfun, iv_cmd, iv_seq, iv_cc); + + /* @errorlog tag + * @errortype ERRL_SEV_INFORMATIONAL + * @moduleid IPMI::MOD_IPMISRV_REPLY + * @reasoncode IPMI::RC_READ_EVENT_FAILURE + * @userdata1 command of message + * @userdata2 completion code + * @devdesc an async completion code was not CC_OK + * @custdesc Unexpected IPMI completion code from the BMC + */ + errlHndl_t err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + IPMI::MOD_IPMISRV_REPLY, + IPMI::RC_READ_EVENT_FAILURE, + iv_cmd, + iv_cc, + true); + + err->collectTrace(IPMI_COMP_NAME); + errlCommit(err, IPMI_COMP_ID); + break; + } + + // Before we self destruct, we need to turn the data collected in to + // a record we can pass to the waiting event handler. + Singleton<IpmiRP>::instance().postEvent(new IPMI::oemSEL(iv_data)); + + } while(false); + + // Yes, this is OK - there is no further reference to this object. + delete this; + } + }; |

