| #pragma once |
| #include <cstdint> |
| #include <nlohmann/json.hpp> |
| |
| namespace pcie_device |
| { |
| // clang-format off |
| |
| enum class PCIeTypes : std::uint8_t{ |
| Invalid, |
| Gen1, |
| Gen2, |
| Gen3, |
| Gen4, |
| Gen5, |
| }; |
| |
| enum class DeviceType : std::uint8_t{ |
| Invalid, |
| SingleFunction, |
| MultiFunction, |
| Simulated, |
| Retimer, |
| }; |
| |
| enum class SlotType : std::uint8_t{ |
| Invalid, |
| FullLength, |
| HalfLength, |
| LowProfile, |
| Mini, |
| M2, |
| OEM, |
| OCP3Small, |
| OCP3Large, |
| U2, |
| }; |
| |
| enum class LaneSplittingType : std::uint8_t{ |
| Invalid, |
| None, |
| Bridged, |
| Bifurcated, |
| }; |
| |
| enum class CXLDeviceType : std::uint8_t{ |
| Invalid, |
| Type1, |
| Type2, |
| Type3, |
| }; |
| |
| NLOHMANN_JSON_SERIALIZE_ENUM(PCIeTypes, { |
| {PCIeTypes::Invalid, "Invalid"}, |
| {PCIeTypes::Gen1, "Gen1"}, |
| {PCIeTypes::Gen2, "Gen2"}, |
| {PCIeTypes::Gen3, "Gen3"}, |
| {PCIeTypes::Gen4, "Gen4"}, |
| {PCIeTypes::Gen5, "Gen5"}, |
| }); |
| |
| NLOHMANN_JSON_SERIALIZE_ENUM(DeviceType, { |
| {DeviceType::Invalid, "Invalid"}, |
| {DeviceType::SingleFunction, "SingleFunction"}, |
| {DeviceType::MultiFunction, "MultiFunction"}, |
| {DeviceType::Simulated, "Simulated"}, |
| {DeviceType::Retimer, "Retimer"}, |
| }); |
| |
| NLOHMANN_JSON_SERIALIZE_ENUM(SlotType, { |
| {SlotType::Invalid, "Invalid"}, |
| {SlotType::FullLength, "FullLength"}, |
| {SlotType::HalfLength, "HalfLength"}, |
| {SlotType::LowProfile, "LowProfile"}, |
| {SlotType::Mini, "Mini"}, |
| {SlotType::M2, "M2"}, |
| {SlotType::OEM, "OEM"}, |
| {SlotType::OCP3Small, "OCP3Small"}, |
| {SlotType::OCP3Large, "OCP3Large"}, |
| {SlotType::U2, "U2"}, |
| }); |
| |
| NLOHMANN_JSON_SERIALIZE_ENUM(LaneSplittingType, { |
| {LaneSplittingType::Invalid, "Invalid"}, |
| {LaneSplittingType::None, "None"}, |
| {LaneSplittingType::Bridged, "Bridged"}, |
| {LaneSplittingType::Bifurcated, "Bifurcated"}, |
| }); |
| |
| NLOHMANN_JSON_SERIALIZE_ENUM(CXLDeviceType, { |
| {CXLDeviceType::Invalid, "Invalid"}, |
| {CXLDeviceType::Type1, "Type1"}, |
| {CXLDeviceType::Type2, "Type2"}, |
| {CXLDeviceType::Type3, "Type3"}, |
| }); |
| |
| } // namespace pcie_device |
| // clang-format on |