blob: c1c1bb933256ca8965dc2d26020acd3aecb1d04b [file] [log] [blame]
Harshit Aghera4ecdfaa2025-05-22 11:35:39 +05301/*
Ed Tanousb5e823f2025-10-09 20:28:42 -04002 * SPDX-FileCopyrightText: Copyright OpenBMC Authors
Harshit Aghera4ecdfaa2025-05-22 11:35:39 +05303 * 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
20constexpr const char* sensorPathPrefix = "/xyz/openbmc_project/sensors/";
21constexpr const char* deviceType = "NvidiaMctpVdm";
22
23struct SensorConfigs
24{
25 std::string name;
26 uint64_t pollRate{};
27};
28
29class GpuDevice;
Harshit Aghera8951c872025-06-25 15:25:33 +053030class SmaDevice;
Harshit Aghera4ecdfaa2025-05-22 11:35:39 +053031
32void 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 Aghera8951c872025-06-25 15:25:33 +053036 boost::container::flat_map<std::string, std::shared_ptr<SmaDevice>>&
37 smaDevices,
Harshit Aghera4ecdfaa2025-05-22 11:35:39 +053038 const std::shared_ptr<sdbusplus::asio::connection>& dbusConnection,
39 mctp::MctpRequester& mctpRequester);
40
41void interfaceRemoved(
42 sdbusplus::message_t& message,
43 boost::container::flat_map<std::string, std::shared_ptr<GpuDevice>>&
Harshit Aghera8951c872025-06-25 15:25:33 +053044 gpuDevices,
45 boost::container::flat_map<std::string, std::shared_ptr<SmaDevice>>&
46 smaDevices);