blob: 0aef3e35cee7938f0d469c086999c844cea22776 [file] [log] [blame]
Chris Austenb4f5b922015-10-13 12:44:43 -05001#ifndef __HOST_IPMI_STORAGE_HANDLER_H__
2#define __HOST_IPMI_STORAGE_HANDLER_H__
3
Patrick Venture1f4bc1f2018-09-12 13:30:16 -07004#include <cstdint>
5
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -05006// IPMI commands for Storage net functions.
Chris Austenb4f5b922015-10-13 12:44:43 -05007enum ipmi_netfn_storage_cmds
8{
9 // Get capability bits
Patrick Venture0b02be92018-08-31 11:55:55 -070010 IPMI_CMD_GET_FRU_INV_AREA_INFO = 0x10,
Dhruvaraj Subhashchandrane66c3b02018-02-07 01:21:56 -060011 IPMI_CMD_GET_REPOSITORY_INFO = 0x20,
Patrick Venture0b02be92018-08-31 11:55:55 -070012 IPMI_CMD_READ_FRU_DATA = 0x11,
13 IPMI_CMD_RESERVE_SDR = 0x22,
14 IPMI_CMD_GET_SDR = 0x23,
15 IPMI_CMD_GET_SEL_INFO = 0x40,
16 IPMI_CMD_RESERVE_SEL = 0x42,
17 IPMI_CMD_GET_SEL_ENTRY = 0x43,
18 IPMI_CMD_ADD_SEL = 0x44,
19 IPMI_CMD_DELETE_SEL = 0x46,
20 IPMI_CMD_CLEAR_SEL = 0x47,
21 IPMI_CMD_GET_SEL_TIME = 0x48,
22 IPMI_CMD_SET_SEL_TIME = 0x49,
Chris Austenb4f5b922015-10-13 12:44:43 -050023
24};
25
Patrick Venture0b02be92018-08-31 11:55:55 -070026struct ipmi_add_sel_request_t
27{
Chris Austen41a4b312015-10-25 03:45:42 -050028
Patrick Venture0b02be92018-08-31 11:55:55 -070029 uint8_t recordid[2];
30 uint8_t recordtype;
31 uint8_t timestampe[4];
32 uint8_t generatorid[2];
33 uint8_t evmrev;
34 uint8_t sensortype;
35 uint8_t sensornumber;
36 uint8_t eventdir;
37 uint8_t eventdata[3];
Chris Austen41a4b312015-10-25 03:45:42 -050038};
Marri Devender Raocac383b2017-07-03 13:24:27 -050039
40/**
41 * @struct Read FRU Data command request data
42 */
43struct ReadFruDataRequest
44{
Patrick Venture0b02be92018-08-31 11:55:55 -070045 uint8_t fruID; ///< FRU Device ID. FFh = reserved
46 uint8_t offsetLS; ///< FRU Inventory Offset to read, LS Byte
47 uint8_t offsetMS; ///< FRU Inventory Offset ro read, MS Byte
48 uint8_t count; ///< Count to read
49} __attribute__((packed));
Marri Devender Raocac383b2017-07-03 13:24:27 -050050
51/**
Nagaraju Goruganti7f2d7c92018-03-21 11:18:30 -050052 * @struct Read FRU Data command response data
53 */
54struct ReadFruDataResponse
55{
Patrick Venture0b02be92018-08-31 11:55:55 -070056 uint8_t count; ///< Response data Count.
Nagaraju Goruganti7f2d7c92018-03-21 11:18:30 -050057 uint8_t data[]; ///< Response data.
Patrick Venture0b02be92018-08-31 11:55:55 -070058} __attribute__((packed));
Nagaraju Goruganti7f2d7c92018-03-21 11:18:30 -050059
60/**
Marri Devender Raocac383b2017-07-03 13:24:27 -050061 * @struct Get FRU inventory area info command request data
62 */
63struct FruInvenAreaInfoRequest
64{
65 uint8_t fruID; ///< FRU Device ID. FFH = reserved.
Patrick Venture0b02be92018-08-31 11:55:55 -070066} __attribute__((packed));
Marri Devender Raocac383b2017-07-03 13:24:27 -050067
68/**
69 * @struct Get FRU inventory area info command response
70 */
71struct FruInvenAreaInfoResponse
72{
Patrick Venture0b02be92018-08-31 11:55:55 -070073 uint8_t sizels; ///< Fru Inventory area size in bytes, LS Byte
74 uint8_t sizems; ///< Fru Inventory are size in bytes, MS Byte
75 uint8_t access; ///< 0b Devices is accessed by bytes, 1b - by words
76} __attribute__((packed));
Marri Devender Raocac383b2017-07-03 13:24:27 -050077
Dhruvaraj Subhashchandrane66c3b02018-02-07 01:21:56 -060078/**
79 * @struct Get Repository info command response
80 */
81struct GetRepositoryInfoResponse
82{
Patrick Venture0b02be92018-08-31 11:55:55 -070083 uint8_t sdrVersion; //< SDR version
84 uint8_t recordCountLs; //< Record count LS byte
85 uint8_t recordCountMs; //< Record count MS bte
86 uint8_t freeSpace[2]; //< Free space in bytes, LS first
Dhruvaraj Subhashchandrane66c3b02018-02-07 01:21:56 -060087 uint8_t additionTimestamp[4]; //< Most recent addition timestamp LS first
88 uint8_t deletionTimestamp[4]; //< Most recent deletion timestamp LS first
Patrick Venture0b02be92018-08-31 11:55:55 -070089 uint8_t operationSupport; //< Operation support
90} __attribute__((packed));
Chris Austenb4f5b922015-10-13 12:44:43 -050091#endif