summaryrefslogtreecommitdiffstats
path: root/storagehandler.hpp
blob: 4754bf626bf6ef484558801a3016f0f02a2ad345 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#pragma once

#include <cstdint>

// IPMI commands for Storage net functions.
enum ipmi_netfn_storage_cmds
{
    // Get capability bits
    IPMI_CMD_GET_FRU_INV_AREA_INFO = 0x10,
    IPMI_CMD_GET_REPOSITORY_INFO = 0x20,
    IPMI_CMD_READ_FRU_DATA = 0x11,
    IPMI_CMD_RESERVE_SDR = 0x22,
    IPMI_CMD_GET_SDR = 0x23,
    IPMI_CMD_GET_SEL_INFO = 0x40,
    IPMI_CMD_RESERVE_SEL = 0x42,
    IPMI_CMD_GET_SEL_ENTRY = 0x43,
    IPMI_CMD_ADD_SEL = 0x44,
    IPMI_CMD_DELETE_SEL = 0x46,
    IPMI_CMD_CLEAR_SEL = 0x47,
    IPMI_CMD_GET_SEL_TIME = 0x48,
    IPMI_CMD_SET_SEL_TIME = 0x49,

};

struct ipmi_add_sel_request_t
{

    uint8_t recordid[2];
    uint8_t recordtype;
    uint8_t timestamp[4];
    uint8_t generatorid[2];
    uint8_t evmrev;
    uint8_t sensortype;
    uint8_t sensornumber;
    uint8_t eventdir;
    uint8_t eventdata[3];
};

/**
 * @struct Read FRU Data command request data
 */
struct ReadFruDataRequest
{
    uint8_t fruID;    ///< FRU Device ID. FFh = reserved
    uint8_t offsetLS; ///< FRU Inventory Offset to read, LS Byte
    uint8_t offsetMS; ///< FRU Inventory Offset ro read, MS Byte
    uint8_t count;    ///< Count to read
} __attribute__((packed));

/**
 * @struct Read FRU Data command response data
 */
struct ReadFruDataResponse
{
    uint8_t count;  ///< Response data Count.
    uint8_t data[]; ///< Response data.
} __attribute__((packed));

/**
 * @struct Get Repository info command response
 */
struct GetRepositoryInfoResponse
{
    uint8_t sdrVersion;           //< SDR version
    uint8_t recordCountLs;        //< Record count LS byte
    uint8_t recordCountMs;        //< Record count MS bte
    uint8_t freeSpace[2];         //< Free space in bytes, LS first
    uint8_t additionTimestamp[4]; //< Most recent addition timestamp LS first
    uint8_t deletionTimestamp[4]; //< Most recent deletion timestamp LS first
    uint8_t operationSupport;     //< Operation support
} __attribute__((packed));
OpenPOWER on IntegriCloud