blob: 0c6d5a27523d1605d199a5ba60669f30e6cc30b6 [file] [log] [blame]
Adriana Kobylak40814c62015-10-27 15:58:44 -05001#ifndef __HOST_IPMI_CHASSIS_HANDLER_H__
2#define __HOST_IPMI_CHASSIS_HANDLER_H__
3
vishwa36993272015-11-20 12:43:49 -06004#include <stdint.h>
Patrick Venture0b02be92018-08-31 11:55:55 -07005
Ratan Guptafd28dd72016-08-01 04:58:01 -05006#include <cstddef>
vishwa36993272015-11-20 12:43:49 -06007
Adriana Kobylak40814c62015-10-27 15:58:44 -05008// IPMI commands for Chassis net functions.
Kuiying Wang49a33f92018-07-26 16:24:22 +08009enum ipmi_netfn_chassis_cmds
Adriana Kobylak40814c62015-10-27 15:58:44 -050010{
Patrick Venture0b02be92018-08-31 11:55:55 -070011 IPMI_CMD_GET_CHASSIS_CAP = 0x00,
Nan Lifdd8ec52016-08-28 03:57:40 +080012 // Chassis Status
Patrick Venture0b02be92018-08-31 11:55:55 -070013 IPMI_CMD_CHASSIS_STATUS = 0x01,
Tom Joseph5110c122018-03-23 17:55:40 +053014 // Chassis Control
Patrick Venture0b02be92018-08-31 11:55:55 -070015 IPMI_CMD_CHASSIS_CONTROL = 0x02,
16 IPMI_CMD_CHASSIS_IDENTIFY = 0x04,
Yong Lic6713cf2018-09-12 12:35:13 +080017 // Set Power Restore Policy
18 IPMI_CMD_SET_RESTORE_POLICY = 0x06,
Adriana Kobylak40814c62015-10-27 15:58:44 -050019 // Get capability bits
shgoupfd84fbbf2015-12-17 10:05:51 +080020 IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08,
Adriana Kobylak40814c62015-10-27 15:58:44 -050021 IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09,
Patrick Venture0b02be92018-08-31 11:55:55 -070022 IPMI_CMD_GET_POH_COUNTER = 0x0F,
Adriana Kobylak40814c62015-10-27 15:58:44 -050023};
24
25// Command specific completion codes
26enum ipmi_chassis_return_codes
27{
shgoupfd84fbbf2015-12-17 10:05:51 +080028 IPMI_OK = 0x0,
Adriana Kobylak40814c62015-10-27 15:58:44 -050029 IPMI_CC_PARM_NOT_SUPPORTED = 0x80,
30};
31
shgoupfd84fbbf2015-12-17 10:05:51 +080032// Generic completion codes,
33// see IPMI doc section 5.2
34enum ipmi_generic_return_codes
35{
36 IPMI_OUT_OF_SPACE = 0xC4,
37};
38
vishwa36993272015-11-20 12:43:49 -060039// Various Chassis operations under a single command.
40enum ipmi_chassis_control_cmds : uint8_t
41{
Patrick Venture0b02be92018-08-31 11:55:55 -070042 CMD_POWER_OFF = 0x00,
43 CMD_POWER_ON = 0x01,
44 CMD_POWER_CYCLE = 0x02,
45 CMD_HARD_RESET = 0x03,
46 CMD_PULSE_DIAGNOSTIC_INTR = 0x04,
47 CMD_SOFT_OFF_VIA_OVER_TEMP = 0x05,
vishwa36993272015-11-20 12:43:49 -060048};
Ratan Guptafd28dd72016-08-01 04:58:01 -050049enum class BootOptionParameter : size_t
50{
Patrick Venture0b02be92018-08-31 11:55:55 -070051 BOOT_INFO = 0x4,
52 BOOT_FLAGS = 0x5,
53 OPAL_NETWORK_SETTINGS = 0x61
Ratan Guptafd28dd72016-08-01 04:58:01 -050054};
55
56enum class BootOptionResponseSize : size_t
57{
Patrick Venture0b02be92018-08-31 11:55:55 -070058 BOOT_FLAGS = 5,
59 OPAL_NETWORK_SETTINGS = 50
Ratan Guptafd28dd72016-08-01 04:58:01 -050060};
vishwa36993272015-11-20 12:43:49 -060061
Adriana Kobylak40814c62015-10-27 15:58:44 -050062#endif