Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 1 | #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 Joseph | 246bc0d | 2017-10-17 16:08:38 +0530 | [diff] [blame] | 6 | #include <string> |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 7 | |
| 8 | |
| 9 | // IPMI commands for net functions. |
| 10 | enum ipmi_netfn_oem_cmds |
| 11 | { |
Adriana Kobylak | 187bfce | 2016-03-04 11:55:43 -0600 | [diff] [blame] | 12 | IPMI_CMD_PREP_FW_UPDATE = 0x10, |
Adriana Kobylak | 81e2310 | 2018-08-09 14:44:19 -0500 | [diff] [blame] | 13 | IPMI_CMD_RESET_BMC_PASSWORD = 0x11, |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 14 | IPMI_CMD_PESEL = 0xF0, |
Vishwanatha Subbanna | 0765506 | 2017-07-14 20:31:57 +0530 | [diff] [blame] | 15 | IPMI_CMD_OCC_RESET = 0x0E, |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 16 | }; |
| 17 | |
Tom Joseph | 246bc0d | 2017-10-17 16:08:38 +0530 | [diff] [blame] | 18 | /** @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 | */ |
| 24 | std::string readESEL(const char* filename); |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 25 | |
Tom Joseph | 246bc0d | 2017-10-17 16:08:38 +0530 | [diff] [blame] | 26 | /** @brief Create OCC metrics log entry |
| 27 | * |
| 28 | * @param[in] eSELData - eSEL data containing OCC metrics data |
| 29 | */ |
| 30 | void createLogEntry(const std::string& eSELData); |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 31 | |
Patrick Williams | 24fa5a9 | 2015-10-30 14:53:57 -0500 | [diff] [blame] | 32 | ipmi_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 Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 34 | ipmi_data_len_t data_len, ipmi_context_t context); |
| 35 | |
| 36 | |
| 37 | struct esel_request_t { |
Nan Li | 8a0807a | 2016-05-24 16:59:24 +0800 | [diff] [blame] | 38 | uint16_t resid; |
| 39 | uint16_t selrecord; |
| 40 | uint16_t offset; |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 41 | uint8_t progress; |
| 42 | } __attribute__ ((packed)) ; |
| 43 | |
| 44 | |
| 45 | |
| 46 | #endif |