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, |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 13 | IPMI_CMD_PESEL = 0xF0, |
Vishwanatha Subbanna | 0765506 | 2017-07-14 20:31:57 +0530 | [diff] [blame] | 14 | IPMI_CMD_OCC_RESET = 0x0E, |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 15 | }; |
| 16 | |
Tom Joseph | 246bc0d | 2017-10-17 16:08:38 +0530 | [diff] [blame] | 17 | /** @brief Read eSEL data into a string |
| 18 | * |
| 19 | * @param[in] filename - filename of file containing eSEL |
| 20 | * |
| 21 | * @return On success return the eSEL data |
| 22 | */ |
| 23 | std::string readESEL(const char* filename); |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 24 | |
Tom Joseph | 246bc0d | 2017-10-17 16:08:38 +0530 | [diff] [blame] | 25 | /** @brief Create OCC metrics log entry |
| 26 | * |
| 27 | * @param[in] eSELData - eSEL data containing OCC metrics data |
| 28 | */ |
| 29 | void createLogEntry(const std::string& eSELData); |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 30 | |
Patrick Williams | 24fa5a9 | 2015-10-30 14:53:57 -0500 | [diff] [blame] | 31 | ipmi_ret_t ipmi_ibm_oem_partial_esel(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 32 | ipmi_request_t request, ipmi_response_t response, |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 33 | ipmi_data_len_t data_len, ipmi_context_t context); |
| 34 | |
| 35 | |
| 36 | struct esel_request_t { |
Nan Li | 8a0807a | 2016-05-24 16:59:24 +0800 | [diff] [blame] | 37 | uint16_t resid; |
| 38 | uint16_t selrecord; |
| 39 | uint16_t offset; |
Chris Austen | 4d98c1e | 2015-10-13 14:33:50 -0500 | [diff] [blame] | 40 | uint8_t progress; |
| 41 | } __attribute__ ((packed)) ; |
| 42 | |
| 43 | |
| 44 | |
| 45 | #endif |