Ben Pai | 44cee31 | 2020-03-16 15:24:46 +0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <ipmid/api.h> |
| 4 | #include <stdint.h> |
| 5 | |
| 6 | #include <map> |
| 7 | #include <string> |
| 8 | |
| 9 | // IPMI commands for net functions. |
| 10 | enum ipmi_netfn_oem_cmds |
| 11 | { |
| 12 | IPMI_CMD_DETECT_RISERF = 0x01, |
Ben Pai | ba89a1e | 2020-11-06 17:00:33 +0800 | [diff] [blame] | 13 | IPMI_CMD_SWITCH_BITTWARE_IMAGE = 0x02, |
Ben Pai | 44cee31 | 2020-03-16 15:24:46 +0800 | [diff] [blame] | 14 | }; |
| 15 | |
| 16 | constexpr int initError = -1; /* The parameter of definition error */ |
| 17 | constexpr unsigned char command = 0; /* The parameter of smbus command */ |
| 18 | constexpr unsigned char a[] = { |
| 19 | 0x00, 0x00}; /* The response data : CPU0 & CPU1 are not present */ |
| 20 | constexpr unsigned char b[] = { |
| 21 | 0x00, 0x01}; /* The response data : CPU1 is present but CPU0 isn't */ |
| 22 | constexpr unsigned char c[] = { |
| 23 | 0x01, 0x00}; /* The response data : CPU0 is present but CPU1 isn't */ |
| 24 | constexpr unsigned char d[] = { |
| 25 | 0x01, 0x01}; /* The response data : CPU0 & CPU1 are present */ |
| 26 | |
| 27 | ipmi_ret_t ipmi_wistron_detect_riserf(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 28 | ipmi_request_t request, |
| 29 | ipmi_response_t response, |
| 30 | ipmi_data_len_t data_len, |
| 31 | ipmi_context_t context); |
Ben Pai | ba89a1e | 2020-11-06 17:00:33 +0800 | [diff] [blame] | 32 | |
| 33 | ipmi_ret_t ipmi_wistron_switch_image(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 34 | ipmi_request_t request, |
| 35 | ipmi_response_t response, |
| 36 | ipmi_data_len_t data_len, |
| 37 | ipmi_context_t context); |