blob: a98ae9522f2b478f1c51dbac340b301c6673b708 [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
Chris Austen4d98c1e2015-10-13 14:33:50 -05004#include <host-ipmid/ipmid-api.h>
Patrick Venture02261c02018-10-31 15:16:23 -07005#include <stdint.h>
Chris Austen4d98c1e2015-10-13 14:33:50 -05006
Patrick Venture02261c02018-10-31 15:16:23 -07007#include <string>
Chris Austen4d98c1e2015-10-13 14:33:50 -05008
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,
Patrick Venture02261c02018-10-31 15:16:23 -070033 ipmi_request_t request,
34 ipmi_response_t response,
35 ipmi_data_len_t data_len,
36 ipmi_context_t context);
Chris Austen4d98c1e2015-10-13 14:33:50 -050037
Patrick Venture02261c02018-10-31 15:16:23 -070038struct esel_request_t
39{
40 uint16_t resid;
41 uint16_t selrecord;
42 uint16_t offset;
43 uint8_t progress;
44} __attribute__((packed));
Chris Austen4d98c1e2015-10-13 14:33:50 -050045
46#endif