Ed Tanous | 40e9b92 | 2024-09-10 13:50:16 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: Apache-2.0 |
| 2 | // SPDX-FileCopyrightText: Copyright OpenBMC Authors |
| 3 | // SPDX-FileCopyrightText: Copyright 2018 Intel Corporation |
Jason M. Bills | f5c9f8b | 2018-12-18 16:51:18 -0800 | [diff] [blame] | 4 | |
| 5 | #pragma once |
| 6 | |
Ed Tanous | d785720 | 2025-01-28 15:32:26 -0800 | [diff] [blame^] | 7 | #include "bmcweb_config.h" |
| 8 | |
Ed Tanous | 3ccb3ad | 2023-01-13 17:40:03 -0800 | [diff] [blame] | 9 | #include "app.hpp" |
Ed Tanous | d785720 | 2025-01-28 15:32:26 -0800 | [diff] [blame^] | 10 | #include "async_resp.hpp" |
George Liu | 7a1dbc4 | 2022-12-07 16:03:22 +0800 | [diff] [blame] | 11 | #include "dbus_utility.hpp" |
Ed Tanous | d785720 | 2025-01-28 15:32:26 -0800 | [diff] [blame^] | 12 | #include "error_messages.hpp" |
| 13 | #include "generated/enums/pcie_device.hpp" |
| 14 | #include "generated/enums/pcie_slots.hpp" |
Ed Tanous | 539d8c6 | 2024-06-19 14:38:27 -0700 | [diff] [blame] | 15 | #include "generated/enums/resource.hpp" |
Ed Tanous | d785720 | 2025-01-28 15:32:26 -0800 | [diff] [blame^] | 16 | #include "http_request.hpp" |
| 17 | #include "logging.hpp" |
Ed Tanous | 3ccb3ad | 2023-01-13 17:40:03 -0800 | [diff] [blame] | 18 | #include "query.hpp" |
| 19 | #include "registries/privilege_registry.hpp" |
| 20 | #include "utils/dbus_utils.hpp" |
Lakshmi Yadlapati | c49c329 | 2023-04-19 16:42:35 -0500 | [diff] [blame] | 21 | #include "utils/pcie_util.hpp" |
Ed Tanous | 0ec8b83 | 2022-03-14 14:56:47 -0700 | [diff] [blame] | 22 | |
Ed Tanous | d785720 | 2025-01-28 15:32:26 -0800 | [diff] [blame^] | 23 | #include <asm-generic/errno.h> |
| 24 | |
| 25 | #include <boost/beast/http/field.hpp> |
| 26 | #include <boost/beast/http/verb.hpp> |
Ed Tanous | ef4c65b | 2023-04-24 15:28:50 -0700 | [diff] [blame] | 27 | #include <boost/url/format.hpp> |
Krzysztof Grobelny | d1bde9e | 2022-09-07 10:40:51 +0200 | [diff] [blame] | 28 | #include <sdbusplus/unpack_properties.hpp> |
Jason M. Bills | f5c9f8b | 2018-12-18 16:51:18 -0800 | [diff] [blame] | 29 | |
Ed Tanous | d785720 | 2025-01-28 15:32:26 -0800 | [diff] [blame^] | 30 | #include <array> |
| 31 | #include <charconv> |
| 32 | #include <cstddef> |
| 33 | #include <cstdint> |
| 34 | #include <format> |
| 35 | #include <functional> |
Myung Bae | 8c1d054 | 2024-03-12 17:50:48 -0500 | [diff] [blame] | 36 | #include <limits> |
Ed Tanous | d785720 | 2025-01-28 15:32:26 -0800 | [diff] [blame^] | 37 | #include <memory> |
| 38 | #include <optional> |
| 39 | #include <string> |
| 40 | #include <string_view> |
| 41 | #include <system_error> |
| 42 | #include <utility> |
| 43 | #include <variant> |
Myung Bae | 8c1d054 | 2024-03-12 17:50:48 -0500 | [diff] [blame] | 44 | |
Jason M. Bills | f5c9f8b | 2018-12-18 16:51:18 -0800 | [diff] [blame] | 45 | namespace redfish |
| 46 | { |
| 47 | |
Patrick Williams | 89492a1 | 2023-05-10 07:51:34 -0500 | [diff] [blame] | 48 | static constexpr const char* inventoryPath = "/xyz/openbmc_project/inventory"; |
Lakshmi Yadlapati | 94c3a10 | 2023-04-05 18:11:22 -0500 | [diff] [blame] | 49 | static constexpr std::array<std::string_view, 1> pcieDeviceInterface = { |
| 50 | "xyz.openbmc_project.Inventory.Item.PCIeDevice"}; |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 51 | static constexpr std::array<std::string_view, 1> pcieSlotInterface = { |
| 52 | "xyz.openbmc_project.Inventory.Item.PCIeSlot"}; |
Jason M. Bills | f5c9f8b | 2018-12-18 16:51:18 -0800 | [diff] [blame] | 53 | |
Ed Tanous | 4ff0f1f | 2024-09-04 17:27:37 -0700 | [diff] [blame] | 54 | inline void handlePCIeDevicePath( |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 55 | const std::string& pcieDeviceId, |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 56 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 57 | const dbus::utility::MapperGetSubTreePathsResponse& pcieDevicePaths, |
| 58 | const std::function<void(const std::string& pcieDevicePath, |
| 59 | const std::string& service)>& callback) |
| 60 | |
| 61 | { |
| 62 | for (const std::string& pcieDevicePath : pcieDevicePaths) |
| 63 | { |
| 64 | std::string pciecDeviceName = |
| 65 | sdbusplus::message::object_path(pcieDevicePath).filename(); |
| 66 | if (pciecDeviceName.empty() || pciecDeviceName != pcieDeviceId) |
| 67 | { |
| 68 | continue; |
| 69 | } |
| 70 | |
| 71 | dbus::utility::getDbusObject( |
Konstantin Aladyshev | 3a58c5a | 2024-08-05 12:57:13 +0300 | [diff] [blame] | 72 | pcieDevicePath, pcieDeviceInterface, |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 73 | [pcieDevicePath, asyncResp, |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 74 | callback](const boost::system::error_code& ec, |
| 75 | const dbus::utility::MapperGetObject& object) { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 76 | if (ec || object.empty()) |
| 77 | { |
| 78 | BMCWEB_LOG_ERROR("DBUS response error {}", ec); |
| 79 | messages::internalError(asyncResp->res); |
| 80 | return; |
| 81 | } |
| 82 | callback(pcieDevicePath, object.begin()->first); |
| 83 | }); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 84 | return; |
| 85 | } |
| 86 | |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 87 | BMCWEB_LOG_WARNING("PCIe Device not found"); |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 88 | messages::resourceNotFound(asyncResp->res, "PCIeDevice", pcieDeviceId); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 89 | } |
| 90 | |
Ed Tanous | 4ff0f1f | 2024-09-04 17:27:37 -0700 | [diff] [blame] | 91 | inline void getValidPCIeDevicePath( |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 92 | const std::string& pcieDeviceId, |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 93 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 94 | const std::function<void(const std::string& pcieDevicePath, |
| 95 | const std::string& service)>& callback) |
| 96 | { |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 97 | dbus::utility::getSubTreePaths( |
Lakshmi Yadlapati | 94c3a10 | 2023-04-05 18:11:22 -0500 | [diff] [blame] | 98 | inventoryPath, 0, pcieDeviceInterface, |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 99 | [pcieDeviceId, asyncResp, |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 100 | callback](const boost::system::error_code& ec, |
| 101 | const dbus::utility::MapperGetSubTreePathsResponse& |
| 102 | pcieDevicePaths) { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 103 | if (ec) |
| 104 | { |
| 105 | BMCWEB_LOG_ERROR("D-Bus response error on GetSubTree {}", ec); |
| 106 | messages::internalError(asyncResp->res); |
| 107 | return; |
| 108 | } |
| 109 | handlePCIeDevicePath(pcieDeviceId, asyncResp, pcieDevicePaths, |
| 110 | callback); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 111 | return; |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 112 | }); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 113 | } |
| 114 | |
Ed Tanous | 4ff0f1f | 2024-09-04 17:27:37 -0700 | [diff] [blame] | 115 | inline void handlePCIeDeviceCollectionGet( |
Lakshmi Yadlapati | b38fa2a | 2023-03-10 16:19:46 -0600 | [diff] [blame] | 116 | crow::App& app, const crow::Request& req, |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 117 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
Lakshmi Yadlapati | b38fa2a | 2023-03-10 16:19:46 -0600 | [diff] [blame] | 118 | const std::string& systemName) |
| 119 | { |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 120 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Lakshmi Yadlapati | b38fa2a | 2023-03-10 16:19:46 -0600 | [diff] [blame] | 121 | { |
| 122 | return; |
| 123 | } |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 124 | if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM) |
Ed Tanous | 7f3e84a | 2022-12-28 16:22:54 -0800 | [diff] [blame] | 125 | { |
| 126 | // Option currently returns no systems. TBD |
| 127 | messages::resourceNotFound(asyncResp->res, "ComputerSystem", |
| 128 | systemName); |
| 129 | return; |
| 130 | } |
Ed Tanous | 253f11b | 2024-05-16 09:38:31 -0700 | [diff] [blame] | 131 | if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME) |
Lakshmi Yadlapati | b38fa2a | 2023-03-10 16:19:46 -0600 | [diff] [blame] | 132 | { |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 133 | messages::resourceNotFound(asyncResp->res, "ComputerSystem", |
| 134 | systemName); |
Lakshmi Yadlapati | b38fa2a | 2023-03-10 16:19:46 -0600 | [diff] [blame] | 135 | return; |
| 136 | } |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 137 | |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 138 | asyncResp->res.addHeader(boost::beast::http::field::link, |
| 139 | "</redfish/v1/JsonSchemas/PCIeDeviceCollection/" |
| 140 | "PCIeDeviceCollection.json>; rel=describedby"); |
| 141 | asyncResp->res.jsonValue["@odata.type"] = |
Lakshmi Yadlapati | b38fa2a | 2023-03-10 16:19:46 -0600 | [diff] [blame] | 142 | "#PCIeDeviceCollection.PCIeDeviceCollection"; |
Ed Tanous | 253f11b | 2024-05-16 09:38:31 -0700 | [diff] [blame] | 143 | asyncResp->res.jsonValue["@odata.id"] = std::format( |
| 144 | "/redfish/v1/Systems/{}/PCIeDevices", BMCWEB_REDFISH_SYSTEM_URI_NAME); |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 145 | asyncResp->res.jsonValue["Name"] = "PCIe Device Collection"; |
| 146 | asyncResp->res.jsonValue["Description"] = "Collection of PCIe Devices"; |
Lakshmi Yadlapati | b38fa2a | 2023-03-10 16:19:46 -0600 | [diff] [blame] | 147 | |
Lakshmi Yadlapati | 70c4d54 | 2023-06-08 04:37:18 -0500 | [diff] [blame] | 148 | pcie_util::getPCIeDeviceList(asyncResp, |
| 149 | nlohmann::json::json_pointer("/Members")); |
Lakshmi Yadlapati | b38fa2a | 2023-03-10 16:19:46 -0600 | [diff] [blame] | 150 | } |
| 151 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 152 | inline void requestRoutesSystemPCIeDeviceCollection(App& app) |
Jason M. Bills | adbe192 | 2019-10-14 15:44:35 -0700 | [diff] [blame] | 153 | { |
Jason M. Bills | adbe192 | 2019-10-14 15:44:35 -0700 | [diff] [blame] | 154 | /** |
| 155 | * Functions triggers appropriate requests on DBus |
| 156 | */ |
Ed Tanous | 22d268c | 2022-05-19 09:39:07 -0700 | [diff] [blame] | 157 | BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/PCIeDevices/") |
Ed Tanous | ed39821 | 2021-06-09 17:05:54 -0700 | [diff] [blame] | 158 | .privileges(redfish::privileges::getPCIeDeviceCollection) |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 159 | .methods(boost::beast::http::verb::get)( |
Lakshmi Yadlapati | b38fa2a | 2023-03-10 16:19:46 -0600 | [diff] [blame] | 160 | std::bind_front(handlePCIeDeviceCollectionGet, std::ref(app))); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 161 | } |
| 162 | |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 163 | inline void addPCIeSlotProperties( |
| 164 | crow::Response& res, const boost::system::error_code& ec, |
| 165 | const dbus::utility::DBusPropertiesMap& pcieSlotProperties) |
| 166 | { |
| 167 | if (ec) |
| 168 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 169 | BMCWEB_LOG_ERROR("DBUS response error for getAllProperties{}", |
| 170 | ec.value()); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 171 | messages::internalError(res); |
| 172 | return; |
| 173 | } |
| 174 | std::string generation; |
| 175 | size_t lanes = 0; |
| 176 | std::string slotType; |
| 177 | |
| 178 | bool success = sdbusplus::unpackPropertiesNoThrow( |
| 179 | dbus_utils::UnpackErrorPrinter(), pcieSlotProperties, "Generation", |
| 180 | generation, "Lanes", lanes, "SlotType", slotType); |
| 181 | |
| 182 | if (!success) |
| 183 | { |
| 184 | messages::internalError(res); |
| 185 | return; |
| 186 | } |
| 187 | |
| 188 | std::optional<pcie_device::PCIeTypes> pcieType = |
| 189 | pcie_util::redfishPcieGenerationFromDbus(generation); |
| 190 | if (!pcieType) |
| 191 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 192 | BMCWEB_LOG_WARNING("Unknown PCIeType: {}", generation); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 193 | } |
| 194 | else |
| 195 | { |
| 196 | if (*pcieType == pcie_device::PCIeTypes::Invalid) |
| 197 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 198 | BMCWEB_LOG_ERROR("Invalid PCIeType: {}", generation); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 199 | messages::internalError(res); |
| 200 | return; |
| 201 | } |
| 202 | res.jsonValue["Slot"]["PCIeType"] = *pcieType; |
| 203 | } |
| 204 | |
Konstantin Aladyshev | 82f8032 | 2023-07-10 15:00:38 +0300 | [diff] [blame] | 205 | if (lanes != 0) |
| 206 | { |
| 207 | res.jsonValue["Slot"]["Lanes"] = lanes; |
| 208 | } |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 209 | |
| 210 | std::optional<pcie_slots::SlotTypes> redfishSlotType = |
| 211 | pcie_util::dbusSlotTypeToRf(slotType); |
| 212 | if (!redfishSlotType) |
| 213 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 214 | BMCWEB_LOG_WARNING("Unknown PCIeSlot Type: {}", slotType); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 215 | } |
| 216 | else |
| 217 | { |
| 218 | if (*redfishSlotType == pcie_slots::SlotTypes::Invalid) |
| 219 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 220 | BMCWEB_LOG_ERROR("Invalid PCIeSlot type: {}", slotType); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 221 | messages::internalError(res); |
| 222 | return; |
| 223 | } |
| 224 | res.jsonValue["Slot"]["SlotType"] = *redfishSlotType; |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | inline void getPCIeDeviceSlotPath( |
| 229 | const std::string& pcieDevicePath, |
| 230 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 231 | std::function<void(const std::string& pcieDeviceSlot)>&& callback) |
| 232 | { |
| 233 | std::string associationPath = pcieDevicePath + "/contained_by"; |
| 234 | dbus::utility::getAssociatedSubTreePaths( |
| 235 | associationPath, sdbusplus::message::object_path(inventoryPath), 0, |
| 236 | pcieSlotInterface, |
Ed Tanous | 8cb2c02 | 2024-03-27 16:31:46 -0700 | [diff] [blame] | 237 | [callback = std::move(callback), asyncResp, pcieDevicePath]( |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 238 | const boost::system::error_code& ec, |
| 239 | const dbus::utility::MapperGetSubTreePathsResponse& endpoints) { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 240 | if (ec) |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 241 | { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 242 | if (ec.value() == EBADR) |
| 243 | { |
| 244 | // Missing association is not an error |
| 245 | return; |
| 246 | } |
| 247 | BMCWEB_LOG_ERROR( |
| 248 | "DBUS response error for getAssociatedSubTreePaths {}", |
| 249 | ec.value()); |
| 250 | messages::internalError(asyncResp->res); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 251 | return; |
| 252 | } |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 253 | if (endpoints.size() > 1) |
| 254 | { |
| 255 | BMCWEB_LOG_ERROR( |
Gunnar Mills | a6bd55b | 2025-01-13 11:24:00 -0600 | [diff] [blame] | 256 | "PCIeDevice {} is associated with more than one PCIeSlot: {}", |
| 257 | pcieDevicePath, endpoints.size()); |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 258 | messages::internalError(asyncResp->res); |
| 259 | return; |
| 260 | } |
| 261 | if (endpoints.empty()) |
| 262 | { |
| 263 | // If the device doesn't have an association, return without |
| 264 | // PCIe Slot properties |
| 265 | BMCWEB_LOG_DEBUG("PCIeDevice is not associated with PCIeSlot"); |
| 266 | return; |
| 267 | } |
| 268 | callback(endpoints[0]); |
| 269 | }); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 270 | } |
| 271 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 272 | inline void afterGetDbusObject( |
| 273 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 274 | const std::string& pcieDeviceSlot, const boost::system::error_code& ec, |
| 275 | const dbus::utility::MapperGetObject& object) |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 276 | { |
| 277 | if (ec || object.empty()) |
| 278 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 279 | BMCWEB_LOG_ERROR("DBUS response error for getDbusObject {}", |
| 280 | ec.value()); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 281 | messages::internalError(asyncResp->res); |
| 282 | return; |
| 283 | } |
Ed Tanous | deae6a7 | 2024-11-11 21:58:57 -0800 | [diff] [blame] | 284 | dbus::utility::getAllProperties( |
| 285 | object.begin()->first, pcieDeviceSlot, |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 286 | "xyz.openbmc_project.Inventory.Item.PCIeSlot", |
| 287 | [asyncResp]( |
| 288 | const boost::system::error_code& ec2, |
| 289 | const dbus::utility::DBusPropertiesMap& pcieSlotProperties) { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 290 | addPCIeSlotProperties(asyncResp->res, ec2, pcieSlotProperties); |
| 291 | }); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | inline void afterGetPCIeDeviceSlotPath( |
| 295 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 296 | const std::string& pcieDeviceSlot) |
| 297 | { |
| 298 | dbus::utility::getDbusObject( |
| 299 | pcieDeviceSlot, pcieSlotInterface, |
| 300 | [asyncResp, |
| 301 | pcieDeviceSlot](const boost::system::error_code& ec, |
| 302 | const dbus::utility::MapperGetObject& object) { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 303 | afterGetDbusObject(asyncResp, pcieDeviceSlot, ec, object); |
| 304 | }); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 305 | } |
| 306 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 307 | inline void getPCIeDeviceHealth( |
| 308 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 309 | const std::string& pcieDevicePath, const std::string& service) |
Lakshmi Yadlapati | e164f1b | 2023-04-12 17:01:34 -0500 | [diff] [blame] | 310 | { |
Ed Tanous | deae6a7 | 2024-11-11 21:58:57 -0800 | [diff] [blame] | 311 | dbus::utility::getProperty<bool>( |
| 312 | service, pcieDevicePath, |
Lakshmi Yadlapati | e164f1b | 2023-04-12 17:01:34 -0500 | [diff] [blame] | 313 | "xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional", |
| 314 | [asyncResp](const boost::system::error_code& ec, const bool value) { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 315 | if (ec) |
Lakshmi Yadlapati | e164f1b | 2023-04-12 17:01:34 -0500 | [diff] [blame] | 316 | { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 317 | if (ec.value() != EBADR) |
| 318 | { |
| 319 | BMCWEB_LOG_ERROR("DBUS response error for Health {}", |
| 320 | ec.value()); |
| 321 | messages::internalError(asyncResp->res); |
| 322 | } |
| 323 | return; |
Lakshmi Yadlapati | e164f1b | 2023-04-12 17:01:34 -0500 | [diff] [blame] | 324 | } |
Lakshmi Yadlapati | e164f1b | 2023-04-12 17:01:34 -0500 | [diff] [blame] | 325 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 326 | if (!value) |
| 327 | { |
| 328 | asyncResp->res.jsonValue["Status"]["Health"] = |
| 329 | resource::Health::Critical; |
| 330 | } |
| 331 | }); |
Lakshmi Yadlapati | e164f1b | 2023-04-12 17:01:34 -0500 | [diff] [blame] | 332 | } |
| 333 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 334 | inline void getPCIeDeviceState( |
| 335 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 336 | const std::string& pcieDevicePath, const std::string& service) |
Lakshmi Yadlapati | c6bb328 | 2023-04-12 16:56:49 -0500 | [diff] [blame] | 337 | { |
Ed Tanous | deae6a7 | 2024-11-11 21:58:57 -0800 | [diff] [blame] | 338 | dbus::utility::getProperty<bool>( |
| 339 | service, pcieDevicePath, "xyz.openbmc_project.Inventory.Item", |
| 340 | "Present", |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 341 | [asyncResp](const boost::system::error_code& ec, bool value) { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 342 | if (ec) |
Lakshmi Yadlapati | c6bb328 | 2023-04-12 16:56:49 -0500 | [diff] [blame] | 343 | { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 344 | if (ec.value() != EBADR) |
| 345 | { |
| 346 | BMCWEB_LOG_ERROR("DBUS response error for State"); |
| 347 | messages::internalError(asyncResp->res); |
| 348 | } |
| 349 | return; |
Lakshmi Yadlapati | c6bb328 | 2023-04-12 16:56:49 -0500 | [diff] [blame] | 350 | } |
Lakshmi Yadlapati | c6bb328 | 2023-04-12 16:56:49 -0500 | [diff] [blame] | 351 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 352 | if (!value) |
| 353 | { |
| 354 | asyncResp->res.jsonValue["Status"]["State"] = |
| 355 | resource::State::Absent; |
| 356 | } |
| 357 | }); |
Lakshmi Yadlapati | c6bb328 | 2023-04-12 16:56:49 -0500 | [diff] [blame] | 358 | } |
| 359 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 360 | inline void getPCIeDeviceAsset( |
| 361 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 362 | const std::string& pcieDevicePath, const std::string& service) |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 363 | { |
Ed Tanous | deae6a7 | 2024-11-11 21:58:57 -0800 | [diff] [blame] | 364 | dbus::utility::getAllProperties( |
| 365 | service, pcieDevicePath, |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 366 | "xyz.openbmc_project.Inventory.Decorator.Asset", |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 367 | [pcieDevicePath, asyncResp{asyncResp}]( |
| 368 | const boost::system::error_code& ec, |
| 369 | const dbus::utility::DBusPropertiesMap& assetList) { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 370 | if (ec) |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 371 | { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 372 | if (ec.value() != EBADR) |
| 373 | { |
| 374 | BMCWEB_LOG_ERROR("DBUS response error for Properties{}", |
| 375 | ec.value()); |
| 376 | messages::internalError(asyncResp->res); |
| 377 | } |
| 378 | return; |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 379 | } |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 380 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 381 | const std::string* manufacturer = nullptr; |
| 382 | const std::string* model = nullptr; |
| 383 | const std::string* partNumber = nullptr; |
| 384 | const std::string* serialNumber = nullptr; |
| 385 | const std::string* sparePartNumber = nullptr; |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 386 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 387 | const bool success = sdbusplus::unpackPropertiesNoThrow( |
| 388 | dbus_utils::UnpackErrorPrinter(), assetList, "Manufacturer", |
| 389 | manufacturer, "Model", model, "PartNumber", partNumber, |
| 390 | "SerialNumber", serialNumber, "SparePartNumber", |
| 391 | sparePartNumber); |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 392 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 393 | if (!success) |
| 394 | { |
| 395 | messages::internalError(asyncResp->res); |
| 396 | return; |
| 397 | } |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 398 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 399 | if (manufacturer != nullptr) |
| 400 | { |
| 401 | asyncResp->res.jsonValue["Manufacturer"] = *manufacturer; |
| 402 | } |
| 403 | if (model != nullptr) |
| 404 | { |
| 405 | asyncResp->res.jsonValue["Model"] = *model; |
| 406 | } |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 407 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 408 | if (partNumber != nullptr) |
| 409 | { |
| 410 | asyncResp->res.jsonValue["PartNumber"] = *partNumber; |
| 411 | } |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 412 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 413 | if (serialNumber != nullptr) |
| 414 | { |
| 415 | asyncResp->res.jsonValue["SerialNumber"] = *serialNumber; |
| 416 | } |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 417 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 418 | if (sparePartNumber != nullptr && !sparePartNumber->empty()) |
| 419 | { |
| 420 | asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber; |
| 421 | } |
| 422 | }); |
SunnySrivastava1984 | 913e773 | 2021-01-27 06:23:24 -0600 | [diff] [blame] | 423 | } |
| 424 | |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 425 | inline void addPCIeDeviceProperties( |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 426 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 427 | const std::string& pcieDeviceId, |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 428 | const dbus::utility::DBusPropertiesMap& pcieDevProperties) |
| 429 | { |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 430 | const std::string* generationInUse = nullptr; |
Konstantin Aladyshev | 814bf20 | 2023-07-04 16:30:10 +0300 | [diff] [blame] | 431 | const std::string* generationSupported = nullptr; |
Konstantin Aladyshev | 9bb0a7f | 2023-07-04 12:59:34 +0300 | [diff] [blame] | 432 | const size_t* lanesInUse = nullptr; |
Konstantin Aladyshev | 814bf20 | 2023-07-04 16:30:10 +0300 | [diff] [blame] | 433 | const size_t* maxLanes = nullptr; |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 434 | |
| 435 | const bool success = sdbusplus::unpackPropertiesNoThrow( |
Ed Tanous | 609ba4c | 2023-07-11 09:14:24 -0700 | [diff] [blame] | 436 | dbus_utils::UnpackErrorPrinter(), pcieDevProperties, "GenerationInUse", |
| 437 | generationInUse, "GenerationSupported", generationSupported, |
| 438 | "LanesInUse", lanesInUse, "MaxLanes", maxLanes); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 439 | |
| 440 | if (!success) |
| 441 | { |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 442 | messages::internalError(asyncResp->res); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 443 | return; |
| 444 | } |
| 445 | |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 446 | if (generationInUse != nullptr) |
| 447 | { |
| 448 | std::optional<pcie_device::PCIeTypes> redfishGenerationInUse = |
Lakshmi Yadlapati | c49c329 | 2023-04-19 16:42:35 -0500 | [diff] [blame] | 449 | pcie_util::redfishPcieGenerationFromDbus(*generationInUse); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 450 | |
| 451 | if (!redfishGenerationInUse) |
| 452 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 453 | BMCWEB_LOG_WARNING("Unknown PCIe Device Generation: {}", |
| 454 | *generationInUse); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 455 | } |
Lakshmi Yadlapati | cf3b484 | 2023-06-27 02:36:53 -0500 | [diff] [blame] | 456 | else |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 457 | { |
Lakshmi Yadlapati | cf3b484 | 2023-06-27 02:36:53 -0500 | [diff] [blame] | 458 | if (*redfishGenerationInUse == pcie_device::PCIeTypes::Invalid) |
| 459 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 460 | BMCWEB_LOG_ERROR("Invalid PCIe Device Generation: {}", |
| 461 | *generationInUse); |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 462 | messages::internalError(asyncResp->res); |
Lakshmi Yadlapati | cf3b484 | 2023-06-27 02:36:53 -0500 | [diff] [blame] | 463 | return; |
| 464 | } |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 465 | asyncResp->res.jsonValue["PCIeInterface"]["PCIeType"] = |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 466 | *redfishGenerationInUse; |
| 467 | } |
| 468 | } |
| 469 | |
Konstantin Aladyshev | 814bf20 | 2023-07-04 16:30:10 +0300 | [diff] [blame] | 470 | if (generationSupported != nullptr) |
| 471 | { |
| 472 | std::optional<pcie_device::PCIeTypes> redfishGenerationSupported = |
| 473 | pcie_util::redfishPcieGenerationFromDbus(*generationSupported); |
| 474 | |
| 475 | if (!redfishGenerationSupported) |
| 476 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 477 | BMCWEB_LOG_WARNING("Unknown PCIe Device Generation: {}", |
| 478 | *generationSupported); |
Konstantin Aladyshev | 814bf20 | 2023-07-04 16:30:10 +0300 | [diff] [blame] | 479 | } |
| 480 | else |
| 481 | { |
| 482 | if (*redfishGenerationSupported == pcie_device::PCIeTypes::Invalid) |
| 483 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 484 | BMCWEB_LOG_ERROR("Invalid PCIe Device Generation: {}", |
| 485 | *generationSupported); |
Konstantin Aladyshev | 814bf20 | 2023-07-04 16:30:10 +0300 | [diff] [blame] | 486 | messages::internalError(asyncResp->res); |
| 487 | return; |
| 488 | } |
| 489 | asyncResp->res.jsonValue["PCIeInterface"]["MaxPCIeType"] = |
| 490 | *redfishGenerationSupported; |
| 491 | } |
| 492 | } |
| 493 | |
Myung Bae | 8c1d054 | 2024-03-12 17:50:48 -0500 | [diff] [blame] | 494 | if (lanesInUse != nullptr) |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 495 | { |
Myung Bae | 8c1d054 | 2024-03-12 17:50:48 -0500 | [diff] [blame] | 496 | if (*lanesInUse == std::numeric_limits<size_t>::max()) |
| 497 | { |
| 498 | // The default value of LanesInUse is "maxint", and the field will |
| 499 | // be null if it is a default value. |
| 500 | asyncResp->res.jsonValue["PCIeInterface"]["LanesInUse"] = nullptr; |
| 501 | } |
| 502 | else |
| 503 | { |
| 504 | asyncResp->res.jsonValue["PCIeInterface"]["LanesInUse"] = |
| 505 | *lanesInUse; |
| 506 | } |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 507 | } |
Konstantin Aladyshev | 814bf20 | 2023-07-04 16:30:10 +0300 | [diff] [blame] | 508 | // The default value of MaxLanes is 0, and the field will be |
| 509 | // left as off if it is a default value. |
| 510 | if (maxLanes != nullptr && *maxLanes != 0) |
| 511 | { |
| 512 | asyncResp->res.jsonValue["PCIeInterface"]["MaxLanes"] = *maxLanes; |
| 513 | } |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 514 | |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 515 | asyncResp->res.jsonValue["PCIeFunctions"]["@odata.id"] = |
| 516 | boost::urls::format( |
Ed Tanous | 253f11b | 2024-05-16 09:38:31 -0700 | [diff] [blame] | 517 | "/redfish/v1/Systems/{}/PCIeDevices/{}/PCIeFunctions", |
| 518 | BMCWEB_REDFISH_SYSTEM_URI_NAME, pcieDeviceId); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 519 | } |
| 520 | |
| 521 | inline void getPCIeDeviceProperties( |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 522 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 523 | const std::string& pcieDevicePath, const std::string& service, |
| 524 | const std::function<void( |
| 525 | const dbus::utility::DBusPropertiesMap& pcieDevProperties)>&& callback) |
| 526 | { |
Ed Tanous | deae6a7 | 2024-11-11 21:58:57 -0800 | [diff] [blame] | 527 | dbus::utility::getAllProperties( |
| 528 | service, pcieDevicePath, |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 529 | "xyz.openbmc_project.Inventory.Item.PCIeDevice", |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 530 | [asyncResp, |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 531 | callback](const boost::system::error_code& ec, |
| 532 | const dbus::utility::DBusPropertiesMap& pcieDevProperties) { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 533 | if (ec) |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 534 | { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 535 | if (ec.value() != EBADR) |
| 536 | { |
| 537 | BMCWEB_LOG_ERROR("DBUS response error for Properties"); |
| 538 | messages::internalError(asyncResp->res); |
| 539 | } |
| 540 | return; |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 541 | } |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 542 | callback(pcieDevProperties); |
| 543 | }); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 544 | } |
| 545 | |
| 546 | inline void addPCIeDeviceCommonProperties( |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 547 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 548 | const std::string& pcieDeviceId) |
| 549 | { |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 550 | asyncResp->res.addHeader( |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 551 | boost::beast::http::field::link, |
| 552 | "</redfish/v1/JsonSchemas/PCIeDevice/PCIeDevice.json>; rel=describedby"); |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 553 | asyncResp->res.jsonValue["@odata.type"] = "#PCIeDevice.v1_9_0.PCIeDevice"; |
Ed Tanous | 253f11b | 2024-05-16 09:38:31 -0700 | [diff] [blame] | 554 | asyncResp->res.jsonValue["@odata.id"] = |
| 555 | boost::urls::format("/redfish/v1/Systems/{}/PCIeDevices/{}", |
| 556 | BMCWEB_REDFISH_SYSTEM_URI_NAME, pcieDeviceId); |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 557 | asyncResp->res.jsonValue["Name"] = "PCIe Device"; |
| 558 | asyncResp->res.jsonValue["Id"] = pcieDeviceId; |
Ed Tanous | 539d8c6 | 2024-06-19 14:38:27 -0700 | [diff] [blame] | 559 | asyncResp->res.jsonValue["Status"]["State"] = resource::State::Enabled; |
| 560 | asyncResp->res.jsonValue["Status"]["Health"] = resource::Health::OK; |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 561 | } |
| 562 | |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 563 | inline void afterGetValidPcieDevicePath( |
| 564 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 565 | const std::string& pcieDeviceId, const std::string& pcieDevicePath, |
| 566 | const std::string& service) |
| 567 | { |
| 568 | addPCIeDeviceCommonProperties(asyncResp, pcieDeviceId); |
| 569 | getPCIeDeviceAsset(asyncResp, pcieDevicePath, service); |
| 570 | getPCIeDeviceState(asyncResp, pcieDevicePath, service); |
| 571 | getPCIeDeviceHealth(asyncResp, pcieDevicePath, service); |
| 572 | getPCIeDeviceProperties( |
| 573 | asyncResp, pcieDevicePath, service, |
| 574 | std::bind_front(addPCIeDeviceProperties, asyncResp, pcieDeviceId)); |
| 575 | getPCIeDeviceSlotPath( |
| 576 | pcieDevicePath, asyncResp, |
| 577 | std::bind_front(afterGetPCIeDeviceSlotPath, asyncResp)); |
| 578 | } |
| 579 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 580 | inline void handlePCIeDeviceGet( |
| 581 | App& app, const crow::Request& req, |
| 582 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 583 | const std::string& systemName, const std::string& pcieDeviceId) |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 584 | { |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 585 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 586 | { |
| 587 | return; |
| 588 | } |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 589 | if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM) |
Ed Tanous | 7f3e84a | 2022-12-28 16:22:54 -0800 | [diff] [blame] | 590 | { |
| 591 | // Option currently returns no systems. TBD |
| 592 | messages::resourceNotFound(asyncResp->res, "ComputerSystem", |
| 593 | systemName); |
| 594 | return; |
| 595 | } |
Ed Tanous | 253f11b | 2024-05-16 09:38:31 -0700 | [diff] [blame] | 596 | if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME) |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 597 | { |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 598 | messages::resourceNotFound(asyncResp->res, "ComputerSystem", |
| 599 | systemName); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 600 | return; |
| 601 | } |
| 602 | |
| 603 | getValidPCIeDevicePath( |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 604 | pcieDeviceId, asyncResp, |
Lakshmi Yadlapati | a540999 | 2023-04-20 16:53:59 -0500 | [diff] [blame] | 605 | std::bind_front(afterGetValidPcieDevicePath, asyncResp, pcieDeviceId)); |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 606 | } |
| 607 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 608 | inline void requestRoutesSystemPCIeDevice(App& app) |
Jason M. Bills | f5c9f8b | 2018-12-18 16:51:18 -0800 | [diff] [blame] | 609 | { |
Ed Tanous | 22d268c | 2022-05-19 09:39:07 -0700 | [diff] [blame] | 610 | BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/PCIeDevices/<str>/") |
Ed Tanous | ed39821 | 2021-06-09 17:05:54 -0700 | [diff] [blame] | 611 | .privileges(redfish::privileges::getPCIeDevice) |
Ed Tanous | 002d39b | 2022-05-31 08:59:27 -0700 | [diff] [blame] | 612 | .methods(boost::beast::http::verb::get)( |
Lakshmi Yadlapati | 543f9a7 | 2023-03-10 17:06:05 -0600 | [diff] [blame] | 613 | std::bind_front(handlePCIeDeviceGet, std::ref(app))); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 614 | } |
| 615 | |
Lakshmi Yadlapati | 35ad613 | 2023-03-10 22:31:49 -0600 | [diff] [blame] | 616 | inline void addPCIeFunctionList( |
| 617 | crow::Response& res, const std::string& pcieDeviceId, |
| 618 | const dbus::utility::DBusPropertiesMap& pcieDevProperties) |
| 619 | { |
| 620 | nlohmann::json& pcieFunctionList = res.jsonValue["Members"]; |
| 621 | pcieFunctionList = nlohmann::json::array(); |
| 622 | static constexpr const int maxPciFunctionNum = 8; |
| 623 | |
| 624 | for (int functionNum = 0; functionNum < maxPciFunctionNum; functionNum++) |
| 625 | { |
| 626 | // Check if this function exists by |
| 627 | // looking for a device ID |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 628 | std::string devIDProperty = |
| 629 | "Function" + std::to_string(functionNum) + "DeviceId"; |
Lakshmi Yadlapati | 35ad613 | 2023-03-10 22:31:49 -0600 | [diff] [blame] | 630 | const std::string* property = nullptr; |
| 631 | for (const auto& propEntry : pcieDevProperties) |
| 632 | { |
| 633 | if (propEntry.first == devIDProperty) |
| 634 | { |
| 635 | property = std::get_if<std::string>(&propEntry.second); |
| 636 | break; |
| 637 | } |
| 638 | } |
| 639 | if (property == nullptr || property->empty()) |
| 640 | { |
| 641 | continue; |
| 642 | } |
| 643 | |
| 644 | nlohmann::json::object_t pcieFunction; |
Ed Tanous | ef4c65b | 2023-04-24 15:28:50 -0700 | [diff] [blame] | 645 | pcieFunction["@odata.id"] = boost::urls::format( |
Ed Tanous | 253f11b | 2024-05-16 09:38:31 -0700 | [diff] [blame] | 646 | "/redfish/v1/Systems/{}/PCIeDevices/{}/PCIeFunctions/{}", |
| 647 | BMCWEB_REDFISH_SYSTEM_URI_NAME, pcieDeviceId, |
| 648 | std::to_string(functionNum)); |
Patrick Williams | b2ba307 | 2023-05-12 10:27:39 -0500 | [diff] [blame] | 649 | pcieFunctionList.emplace_back(std::move(pcieFunction)); |
Lakshmi Yadlapati | 35ad613 | 2023-03-10 22:31:49 -0600 | [diff] [blame] | 650 | } |
| 651 | res.jsonValue["PCIeFunctions@odata.count"] = pcieFunctionList.size(); |
| 652 | } |
| 653 | |
| 654 | inline void handlePCIeFunctionCollectionGet( |
| 655 | App& app, const crow::Request& req, |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 656 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
Ed Tanous | 7f3e84a | 2022-12-28 16:22:54 -0800 | [diff] [blame] | 657 | const std::string& systemName, const std::string& pcieDeviceId) |
Lakshmi Yadlapati | 35ad613 | 2023-03-10 22:31:49 -0600 | [diff] [blame] | 658 | { |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 659 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Lakshmi Yadlapati | 35ad613 | 2023-03-10 22:31:49 -0600 | [diff] [blame] | 660 | { |
| 661 | return; |
| 662 | } |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 663 | if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM) |
Ed Tanous | 7f3e84a | 2022-12-28 16:22:54 -0800 | [diff] [blame] | 664 | { |
| 665 | // Option currently returns no systems. TBD |
| 666 | messages::resourceNotFound(asyncResp->res, "ComputerSystem", |
| 667 | systemName); |
| 668 | return; |
| 669 | } |
Lakshmi Yadlapati | 35ad613 | 2023-03-10 22:31:49 -0600 | [diff] [blame] | 670 | |
| 671 | getValidPCIeDevicePath( |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 672 | pcieDeviceId, asyncResp, |
| 673 | [asyncResp, pcieDeviceId](const std::string& pcieDevicePath, |
| 674 | const std::string& service) { |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 675 | asyncResp->res.addHeader( |
| 676 | boost::beast::http::field::link, |
| 677 | "</redfish/v1/JsonSchemas/PCIeFunctionCollection/PCIeFunctionCollection.json>; rel=describedby"); |
| 678 | asyncResp->res.jsonValue["@odata.type"] = |
| 679 | "#PCIeFunctionCollection.PCIeFunctionCollection"; |
| 680 | asyncResp->res.jsonValue["@odata.id"] = boost::urls::format( |
| 681 | "/redfish/v1/Systems/{}/PCIeDevices/{}/PCIeFunctions", |
| 682 | BMCWEB_REDFISH_SYSTEM_URI_NAME, pcieDeviceId); |
| 683 | asyncResp->res.jsonValue["Name"] = "PCIe Function Collection"; |
| 684 | asyncResp->res.jsonValue["Description"] = |
| 685 | "Collection of PCIe Functions for PCIe Device " + pcieDeviceId; |
| 686 | getPCIeDeviceProperties( |
| 687 | asyncResp, pcieDevicePath, service, |
| 688 | [asyncResp, pcieDeviceId]( |
| 689 | const dbus::utility::DBusPropertiesMap& pcieDevProperties) { |
| 690 | addPCIeFunctionList(asyncResp->res, pcieDeviceId, |
| 691 | pcieDevProperties); |
| 692 | }); |
Lakshmi Yadlapati | 35ad613 | 2023-03-10 22:31:49 -0600 | [diff] [blame] | 693 | }); |
| 694 | } |
| 695 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 696 | inline void requestRoutesSystemPCIeFunctionCollection(App& app) |
| 697 | { |
| 698 | /** |
| 699 | * Functions triggers appropriate requests on DBus |
| 700 | */ |
| 701 | BMCWEB_ROUTE(app, |
Ed Tanous | 7f3e84a | 2022-12-28 16:22:54 -0800 | [diff] [blame] | 702 | "/redfish/v1/Systems/<str>/PCIeDevices/<str>/PCIeFunctions/") |
Ed Tanous | ed39821 | 2021-06-09 17:05:54 -0700 | [diff] [blame] | 703 | .privileges(redfish::privileges::getPCIeFunctionCollection) |
Ed Tanous | 002d39b | 2022-05-31 08:59:27 -0700 | [diff] [blame] | 704 | .methods(boost::beast::http::verb::get)( |
Lakshmi Yadlapati | 35ad613 | 2023-03-10 22:31:49 -0600 | [diff] [blame] | 705 | std::bind_front(handlePCIeFunctionCollectionGet, std::ref(app))); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 706 | } |
| 707 | |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 708 | inline bool validatePCIeFunctionId( |
Myung Bae | d5e74b8 | 2023-05-31 11:28:02 -0500 | [diff] [blame] | 709 | uint64_t pcieFunctionId, |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 710 | const dbus::utility::DBusPropertiesMap& pcieDevProperties) |
| 711 | { |
Myung Bae | d5e74b8 | 2023-05-31 11:28:02 -0500 | [diff] [blame] | 712 | std::string functionName = "Function" + std::to_string(pcieFunctionId); |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 713 | std::string devIDProperty = functionName + "DeviceId"; |
| 714 | |
| 715 | const std::string* devIdProperty = nullptr; |
| 716 | for (const auto& property : pcieDevProperties) |
| 717 | { |
| 718 | if (property.first == devIDProperty) |
| 719 | { |
| 720 | devIdProperty = std::get_if<std::string>(&property.second); |
| 721 | break; |
| 722 | } |
| 723 | } |
| 724 | return (devIdProperty != nullptr && !devIdProperty->empty()); |
| 725 | } |
| 726 | |
| 727 | inline void addPCIeFunctionProperties( |
Ed Tanous | e14742c | 2023-05-31 10:27:49 -0700 | [diff] [blame] | 728 | crow::Response& resp, uint64_t pcieFunctionId, |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 729 | const dbus::utility::DBusPropertiesMap& pcieDevProperties) |
| 730 | { |
Ed Tanous | e14742c | 2023-05-31 10:27:49 -0700 | [diff] [blame] | 731 | std::string functionName = "Function" + std::to_string(pcieFunctionId); |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 732 | for (const auto& property : pcieDevProperties) |
| 733 | { |
| 734 | const std::string* strProperty = |
| 735 | std::get_if<std::string>(&property.second); |
Ed Tanous | dc8cfa6 | 2024-04-07 13:37:25 -0700 | [diff] [blame] | 736 | if (strProperty == nullptr) |
| 737 | { |
Ed Tanous | dc8cfa6 | 2024-04-07 13:37:25 -0700 | [diff] [blame] | 738 | continue; |
| 739 | } |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 740 | if (property.first == functionName + "DeviceId") |
| 741 | { |
| 742 | resp.jsonValue["DeviceId"] = *strProperty; |
| 743 | } |
| 744 | if (property.first == functionName + "VendorId") |
| 745 | { |
| 746 | resp.jsonValue["VendorId"] = *strProperty; |
| 747 | } |
| 748 | // TODO: FunctionType and DeviceClass are Redfish enums. The D-Bus |
| 749 | // property strings should be mapped correctly to ensure these |
| 750 | // strings are Redfish enum values. For now just check for empty. |
| 751 | if (property.first == functionName + "FunctionType") |
| 752 | { |
| 753 | if (!strProperty->empty()) |
| 754 | { |
| 755 | resp.jsonValue["FunctionType"] = *strProperty; |
| 756 | } |
| 757 | } |
| 758 | if (property.first == functionName + "DeviceClass") |
| 759 | { |
| 760 | if (!strProperty->empty()) |
| 761 | { |
| 762 | resp.jsonValue["DeviceClass"] = *strProperty; |
| 763 | } |
| 764 | } |
| 765 | if (property.first == functionName + "ClassCode") |
| 766 | { |
| 767 | resp.jsonValue["ClassCode"] = *strProperty; |
| 768 | } |
| 769 | if (property.first == functionName + "RevisionId") |
| 770 | { |
| 771 | resp.jsonValue["RevisionId"] = *strProperty; |
| 772 | } |
| 773 | if (property.first == functionName + "SubsystemId") |
| 774 | { |
| 775 | resp.jsonValue["SubsystemId"] = *strProperty; |
| 776 | } |
| 777 | if (property.first == functionName + "SubsystemVendorId") |
| 778 | { |
| 779 | resp.jsonValue["SubsystemVendorId"] = *strProperty; |
| 780 | } |
| 781 | } |
| 782 | } |
| 783 | |
| 784 | inline void addPCIeFunctionCommonProperties(crow::Response& resp, |
| 785 | const std::string& pcieDeviceId, |
Ed Tanous | e14742c | 2023-05-31 10:27:49 -0700 | [diff] [blame] | 786 | uint64_t pcieFunctionId) |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 787 | { |
| 788 | resp.addHeader( |
| 789 | boost::beast::http::field::link, |
| 790 | "</redfish/v1/JsonSchemas/PCIeFunction/PCIeFunction.json>; rel=describedby"); |
| 791 | resp.jsonValue["@odata.type"] = "#PCIeFunction.v1_2_3.PCIeFunction"; |
Ed Tanous | ef4c65b | 2023-04-24 15:28:50 -0700 | [diff] [blame] | 792 | resp.jsonValue["@odata.id"] = boost::urls::format( |
Ed Tanous | 253f11b | 2024-05-16 09:38:31 -0700 | [diff] [blame] | 793 | "/redfish/v1/Systems/{}/PCIeDevices/{}/PCIeFunctions/{}", |
| 794 | BMCWEB_REDFISH_SYSTEM_URI_NAME, pcieDeviceId, |
| 795 | std::to_string(pcieFunctionId)); |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 796 | resp.jsonValue["Name"] = "PCIe Function"; |
Ed Tanous | e14742c | 2023-05-31 10:27:49 -0700 | [diff] [blame] | 797 | resp.jsonValue["Id"] = std::to_string(pcieFunctionId); |
| 798 | resp.jsonValue["FunctionId"] = pcieFunctionId; |
Ed Tanous | 253f11b | 2024-05-16 09:38:31 -0700 | [diff] [blame] | 799 | resp.jsonValue["Links"]["PCIeDevice"]["@odata.id"] = |
| 800 | boost::urls::format("/redfish/v1/Systems/{}/PCIeDevices/{}", |
| 801 | BMCWEB_REDFISH_SYSTEM_URI_NAME, pcieDeviceId); |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 802 | } |
| 803 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 804 | inline void handlePCIeFunctionGet( |
| 805 | App& app, const crow::Request& req, |
| 806 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 807 | const std::string& systemName, const std::string& pcieDeviceId, |
| 808 | const std::string& pcieFunctionIdStr) |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 809 | { |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 810 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 811 | { |
| 812 | return; |
| 813 | } |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 814 | if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM) |
Ed Tanous | 7f3e84a | 2022-12-28 16:22:54 -0800 | [diff] [blame] | 815 | { |
| 816 | // Option currently returns no systems. TBD |
| 817 | messages::resourceNotFound(asyncResp->res, "ComputerSystem", |
| 818 | systemName); |
| 819 | return; |
| 820 | } |
Ed Tanous | 253f11b | 2024-05-16 09:38:31 -0700 | [diff] [blame] | 821 | if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME) |
Ed Tanous | 7f3e84a | 2022-12-28 16:22:54 -0800 | [diff] [blame] | 822 | { |
| 823 | messages::resourceNotFound(asyncResp->res, "ComputerSystem", |
| 824 | systemName); |
| 825 | return; |
| 826 | } |
Ed Tanous | dc8cfa6 | 2024-04-07 13:37:25 -0700 | [diff] [blame] | 827 | std::string_view pcieFunctionIdView = pcieFunctionIdStr; |
Ed Tanous | 7f3e84a | 2022-12-28 16:22:54 -0800 | [diff] [blame] | 828 | |
Ed Tanous | e14742c | 2023-05-31 10:27:49 -0700 | [diff] [blame] | 829 | uint64_t pcieFunctionId = 0; |
| 830 | std::from_chars_result result = std::from_chars( |
Ed Tanous | dc8cfa6 | 2024-04-07 13:37:25 -0700 | [diff] [blame] | 831 | pcieFunctionIdView.begin(), pcieFunctionIdView.end(), pcieFunctionId); |
| 832 | if (result.ec != std::errc{} || result.ptr != pcieFunctionIdView.end()) |
Ed Tanous | e14742c | 2023-05-31 10:27:49 -0700 | [diff] [blame] | 833 | { |
Ed Tanous | ac106bf | 2023-06-07 09:24:59 -0700 | [diff] [blame] | 834 | messages::resourceNotFound(asyncResp->res, "PCIeFunction", |
Ed Tanous | e14742c | 2023-05-31 10:27:49 -0700 | [diff] [blame] | 835 | pcieFunctionIdStr); |
| 836 | return; |
| 837 | } |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 838 | |
Patrick Williams | bd79bce | 2024-08-16 15:22:20 -0400 | [diff] [blame] | 839 | getValidPCIeDevicePath( |
| 840 | pcieDeviceId, asyncResp, |
| 841 | [asyncResp, pcieDeviceId, pcieFunctionId]( |
| 842 | const std::string& pcieDevicePath, const std::string& service) { |
| 843 | getPCIeDeviceProperties( |
| 844 | asyncResp, pcieDevicePath, service, |
| 845 | [asyncResp, pcieDeviceId, pcieFunctionId]( |
| 846 | const dbus::utility::DBusPropertiesMap& pcieDevProperties) { |
| 847 | addPCIeFunctionCommonProperties( |
| 848 | asyncResp->res, pcieDeviceId, pcieFunctionId); |
| 849 | addPCIeFunctionProperties(asyncResp->res, pcieFunctionId, |
| 850 | pcieDevProperties); |
| 851 | }); |
Patrick Williams | 5a39f77 | 2023-10-20 11:20:21 -0500 | [diff] [blame] | 852 | }); |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 853 | } |
| 854 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 855 | inline void requestRoutesSystemPCIeFunction(App& app) |
| 856 | { |
| 857 | BMCWEB_ROUTE( |
Ed Tanous | 7f3e84a | 2022-12-28 16:22:54 -0800 | [diff] [blame] | 858 | app, "/redfish/v1/Systems/<str>/PCIeDevices/<str>/PCIeFunctions/<str>/") |
Ed Tanous | ed39821 | 2021-06-09 17:05:54 -0700 | [diff] [blame] | 859 | .privileges(redfish::privileges::getPCIeFunction) |
Ed Tanous | 002d39b | 2022-05-31 08:59:27 -0700 | [diff] [blame] | 860 | .methods(boost::beast::http::verb::get)( |
Lakshmi Yadlapati | 727a046 | 2023-03-10 23:49:00 -0600 | [diff] [blame] | 861 | std::bind_front(handlePCIeFunctionGet, std::ref(app))); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 862 | } |
Jason M. Bills | f5c9f8b | 2018-12-18 16:51:18 -0800 | [diff] [blame] | 863 | |
| 864 | } // namespace redfish |