diff options
Diffstat (limited to 'redfish-core')
-rw-r--r-- | redfish-core/lib/pcie.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp index c91e52dd48..77afd0acd6 100644 --- a/redfish-core/lib/pcie.hpp +++ b/redfish-core/lib/pcie.hpp @@ -192,11 +192,12 @@ inline void requestRoutesSystemPCIeDevice(App& app) const std::string* manufacturer = nullptr; const std::string* deviceType = nullptr; const std::string* generationInUse = nullptr; + const size_t* lanesInUse = nullptr; const bool success = sdbusplus::unpackPropertiesNoThrow( dbus_utils::UnpackErrorPrinter(), pcieDevProperties, "Manufacturer", manufacturer, "DeviceType", deviceType, - "GenerationInUse", generationInUse); + "LanesInUse", lanesInUse, "GenerationInUse", generationInUse); if (!success) { @@ -204,6 +205,14 @@ inline void requestRoutesSystemPCIeDevice(App& app) return; } + // The default value of LanesInUse is 0, and the field will be + // left as off if it is a default value. + if (lanesInUse != nullptr && *lanesInUse != 0) + { + asyncResp->res.jsonValue["PCIeInterface"]["LanesInUse"] = + *lanesInUse; + } + if (generationInUse != nullptr) { std::optional<pcie_device::PCIeTypes> redfishGenerationInUse = |