1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace pcie_function
5 {
6 // clang-format off
7 
8 enum class DeviceClass{
9     Invalid,
10     UnclassifiedDevice,
11     MassStorageController,
12     NetworkController,
13     DisplayController,
14     MultimediaController,
15     MemoryController,
16     Bridge,
17     CommunicationController,
18     GenericSystemPeripheral,
19     InputDeviceController,
20     DockingStation,
21     Processor,
22     SerialBusController,
23     WirelessController,
24     IntelligentController,
25     SatelliteCommunicationsController,
26     EncryptionController,
27     SignalProcessingController,
28     ProcessingAccelerators,
29     NonEssentialInstrumentation,
30     Coprocessor,
31     UnassignedClass,
32     Other,
33 };
34 
35 enum class FunctionType{
36     Invalid,
37     Physical,
38     Virtual,
39 };
40 
41 enum class FunctionProtocol{
42     Invalid,
43     PCIe,
44     CXL,
45 };
46 
47 NLOHMANN_JSON_SERIALIZE_ENUM(DeviceClass, {
48     {DeviceClass::Invalid, "Invalid"},
49     {DeviceClass::UnclassifiedDevice, "UnclassifiedDevice"},
50     {DeviceClass::MassStorageController, "MassStorageController"},
51     {DeviceClass::NetworkController, "NetworkController"},
52     {DeviceClass::DisplayController, "DisplayController"},
53     {DeviceClass::MultimediaController, "MultimediaController"},
54     {DeviceClass::MemoryController, "MemoryController"},
55     {DeviceClass::Bridge, "Bridge"},
56     {DeviceClass::CommunicationController, "CommunicationController"},
57     {DeviceClass::GenericSystemPeripheral, "GenericSystemPeripheral"},
58     {DeviceClass::InputDeviceController, "InputDeviceController"},
59     {DeviceClass::DockingStation, "DockingStation"},
60     {DeviceClass::Processor, "Processor"},
61     {DeviceClass::SerialBusController, "SerialBusController"},
62     {DeviceClass::WirelessController, "WirelessController"},
63     {DeviceClass::IntelligentController, "IntelligentController"},
64     {DeviceClass::SatelliteCommunicationsController, "SatelliteCommunicationsController"},
65     {DeviceClass::EncryptionController, "EncryptionController"},
66     {DeviceClass::SignalProcessingController, "SignalProcessingController"},
67     {DeviceClass::ProcessingAccelerators, "ProcessingAccelerators"},
68     {DeviceClass::NonEssentialInstrumentation, "NonEssentialInstrumentation"},
69     {DeviceClass::Coprocessor, "Coprocessor"},
70     {DeviceClass::UnassignedClass, "UnassignedClass"},
71     {DeviceClass::Other, "Other"},
72 });
73 
74 NLOHMANN_JSON_SERIALIZE_ENUM(FunctionType, {
75     {FunctionType::Invalid, "Invalid"},
76     {FunctionType::Physical, "Physical"},
77     {FunctionType::Virtual, "Virtual"},
78 });
79 
80 NLOHMANN_JSON_SERIALIZE_ENUM(FunctionProtocol, {
81     {FunctionProtocol::Invalid, "Invalid"},
82     {FunctionProtocol::PCIe, "PCIe"},
83     {FunctionProtocol::CXL, "CXL"},
84 });
85 
86 }
87 // clang-format on
88