summaryrefslogtreecommitdiffstats
path: root/host-ipmid/ipmid-host-cmd-utils.hpp
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-07-13 16:48:20 +0530
committerPatrick Williams <patrick@stwcx.xyz>2017-08-14 18:47:08 +0000
commit6e8979d2be1d0c874fa44eb9f501da23c984037e (patch)
tree0d271fece55fa4526579a367097b6e21775bbf0d /host-ipmid/ipmid-host-cmd-utils.hpp
parent3eb117a322aca11f049bb05beea5eb2f6385cb8e (diff)
downloadphosphor-host-ipmid-6e8979d2be1d0c874fa44eb9f501da23c984037e.tar.gz
phosphor-host-ipmid-6e8979d2be1d0c874fa44eb9f501da23c984037e.zip
Make host command manager accessible by OpenPower OEM
Since OpenPower Host IPMI OEM also needs to use the Host Command manager, need to place the files in appropriate directories and make needed changes. Change-Id: I7536a0ff1e53a844ec05f73c4e0605cbf4341465 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'host-ipmid/ipmid-host-cmd-utils.hpp')
-rw-r--r--host-ipmid/ipmid-host-cmd-utils.hpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/host-ipmid/ipmid-host-cmd-utils.hpp b/host-ipmid/ipmid-host-cmd-utils.hpp
new file mode 100644
index 0000000..f564e2a
--- /dev/null
+++ b/host-ipmid/ipmid-host-cmd-utils.hpp
@@ -0,0 +1,49 @@
+#pragma once
+
+#include <unistd.h>
+#include <tuple>
+
+namespace phosphor
+{
+namespace host
+{
+namespace command
+{
+ /** @detail After sending SMS_ATN to the Host, Host comes down and
+ * asks why an 'SMS_ATN` was sent.
+ * BMC then sends 'There is a Message to be Read` as reponse.
+ * Host then comes down asks for Message and the specified
+ * commands and data would go as data conforming to IPMI spec.
+ *
+ * Refer: 6.13.2 Send Message Command From System Interface
+ * in IPMI V2.0 spec.
+ */
+
+ /** @brief IPMI command */
+ using IPMIcmd = uint8_t;
+
+ /** @brief Data associated with command */
+ using Data = uint8_t;
+
+ /** @brief <IPMI command, Data> to be sent as payload when Host asks for
+ * the message that can be associated with the previous SMS_ATN
+ */
+ using IpmiCmdData = std::pair<IPMIcmd, Data>;
+
+ /** @detail Implementation specific callback function to be invoked
+ * conveying the status of the executed command. Specific
+ * implementations may then broadcast an agreed signal
+ */
+ using CallBack = std::function<void(IpmiCmdData, bool)>;
+
+ /** @detail Tuple encapsulating above 2 to enable using Manager by
+ * different implementations. Users of Manager will supply
+ * <Ipmi command, Data> along with the callback handler.
+ * Manager will invoke the handler onveying the status of
+ * the command.
+ */
+ using CommandHandler = std::tuple<IpmiCmdData, CallBack>;
+
+} // namespace command
+} // namespace host
+} // namespace phosphor
OpenPOWER on IntegriCloud