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