1 #pragma once 2 3 #include <stdint.h> 4 5 #include <cstddef> 6 7 // IPMI commands for Chassis net functions. 8 enum ipmi_netfn_chassis_cmds 9 { 10 IPMI_CMD_GET_CHASSIS_CAP = 0x00, 11 // Chassis Status 12 IPMI_CMD_CHASSIS_STATUS = 0x01, 13 // Chassis Control 14 IPMI_CMD_CHASSIS_CONTROL = 0x02, 15 IPMI_CMD_CHASSIS_IDENTIFY = 0x04, 16 IPMI_CMD_SET_CHASSIS_CAP = 0x05, 17 // Get capability bits 18 IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08, 19 IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09, 20 IPMI_CMD_GET_POH_COUNTER = 0x0F, 21 }; 22 23 // Command specific completion codes 24 enum ipmi_chassis_return_codes 25 { 26 IPMI_OK = 0x0, 27 IPMI_CC_PARM_NOT_SUPPORTED = 0x80, 28 IPMI_CC_FAIL_SET_IN_PROGRESS = 0x81, 29 }; 30 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 38 // Various Chassis operations under a single command. 39 enum ipmi_chassis_control_cmds : uint8_t 40 { 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, 47 }; 48 enum class BootOptionParameter : size_t 49 { 50 setInProgress = 0x0, 51 bootInfo = 0x4, 52 bootFlags = 0x5, 53 opalNetworkSettings = 0x61 54 }; 55 56 enum class BootOptionResponseSize : size_t 57 { 58 setInProgress = 3, 59 bootFlags = 5, 60 opalNetworkSettings = 50 61 }; 62 63 enum class ChassisIDState : uint8_t 64 { 65 off = 0x0, 66 temporaryOn = 0x1, 67 indefiniteOn = 0x2, 68 reserved = 0x3 69 }; 70