Patrick Venture | 46470a3 | 2018-09-07 19:26:25 -0700 | [diff] [blame] | 1 | #pragma once |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 2 | |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 3 | #include <stdint.h> |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 4 | |
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 | { |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 10 | IPMI_CMD_GET_CHASSIS_CAP = 0x00, |
Nan Li | fdd8ec5 | 2016-08-28 03:57:40 +0800 | [diff] [blame] | 11 | // Chassis Status |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 12 | IPMI_CMD_CHASSIS_STATUS = 0x01, |
Tom Joseph | 5110c12 | 2018-03-23 17:55:40 +0530 | [diff] [blame] | 13 | // Chassis Control |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 14 | IPMI_CMD_CHASSIS_CONTROL = 0x02, |
| 15 | IPMI_CMD_CHASSIS_IDENTIFY = 0x04, |
Yong Li | ae4b040 | 2018-11-02 11:12:14 +0800 | [diff] [blame] | 16 | IPMI_CMD_SET_CHASSIS_CAP = 0x05, |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 17 | // Get capability bits |
shgoupf | d84fbbf | 2015-12-17 10:05:51 +0800 | [diff] [blame] | 18 | IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08, |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 19 | IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09, |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 20 | IPMI_CMD_GET_POH_COUNTER = 0x0F, |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 21 | }; |
| 22 | |
| 23 | // Command specific completion codes |
| 24 | enum ipmi_chassis_return_codes |
| 25 | { |
shgoupf | d84fbbf | 2015-12-17 10:05:51 +0800 | [diff] [blame] | 26 | IPMI_OK = 0x0, |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 27 | IPMI_CC_PARM_NOT_SUPPORTED = 0x80, |
huanghe | ab36928 | 2020-10-10 14:40:00 +0800 | [diff] [blame] | 28 | IPMI_CC_FAIL_SET_IN_PROGRESS = 0x81, |
Adriana Kobylak | 40814c6 | 2015-10-27 15:58:44 -0500 | [diff] [blame] | 29 | }; |
| 30 | |
shgoupf | d84fbbf | 2015-12-17 10:05:51 +0800 | [diff] [blame] | 31 | // Generic completion codes, |
| 32 | // see IPMI doc section 5.2 |
| 33 | enum ipmi_generic_return_codes |
| 34 | { |
| 35 | IPMI_OUT_OF_SPACE = 0xC4, |
| 36 | }; |
| 37 | |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 38 | // Various Chassis operations under a single command. |
| 39 | enum ipmi_chassis_control_cmds : uint8_t |
| 40 | { |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 41 | CMD_POWER_OFF = 0x00, |
| 42 | CMD_POWER_ON = 0x01, |
| 43 | CMD_POWER_CYCLE = 0x02, |
| 44 | CMD_HARD_RESET = 0x03, |
| 45 | CMD_PULSE_DIAGNOSTIC_INTR = 0x04, |
| 46 | CMD_SOFT_OFF_VIA_OVER_TEMP = 0x05, |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 47 | }; |
Ratan Gupta | fd28dd7 | 2016-08-01 04:58:01 -0500 | [diff] [blame] | 48 | enum class BootOptionParameter : size_t |
| 49 | { |
John Wang | 97c62e1 | 2021-01-19 14:19:55 +0800 | [diff] [blame] | 50 | setInProgress = 0x0, |
Chen Yugang | 86ac499 | 2021-06-25 08:14:52 +0800 | [diff] [blame] | 51 | bootFlagValidClr = 0x3, |
jayaprakash Mutyala | bfd8fc4 | 2020-05-05 22:38:03 +0000 | [diff] [blame] | 52 | bootInfo = 0x4, |
| 53 | bootFlags = 0x5, |
| 54 | opalNetworkSettings = 0x61 |
Ratan Gupta | fd28dd7 | 2016-08-01 04:58:01 -0500 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | enum class BootOptionResponseSize : size_t |
| 58 | { |
huanghe | ab36928 | 2020-10-10 14:40:00 +0800 | [diff] [blame] | 59 | setInProgress = 3, |
jayaprakash Mutyala | bfd8fc4 | 2020-05-05 22:38:03 +0000 | [diff] [blame] | 60 | bootFlags = 5, |
| 61 | opalNetworkSettings = 50 |
Ratan Gupta | fd28dd7 | 2016-08-01 04:58:01 -0500 | [diff] [blame] | 62 | }; |
Yong Li | f4e3851 | 2019-05-21 14:46:55 +0800 | [diff] [blame] | 63 | |
| 64 | enum class ChassisIDState : uint8_t |
| 65 | { |
| 66 | off = 0x0, |
| 67 | temporaryOn = 0x1, |
| 68 | indefiniteOn = 0x2, |
| 69 | reserved = 0x3 |
| 70 | }; |