Move IBM's OEM state sets oem/ibm/libpldm/state_set.h
Previously the OEM state sets that IBM uses were definied in the
libpldmresponder directory, this is not ideal if the state set
id constants need to be used in a request. This commit moves these
definitions to the new file oem/ibm/libpldm/state_set.h which
is how the common state sets are defined.
Signed-off-by: Christian Geddes <crgeddes@us.ibm.com>
Change-Id: I14d94b1b003e73c733085688721081f9fee7f56d
diff --git a/oem/ibm/libpldm/state_set.h b/oem/ibm/libpldm/state_set.h
new file mode 100644
index 0000000..e0dc6fe
--- /dev/null
+++ b/oem/ibm/libpldm/state_set.h
@@ -0,0 +1,45 @@
+#ifndef OEM_IBM_STATE_SETS_H
+#define OEM_IBM_STATE_SETS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief IBM OEM State Set IDs */
+enum ibm_oem_pldm_state_set_ids {
+ PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE = 32768,
+ PLDM_OEM_IBM_BOOT_STATE = 32769,
+ PLDM_OEM_IBM_VERIFICATION_STATE = 32770,
+ PLDM_OEM_IBM_SYSTEM_POWER_STATE = 32771,
+};
+
+enum ibm_oem_pldm_state_set_firmware_update_state_values {
+ START = 0x1,
+ END = 0x2,
+ FAIL = 0x3,
+ ABORT = 0x4,
+ ACCEPT = 0x5,
+ REJECT = 0x6,
+};
+
+enum ibm_oem_pldm_state_set_boot_state_values {
+ P = 0x1,
+ T = 0x2,
+};
+
+enum ibm_oem_pldm_state_set_verification_state_values {
+ VALID = 0x0,
+ ENTITLEMENT_FAIL = 0x1,
+ BANNED_PLATFORM_FAIL = 0x2,
+ MIN_MIF_FAIL = 0x4,
+};
+
+enum ibm_oem_pldm_state_set_system_power_state_values {
+ POWER_CYCLE_HARD = 0x1,
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OEM_IBM_STATE_SETS_H */
\ No newline at end of file
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index fec9ec7..c3bff2e 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -240,7 +240,7 @@
auto state =
reinterpret_cast<state_sensor_possible_states*>(possibleStates);
if ((stateSetID == PLDM_OEM_IBM_BOOT_STATE) ||
- (stateSetID == oem_ibm_platform::PLDM_OEM_IBM_VERIFICATION_STATE))
+ (stateSetID == PLDM_OEM_IBM_VERIFICATION_STATE))
state->states[0].byte = 6;
else if (stateSetID == PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE)
state->states[0].byte = 126;
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
index 84ea2a6..8181149 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
@@ -1,6 +1,7 @@
#pragma once
#include "libpldm/entity.h"
#include "libpldm/platform.h"
+#include "oem/ibm/libpldm/state_set.h"
#include "inband_code_update.hpp"
#include "libpldmresponder/oem_handler.hpp"
@@ -8,45 +9,18 @@
#include "libpldmresponder/platform.hpp"
#include "requester/handler.hpp"
+typedef ibm_oem_pldm_state_set_firmware_update_state_values CodeUpdateState;
+
namespace pldm
{
namespace responder
{
namespace oem_ibm_platform
{
-
-#define PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE 32768
-#define PLDM_OEM_IBM_BOOT_STATE 32769
-#define PLDM_OEM_IBM_SYSTEM_POWER_STATE 32771
-
static constexpr auto PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE = 24577;
-static constexpr auto PLDM_OEM_IBM_VERIFICATION_STATE = 32770;
constexpr uint16_t ENTITY_INSTANCE_0 = 0;
constexpr uint16_t ENTITY_INSTANCE_1 = 1;
-enum class CodeUpdateState : uint8_t
-{
- START = 0x1,
- END = 0x2,
- FAIL = 0x3,
- ABORT = 0x4,
- ACCEPT = 0x5,
- REJECT = 0x6
-};
-
-enum VerificationStateValues
-{
- VALID = 0x0,
- ENTITLEMENT_FAIL = 0x1,
- BANNED_PLATFORM_FAIL = 0x2,
- MIN_MIF_FAIL = 0x4,
-};
-
-enum SystemPowerStates
-{
- POWER_CYCLE_HARD = 0x1,
-};
-
enum SetEventReceiverCount
{
SET_EVENT_RECEIVER_SENT = 0x2,