xref: /openbmc/google-ipmi-sys/pcie_i2c.hpp (revision ff3cd8e9)
1a2056e9cSWilly Tu // Copyright 2021 Google LLC
2a2056e9cSWilly Tu //
3a2056e9cSWilly Tu // Licensed under the Apache License, Version 2.0 (the "License");
4a2056e9cSWilly Tu // you may not use this file except in compliance with the License.
5a2056e9cSWilly Tu // You may obtain a copy of the License at
6a2056e9cSWilly Tu //
7a2056e9cSWilly Tu //      http://www.apache.org/licenses/LICENSE-2.0
8a2056e9cSWilly Tu //
9a2056e9cSWilly Tu // Unless required by applicable law or agreed to in writing, software
10a2056e9cSWilly Tu // distributed under the License is distributed on an "AS IS" BASIS,
11a2056e9cSWilly Tu // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12a2056e9cSWilly Tu // See the License for the specific language governing permissions and
13a2056e9cSWilly Tu // limitations under the License.
14a2056e9cSWilly Tu 
152d4836dbSJaghathiswari Rankappagounder Natarajan #pragma once
162d4836dbSJaghathiswari Rankappagounder Natarajan 
1749f23ad9SPatrick Venture #include "handler.hpp"
1849f23ad9SPatrick Venture 
192c9e1625SWilliam A. Kennington III #include <ipmid/api.h>
202d4836dbSJaghathiswari Rankappagounder Natarajan 
21*ff3cd8e9SWilly Tu #include <ipmid/api-types.hpp>
22*ff3cd8e9SWilly Tu #include <vector>
23*ff3cd8e9SWilly Tu 
242d4836dbSJaghathiswari Rankappagounder Natarajan namespace google
252d4836dbSJaghathiswari Rankappagounder Natarajan {
262d4836dbSJaghathiswari Rankappagounder Natarajan namespace ipmi
272d4836dbSJaghathiswari Rankappagounder Natarajan {
282d4836dbSJaghathiswari Rankappagounder Natarajan 
29*ff3cd8e9SWilly Tu struct PcieSlotCountReply
30*ff3cd8e9SWilly Tu {
31*ff3cd8e9SWilly Tu     uint8_t value;
32*ff3cd8e9SWilly Tu } __attribute__((packed));
33*ff3cd8e9SWilly Tu 
34*ff3cd8e9SWilly Tu struct PcieSlotI2cBusMappingReply
35*ff3cd8e9SWilly Tu {
36*ff3cd8e9SWilly Tu     uint8_t i2c_bus_number;
37*ff3cd8e9SWilly Tu     uint8_t pcie_slot_name_len;
38*ff3cd8e9SWilly Tu } __attribute__((packed));
39*ff3cd8e9SWilly Tu 
402d4836dbSJaghathiswari Rankappagounder Natarajan //  Handle the pcie slot count command.
412d4836dbSJaghathiswari Rankappagounder Natarajan //  Sys can query the number of pcie slots.
42*ff3cd8e9SWilly Tu Resp pcieSlotCount(const std::vector<std::uint8_t>& data,
43*ff3cd8e9SWilly Tu                    HandlerInterface* handler);
442d4836dbSJaghathiswari Rankappagounder Natarajan 
452d4836dbSJaghathiswari Rankappagounder Natarajan // Handle the pcie slot to i2c bus mapping command.
462d4836dbSJaghathiswari Rankappagounder Natarajan // Sys can query which i2c bus is routed to which pcie slot.
47*ff3cd8e9SWilly Tu Resp pcieSlotI2cBusMapping(const std::vector<std::uint8_t>& data,
48*ff3cd8e9SWilly Tu                            HandlerInterface* handler);
492d4836dbSJaghathiswari Rankappagounder Natarajan 
502d4836dbSJaghathiswari Rankappagounder Natarajan } // namespace ipmi
512d4836dbSJaghathiswari Rankappagounder Natarajan } // namespace google
52