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 NLOHMANN_JSON_SERIALIZE_ENUM(PCIeTypes, {
53     {PCIeTypes::Invalid, "Invalid"},
54     {PCIeTypes::Gen1, "Gen1"},
55     {PCIeTypes::Gen2, "Gen2"},
56     {PCIeTypes::Gen3, "Gen3"},
57     {PCIeTypes::Gen4, "Gen4"},
58     {PCIeTypes::Gen5, "Gen5"},
59 });
60 
61 NLOHMANN_JSON_SERIALIZE_ENUM(DeviceType, {
62     {DeviceType::Invalid, "Invalid"},
63     {DeviceType::SingleFunction, "SingleFunction"},
64     {DeviceType::MultiFunction, "MultiFunction"},
65     {DeviceType::Simulated, "Simulated"},
66     {DeviceType::Retimer, "Retimer"},
67 });
68 
69 NLOHMANN_JSON_SERIALIZE_ENUM(SlotType, {
70     {SlotType::Invalid, "Invalid"},
71     {SlotType::FullLength, "FullLength"},
72     {SlotType::HalfLength, "HalfLength"},
73     {SlotType::LowProfile, "LowProfile"},
74     {SlotType::Mini, "Mini"},
75     {SlotType::M2, "M2"},
76     {SlotType::OEM, "OEM"},
77     {SlotType::OCP3Small, "OCP3Small"},
78     {SlotType::OCP3Large, "OCP3Large"},
79     {SlotType::U2, "U2"},
80 });
81 
82 NLOHMANN_JSON_SERIALIZE_ENUM(LaneSplittingType, {
83     {LaneSplittingType::Invalid, "Invalid"},
84     {LaneSplittingType::None, "None"},
85     {LaneSplittingType::Bridged, "Bridged"},
86     {LaneSplittingType::Bifurcated, "Bifurcated"},
87 });
88 
89 NLOHMANN_JSON_SERIALIZE_ENUM(CXLDeviceType, {
90     {CXLDeviceType::Invalid, "Invalid"},
91     {CXLDeviceType::Type1, "Type1"},
92     {CXLDeviceType::Type2, "Type2"},
93     {CXLDeviceType::Type3, "Type3"},
94 });
95 
96 }
97 // clang-format on
98