blob: 097d4b44e51b8ac74cf492de9c7bff8c8e2b2a04 [file] [log] [blame]
Chris Austen4d98c1e2015-10-13 14:33:50 -05001#ifndef __HOST_IPMI_OPENPOWEROEM_HANDLER_H__
2#define __HOST_IPMI_OPENPOWEROEM_HANDLER_H__
3
4#include <stdint.h>
5#include <host-ipmid/ipmid-api.h>
Tom Joseph246bc0d2017-10-17 16:08:38 +05306#include <string>
Chris Austen4d98c1e2015-10-13 14:33:50 -05007
8
9// IPMI commands for net functions.
10enum ipmi_netfn_oem_cmds
11{
Adriana Kobylak187bfce2016-03-04 11:55:43 -060012 IPMI_CMD_PREP_FW_UPDATE = 0x10,
Matt Spinler32884712018-09-28 13:56:20 -050013 IPMI_CMD_RESET_BMC_AUTH = 0x11,
Chris Austen4d98c1e2015-10-13 14:33:50 -050014 IPMI_CMD_PESEL = 0xF0,
Vishwanatha Subbanna07655062017-07-14 20:31:57 +053015 IPMI_CMD_OCC_RESET = 0x0E,
Chris Austen4d98c1e2015-10-13 14:33:50 -050016};
17
Tom Joseph246bc0d2017-10-17 16:08:38 +053018/** @brief Read eSEL data into a string
19 *
20 * @param[in] filename - filename of file containing eSEL
21 *
22 * @return On success return the eSEL data
23 */
24std::string readESEL(const char* filename);
Chris Austen4d98c1e2015-10-13 14:33:50 -050025
Tom Joseph246bc0d2017-10-17 16:08:38 +053026/** @brief Create OCC metrics log entry
27 *
28 * @param[in] eSELData - eSEL data containing OCC metrics data
29 */
30void createLogEntry(const std::string& eSELData);
Chris Austen4d98c1e2015-10-13 14:33:50 -050031
Patrick Williams24fa5a92015-10-30 14:53:57 -050032ipmi_ret_t ipmi_ibm_oem_partial_esel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
33 ipmi_request_t request, ipmi_response_t response,
Chris Austen4d98c1e2015-10-13 14:33:50 -050034 ipmi_data_len_t data_len, ipmi_context_t context);
35
36
37struct esel_request_t {
Nan Li8a0807a2016-05-24 16:59:24 +080038 uint16_t resid;
39 uint16_t selrecord;
40 uint16_t offset;
Chris Austen4d98c1e2015-10-13 14:33:50 -050041 uint8_t progress;
42} __attribute__ ((packed)) ;
43
44
45
46#endif