10ec8b83dSEd Tanous #pragma once 20ec8b83dSEd Tanous #include <nlohmann/json.hpp> 30ec8b83dSEd Tanous 40ec8b83dSEd Tanous namespace pcie_function 50ec8b83dSEd Tanous { 60ec8b83dSEd Tanous // clang-format off 70ec8b83dSEd Tanous 80ec8b83dSEd Tanous enum class DeviceClass{ 90ec8b83dSEd Tanous Invalid, 100ec8b83dSEd Tanous UnclassifiedDevice, 110ec8b83dSEd Tanous MassStorageController, 120ec8b83dSEd Tanous NetworkController, 130ec8b83dSEd Tanous DisplayController, 140ec8b83dSEd Tanous MultimediaController, 150ec8b83dSEd Tanous MemoryController, 160ec8b83dSEd Tanous Bridge, 170ec8b83dSEd Tanous CommunicationController, 180ec8b83dSEd Tanous GenericSystemPeripheral, 190ec8b83dSEd Tanous InputDeviceController, 200ec8b83dSEd Tanous DockingStation, 210ec8b83dSEd Tanous Processor, 220ec8b83dSEd Tanous SerialBusController, 230ec8b83dSEd Tanous WirelessController, 240ec8b83dSEd Tanous IntelligentController, 250ec8b83dSEd Tanous SatelliteCommunicationsController, 260ec8b83dSEd Tanous EncryptionController, 270ec8b83dSEd Tanous SignalProcessingController, 280ec8b83dSEd Tanous ProcessingAccelerators, 290ec8b83dSEd Tanous NonEssentialInstrumentation, 300ec8b83dSEd Tanous Coprocessor, 310ec8b83dSEd Tanous UnassignedClass, 320ec8b83dSEd Tanous Other, 330ec8b83dSEd Tanous }; 340ec8b83dSEd Tanous 350ec8b83dSEd Tanous enum class FunctionType{ 360ec8b83dSEd Tanous Invalid, 370ec8b83dSEd Tanous Physical, 380ec8b83dSEd Tanous Virtual, 390ec8b83dSEd Tanous }; 400ec8b83dSEd Tanous 41*a8d8f9d8SEd Tanous enum class FunctionProtocol{ 42*a8d8f9d8SEd Tanous Invalid, 43*a8d8f9d8SEd Tanous PCIe, 44*a8d8f9d8SEd Tanous CXL, 45*a8d8f9d8SEd Tanous }; 46*a8d8f9d8SEd Tanous 470ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(DeviceClass, { 480ec8b83dSEd Tanous {DeviceClass::Invalid, "Invalid"}, 490ec8b83dSEd Tanous {DeviceClass::UnclassifiedDevice, "UnclassifiedDevice"}, 500ec8b83dSEd Tanous {DeviceClass::MassStorageController, "MassStorageController"}, 510ec8b83dSEd Tanous {DeviceClass::NetworkController, "NetworkController"}, 520ec8b83dSEd Tanous {DeviceClass::DisplayController, "DisplayController"}, 530ec8b83dSEd Tanous {DeviceClass::MultimediaController, "MultimediaController"}, 540ec8b83dSEd Tanous {DeviceClass::MemoryController, "MemoryController"}, 550ec8b83dSEd Tanous {DeviceClass::Bridge, "Bridge"}, 560ec8b83dSEd Tanous {DeviceClass::CommunicationController, "CommunicationController"}, 570ec8b83dSEd Tanous {DeviceClass::GenericSystemPeripheral, "GenericSystemPeripheral"}, 580ec8b83dSEd Tanous {DeviceClass::InputDeviceController, "InputDeviceController"}, 590ec8b83dSEd Tanous {DeviceClass::DockingStation, "DockingStation"}, 600ec8b83dSEd Tanous {DeviceClass::Processor, "Processor"}, 610ec8b83dSEd Tanous {DeviceClass::SerialBusController, "SerialBusController"}, 620ec8b83dSEd Tanous {DeviceClass::WirelessController, "WirelessController"}, 630ec8b83dSEd Tanous {DeviceClass::IntelligentController, "IntelligentController"}, 640ec8b83dSEd Tanous {DeviceClass::SatelliteCommunicationsController, "SatelliteCommunicationsController"}, 650ec8b83dSEd Tanous {DeviceClass::EncryptionController, "EncryptionController"}, 660ec8b83dSEd Tanous {DeviceClass::SignalProcessingController, "SignalProcessingController"}, 670ec8b83dSEd Tanous {DeviceClass::ProcessingAccelerators, "ProcessingAccelerators"}, 680ec8b83dSEd Tanous {DeviceClass::NonEssentialInstrumentation, "NonEssentialInstrumentation"}, 690ec8b83dSEd Tanous {DeviceClass::Coprocessor, "Coprocessor"}, 700ec8b83dSEd Tanous {DeviceClass::UnassignedClass, "UnassignedClass"}, 710ec8b83dSEd Tanous {DeviceClass::Other, "Other"}, 720ec8b83dSEd Tanous }); 730ec8b83dSEd Tanous 740ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(FunctionType, { 750ec8b83dSEd Tanous {FunctionType::Invalid, "Invalid"}, 760ec8b83dSEd Tanous {FunctionType::Physical, "Physical"}, 770ec8b83dSEd Tanous {FunctionType::Virtual, "Virtual"}, 780ec8b83dSEd Tanous }); 790ec8b83dSEd Tanous 80*a8d8f9d8SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(FunctionProtocol, { 81*a8d8f9d8SEd Tanous {FunctionProtocol::Invalid, "Invalid"}, 82*a8d8f9d8SEd Tanous {FunctionProtocol::PCIe, "PCIe"}, 83*a8d8f9d8SEd Tanous {FunctionProtocol::CXL, "CXL"}, 84*a8d8f9d8SEd Tanous }); 85*a8d8f9d8SEd Tanous 860ec8b83dSEd Tanous } 870ec8b83dSEd Tanous // clang-format on 88