blob: 4754bf626bf6ef484558801a3016f0f02a2ad345 [file] [log] [blame]
Patrick Venture46470a32018-09-07 19:26:25 -07001#pragma once
Chris Austenb4f5b922015-10-13 12:44:43 -05002
Patrick Venture1f4bc1f2018-09-12 13:30:16 -07003#include <cstdint>
4
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -05005// IPMI commands for Storage net functions.
Chris Austenb4f5b922015-10-13 12:44:43 -05006enum ipmi_netfn_storage_cmds
7{
8 // Get capability bits
Patrick Venture0b02be92018-08-31 11:55:55 -07009 IPMI_CMD_GET_FRU_INV_AREA_INFO = 0x10,
Dhruvaraj Subhashchandrane66c3b02018-02-07 01:21:56 -060010 IPMI_CMD_GET_REPOSITORY_INFO = 0x20,
Patrick Venture0b02be92018-08-31 11:55:55 -070011 IPMI_CMD_READ_FRU_DATA = 0x11,
12 IPMI_CMD_RESERVE_SDR = 0x22,
13 IPMI_CMD_GET_SDR = 0x23,
14 IPMI_CMD_GET_SEL_INFO = 0x40,
15 IPMI_CMD_RESERVE_SEL = 0x42,
16 IPMI_CMD_GET_SEL_ENTRY = 0x43,
17 IPMI_CMD_ADD_SEL = 0x44,
18 IPMI_CMD_DELETE_SEL = 0x46,
19 IPMI_CMD_CLEAR_SEL = 0x47,
20 IPMI_CMD_GET_SEL_TIME = 0x48,
21 IPMI_CMD_SET_SEL_TIME = 0x49,
Chris Austenb4f5b922015-10-13 12:44:43 -050022
23};
24
Patrick Venture0b02be92018-08-31 11:55:55 -070025struct ipmi_add_sel_request_t
26{
Chris Austen41a4b312015-10-25 03:45:42 -050027
Patrick Venture0b02be92018-08-31 11:55:55 -070028 uint8_t recordid[2];
29 uint8_t recordtype;
Jason M. Billsd3e57d72018-10-24 09:49:49 -070030 uint8_t timestamp[4];
Patrick Venture0b02be92018-08-31 11:55:55 -070031 uint8_t generatorid[2];
32 uint8_t evmrev;
33 uint8_t sensortype;
34 uint8_t sensornumber;
35 uint8_t eventdir;
36 uint8_t eventdata[3];
Chris Austen41a4b312015-10-25 03:45:42 -050037};
Marri Devender Raocac383b2017-07-03 13:24:27 -050038
39/**
40 * @struct Read FRU Data command request data
41 */
42struct ReadFruDataRequest
43{
Patrick Venture0b02be92018-08-31 11:55:55 -070044 uint8_t fruID; ///< FRU Device ID. FFh = reserved
45 uint8_t offsetLS; ///< FRU Inventory Offset to read, LS Byte
46 uint8_t offsetMS; ///< FRU Inventory Offset ro read, MS Byte
47 uint8_t count; ///< Count to read
48} __attribute__((packed));
Marri Devender Raocac383b2017-07-03 13:24:27 -050049
50/**
Nagaraju Goruganti7f2d7c92018-03-21 11:18:30 -050051 * @struct Read FRU Data command response data
52 */
53struct ReadFruDataResponse
54{
Patrick Venture0b02be92018-08-31 11:55:55 -070055 uint8_t count; ///< Response data Count.
Nagaraju Goruganti7f2d7c92018-03-21 11:18:30 -050056 uint8_t data[]; ///< Response data.
Patrick Venture0b02be92018-08-31 11:55:55 -070057} __attribute__((packed));
Nagaraju Goruganti7f2d7c92018-03-21 11:18:30 -050058
59/**
Dhruvaraj Subhashchandrane66c3b02018-02-07 01:21:56 -060060 * @struct Get Repository info command response
61 */
62struct GetRepositoryInfoResponse
63{
Patrick Venture0b02be92018-08-31 11:55:55 -070064 uint8_t sdrVersion; //< SDR version
65 uint8_t recordCountLs; //< Record count LS byte
66 uint8_t recordCountMs; //< Record count MS bte
67 uint8_t freeSpace[2]; //< Free space in bytes, LS first
Dhruvaraj Subhashchandrane66c3b02018-02-07 01:21:56 -060068 uint8_t additionTimestamp[4]; //< Most recent addition timestamp LS first
69 uint8_t deletionTimestamp[4]; //< Most recent deletion timestamp LS first
Patrick Venture0b02be92018-08-31 11:55:55 -070070 uint8_t operationSupport; //< Operation support
71} __attribute__((packed));