blob: 86211a945d09456b0cbbdb5e144e9ddcbd736890 [file] [log] [blame]
Harshit Aghera4ecdfaa2025-05-22 11:35:39 +05301/*
2 * SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION &
3 * AFFILIATES. All rights reserved.
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#pragma once
8
9#include "MctpRequester.hpp"
10
11#include <boost/asio/io_context.hpp>
12#include <boost/container/flat_map.hpp>
13#include <sdbusplus/asio/connection.hpp>
14#include <sdbusplus/asio/object_server.hpp>
15#include <sdbusplus/message.hpp>
16
17#include <cstdint>
18#include <memory>
19#include <string>
20
21constexpr const char* sensorPathPrefix = "/xyz/openbmc_project/sensors/";
22constexpr const char* deviceType = "NvidiaMctpVdm";
23
24struct SensorConfigs
25{
26 std::string name;
27 uint64_t pollRate{};
28};
29
30class GpuDevice;
31
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,
36 const std::shared_ptr<sdbusplus::asio::connection>& dbusConnection,
37 mctp::MctpRequester& mctpRequester);
38
39void interfaceRemoved(
40 sdbusplus::message_t& message,
41 boost::container::flat_map<std::string, std::shared_ptr<GpuDevice>>&
42 gpuDevices);