From 3342a8e0876909b34c076172727b8cac861f5277 Mon Sep 17 00:00:00 2001 From: "Jia, Chunhui" Date: Sat, 29 Dec 2018 13:32:26 +0800 Subject: Platform event command This command is used for logging SEL. Tested: 1. test with netipmid and ipmid. 2. test pass with good parameter ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x80 0xc0 0x10 0xFF ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x00 0x30 0x10 0xab 3. test pass with bad parameter (expect invalid data length error) ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x00 0x30 ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x00 0x30 0x11 ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x00 0xc0 ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x00 Change-Id: I7d51aac8fee2edb1faeb91f4c96a033736068779 Signed-off-by: Jia, Chunhui --- sensorhandler.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'sensorhandler.hpp') diff --git a/sensorhandler.hpp b/sensorhandler.hpp index 1d455f3..0338597 100644 --- a/sensorhandler.hpp +++ b/sensorhandler.hpp @@ -8,6 +8,7 @@ // IPMI commands for net functions. enum ipmi_netfn_sen_cmds { + IPMI_CMD_PLATFORM_EVENT = 0x2, IPMI_CMD_GET_DEVICE_SDR_INFO = 0x20, IPMI_CMD_GET_DEVICE_SDR = 0x21, IPMI_CMD_RESERVE_DEVICE_SDR_REPO = 0x22, @@ -48,6 +49,28 @@ struct dbus_interface_t char interface[MAX_DBUS_PATH]; }; +struct PlatformEventRequest +{ + uint8_t eventMessageRevision; + uint8_t sensorType; + uint8_t sensorNumber; + uint8_t eventDirectionType; + uint8_t data[3]; +}; + +static constexpr char const* ipmiSELPath = "/xyz/openbmc_project/Logging/IPMI"; +static constexpr char const* ipmiSELAddInterface = + "xyz.openbmc_project.Logging.IPMI"; +static const std::string ipmiSELAddMessage = "SEL Entry"; + +static constexpr int selSystemEventSizeWith3Bytes = 8; +static constexpr int selSystemEventSizeWith2Bytes = 7; +static constexpr int selSystemEventSizeWith1Bytes = 6; +static constexpr int selIPMBEventSize = 7; +static constexpr uint8_t directionMask = 0x80; +static constexpr uint8_t byte3EnableMask = 0x30; +static constexpr uint8_t byte2EnableMask = 0xC0; + int set_sensor_dbus_state_s(uint8_t, const char*, const char*); int set_sensor_dbus_state_y(uint8_t, const char*, const uint8_t); int find_openbmc_path(uint8_t, dbus_interface_t*); -- cgit v1.2.1