summaryrefslogtreecommitdiffstats
path: root/src/include/usr/ipmi
diff options
context:
space:
mode:
authorBrian Silver <bsilver@us.ibm.com>2014-10-06 13:45:16 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-11-12 08:26:50 -0600
commite92561c3352a4af3b1b8506fae61652cde4ee3d5 (patch)
tree0c4fe19f433cb22180ea42b0e84fb584b7b85bec /src/include/usr/ipmi
parent17aadfc41822980c53ca70340dabcf84ac611601 (diff)
downloadblackbird-hostboot-e92561c3352a4af3b1b8506fae61652cde4ee3d5.tar.gz
blackbird-hostboot-e92561c3352a4af3b1b8506fae61652cde4ee3d5.zip
Add response timeouts and event requests
Change-Id: I2a763e5e3ea59e6afb7b7ab7d088fb236ee3428e Depends-On: I8f6a590b29d9171389d10abc5b6e68f91ac94d16 RTC: 116300 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13856 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/ipmi')
-rw-r--r--src/include/usr/ipmi/ipmi_reasoncodes.H2
-rw-r--r--src/include/usr/ipmi/ipmiif.H102
2 files changed, 96 insertions, 8 deletions
diff --git a/src/include/usr/ipmi/ipmi_reasoncodes.H b/src/include/usr/ipmi/ipmi_reasoncodes.H
index 12a9391bc..3e66dbcd8 100644
--- a/src/include/usr/ipmi/ipmi_reasoncodes.H
+++ b/src/include/usr/ipmi/ipmi_reasoncodes.H
@@ -40,6 +40,8 @@ namespace IPMI
RC_INVALID_QRESPONSE = IPMI_COMP_ID | 0x01,
RC_INVALID_SENDRECV = IPMI_COMP_ID | 0x02,
RC_INVALID_SEND = IPMI_COMP_ID | 0x03,
+ RC_WAITER_NOT_FOUND = IPMI_COMP_ID | 0x04,
+ RC_ASYNC_BAD_CC = IPMI_COMP_ID | 0x05,
};
};
diff --git a/src/include/usr/ipmi/ipmiif.H b/src/include/usr/ipmi/ipmiif.H
index 431b006ef..040244041 100644
--- a/src/include/usr/ipmi/ipmiif.H
+++ b/src/include/usr/ipmi/ipmiif.H
@@ -27,6 +27,7 @@
#include <sys/msg.h>
#include <errl/errlentry.H>
+#include <map>
namespace IPMI
{
@@ -74,10 +75,76 @@ namespace IPMI
NETFUN_NONE = (0x30 << 2),
};
+ // IPMI Completion Codes
+ enum completion_code
+ {
+ CC_OK = 0x00,
+ CC_BUSY = 0xc0,
+ CC_INVALID = 0xc1,
+ CC_CMDLUN = 0xc2,
+ CC_TIMEOUT = 0xc3,
+ CC_NOSPACE = 0xc4,
+ CC_BADRESV = 0xc5,
+ CC_TRUNC = 0xc6,
+ CC_BADLEN = 0xc7,
+ CC_TOOLONG = 0xc8,
+ CC_OORANGE = 0xc9,
+ CC_LONGREPLY = 0xca,
+ CC_BADSENSOR = 0xcb,
+ CC_REQINVAL = 0xcc,
+ CC_CMDSENSOR = 0xcd,
+ CC_CANTREPLY = 0xce,
+ CC_DUPREQ = 0xcf,
+ CC_SDRUPDATE = 0xd0,
+ CC_FMWUPDATE = 0xd1,
+ CC_BMCINIT = 0xd2,
+ CC_BADDEST = 0xd3,
+ CC_NOPERM = 0xd4,
+ CC_NOTSUP = 0xd5,
+ CC_ILLPARAM = 0xd6,
+ CC_UNKBAD = 0xff
+ };
+
+ //
+ // Network function, command pairs.
+ //
+ typedef std::pair<network_function, uint8_t> command_t;
+
+
+ // Application messages
+ inline const command_t get_device_id(void)
+ { return std::make_pair(NETFUN_APP, 0x01); }
+
+ inline const command_t set_watchdog(void)
+ { return std::make_pair(NETFUN_APP, 0x24); }
+
+ inline const command_t get_capabilities(void)
+ { return std::make_pair(NETFUN_APP, 0x36); }
+
+
+ // Storage messages
+ inline const command_t set_sel_time(void)
+ { return std::make_pair(NETFUN_STORAGE, 0x49); }
+
+
+ // Sensor messages
+ inline const command_t platform_event(void)
+ { return std::make_pair(NETFUN_SENSOR, 0x02); }
+
+
+ // Some helper messages
+ // Used to create an empty message for reception
+ inline const command_t no_command(void)
+ { return std::make_pair(NETFUN_NONE, 0x00); }
+
+ // This is a message used only for testing. The ipmid responder
+ // will drop this message so we can test timeouts.
+ inline const command_t test_drop(void)
+ { return std::make_pair(NETFUN_APP, 0x3e); }
+
/**
* Send message asynchronously
- * @param[in] i_netfun, the network function
- * @param[in] i_cmd, the command
+ * @param[in] i_cmd, the network function and command
* @param[in] i_len, the length of the buffer
* @param[in] i_data, the buffer - must be new'd
* @example uint8_t* data = new uint8_t[length];
@@ -85,14 +152,13 @@ namespace IPMI
*
* @return errlHndl_t, NULL on success
*/
- errlHndl_t send(const network_function i_netfun,
- const uint8_t i_cmd, const size_t i_len,
+ errlHndl_t send(const command_t& i_cmd,
+ const size_t i_len,
uint8_t* i_data);
/**
* Send message synchronously
- * @param[in] i_netfun, the network function
- * @param[in] i_cmd, the command
+ * @param[in] i_cmd, the command and network function
* @param[out] o_completion_code, the completion code
* @param[in,out] io_len, the length of the buffer
* @param[in] i_data, the buffer - must be new'd
@@ -101,11 +167,31 @@ namespace IPMI
*
* @return errlHndl_t, NULL on success
*/
- errlHndl_t sendrecv(const network_function i_netfun,
- const uint8_t i_cmd, uint8_t& o_completion_code,
+ errlHndl_t sendrecv(const command_t& i_cmd,
+ completion_code& o_completion_code,
size_t& io_len, uint8_t*& io_data);
/**
+ * Synchronously send an event
+ * @param[in] i_sensor_type, the sensor type
+ * @param[in] i_sensor_num, the sensor number
+ * @param[in] i_assertion, bool true is assert, false is deassert.
+ * @param[in] i_type, event type
+ * @param[out] o_completion_code, completion code
+ * @param[in] i_len, number of data bytes (1-3)
+ * @param[in] i_data, data bytes
+ *
+ * @return errlHndl_t, NULL on success
+ */
+ errlHndl_t send_event(const uint8_t i_sensor_type,
+ const uint8_t i_sensor_number,
+ const bool i_assertion,
+ const uint8_t i_type,
+ completion_code& o_completion_code,
+ const size_t i_len,
+ uint8_t* i_data);
+
+ /**
* Get the max buffer size
* @param void
*
OpenPOWER on IntegriCloud