storagehandler: move get & reserve SEL to new API
Rewrite "Get sel info & Reserve SEL" commands to use the new API.
Tested:
1. verified ipmitool sel info is same both before and
after the changes
Command: ipmitool sel info
Output:
SEL Information
Version : 1.5 (v1.5, v2 compliant)
Entries : 0
Free Space : 65535 bytes or more
Percent Used : unknown
Last Add Time : Not Available
Last Del Time : Not Available
Overflow : false
Supported Cmds : 'Delete' 'Reserve'
Command: ipmitool raw 0x0a 0x40
Output: 51 00 00 ff ff ff ff ff ff ff ff ff ff 0a
2. verfied the Reserve SEL command
ipmitool raw 0x0a 0x42
01 00
ipmitool raw 0x0a 0x42
02 00
Change-Id: I37d602293066274a3fc417ad7e59cea3c73315f7
Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
diff --git a/selutility.hpp b/selutility.hpp
index bf16a5c..49ec1b7 100644
--- a/selutility.hpp
+++ b/selutility.hpp
@@ -33,27 +33,21 @@
static constexpr auto selVersion = 0x51;
static constexpr auto invalidTimeStamp = 0xFFFFFFFF;
-static constexpr auto operationSupport = 0x0A;
-
-/** @struct GetSELInfoResponse
- *
- * IPMI payload for Get SEL Info command response.
- */
-struct GetSELInfoResponse
-{
- uint8_t selVersion; //!< SEL revision.
- uint16_t entries; //!< Number of log entries in SEL.
- uint16_t freeSpace; //!< Free Space in bytes.
- uint32_t addTimeStamp; //!< Most recent addition timestamp.
- uint32_t eraseTimeStamp; //!< Most recent erase timestamp.
- uint8_t operationSupport; //!< Operation support.
-} __attribute__((packed));
static constexpr auto firstEntry = 0x0000;
static constexpr auto lastEntry = 0xFFFF;
static constexpr auto entireRecord = 0xFF;
static constexpr auto selRecordSize = 16;
+namespace operationSupport
+{
+static constexpr bool overflow = false;
+static constexpr bool deleteSel = true;
+static constexpr bool partialAddSelEntry = false;
+static constexpr bool reserveSel = true;
+static constexpr bool getSelAllocationInfo = false;
+} // namespace operationSupport
+
/** @struct GetSELEntryRequest
*
* IPMI payload for Get SEL Entry command request.