Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 1 | #ifndef __HOST_IPMI_CHASSIS_HANDLER_H__ |
| 2 | #define __HOST_IPMI_CHASSIS_HANDLER_H__ |
| 3 | |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 4 | #include <stdint.h> |
Ratan Gupta | fd28dd7 | 2016-08-01 04:58:01 -0500 | [diff] [blame] | 5 | #include <cstddef> |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 6 | |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 7 | // IPMI commands for Chassis net functions. |
Kuiying Wang | 49a33f9 | 2018-07-26 16:24:22 +0800 | [diff] [blame] | 8 | enum ipmi_netfn_chassis_cmds |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 9 | { |
Nan Li | 8d15fb4 | 2016-08-16 22:29:40 +0800 | [diff] [blame] | 10 | IPMI_CMD_GET_CHASSIS_CAP = 0x00, |
Nan Li | fdd8ec5 | 2016-08-28 03:57:40 +0800 | [diff] [blame] | 11 | // Chassis Status |
| 12 | IPMI_CMD_CHASSIS_STATUS = 0x01, |
Tom Joseph | 5110c12 | 2018-03-23 17:55:40 +0530 | [diff] [blame] | 13 | // Chassis Control |
| 14 | IPMI_CMD_CHASSIS_CONTROL = 0x02, |
| 15 | IPMI_CMD_CHASSIS_IDENTIFY = 0x04, |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 16 | // Get capability bits |
shgoupf | d84fbbf | 2015-12-17 10:05:51 +0800 | [diff] [blame] | 17 | IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08, |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 18 | IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09, |
Nagaraju Goruganti | a59d83f | 2018-04-06 05:55:42 -0500 | [diff] [blame] | 19 | IPMI_CMD_GET_POH_COUNTER = 0x0F, |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | // Command specific completion codes |
| 23 | enum ipmi_chassis_return_codes |
| 24 | { |
shgoupf | d84fbbf | 2015-12-17 10:05:51 +0800 | [diff] [blame] | 25 | IPMI_OK = 0x0, |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 26 | IPMI_CC_PARM_NOT_SUPPORTED = 0x80, |
| 27 | }; |
| 28 | |
shgoupf | d84fbbf | 2015-12-17 10:05:51 +0800 | [diff] [blame] | 29 | // Generic completion codes, |
| 30 | // see IPMI doc section 5.2 |
| 31 | enum ipmi_generic_return_codes |
| 32 | { |
| 33 | IPMI_OUT_OF_SPACE = 0xC4, |
| 34 | }; |
| 35 | |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 36 | // Various Chassis operations under a single command. |
| 37 | enum ipmi_chassis_control_cmds : uint8_t |
| 38 | { |
Marri Devender Rao | b93e980 | 2018-05-07 00:59:25 -0500 | [diff] [blame] | 39 | CMD_POWER_OFF = 0x00, |
| 40 | CMD_POWER_ON = 0x01, |
| 41 | CMD_POWER_CYCLE = 0x02, |
| 42 | CMD_HARD_RESET = 0x03, |
| 43 | CMD_PULSE_DIAGNOSTIC_INTR = 0x04, |
| 44 | CMD_SOFT_OFF_VIA_OVER_TEMP = 0x05, |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 45 | }; |
Ratan Gupta | fd28dd7 | 2016-08-01 04:58:01 -0500 | [diff] [blame] | 46 | enum class BootOptionParameter : size_t |
| 47 | { |
Tom Joseph | f536c90 | 2017-09-25 18:08:15 +0530 | [diff] [blame] | 48 | BOOT_INFO = 0x4, |
Ratan Gupta | fd28dd7 | 2016-08-01 04:58:01 -0500 | [diff] [blame] | 49 | BOOT_FLAGS = 0x5, |
| 50 | OPAL_NETWORK_SETTINGS = 0x61 |
| 51 | }; |
| 52 | |
| 53 | enum class BootOptionResponseSize : size_t |
| 54 | { |
| 55 | BOOT_FLAGS = 5, |
Ratan Gupta | 6ec7daa | 2017-07-15 14:13:01 +0530 | [diff] [blame] | 56 | OPAL_NETWORK_SETTINGS = 50 |
Ratan Gupta | fd28dd7 | 2016-08-01 04:58:01 -0500 | [diff] [blame] | 57 | }; |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 58 | |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 59 | #endif |