blob: 6535c0e9bad825547dcbe7d76d36986be3b42d76 [file] [log] [blame]
Patrick Venture46470a32018-09-07 19:26:25 -07001#pragma once
Adriana Kobylak40814c62015-10-27 15:58:44 -05002
vishwa36993272015-11-20 12:43:49 -06003#include <stdint.h>
Patrick Venture0b02be92018-08-31 11:55:55 -07004
Ratan Guptafd28dd72016-08-01 04:58:01 -05005#include <cstddef>
vishwa36993272015-11-20 12:43:49 -06006
Adriana Kobylak40814c62015-10-27 15:58:44 -05007// IPMI commands for Chassis net functions.
Kuiying Wang49a33f92018-07-26 16:24:22 +08008enum ipmi_netfn_chassis_cmds
Adriana Kobylak40814c62015-10-27 15:58:44 -05009{
Patrick Venture0b02be92018-08-31 11:55:55 -070010 IPMI_CMD_GET_CHASSIS_CAP = 0x00,
Nan Lifdd8ec52016-08-28 03:57:40 +080011 // Chassis Status
Patrick Venture0b02be92018-08-31 11:55:55 -070012 IPMI_CMD_CHASSIS_STATUS = 0x01,
Tom Joseph5110c122018-03-23 17:55:40 +053013 // Chassis Control
Patrick Venture0b02be92018-08-31 11:55:55 -070014 IPMI_CMD_CHASSIS_CONTROL = 0x02,
15 IPMI_CMD_CHASSIS_IDENTIFY = 0x04,
Yong Lic6713cf2018-09-12 12:35:13 +080016 // Set Power Restore Policy
17 IPMI_CMD_SET_RESTORE_POLICY = 0x06,
Adriana Kobylak40814c62015-10-27 15:58:44 -050018 // Get capability bits
shgoupfd84fbbf2015-12-17 10:05:51 +080019 IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08,
Adriana Kobylak40814c62015-10-27 15:58:44 -050020 IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09,
Patrick Venture0b02be92018-08-31 11:55:55 -070021 IPMI_CMD_GET_POH_COUNTER = 0x0F,
Adriana Kobylak40814c62015-10-27 15:58:44 -050022};
23
24// Command specific completion codes
25enum ipmi_chassis_return_codes
26{
shgoupfd84fbbf2015-12-17 10:05:51 +080027 IPMI_OK = 0x0,
Adriana Kobylak40814c62015-10-27 15:58:44 -050028 IPMI_CC_PARM_NOT_SUPPORTED = 0x80,
29};
30
shgoupfd84fbbf2015-12-17 10:05:51 +080031// Generic completion codes,
32// see IPMI doc section 5.2
33enum ipmi_generic_return_codes
34{
35 IPMI_OUT_OF_SPACE = 0xC4,
36};
37
vishwa36993272015-11-20 12:43:49 -060038// Various Chassis operations under a single command.
39enum ipmi_chassis_control_cmds : uint8_t
40{
Patrick Venture0b02be92018-08-31 11:55:55 -070041 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,
vishwa36993272015-11-20 12:43:49 -060047};
Ratan Guptafd28dd72016-08-01 04:58:01 -050048enum class BootOptionParameter : size_t
49{
Patrick Venture0b02be92018-08-31 11:55:55 -070050 BOOT_INFO = 0x4,
51 BOOT_FLAGS = 0x5,
52 OPAL_NETWORK_SETTINGS = 0x61
Ratan Guptafd28dd72016-08-01 04:58:01 -050053};
54
55enum class BootOptionResponseSize : size_t
56{
Patrick Venture0b02be92018-08-31 11:55:55 -070057 BOOT_FLAGS = 5,
58 OPAL_NETWORK_SETTINGS = 50
Ratan Guptafd28dd72016-08-01 04:58:01 -050059};