summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi/ipmirp.H
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/usr/ipmi/ipmirp.H
parent17aadfc41822980c53ca70340dabcf84ac611601 (diff)
downloadtalos-hostboot-e92561c3352a4af3b1b8506fae61652cde4ee3d5.tar.gz
talos-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/usr/ipmi/ipmirp.H')
-rw-r--r--src/usr/ipmi/ipmirp.H69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/usr/ipmi/ipmirp.H b/src/usr/ipmi/ipmirp.H
index 7e535fe67..2edf24e9a 100644
--- a/src/usr/ipmi/ipmirp.H
+++ b/src/usr/ipmi/ipmirp.H
@@ -66,6 +66,19 @@ class IpmiRP
static void* start(void* unused);
/**
+ * Thread start routine for the timeout thread
+ * @param[in] void*, unused
+ */
+ static void* timeout_thread(void* unused);
+
+ /**
+ * Thread start routine for a little task which
+ * waits for the BMC to give us the interface capabilties
+ * @param[in] void*, unused
+ */
+ static void* get_capabilities(void* unused);
+
+ /**
* Default constructor
*/
IpmiRP(void);
@@ -93,6 +106,12 @@ class IpmiRP
msg_q_t msgQueue(void)
{ return iv_msgQ; }
+ /**
+ * @brief Queue a message on to the response queue
+ * @param[in] i_msg, the message to queue
+ */
+ void queueForResponse(IPMI::Message& i_msg);
+
private:
/**
@@ -101,6 +120,11 @@ class IpmiRP
void execute(void);
/**
+ * Entry point for the timeout thread
+ */
+ void timeoutThread(void);
+
+ /**
* @brief Transmit a message over the IPMI interface
* @param[in] i_msg, ptr to the message_q message
* @note i_msg is not const because it contains a return code
@@ -140,16 +164,61 @@ class IpmiRP
void response(void);
/**
+ * @brief Respond to an existing message.
+ * @note This is used as the "base" response handler
+ * @param[in] i_msg, the message to respond to
+ */
+ void response(IPMI::Message* i_msg);
+
+ /**
+ * @brief Respond to a message we're changing
+ * @note This is used when we have a timeout and need to
+ * respond to the caller.
+ * @param[in] i_msg, the message to respond to
+ * @param[in] i_cc, the complettion code
+ */
+ void response(IPMI::Message* i_msg, IPMI::completion_code i_cc);
+
+ /**
* @brief Handle an indication from the interface indicating the
* BMC interface has an event/sms message ready to read
* @param[in] void
*/
void event(void);
+ /**
+ * @brief Query the BMC for interface capabilities
+ * @param[in] void
+ * @note this fills in iv_bmc_timeout, etc.
+ */
+ void getInterfaceCapabilities(void);
+
msg_q_t iv_msgQ; //!< ipmi mesage queue
IPMI::send_q_t iv_sendq; //!< msg to send queue
+ IPMI::timeout_q_t iv_timeoutq; //!< msgs waiting for a timeout
IPMI::respond_q_t iv_respondq; //!< msg respond pending list
+ // Protect the queues from the message loop and the timeout thread
+ mutex_t iv_mutex;
+ sync_cond_t iv_cv;
+
+ // The time, in seconds, the BMC told us is the max request/response
+ // time interval.
+ uint8_t iv_bmc_timeout;
+
+ // How many outstanding requests the BMC can handle
+ uint8_t iv_outstanding_req;
+
+ // Size of the xmit buffer (max we can send)
+ uint8_t iv_xmit_buffer_size;
+
+ // Size of the recv buffer (max BMC will send)
+ uint8_t iv_recv_buffer_size;
+
+ // Recomended number of retries
+ uint8_t iv_retries;
+
+
// Disallow copying this class.
IpmiRP& operator=(const IpmiRP&);
IpmiRP(const IpmiRP&);
OpenPOWER on IntegriCloud