blob: f9b1ed57dbb4d5ffcddfe578116cc988a5225e88 [file] [log] [blame]
Vijay Khemkae7d23d02019-03-08 13:13:40 -08001/*
2 * Copyright (c) 2018-present Facebook. All Rights Reserved.
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#include <phosphor-ipmi-host/sensorhandler.hpp>
19
20static constexpr uint8_t ipmiSdrVersion = 0x51;
21
22#pragma pack(push, 1)
23
24struct GetSDRReq
25{
26 uint16_t reservationID;
27 uint16_t recordID;
28 uint8_t offset;
29 uint8_t bytesToRead;
30};
31
32struct GetFRUAreaReq
33{
34 uint8_t fruDeviceID;
35 uint16_t fruInventoryOffset;
36 uint8_t countToRead;
37};
38
39struct WriteFRUDataReq
40{
41 uint8_t fruDeviceID;
42 uint16_t fruInventoryOffset;
43 uint8_t data[];
44};
45
46#pragma pack(pop)
47
48enum class GetFRUAreaAccessType : uint8_t
49{
50 byte = 0x0,
51 words = 0x1
52};
53
54enum class IPMINetfnStorageCmds : ipmi_cmd_t
55{
56 ipmiCmdGetFRUInvAreaInfo = 0x10,
57 ipmiCmdReadFRUData = 0x11,
58 ipmiCmdWriteFRUData = 0x12,
59 ipmiCmdGetRepositoryInfo = 0x20,
60 ipmiCmdGetSDRAllocationInfo = 0x21,
61 ipmiCmdReserveSDR = 0x22,
62 ipmiCmdGetSDR = 0x23,
63 ipmiCmdGetSELInfo = 0x40,
64 ipmiCmdReserveSEL = 0x42,
65 ipmiCmdGetSELEntry = 0x43,
66 ipmiCmdAddSEL = 0x44,
67 ipmiCmdDeleteSEL = 0x46,
68 ipmiCmdClearSEL = 0x47,
69 ipmiCmdGetSELTime = 0x48,
70 ipmiCmdSetSELTime = 0x49,
71};
72
73#pragma pack(push, 1)
74struct FRUHeader
75{
76 uint8_t commonHeaderFormat;
77 uint8_t internalOffset;
78 uint8_t chassisOffset;
79 uint8_t boardOffset;
80 uint8_t productOffset;
81 uint8_t multiRecordOffset;
82 uint8_t pad;
83 uint8_t checksum;
84};
85#pragma pack(pop)