1*0ec8b83dSEd Tanous #pragma once 2*0ec8b83dSEd Tanous #include <nlohmann/json.hpp> 3*0ec8b83dSEd Tanous 4*0ec8b83dSEd Tanous namespace pcie_device 5*0ec8b83dSEd Tanous { 6*0ec8b83dSEd Tanous // clang-format off 7*0ec8b83dSEd Tanous 8*0ec8b83dSEd Tanous enum class PCIeTypes{ 9*0ec8b83dSEd Tanous Invalid, 10*0ec8b83dSEd Tanous Gen1, 11*0ec8b83dSEd Tanous Gen2, 12*0ec8b83dSEd Tanous Gen3, 13*0ec8b83dSEd Tanous Gen4, 14*0ec8b83dSEd Tanous Gen5, 15*0ec8b83dSEd Tanous }; 16*0ec8b83dSEd Tanous 17*0ec8b83dSEd Tanous enum class DeviceType{ 18*0ec8b83dSEd Tanous Invalid, 19*0ec8b83dSEd Tanous SingleFunction, 20*0ec8b83dSEd Tanous MultiFunction, 21*0ec8b83dSEd Tanous Simulated, 22*0ec8b83dSEd Tanous Retimer, 23*0ec8b83dSEd Tanous }; 24*0ec8b83dSEd Tanous 25*0ec8b83dSEd Tanous enum class SlotType{ 26*0ec8b83dSEd Tanous Invalid, 27*0ec8b83dSEd Tanous FullLength, 28*0ec8b83dSEd Tanous HalfLength, 29*0ec8b83dSEd Tanous LowProfile, 30*0ec8b83dSEd Tanous Mini, 31*0ec8b83dSEd Tanous M2, 32*0ec8b83dSEd Tanous OEM, 33*0ec8b83dSEd Tanous OCP3Small, 34*0ec8b83dSEd Tanous OCP3Large, 35*0ec8b83dSEd Tanous U2, 36*0ec8b83dSEd Tanous }; 37*0ec8b83dSEd Tanous 38*0ec8b83dSEd Tanous enum class LaneSplittingType{ 39*0ec8b83dSEd Tanous Invalid, 40*0ec8b83dSEd Tanous None, 41*0ec8b83dSEd Tanous Bridged, 42*0ec8b83dSEd Tanous Bifurcated, 43*0ec8b83dSEd Tanous }; 44*0ec8b83dSEd Tanous 45*0ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(PCIeTypes, { 46*0ec8b83dSEd Tanous {PCIeTypes::Invalid, "Invalid"}, 47*0ec8b83dSEd Tanous {PCIeTypes::Gen1, "Gen1"}, 48*0ec8b83dSEd Tanous {PCIeTypes::Gen2, "Gen2"}, 49*0ec8b83dSEd Tanous {PCIeTypes::Gen3, "Gen3"}, 50*0ec8b83dSEd Tanous {PCIeTypes::Gen4, "Gen4"}, 51*0ec8b83dSEd Tanous {PCIeTypes::Gen5, "Gen5"}, 52*0ec8b83dSEd Tanous }); 53*0ec8b83dSEd Tanous 54*0ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(DeviceType, { 55*0ec8b83dSEd Tanous {DeviceType::Invalid, "Invalid"}, 56*0ec8b83dSEd Tanous {DeviceType::SingleFunction, "SingleFunction"}, 57*0ec8b83dSEd Tanous {DeviceType::MultiFunction, "MultiFunction"}, 58*0ec8b83dSEd Tanous {DeviceType::Simulated, "Simulated"}, 59*0ec8b83dSEd Tanous {DeviceType::Retimer, "Retimer"}, 60*0ec8b83dSEd Tanous }); 61*0ec8b83dSEd Tanous 62*0ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(SlotType, { 63*0ec8b83dSEd Tanous {SlotType::Invalid, "Invalid"}, 64*0ec8b83dSEd Tanous {SlotType::FullLength, "FullLength"}, 65*0ec8b83dSEd Tanous {SlotType::HalfLength, "HalfLength"}, 66*0ec8b83dSEd Tanous {SlotType::LowProfile, "LowProfile"}, 67*0ec8b83dSEd Tanous {SlotType::Mini, "Mini"}, 68*0ec8b83dSEd Tanous {SlotType::M2, "M2"}, 69*0ec8b83dSEd Tanous {SlotType::OEM, "OEM"}, 70*0ec8b83dSEd Tanous {SlotType::OCP3Small, "OCP3Small"}, 71*0ec8b83dSEd Tanous {SlotType::OCP3Large, "OCP3Large"}, 72*0ec8b83dSEd Tanous {SlotType::U2, "U2"}, 73*0ec8b83dSEd Tanous }); 74*0ec8b83dSEd Tanous 75*0ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LaneSplittingType, { 76*0ec8b83dSEd Tanous {LaneSplittingType::Invalid, "Invalid"}, 77*0ec8b83dSEd Tanous {LaneSplittingType::None, "None"}, 78*0ec8b83dSEd Tanous {LaneSplittingType::Bridged, "Bridged"}, 79*0ec8b83dSEd Tanous {LaneSplittingType::Bifurcated, "Bifurcated"}, 80*0ec8b83dSEd Tanous }); 81*0ec8b83dSEd Tanous 82*0ec8b83dSEd Tanous } 83*0ec8b83dSEd Tanous // clang-format on 84