1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace pcie_device 5 { 6 // clang-format off 7 8 enum class PCIeTypes{ 9 Invalid, 10 Gen1, 11 Gen2, 12 Gen3, 13 Gen4, 14 Gen5, 15 Gen6, 16 }; 17 18 enum class DeviceType{ 19 Invalid, 20 SingleFunction, 21 MultiFunction, 22 Simulated, 23 Retimer, 24 }; 25 26 enum class SlotType{ 27 Invalid, 28 FullLength, 29 HalfLength, 30 LowProfile, 31 Mini, 32 M2, 33 OEM, 34 OCP3Small, 35 OCP3Large, 36 U2, 37 }; 38 39 enum class LaneSplittingType{ 40 Invalid, 41 None, 42 Bridged, 43 Bifurcated, 44 }; 45 46 enum class CXLDeviceType{ 47 Invalid, 48 Type1, 49 Type2, 50 Type3, 51 }; 52 53 enum class CXLDynamicCapacityPolicies{ 54 Invalid, 55 Free, 56 Contiguous, 57 Prescriptive, 58 TagBased, 59 }; 60 61 NLOHMANN_JSON_SERIALIZE_ENUM(PCIeTypes, { 62 {PCIeTypes::Invalid, "Invalid"}, 63 {PCIeTypes::Gen1, "Gen1"}, 64 {PCIeTypes::Gen2, "Gen2"}, 65 {PCIeTypes::Gen3, "Gen3"}, 66 {PCIeTypes::Gen4, "Gen4"}, 67 {PCIeTypes::Gen5, "Gen5"}, 68 {PCIeTypes::Gen6, "Gen6"}, 69 }); 70 71 NLOHMANN_JSON_SERIALIZE_ENUM(DeviceType, { 72 {DeviceType::Invalid, "Invalid"}, 73 {DeviceType::SingleFunction, "SingleFunction"}, 74 {DeviceType::MultiFunction, "MultiFunction"}, 75 {DeviceType::Simulated, "Simulated"}, 76 {DeviceType::Retimer, "Retimer"}, 77 }); 78 79 NLOHMANN_JSON_SERIALIZE_ENUM(SlotType, { 80 {SlotType::Invalid, "Invalid"}, 81 {SlotType::FullLength, "FullLength"}, 82 {SlotType::HalfLength, "HalfLength"}, 83 {SlotType::LowProfile, "LowProfile"}, 84 {SlotType::Mini, "Mini"}, 85 {SlotType::M2, "M2"}, 86 {SlotType::OEM, "OEM"}, 87 {SlotType::OCP3Small, "OCP3Small"}, 88 {SlotType::OCP3Large, "OCP3Large"}, 89 {SlotType::U2, "U2"}, 90 }); 91 92 NLOHMANN_JSON_SERIALIZE_ENUM(LaneSplittingType, { 93 {LaneSplittingType::Invalid, "Invalid"}, 94 {LaneSplittingType::None, "None"}, 95 {LaneSplittingType::Bridged, "Bridged"}, 96 {LaneSplittingType::Bifurcated, "Bifurcated"}, 97 }); 98 99 NLOHMANN_JSON_SERIALIZE_ENUM(CXLDeviceType, { 100 {CXLDeviceType::Invalid, "Invalid"}, 101 {CXLDeviceType::Type1, "Type1"}, 102 {CXLDeviceType::Type2, "Type2"}, 103 {CXLDeviceType::Type3, "Type3"}, 104 }); 105 106 NLOHMANN_JSON_SERIALIZE_ENUM(CXLDynamicCapacityPolicies, { 107 {CXLDynamicCapacityPolicies::Invalid, "Invalid"}, 108 {CXLDynamicCapacityPolicies::Free, "Free"}, 109 {CXLDynamicCapacityPolicies::Contiguous, "Contiguous"}, 110 {CXLDynamicCapacityPolicies::Prescriptive, "Prescriptive"}, 111 {CXLDynamicCapacityPolicies::TagBased, "TagBased"}, 112 }); 113 114 } 115 // clang-format on 116