blob: 2e8f1fcaefbf4f82abbfc682f0383725975e0f0f [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
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -05004// IPMI commands for Storage net functions.
Chris Austenb4f5b922015-10-13 12:44:43 -05005enum ipmi_netfn_storage_cmds
6{
7 // Get capability bits
Marri Devender Raofa7b4e22017-07-03 00:52:20 -05008 IPMI_CMD_GET_FRU_INV_AREA_INFO = 0x10,
Dhruvaraj Subhashchandrane66c3b02018-02-07 01:21:56 -06009 IPMI_CMD_GET_REPOSITORY_INFO = 0x20,
Marri Devender Raofa7b4e22017-07-03 00:52:20 -050010 IPMI_CMD_READ_FRU_DATA = 0x11,
Tom Joseph5ca50952018-02-22 00:33:38 +053011 IPMI_CMD_RESERVE_SDR = 0x22,
12 IPMI_CMD_GET_SDR = 0x23,
Chris Austenb4f5b922015-10-13 12:44:43 -050013 IPMI_CMD_GET_SEL_INFO = 0x40,
14 IPMI_CMD_RESERVE_SEL = 0x42,
Tom Josepha4953392017-06-30 19:09:47 +053015 IPMI_CMD_GET_SEL_ENTRY = 0x43,
Chris Austenb4f5b922015-10-13 12:44:43 -050016 IPMI_CMD_ADD_SEL = 0x44,
Tom Joseph8f4a2aa2017-06-30 19:12:49 +053017 IPMI_CMD_DELETE_SEL = 0x46,
Tom Joseph2f05bb52017-06-30 19:14:49 +053018 IPMI_CMD_CLEAR_SEL = 0x47,
Adriana Kobylak8e30f2a2015-10-20 10:23:51 -050019 IPMI_CMD_GET_SEL_TIME = 0x48,
20 IPMI_CMD_SET_SEL_TIME = 0x49,
Chris Austenb4f5b922015-10-13 12:44:43 -050021
22};
23
Chris Austen41a4b312015-10-25 03:45:42 -050024struct ipmi_add_sel_request_t {
25
26 uint8_t recordid[2];
27 uint8_t recordtype;
28 uint8_t timestampe[4];
29 uint8_t generatorid[2];
30 uint8_t evmrev;
31 uint8_t sensortype;
32 uint8_t sensornumber;
33 uint8_t eventdir;
34 uint8_t eventdata[3];
35};
Marri Devender Raocac383b2017-07-03 13:24:27 -050036
37/**
38 * @struct Read FRU Data command request data
39 */
40struct ReadFruDataRequest
41{
42 uint8_t fruID; ///< FRU Device ID. FFh = reserved
43 uint8_t offsetLS; ///< FRU Inventory Offset to read, LS Byte
44 uint8_t offsetMS; ///< FRU Inventory Offset ro read, MS Byte
45 uint8_t count; ///< Count to read
46}__attribute__ ((packed));
47
48/**
Nagaraju Goruganti7f2d7c92018-03-21 11:18:30 -050049 * @struct Read FRU Data command response data
50 */
51struct ReadFruDataResponse
52{
53 uint8_t count; ///< Response data Count.
54 uint8_t data[]; ///< Response data.
55}__attribute__ ((packed));
56
57/**
Marri Devender Raocac383b2017-07-03 13:24:27 -050058 * @struct Get FRU inventory area info command request data
59 */
60struct FruInvenAreaInfoRequest
61{
62 uint8_t fruID; ///< FRU Device ID. FFH = reserved.
63}__attribute__ ((packed));
64
65
66/**
67 * @struct Get FRU inventory area info command response
68 */
69struct FruInvenAreaInfoResponse
70{
Marri Devender Raocac383b2017-07-03 13:24:27 -050071 uint8_t sizels; ///< Fru Inventory area size in bytes, LS Byte
72 uint8_t sizems; ///< Fru Inventory are size in bytes, MS Byte
73 uint8_t access; ///< 0b Devices is accessed by bytes, 1b - by words
74}__attribute__ ((packed));
75
Dhruvaraj Subhashchandrane66c3b02018-02-07 01:21:56 -060076/**
77 * @struct Get Repository info command response
78 */
79struct GetRepositoryInfoResponse
80{
81 uint8_t sdrVersion; //< SDR version
82 uint8_t recordCountLs; //< Record count LS byte
83 uint8_t recordCountMs; //< Record count MS bte
84 uint8_t freeSpace[2]; //< Free space in bytes, LS first
85 uint8_t additionTimestamp[4]; //< Most recent addition timestamp LS first
86 uint8_t deletionTimestamp[4]; //< Most recent deletion timestamp LS first
87 uint8_t operationSupport; //< Operation support
88}__attribute__ ((packed));
Chris Austenb4f5b922015-10-13 12:44:43 -050089#endif