Eddie James | cc5c22d | 2021-11-18 11:38:05 -0600 | [diff] [blame] | 1 | #include "oem/ibm/libpldm/state_set_oem_ibm.h" |
Pavithra Barithaya | a2b964f | 2021-10-06 07:46:19 -0500 | [diff] [blame] | 2 | |
Brad Bishop | 869b776 | 2021-12-03 13:56:23 -0500 | [diff] [blame] | 3 | #include <libpldm/entity.h> |
Brad Bishop | 27403f4 | 2021-12-01 21:37:44 -0500 | [diff] [blame] | 4 | #include <libpldm/entity_oem_ibm.h> |
Brad Bishop | 869b776 | 2021-12-03 13:56:23 -0500 | [diff] [blame] | 5 | |
Sridevi Ramesh | dcdcd3b | 2021-06-15 04:06:49 -0500 | [diff] [blame] | 6 | /** @brief PLDM OEM IBM Code Update possible state set values |
| 7 | */ |
| 8 | enum pldm_oem_ibm_cu_state_set_values |
| 9 | { |
| 10 | OEM_IBM_STATE_SET_CU_START = 1, |
| 11 | OEM_IBM_STATE_SET_CU_END = 2, |
| 12 | OEM_IBM_STATE_SET_CU_FAIL = 3, |
| 13 | OEM_IBM_STATE_SET_CU_ABORT = 4, |
| 14 | OEM_IBM_STATE_SET_CU_ACCEPT = 5, |
| 15 | OEM_IBM_STATE_SET_CU_REJECT = 6, |
| 16 | }; |
| 17 | |
| 18 | /** @brief PLDM OEM IBM Verification possible state set values |
| 19 | */ |
| 20 | enum pldm_oem_ibm_verification_state_set_values |
| 21 | { |
| 22 | OEM_IBM_STATE_SET_VERFICATION_VALID = 0, |
| 23 | OEM_IBM_STATE_SET_VERFICATION_ENTITLEMENT_FAIL = 1, |
| 24 | OEM_IBM_STATE_SET_VERFICATION_BANNED_PLATFORM_FAIL = 2, |
| 25 | OEM_IBM_STATE_SET_VERFICATION_MIN_MIF_FAIL = 4, |
| 26 | }; |
| 27 | |
| 28 | /** @brief PLDM OEM IBM system power state possible state set values |
| 29 | */ |
| 30 | enum pldm_oem_ibm_sys_power_state_set_values |
| 31 | { |
| 32 | OEM_IBM_STATE_SET_SYS_PWR_STATE_RECYCLE_HARD = 1, |
| 33 | }; |
| 34 | |
| 35 | /** @brief PLDM OEM IBM boot state possible state set values |
| 36 | */ |
| 37 | enum pldm_oem_ibm_boot_state_set_values |
| 38 | { |
| 39 | OEM_IBM_STATE_SET_BOOT_STATE_P_SIDE = 1, |
| 40 | OEM_IBM_STATE_SET_BOOT_STATE_T_SIDE = 2, |
| 41 | }; |
| 42 | |
| 43 | /** @brief Map for PLDM OEM IBM Entity Types |
| 44 | */ |
| 45 | extern const std::map<uint8_t, std::string> OemIBMEntityType{ |
Brad Bishop | 27403f4 | 2021-12-01 21:37:44 -0500 | [diff] [blame] | 46 | {PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE, "OEM IBM Firmware Update"}, |
Manojkiran Eda | 8fadc9e | 2022-01-03 12:42:19 +0530 | [diff] [blame] | 47 | {PLDM_OEM_IBM_ENTITY_TPM, "OEM IBM Trusted Platform Module"}}; |
Sridevi Ramesh | dcdcd3b | 2021-06-15 04:06:49 -0500 | [diff] [blame] | 48 | |
| 49 | /** @brief Map for PLDM OEM IBM State Sets |
| 50 | */ |
| 51 | extern const std::map<uint16_t, std::string> OemIBMstateSet{ |
| 52 | {PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE, "OEM IBM Firmware Update State"}, |
| 53 | {PLDM_OEM_IBM_BOOT_STATE, "OEM IBM Boot State"}, |
Pavithra Barithaya | a2b964f | 2021-10-06 07:46:19 -0500 | [diff] [blame] | 54 | {PLDM_OEM_IBM_VERIFICATION_STATE, "OEM IBM Verification State"}, |
Sridevi Ramesh | dcdcd3b | 2021-06-15 04:06:49 -0500 | [diff] [blame] | 55 | {PLDM_OEM_IBM_SYSTEM_POWER_STATE, "OEM IBM System Power State"}}; |
| 56 | |
| 57 | /** @brief Map for PLDM OEM IBM firmware update possible state values |
| 58 | */ |
| 59 | extern const std::map<uint8_t, std::string> SetOemIBMFWUpdateStateValues{ |
| 60 | {OEM_IBM_STATE_SET_CU_START, "Start"}, |
| 61 | {OEM_IBM_STATE_SET_CU_END, "End"}, |
| 62 | {OEM_IBM_STATE_SET_CU_FAIL, "Fail"}, |
| 63 | {OEM_IBM_STATE_SET_CU_ABORT, "Abort"}, |
| 64 | {OEM_IBM_STATE_SET_CU_ACCEPT, "Accept"}, |
| 65 | {OEM_IBM_STATE_SET_CU_REJECT, "Reject"}}; |
| 66 | |
| 67 | /** @brief Map for PLDM OEM IBM verification state possible state values |
| 68 | */ |
| 69 | extern const std::map<uint8_t, std::string> SetOemIBMVerStateValues{ |
| 70 | {OEM_IBM_STATE_SET_VERFICATION_VALID, "Valid"}, |
| 71 | {OEM_IBM_STATE_SET_VERFICATION_ENTITLEMENT_FAIL, "Entitlement Fail"}, |
| 72 | {OEM_IBM_STATE_SET_VERFICATION_BANNED_PLATFORM_FAIL, |
| 73 | "Banned Platform Fail"}, |
| 74 | {OEM_IBM_STATE_SET_VERFICATION_MIN_MIF_FAIL, "Minimum MIF Fail"}}; |
| 75 | |
| 76 | /** @brief Map for PLDM OEM IBM systerm power state possible state values |
| 77 | */ |
| 78 | extern const std::map<uint8_t, std::string> SetOemIBMSysPowerStatesValues{ |
| 79 | {OEM_IBM_STATE_SET_SYS_PWR_STATE_RECYCLE_HARD, "Power Cycle Hard"}}; |
| 80 | |
| 81 | /** @brief Map for PLDM OEM IBM boot state possible state values |
| 82 | */ |
| 83 | extern const std::map<uint8_t, std::string> SetOemIBMBootStateValues{ |
| 84 | {OEM_IBM_STATE_SET_BOOT_STATE_P_SIDE, "P Side"}, |
| 85 | {OEM_IBM_STATE_SET_BOOT_STATE_T_SIDE, "T side"}}; |
| 86 | |
| 87 | /** @brief Map for populating PLDM OEM IBM state sets with possible state values |
| 88 | */ |
| 89 | extern const std::map<uint16_t, const std::map<uint8_t, std::string>> |
| 90 | populateOemIBMStateMaps{ |
Pavithra Barithaya | a2b964f | 2021-10-06 07:46:19 -0500 | [diff] [blame] | 91 | {PLDM_OEM_IBM_VERIFICATION_STATE, SetOemIBMVerStateValues}, |
Sridevi Ramesh | dcdcd3b | 2021-06-15 04:06:49 -0500 | [diff] [blame] | 92 | {PLDM_OEM_IBM_SYSTEM_POWER_STATE, SetOemIBMSysPowerStatesValues}, |
| 93 | {PLDM_OEM_IBM_BOOT_STATE, SetOemIBMBootStateValues}, |
| 94 | {PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE, SetOemIBMFWUpdateStateValues}, |
| 95 | }; |