146470a38SPatrick Venture #pragma once
246470a38SPatrick Venture 
346470a38SPatrick Venture #include <stdint.h>
446470a38SPatrick Venture 
546470a38SPatrick Venture #include <cstddef>
646470a38SPatrick Venture 
746470a38SPatrick Venture // IPMI commands for Chassis net functions.
846470a38SPatrick Venture enum ipmi_netfn_chassis_cmds
946470a38SPatrick Venture {
1046470a38SPatrick Venture     IPMI_CMD_GET_CHASSIS_CAP = 0x00,
1146470a38SPatrick Venture     // Chassis Status
1246470a38SPatrick Venture     IPMI_CMD_CHASSIS_STATUS = 0x01,
1346470a38SPatrick Venture     // Chassis Control
1446470a38SPatrick Venture     IPMI_CMD_CHASSIS_CONTROL = 0x02,
1546470a38SPatrick Venture     IPMI_CMD_CHASSIS_IDENTIFY = 0x04,
16ae4b040bSYong Li     IPMI_CMD_SET_CHASSIS_CAP = 0x05,
1746470a38SPatrick Venture     // Set Power Restore Policy
1846470a38SPatrick Venture     IPMI_CMD_SET_RESTORE_POLICY = 0x06,
1946470a38SPatrick Venture     // Get capability bits
2046470a38SPatrick Venture     IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08,
2146470a38SPatrick Venture     IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09,
2246470a38SPatrick Venture     IPMI_CMD_GET_POH_COUNTER = 0x0F,
2346470a38SPatrick Venture };
2446470a38SPatrick Venture 
2546470a38SPatrick Venture // Command specific completion codes
2646470a38SPatrick Venture enum ipmi_chassis_return_codes
2746470a38SPatrick Venture {
2846470a38SPatrick Venture     IPMI_OK = 0x0,
2946470a38SPatrick Venture     IPMI_CC_PARM_NOT_SUPPORTED = 0x80,
3046470a38SPatrick Venture };
3146470a38SPatrick Venture 
3246470a38SPatrick Venture // Generic completion codes,
3346470a38SPatrick Venture // see IPMI doc section 5.2
3446470a38SPatrick Venture enum ipmi_generic_return_codes
3546470a38SPatrick Venture {
3646470a38SPatrick Venture     IPMI_OUT_OF_SPACE = 0xC4,
3746470a38SPatrick Venture };
3846470a38SPatrick Venture 
3946470a38SPatrick Venture // Various Chassis operations under a single command.
4046470a38SPatrick Venture enum ipmi_chassis_control_cmds : uint8_t
4146470a38SPatrick Venture {
4246470a38SPatrick Venture     CMD_POWER_OFF = 0x00,
4346470a38SPatrick Venture     CMD_POWER_ON = 0x01,
4446470a38SPatrick Venture     CMD_POWER_CYCLE = 0x02,
4546470a38SPatrick Venture     CMD_HARD_RESET = 0x03,
4646470a38SPatrick Venture     CMD_PULSE_DIAGNOSTIC_INTR = 0x04,
4746470a38SPatrick Venture     CMD_SOFT_OFF_VIA_OVER_TEMP = 0x05,
4846470a38SPatrick Venture };
4946470a38SPatrick Venture enum class BootOptionParameter : size_t
5046470a38SPatrick Venture {
5146470a38SPatrick Venture     BOOT_INFO = 0x4,
5246470a38SPatrick Venture     BOOT_FLAGS = 0x5,
5346470a38SPatrick Venture     OPAL_NETWORK_SETTINGS = 0x61
5446470a38SPatrick Venture };
5546470a38SPatrick Venture 
5646470a38SPatrick Venture enum class BootOptionResponseSize : size_t
5746470a38SPatrick Venture {
5846470a38SPatrick Venture     BOOT_FLAGS = 5,
5946470a38SPatrick Venture     OPAL_NETWORK_SETTINGS = 50
6046470a38SPatrick Venture };
61*f4e38515SYong Li 
62*f4e38515SYong Li enum class ChassisIDState : uint8_t
63*f4e38515SYong Li {
64*f4e38515SYong Li     off = 0x0,
65*f4e38515SYong Li     temporaryOn = 0x1,
66*f4e38515SYong Li     indefiniteOn = 0x2,
67*f4e38515SYong Li     reserved = 0x3
68*f4e38515SYong Li };
69