| Harshit Aghera | 4ecdfaa | 2025-05-22 11:35:39 +0530 | [diff] [blame] | 1 | /* |
| Ed Tanous | b5e823f | 2025-10-09 20:28:42 -0400 | [diff] [blame^] | 2 | * SPDX-FileCopyrightText: Copyright OpenBMC Authors |
| Harshit Aghera | 4ecdfaa | 2025-05-22 11:35:39 +0530 | [diff] [blame] | 3 | * SPDX-License-Identifier: Apache-2.0 |
| 4 | */ |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include "MctpRequester.hpp" |
| 9 | |
| 10 | #include <boost/asio/io_context.hpp> |
| 11 | #include <boost/container/flat_map.hpp> |
| 12 | #include <sdbusplus/asio/connection.hpp> |
| 13 | #include <sdbusplus/asio/object_server.hpp> |
| 14 | #include <sdbusplus/message.hpp> |
| 15 | |
| 16 | #include <cstdint> |
| 17 | #include <memory> |
| 18 | #include <string> |
| 19 | |
| 20 | constexpr const char* sensorPathPrefix = "/xyz/openbmc_project/sensors/"; |
| 21 | constexpr const char* deviceType = "NvidiaMctpVdm"; |
| 22 | |
| 23 | struct SensorConfigs |
| 24 | { |
| 25 | std::string name; |
| 26 | uint64_t pollRate{}; |
| 27 | }; |
| 28 | |
| 29 | class GpuDevice; |
| Harshit Aghera | 8951c87 | 2025-06-25 15:25:33 +0530 | [diff] [blame] | 30 | class SmaDevice; |
| Harshit Aghera | 4ecdfaa | 2025-05-22 11:35:39 +0530 | [diff] [blame] | 31 | |
| 32 | void createSensors( |
| 33 | boost::asio::io_context& io, sdbusplus::asio::object_server& objectServer, |
| 34 | boost::container::flat_map<std::string, std::shared_ptr<GpuDevice>>& |
| 35 | gpuDevices, |
| Harshit Aghera | 8951c87 | 2025-06-25 15:25:33 +0530 | [diff] [blame] | 36 | boost::container::flat_map<std::string, std::shared_ptr<SmaDevice>>& |
| 37 | smaDevices, |
| Harshit Aghera | 4ecdfaa | 2025-05-22 11:35:39 +0530 | [diff] [blame] | 38 | const std::shared_ptr<sdbusplus::asio::connection>& dbusConnection, |
| 39 | mctp::MctpRequester& mctpRequester); |
| 40 | |
| 41 | void interfaceRemoved( |
| 42 | sdbusplus::message_t& message, |
| 43 | boost::container::flat_map<std::string, std::shared_ptr<GpuDevice>>& |
| Harshit Aghera | 8951c87 | 2025-06-25 15:25:33 +0530 | [diff] [blame] | 44 | gpuDevices, |
| 45 | boost::container::flat_map<std::string, std::shared_ptr<SmaDevice>>& |
| 46 | smaDevices); |