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     // Get capability bits
1846470a38SPatrick Venture     IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08,
1946470a38SPatrick Venture     IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09,
2046470a38SPatrick Venture     IPMI_CMD_GET_POH_COUNTER = 0x0F,
2146470a38SPatrick Venture };
2246470a38SPatrick Venture 
2346470a38SPatrick Venture // Command specific completion codes
2446470a38SPatrick Venture enum ipmi_chassis_return_codes
2546470a38SPatrick Venture {
2646470a38SPatrick Venture     IPMI_OK = 0x0,
2746470a38SPatrick Venture     IPMI_CC_PARM_NOT_SUPPORTED = 0x80,
28ab369285Shuanghe     IPMI_CC_FAIL_SET_IN_PROGRESS = 0x81,
2946470a38SPatrick Venture };
3046470a38SPatrick Venture 
3146470a38SPatrick Venture // Generic completion codes,
3246470a38SPatrick Venture // see IPMI doc section 5.2
3346470a38SPatrick Venture enum ipmi_generic_return_codes
3446470a38SPatrick Venture {
3546470a38SPatrick Venture     IPMI_OUT_OF_SPACE = 0xC4,
3646470a38SPatrick Venture };
3746470a38SPatrick Venture 
3846470a38SPatrick Venture // Various Chassis operations under a single command.
3946470a38SPatrick Venture enum ipmi_chassis_control_cmds : uint8_t
4046470a38SPatrick Venture {
4146470a38SPatrick Venture     CMD_POWER_OFF = 0x00,
4246470a38SPatrick Venture     CMD_POWER_ON = 0x01,
4346470a38SPatrick Venture     CMD_POWER_CYCLE = 0x02,
4446470a38SPatrick Venture     CMD_HARD_RESET = 0x03,
4546470a38SPatrick Venture     CMD_PULSE_DIAGNOSTIC_INTR = 0x04,
4646470a38SPatrick Venture     CMD_SOFT_OFF_VIA_OVER_TEMP = 0x05,
4746470a38SPatrick Venture };
4846470a38SPatrick Venture enum class BootOptionParameter : size_t
4946470a38SPatrick Venture {
50ab369285Shuanghe     setInProgress = 0x0,
51*86ac4991SChen Yugang     bootFlagValidClr = 0x3,
52bfd8fc4bSjayaprakash Mutyala     bootInfo = 0x4,
53bfd8fc4bSjayaprakash Mutyala     bootFlags = 0x5,
54bfd8fc4bSjayaprakash Mutyala     opalNetworkSettings = 0x61
5546470a38SPatrick Venture };
5646470a38SPatrick Venture 
5746470a38SPatrick Venture enum class BootOptionResponseSize : size_t
5846470a38SPatrick Venture {
59ab369285Shuanghe     setInProgress = 3,
60bfd8fc4bSjayaprakash Mutyala     bootFlags = 5,
61bfd8fc4bSjayaprakash Mutyala     opalNetworkSettings = 50
6246470a38SPatrick Venture };
63f4e38515SYong Li 
64f4e38515SYong Li enum class ChassisIDState : uint8_t
65f4e38515SYong Li {
66f4e38515SYong Li     off = 0x0,
67f4e38515SYong Li     temporaryOn = 0x1,
68f4e38515SYong Li     indefiniteOn = 0x2,
69f4e38515SYong Li     reserved = 0x3
70f4e38515SYong Li };
71