1 // SPDX-License-Identifier: Apache-2.0 2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors 3 #pragma once 4 #include <nlohmann/json.hpp> 5 6 namespace drive 7 { 8 // clang-format off 9 10 enum class MediaType{ 11 Invalid, 12 HDD, 13 SSD, 14 SMR, 15 }; 16 17 enum class HotspareType{ 18 Invalid, 19 None, 20 Global, 21 Chassis, 22 Dedicated, 23 }; 24 25 enum class EncryptionAbility{ 26 Invalid, 27 None, 28 SelfEncryptingDrive, 29 Other, 30 }; 31 32 enum class EncryptionStatus{ 33 Invalid, 34 Unecrypted, 35 Unlocked, 36 Locked, 37 Foreign, 38 Unencrypted, 39 }; 40 41 enum class StatusIndicator{ 42 Invalid, 43 OK, 44 Fail, 45 Rebuild, 46 PredictiveFailureAnalysis, 47 Hotspare, 48 InACriticalArray, 49 InAFailedArray, 50 }; 51 52 enum class HotspareReplacementModeType{ 53 Invalid, 54 Revertible, 55 NonRevertible, 56 }; 57 58 enum class DataSanitizationType{ 59 Invalid, 60 BlockErase, 61 CryptographicErase, 62 Overwrite, 63 }; 64 65 enum class FormFactor{ 66 Invalid, 67 Drive3_5, 68 Drive2_5, 69 EDSFF, 70 EDSFF_1U_Long, 71 EDSFF_1U_Short, 72 EDSFF_E3_Short, 73 EDSFF_E3_Long, 74 M2, 75 M2_2230, 76 M2_2242, 77 M2_2260, 78 M2_2280, 79 M2_22110, 80 U2, 81 PCIeSlotFullLength, 82 PCIeSlotLowProfile, 83 PCIeHalfLength, 84 OEM, 85 }; 86 87 enum class ConfigurationLock{ 88 Invalid, 89 Enabled, 90 Disabled, 91 Partial, 92 }; 93 94 enum class TargetConfigurationLockLevel{ 95 Invalid, 96 Baseline, 97 }; 98 99 enum class ConfigLockOptions{ 100 Invalid, 101 Unlocked, 102 Locked, 103 LockdownUnsupported, 104 CommandUnsupported, 105 }; 106 107 NLOHMANN_JSON_SERIALIZE_ENUM(MediaType, { 108 {MediaType::Invalid, "Invalid"}, 109 {MediaType::HDD, "HDD"}, 110 {MediaType::SSD, "SSD"}, 111 {MediaType::SMR, "SMR"}, 112 }); 113 114 NLOHMANN_JSON_SERIALIZE_ENUM(HotspareType, { 115 {HotspareType::Invalid, "Invalid"}, 116 {HotspareType::None, "None"}, 117 {HotspareType::Global, "Global"}, 118 {HotspareType::Chassis, "Chassis"}, 119 {HotspareType::Dedicated, "Dedicated"}, 120 }); 121 122 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionAbility, { 123 {EncryptionAbility::Invalid, "Invalid"}, 124 {EncryptionAbility::None, "None"}, 125 {EncryptionAbility::SelfEncryptingDrive, "SelfEncryptingDrive"}, 126 {EncryptionAbility::Other, "Other"}, 127 }); 128 129 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionStatus, { 130 {EncryptionStatus::Invalid, "Invalid"}, 131 {EncryptionStatus::Unecrypted, "Unecrypted"}, 132 {EncryptionStatus::Unlocked, "Unlocked"}, 133 {EncryptionStatus::Locked, "Locked"}, 134 {EncryptionStatus::Foreign, "Foreign"}, 135 {EncryptionStatus::Unencrypted, "Unencrypted"}, 136 }); 137 138 NLOHMANN_JSON_SERIALIZE_ENUM(StatusIndicator, { 139 {StatusIndicator::Invalid, "Invalid"}, 140 {StatusIndicator::OK, "OK"}, 141 {StatusIndicator::Fail, "Fail"}, 142 {StatusIndicator::Rebuild, "Rebuild"}, 143 {StatusIndicator::PredictiveFailureAnalysis, "PredictiveFailureAnalysis"}, 144 {StatusIndicator::Hotspare, "Hotspare"}, 145 {StatusIndicator::InACriticalArray, "InACriticalArray"}, 146 {StatusIndicator::InAFailedArray, "InAFailedArray"}, 147 }); 148 149 NLOHMANN_JSON_SERIALIZE_ENUM(HotspareReplacementModeType, { 150 {HotspareReplacementModeType::Invalid, "Invalid"}, 151 {HotspareReplacementModeType::Revertible, "Revertible"}, 152 {HotspareReplacementModeType::NonRevertible, "NonRevertible"}, 153 }); 154 155 NLOHMANN_JSON_SERIALIZE_ENUM(DataSanitizationType, { 156 {DataSanitizationType::Invalid, "Invalid"}, 157 {DataSanitizationType::BlockErase, "BlockErase"}, 158 {DataSanitizationType::CryptographicErase, "CryptographicErase"}, 159 {DataSanitizationType::Overwrite, "Overwrite"}, 160 }); 161 162 NLOHMANN_JSON_SERIALIZE_ENUM(FormFactor, { 163 {FormFactor::Invalid, "Invalid"}, 164 {FormFactor::Drive3_5, "Drive3_5"}, 165 {FormFactor::Drive2_5, "Drive2_5"}, 166 {FormFactor::EDSFF, "EDSFF"}, 167 {FormFactor::EDSFF_1U_Long, "EDSFF_1U_Long"}, 168 {FormFactor::EDSFF_1U_Short, "EDSFF_1U_Short"}, 169 {FormFactor::EDSFF_E3_Short, "EDSFF_E3_Short"}, 170 {FormFactor::EDSFF_E3_Long, "EDSFF_E3_Long"}, 171 {FormFactor::M2, "M2"}, 172 {FormFactor::M2_2230, "M2_2230"}, 173 {FormFactor::M2_2242, "M2_2242"}, 174 {FormFactor::M2_2260, "M2_2260"}, 175 {FormFactor::M2_2280, "M2_2280"}, 176 {FormFactor::M2_22110, "M2_22110"}, 177 {FormFactor::U2, "U2"}, 178 {FormFactor::PCIeSlotFullLength, "PCIeSlotFullLength"}, 179 {FormFactor::PCIeSlotLowProfile, "PCIeSlotLowProfile"}, 180 {FormFactor::PCIeHalfLength, "PCIeHalfLength"}, 181 {FormFactor::OEM, "OEM"}, 182 }); 183 184 NLOHMANN_JSON_SERIALIZE_ENUM(ConfigurationLock, { 185 {ConfigurationLock::Invalid, "Invalid"}, 186 {ConfigurationLock::Enabled, "Enabled"}, 187 {ConfigurationLock::Disabled, "Disabled"}, 188 {ConfigurationLock::Partial, "Partial"}, 189 }); 190 191 NLOHMANN_JSON_SERIALIZE_ENUM(TargetConfigurationLockLevel, { 192 {TargetConfigurationLockLevel::Invalid, "Invalid"}, 193 {TargetConfigurationLockLevel::Baseline, "Baseline"}, 194 }); 195 196 NLOHMANN_JSON_SERIALIZE_ENUM(ConfigLockOptions, { 197 {ConfigLockOptions::Invalid, "Invalid"}, 198 {ConfigLockOptions::Unlocked, "Unlocked"}, 199 {ConfigLockOptions::Locked, "Locked"}, 200 {ConfigLockOptions::LockdownUnsupported, "LockdownUnsupported"}, 201 {ConfigLockOptions::CommandUnsupported, "CommandUnsupported"}, 202 }); 203 204 } 205 // clang-format on 206