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 NLOHMANN_JSON_SERIALIZE_ENUM(DeviceClass, {
42     {DeviceClass::Invalid, "Invalid"},
43     {DeviceClass::UnclassifiedDevice, "UnclassifiedDevice"},
44     {DeviceClass::MassStorageController, "MassStorageController"},
45     {DeviceClass::NetworkController, "NetworkController"},
46     {DeviceClass::DisplayController, "DisplayController"},
47     {DeviceClass::MultimediaController, "MultimediaController"},
48     {DeviceClass::MemoryController, "MemoryController"},
49     {DeviceClass::Bridge, "Bridge"},
50     {DeviceClass::CommunicationController, "CommunicationController"},
51     {DeviceClass::GenericSystemPeripheral, "GenericSystemPeripheral"},
52     {DeviceClass::InputDeviceController, "InputDeviceController"},
53     {DeviceClass::DockingStation, "DockingStation"},
54     {DeviceClass::Processor, "Processor"},
55     {DeviceClass::SerialBusController, "SerialBusController"},
56     {DeviceClass::WirelessController, "WirelessController"},
57     {DeviceClass::IntelligentController, "IntelligentController"},
58     {DeviceClass::SatelliteCommunicationsController, "SatelliteCommunicationsController"},
59     {DeviceClass::EncryptionController, "EncryptionController"},
60     {DeviceClass::SignalProcessingController, "SignalProcessingController"},
61     {DeviceClass::ProcessingAccelerators, "ProcessingAccelerators"},
62     {DeviceClass::NonEssentialInstrumentation, "NonEssentialInstrumentation"},
63     {DeviceClass::Coprocessor, "Coprocessor"},
64     {DeviceClass::UnassignedClass, "UnassignedClass"},
65     {DeviceClass::Other, "Other"},
66 });
67 
68 NLOHMANN_JSON_SERIALIZE_ENUM(FunctionType, {
69     {FunctionType::Invalid, "Invalid"},
70     {FunctionType::Physical, "Physical"},
71     {FunctionType::Virtual, "Virtual"},
72 });
73 
74 }
75 // clang-format on
76