blob: 1e196632abecd5f470565317d66d5c19b33d6222 [file] [log] [blame]
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -08001/*
2// Copyright (c) 2018 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16
17#pragma once
18
George Liu7a1dbc42022-12-07 16:03:22 +080019#include "dbus_utility.hpp"
Ed Tanous0ec8b832022-03-14 14:56:47 -070020#include "generated/enums/pcie_device.hpp"
21
John Edward Broadbent7e860f12021-04-08 15:57:16 -070022#include <app.hpp>
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080023#include <boost/system/linux_error.hpp>
Ed Tanous168e20c2021-12-13 14:39:53 -080024#include <dbus_utility.hpp>
Ed Tanous45ca1b82022-03-25 13:07:27 -070025#include <query.hpp>
Ed Tanoused398212021-06-09 17:05:54 -070026#include <registries/privilege_registry.hpp>
Krzysztof Grobelnyd1bde9e2022-09-07 10:40:51 +020027#include <sdbusplus/asio/property.hpp>
28#include <sdbusplus/unpack_properties.hpp>
29#include <utils/dbus_utils.hpp>
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080030
31namespace redfish
32{
33
Gunnar Mills1214b7e2020-06-04 10:11:30 -050034static constexpr char const* pcieService = "xyz.openbmc_project.PCIe";
35static constexpr char const* pciePath = "/xyz/openbmc_project/PCIe";
36static constexpr char const* pcieDeviceInterface =
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080037 "xyz.openbmc_project.PCIe.Device";
38
Ed Tanousb5a76932020-09-29 16:16:58 -070039static inline void
zhanghch058d1b46d2021-04-01 11:18:24 +080040 getPCIeDeviceList(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Ed Tanousb5a76932020-09-29 16:16:58 -070041 const std::string& name)
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080042{
George Liu7a1dbc42022-12-07 16:03:22 +080043 dbus::utility::getSubTreePaths(
44 pciePath, 1, {},
45 [asyncResp, name](const boost::system::error_code& ec,
Ed Tanousb9d36b42022-02-26 21:42:46 -080046 const dbus::utility::MapperGetSubTreePathsResponse&
47 pcieDevicePaths) {
Ed Tanous002d39b2022-05-31 08:59:27 -070048 if (ec)
49 {
50 BMCWEB_LOG_DEBUG << "no PCIe device paths found ec: "
51 << ec.message();
52 // Not an error, system just doesn't have PCIe info
53 return;
54 }
55 nlohmann::json& pcieDeviceList = asyncResp->res.jsonValue[name];
56 pcieDeviceList = nlohmann::json::array();
57 for (const std::string& pcieDevicePath : pcieDevicePaths)
58 {
59 size_t devStart = pcieDevicePath.rfind('/');
60 if (devStart == std::string::npos)
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080061 {
Ed Tanous002d39b2022-05-31 08:59:27 -070062 continue;
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080063 }
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080064
Ed Tanous002d39b2022-05-31 08:59:27 -070065 std::string devName = pcieDevicePath.substr(devStart + 1);
66 if (devName.empty())
67 {
68 continue;
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080069 }
Ed Tanous002d39b2022-05-31 08:59:27 -070070 nlohmann::json::object_t pcieDevice;
71 pcieDevice["@odata.id"] =
72 "/redfish/v1/Systems/system/PCIeDevices/" + devName;
73 pcieDeviceList.push_back(std::move(pcieDevice));
74 }
75 asyncResp->res.jsonValue[name + "@odata.count"] = pcieDeviceList.size();
George Liu7a1dbc42022-12-07 16:03:22 +080076 });
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080077}
78
John Edward Broadbent7e860f12021-04-08 15:57:16 -070079inline void requestRoutesSystemPCIeDeviceCollection(App& app)
Jason M. Billsadbe1922019-10-14 15:44:35 -070080{
Jason M. Billsadbe1922019-10-14 15:44:35 -070081 /**
82 * Functions triggers appropriate requests on DBus
83 */
Ed Tanous22d268c2022-05-19 09:39:07 -070084 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/PCIeDevices/")
Ed Tanoused398212021-06-09 17:05:54 -070085 .privileges(redfish::privileges::getPCIeDeviceCollection)
John Edward Broadbent7e860f12021-04-08 15:57:16 -070086 .methods(boost::beast::http::verb::get)(
Ed Tanous45ca1b82022-03-25 13:07:27 -070087 [&app](const crow::Request& req,
Ed Tanous22d268c2022-05-19 09:39:07 -070088 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
89 const std::string& systemName) {
Carson Labrado3ba00072022-06-06 19:40:56 +000090 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanous002d39b2022-05-31 08:59:27 -070091 {
92 return;
93 }
Ed Tanous22d268c2022-05-19 09:39:07 -070094 if (systemName != "system")
95 {
96 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
97 systemName);
98 return;
99 }
Ed Tanous14766872022-03-15 10:44:42 -0700100
Ed Tanous002d39b2022-05-31 08:59:27 -0700101 asyncResp->res.jsonValue["@odata.type"] =
102 "#PCIeDeviceCollection.PCIeDeviceCollection";
103 asyncResp->res.jsonValue["@odata.id"] =
104 "/redfish/v1/Systems/system/PCIeDevices";
105 asyncResp->res.jsonValue["Name"] = "PCIe Device Collection";
106 asyncResp->res.jsonValue["Description"] = "Collection of PCIe Devices";
107 asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
108 asyncResp->res.jsonValue["Members@odata.count"] = 0;
109 getPCIeDeviceList(asyncResp, "Members");
110 });
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700111}
112
Ed Tanous0ec8b832022-03-14 14:56:47 -0700113inline std::optional<pcie_device::PCIeTypes>
Spencer Ku62cd45a2021-11-22 16:41:25 +0800114 redfishPcieGenerationFromDbus(const std::string& generationInUse)
115{
116 if (generationInUse ==
117 "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Gen1")
118 {
Ed Tanous0ec8b832022-03-14 14:56:47 -0700119 return pcie_device::PCIeTypes::Gen1;
Spencer Ku62cd45a2021-11-22 16:41:25 +0800120 }
121 if (generationInUse ==
122 "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Gen2")
123 {
Ed Tanous0ec8b832022-03-14 14:56:47 -0700124 return pcie_device::PCIeTypes::Gen2;
Spencer Ku62cd45a2021-11-22 16:41:25 +0800125 }
126 if (generationInUse ==
127 "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Gen3")
128 {
Ed Tanous0ec8b832022-03-14 14:56:47 -0700129 return pcie_device::PCIeTypes::Gen3;
Spencer Ku62cd45a2021-11-22 16:41:25 +0800130 }
131 if (generationInUse ==
132 "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Gen4")
133 {
Ed Tanous0ec8b832022-03-14 14:56:47 -0700134 return pcie_device::PCIeTypes::Gen4;
Spencer Ku62cd45a2021-11-22 16:41:25 +0800135 }
136 if (generationInUse ==
137 "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Gen5")
138 {
Ed Tanous0ec8b832022-03-14 14:56:47 -0700139 return pcie_device::PCIeTypes::Gen5;
Spencer Ku62cd45a2021-11-22 16:41:25 +0800140 }
Ed Tanouse825cbc2022-06-17 11:39:22 -0700141 if (generationInUse.empty() ||
142 generationInUse ==
143 "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Unknown")
Spencer Ku62cd45a2021-11-22 16:41:25 +0800144 {
Ed Tanous0ec8b832022-03-14 14:56:47 -0700145 return pcie_device::PCIeTypes::Invalid;
Spencer Ku62cd45a2021-11-22 16:41:25 +0800146 }
147
148 // The value is not unknown or Gen1-5, need return an internal error.
149 return std::nullopt;
150}
151
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700152inline void requestRoutesSystemPCIeDevice(App& app)
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -0800153{
Ed Tanous22d268c2022-05-19 09:39:07 -0700154 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/PCIeDevices/<str>/")
Ed Tanoused398212021-06-09 17:05:54 -0700155 .privileges(redfish::privileges::getPCIeDevice)
Ed Tanous002d39b2022-05-31 08:59:27 -0700156 .methods(boost::beast::http::verb::get)(
157 [&app](const crow::Request& req,
158 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Ed Tanous22d268c2022-05-19 09:39:07 -0700159 const std::string& systemName, const std::string& device) {
Carson Labrado3ba00072022-06-06 19:40:56 +0000160 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanous002d39b2022-05-31 08:59:27 -0700161 {
162 return;
163 }
Ed Tanous22d268c2022-05-19 09:39:07 -0700164 if (systemName != "system")
165 {
166 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
167 systemName);
168 return;
169 }
170
Ed Tanous002d39b2022-05-31 08:59:27 -0700171 auto getPCIeDeviceCallback =
172 [asyncResp, device](
173 const boost::system::error_code ec,
174 const dbus::utility::DBusPropertiesMap& pcieDevProperties) {
175 if (ec)
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700176 {
Ed Tanous002d39b2022-05-31 08:59:27 -0700177 BMCWEB_LOG_DEBUG
178 << "failed to get PCIe Device properties ec: " << ec.value()
179 << ": " << ec.message();
180 if (ec.value() ==
181 boost::system::linux_error::bad_request_descriptor)
182 {
183 messages::resourceNotFound(asyncResp->res, "PCIeDevice",
184 device);
185 }
186 else
187 {
188 messages::internalError(asyncResp->res);
189 }
Ed Tanous45ca1b82022-03-25 13:07:27 -0700190 return;
191 }
Ed Tanous002d39b2022-05-31 08:59:27 -0700192
Krzysztof Grobelnyd1bde9e2022-09-07 10:40:51 +0200193 const std::string* manufacturer = nullptr;
194 const std::string* deviceType = nullptr;
195 const std::string* generationInUse = nullptr;
196
197 const bool success = sdbusplus::unpackPropertiesNoThrow(
198 dbus_utils::UnpackErrorPrinter(), pcieDevProperties,
199 "Manufacturer", manufacturer, "DeviceType", deviceType,
200 "GenerationInUse", generationInUse);
201
202 if (!success)
203 {
204 messages::internalError(asyncResp->res);
205 return;
206 }
207
208 if (generationInUse != nullptr)
209 {
Ed Tanous0ec8b832022-03-14 14:56:47 -0700210 std::optional<pcie_device::PCIeTypes> redfishGenerationInUse =
Krzysztof Grobelnyd1bde9e2022-09-07 10:40:51 +0200211 redfishPcieGenerationFromDbus(*generationInUse);
212 if (!redfishGenerationInUse)
213 {
214 messages::internalError(asyncResp->res);
215 return;
216 }
Ed Tanous0ec8b832022-03-14 14:56:47 -0700217 if (*redfishGenerationInUse != pcie_device::PCIeTypes::Invalid)
Krzysztof Grobelnyd1bde9e2022-09-07 10:40:51 +0200218 {
Tony Leea9f68bb2022-10-20 19:35:38 +0800219 asyncResp->res.jsonValue["PCIeInterface"]["PCIeType"] =
220 *redfishGenerationInUse;
Krzysztof Grobelnyd1bde9e2022-09-07 10:40:51 +0200221 }
Krzysztof Grobelnyd1bde9e2022-09-07 10:40:51 +0200222 }
223
224 if (manufacturer != nullptr)
225 {
226 asyncResp->res.jsonValue["Manufacturer"] = *manufacturer;
227 }
228
229 if (deviceType != nullptr)
230 {
231 asyncResp->res.jsonValue["DeviceType"] = *deviceType;
232 }
233
Ed Tanous002d39b2022-05-31 08:59:27 -0700234 asyncResp->res.jsonValue["@odata.type"] =
235 "#PCIeDevice.v1_4_0.PCIeDevice";
236 asyncResp->res.jsonValue["@odata.id"] =
237 "/redfish/v1/Systems/system/PCIeDevices/" + device;
238 asyncResp->res.jsonValue["Name"] = "PCIe Device";
239 asyncResp->res.jsonValue["Id"] = device;
240
241 asyncResp->res.jsonValue["PCIeFunctions"]["@odata.id"] =
242 "/redfish/v1/Systems/system/PCIeDevices/" + device +
243 "/PCIeFunctions";
Ed Tanous002d39b2022-05-31 08:59:27 -0700244 };
245 std::string escapedPath = std::string(pciePath) + "/" + device;
246 dbus::utility::escapePathForDbus(escapedPath);
Krzysztof Grobelnyd1bde9e2022-09-07 10:40:51 +0200247 sdbusplus::asio::getAllProperties(
248 *crow::connections::systemBus, pcieService, escapedPath,
249 pcieDeviceInterface, std::move(getPCIeDeviceCallback));
Ed Tanous45ca1b82022-03-25 13:07:27 -0700250 });
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700251}
252
253inline void requestRoutesSystemPCIeFunctionCollection(App& app)
254{
255 /**
256 * Functions triggers appropriate requests on DBus
257 */
258 BMCWEB_ROUTE(app,
259 "/redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions/")
Ed Tanoused398212021-06-09 17:05:54 -0700260 .privileges(redfish::privileges::getPCIeFunctionCollection)
Ed Tanous002d39b2022-05-31 08:59:27 -0700261 .methods(boost::beast::http::verb::get)(
262 [&app](const crow::Request& req,
263 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
264 const std::string& device) {
Carson Labrado3ba00072022-06-06 19:40:56 +0000265 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanous002d39b2022-05-31 08:59:27 -0700266 {
267 return;
268 }
269
270 asyncResp->res.jsonValue["@odata.type"] =
271 "#PCIeFunctionCollection.PCIeFunctionCollection";
272 asyncResp->res.jsonValue["@odata.id"] =
273 "/redfish/v1/Systems/system/PCIeDevices/" + device +
274 "/PCIeFunctions";
275 asyncResp->res.jsonValue["Name"] = "PCIe Function Collection";
276 asyncResp->res.jsonValue["Description"] =
277 "Collection of PCIe Functions for PCIe Device " + device;
278
279 auto getPCIeDeviceCallback =
280 [asyncResp, device](
281 const boost::system::error_code ec,
282 const dbus::utility::DBusPropertiesMap& pcieDevProperties) {
283 if (ec)
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700284 {
Ed Tanous002d39b2022-05-31 08:59:27 -0700285 BMCWEB_LOG_DEBUG
286 << "failed to get PCIe Device properties ec: " << ec.value()
287 << ": " << ec.message();
288 if (ec.value() ==
289 boost::system::linux_error::bad_request_descriptor)
290 {
291 messages::resourceNotFound(asyncResp->res, "PCIeDevice",
292 device);
293 }
294 else
295 {
296 messages::internalError(asyncResp->res);
297 }
Ed Tanous45ca1b82022-03-25 13:07:27 -0700298 return;
299 }
Ed Tanous14766872022-03-15 10:44:42 -0700300
Ed Tanous002d39b2022-05-31 08:59:27 -0700301 nlohmann::json& pcieFunctionList =
302 asyncResp->res.jsonValue["Members"];
303 pcieFunctionList = nlohmann::json::array();
304 static constexpr const int maxPciFunctionNum = 8;
305 for (int functionNum = 0; functionNum < maxPciFunctionNum;
306 functionNum++)
307 {
308 // Check if this function exists by looking for a
309 // device ID
310 std::string devIDProperty =
311 "Function" + std::to_string(functionNum) + "DeviceId";
312 const std::string* property = nullptr;
313 for (const auto& propEntry : pcieDevProperties)
314 {
315 if (propEntry.first == devIDProperty)
Ed Tanous45ca1b82022-03-25 13:07:27 -0700316 {
Ed Tanous002d39b2022-05-31 08:59:27 -0700317 property = std::get_if<std::string>(&propEntry.second);
Ed Tanous45ca1b82022-03-25 13:07:27 -0700318 }
Ed Tanous002d39b2022-05-31 08:59:27 -0700319 }
Nan Zhoufb0ecc32022-10-17 19:17:36 +0000320 if (property == nullptr || property->empty())
Ed Tanous002d39b2022-05-31 08:59:27 -0700321 {
Nan Zhoue28ce0e2022-10-13 22:28:36 +0000322 continue;
Ed Tanous002d39b2022-05-31 08:59:27 -0700323 }
324 nlohmann::json::object_t pcieFunction;
325 pcieFunction["@odata.id"] =
326 "/redfish/v1/Systems/system/PCIeDevices/" + device +
327 "/PCIeFunctions/" + std::to_string(functionNum);
328 pcieFunctionList.push_back(std::move(pcieFunction));
329 }
330 asyncResp->res.jsonValue["Members@odata.count"] =
331 pcieFunctionList.size();
332 };
333 std::string escapedPath = std::string(pciePath) + "/" + device;
334 dbus::utility::escapePathForDbus(escapedPath);
Krzysztof Grobelnyd1bde9e2022-09-07 10:40:51 +0200335 sdbusplus::asio::getAllProperties(
336 *crow::connections::systemBus, pcieService, escapedPath,
337 pcieDeviceInterface, std::move(getPCIeDeviceCallback));
Ed Tanous45ca1b82022-03-25 13:07:27 -0700338 });
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700339}
340
341inline void requestRoutesSystemPCIeFunction(App& app)
342{
343 BMCWEB_ROUTE(
344 app,
345 "/redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions/<str>/")
Ed Tanoused398212021-06-09 17:05:54 -0700346 .privileges(redfish::privileges::getPCIeFunction)
Ed Tanous002d39b2022-05-31 08:59:27 -0700347 .methods(boost::beast::http::verb::get)(
348 [&app](const crow::Request& req,
349 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
350 const std::string& device, const std::string& function) {
Carson Labrado3ba00072022-06-06 19:40:56 +0000351 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanous002d39b2022-05-31 08:59:27 -0700352 {
353 return;
354 }
355 auto getPCIeDeviceCallback =
356 [asyncResp, device, function](
357 const boost::system::error_code ec,
358 const dbus::utility::DBusPropertiesMap& pcieDevProperties) {
359 if (ec)
Ed Tanous45ca1b82022-03-25 13:07:27 -0700360 {
Ed Tanous002d39b2022-05-31 08:59:27 -0700361 BMCWEB_LOG_DEBUG
362 << "failed to get PCIe Device properties ec: " << ec.value()
363 << ": " << ec.message();
364 if (ec.value() ==
365 boost::system::linux_error::bad_request_descriptor)
366 {
367 messages::resourceNotFound(asyncResp->res, "PCIeDevice",
368 device);
369 }
370 else
371 {
372 messages::internalError(asyncResp->res);
373 }
Ed Tanous45ca1b82022-03-25 13:07:27 -0700374 return;
375 }
Ed Tanous168e20c2021-12-13 14:39:53 -0800376
Ed Tanous002d39b2022-05-31 08:59:27 -0700377 // Check if this function exists by looking for a device
378 // ID
379 std::string functionName = "Function" + function;
380 std::string devIDProperty = functionName + "DeviceId";
Ed Tanousb9d36b42022-02-26 21:42:46 -0800381
Ed Tanous002d39b2022-05-31 08:59:27 -0700382 const std::string* devIdProperty = nullptr;
383 for (const auto& property : pcieDevProperties)
384 {
385 if (property.first == devIDProperty)
386 {
387 devIdProperty = std::get_if<std::string>(&property.second);
388 continue;
389 }
390 }
Tony Lee973c1352022-11-18 13:48:27 +0800391 if (devIdProperty == nullptr || devIdProperty->empty())
Ed Tanous002d39b2022-05-31 08:59:27 -0700392 {
393 messages::resourceNotFound(asyncResp->res, "PCIeFunction",
394 function);
395 return;
396 }
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -0800397
Ed Tanous002d39b2022-05-31 08:59:27 -0700398 asyncResp->res.jsonValue["@odata.type"] =
399 "#PCIeFunction.v1_2_0.PCIeFunction";
400 asyncResp->res.jsonValue["@odata.id"] =
401 "/redfish/v1/Systems/system/PCIeDevices/" + device +
402 "/PCIeFunctions/" + function;
403 asyncResp->res.jsonValue["Name"] = "PCIe Function";
404 asyncResp->res.jsonValue["Id"] = function;
405 asyncResp->res.jsonValue["FunctionId"] = std::stoi(function);
406 asyncResp->res.jsonValue["Links"]["PCIeDevice"]["@odata.id"] =
407 "/redfish/v1/Systems/system/PCIeDevices/" + device;
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700408
Ed Tanous002d39b2022-05-31 08:59:27 -0700409 for (const auto& property : pcieDevProperties)
410 {
411 const std::string* strProperty =
412 std::get_if<std::string>(&property.second);
413 if (property.first == functionName + "DeviceId")
414 {
415 asyncResp->res.jsonValue["DeviceId"] = *strProperty;
416 }
417 if (property.first == functionName + "VendorId")
418 {
419 asyncResp->res.jsonValue["VendorId"] = *strProperty;
420 }
421 if (property.first == functionName + "FunctionType")
422 {
423 asyncResp->res.jsonValue["FunctionType"] = *strProperty;
424 }
425 if (property.first == functionName + "DeviceClass")
426 {
427 asyncResp->res.jsonValue["DeviceClass"] = *strProperty;
428 }
429 if (property.first == functionName + "ClassCode")
430 {
431 asyncResp->res.jsonValue["ClassCode"] = *strProperty;
432 }
433 if (property.first == functionName + "RevisionId")
434 {
435 asyncResp->res.jsonValue["RevisionId"] = *strProperty;
436 }
437 if (property.first == functionName + "SubsystemId")
438 {
439 asyncResp->res.jsonValue["SubsystemId"] = *strProperty;
440 }
441 if (property.first == functionName + "SubsystemVendorId")
442 {
443 asyncResp->res.jsonValue["SubsystemVendorId"] =
444 *strProperty;
445 }
446 }
447 };
448 std::string escapedPath = std::string(pciePath) + "/" + device;
449 dbus::utility::escapePathForDbus(escapedPath);
Krzysztof Grobelnyd1bde9e2022-09-07 10:40:51 +0200450 sdbusplus::asio::getAllProperties(
451 *crow::connections::systemBus, pcieService, escapedPath,
452 pcieDeviceInterface, std::move(getPCIeDeviceCallback));
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700453 });
454}
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -0800455
456} // namespace redfish