MdePkg/IndustryStandard/Ipmi: Use union for bitmap fields
This commit enhances the bitmap fields defined in the IPMI header files, union types will be used to provide the users with both the individual bitmap access and the whole byte/word access. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@@ -72,9 +72,16 @@ typedef struct {
|
||||
//
|
||||
// Constants and Structure definitions for "Chassis Control" command to follow here
|
||||
//
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 ChassisControl:4;
|
||||
UINT8 Reserved:4;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_CHASSIS_CONTROL_CHASSIS_CONTROL;
|
||||
|
||||
typedef struct {
|
||||
UINT8 ChassisControl:4;
|
||||
UINT8 Reserved:4;
|
||||
IPMI_CHASSIS_CONTROL_CHASSIS_CONTROL ChassisControl;
|
||||
} IPMI_CHASSIS_CONTROL_REQUEST;
|
||||
|
||||
//
|
||||
@@ -112,9 +119,16 @@ typedef struct {
|
||||
//
|
||||
// Constants and Structure definitions for "Set Power Restore Policy" command to follow here
|
||||
//
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 PowerRestorePolicy : 3;
|
||||
UINT8 Reserved : 5;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_POWER_RESTORE_POLICY;
|
||||
|
||||
typedef struct {
|
||||
UINT8 PowerRestorePolicy:3;
|
||||
UINT8 Reserved:5;
|
||||
IPMI_POWER_RESTORE_POLICY PowerRestorePolicy;
|
||||
} IPMI_SET_POWER_RESTORE_POLICY_REQUEST;
|
||||
|
||||
typedef struct {
|
||||
@@ -130,26 +144,31 @@ typedef struct {
|
||||
//
|
||||
// Constants and Structure definitions for "Get System Restart Cause" command to follow here
|
||||
//
|
||||
typedef enum {
|
||||
Unknown,
|
||||
ChassisControlCommand,
|
||||
ResetViaPushButton,
|
||||
PowerupViaPowerButton,
|
||||
WatchdogExpiration,
|
||||
Oem,
|
||||
AutoPowerOnAlwaysRestore,
|
||||
AutoPowerOnRestorePrevious,
|
||||
ResetViaPef,
|
||||
PowerCycleViaPef,
|
||||
SoftReset,
|
||||
PowerUpViaRtc
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_UNKNOWN 0x0
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_CHASSIS_CONTROL_COMMAND 0x1
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_PUSHBUTTON_RESET 0x2
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_PUSHBUTTON_POWERUP 0x3
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_WATCHDOG_EXPIRE 0x4
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_OEM 0x5
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_AUTO_POWER_ALWAYS_RESTORE 0x6
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_AUTO_POWER_RESTORE_PREV 0x7
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_PEF_RESET 0x8
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_PEF_POWERCYCLE 0x9
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_SOFT_RESET 0xA
|
||||
#define IPMI_SYSTEM_RESTART_CAUSE_RTC_POWERUP 0xB
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 Cause:4;
|
||||
UINT8 Reserved:4;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_SYSTEM_RESTART_CAUSE;
|
||||
|
||||
typedef struct {
|
||||
UINT8 CompletionCode;
|
||||
UINT8 Cause:4;
|
||||
UINT8 Reserved:4;
|
||||
UINT8 ChannelNumber;
|
||||
UINT8 CompletionCode;
|
||||
IPMI_SYSTEM_RESTART_CAUSE RestartCause;
|
||||
UINT8 ChannelNumber;
|
||||
} IPMI_GET_SYSTEM_RESTART_CAUSE_RESPONSE;
|
||||
|
||||
//
|
||||
@@ -160,10 +179,17 @@ typedef struct {
|
||||
//
|
||||
// Constants and Structure definitions for "Set System boot options" command to follow here
|
||||
//
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 ParameterSelector:7;
|
||||
UINT8 MarkParameterInvalid:1;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_SET_BOOT_OPTIONS_PARAMETER_VALID;
|
||||
|
||||
typedef struct {
|
||||
UINT8 ParameterSelector:7;
|
||||
UINT8 MarkParameterInvalid:1;
|
||||
UINT8 ParameterData[1];
|
||||
IPMI_SET_BOOT_OPTIONS_PARAMETER_VALID ParameterValid;
|
||||
UINT8 ParameterData[0];
|
||||
} IPMI_SET_BOOT_OPTIONS_REQUEST;
|
||||
|
||||
//
|
||||
@@ -174,11 +200,18 @@ typedef struct {
|
||||
//
|
||||
// Constants and Structure definitions for "Get System boot options" command to follow here
|
||||
//
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 ParameterSelector:7;
|
||||
UINT8 Reserved:1;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_GET_BOOT_OPTIONS_PARAMETER_SELECTOR;
|
||||
|
||||
typedef struct {
|
||||
UINT8 ParameterSelector:7;
|
||||
UINT8 Reserved:1;
|
||||
UINT8 SetSelector;
|
||||
UINT8 BlockSelector;
|
||||
IPMI_GET_BOOT_OPTIONS_PARAMETER_SELECTOR ParameterSelector;
|
||||
UINT8 SetSelector;
|
||||
UINT8 BlockSelector;
|
||||
} IPMI_GET_BOOT_OPTIONS_REQUEST;
|
||||
|
||||
typedef struct {
|
||||
@@ -217,24 +250,33 @@ typedef struct {
|
||||
//
|
||||
// Response Parameters for IPMI Get Boot Options
|
||||
//
|
||||
typedef struct {
|
||||
UINT8 SetInProgress: 2;
|
||||
UINT8 Reserved: 6;
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 SetInProgress : 2;
|
||||
UINT8 Reserved : 6;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_0;
|
||||
|
||||
typedef struct {
|
||||
UINT8 ServicePartitionSelector;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_1;
|
||||
|
||||
typedef struct {
|
||||
UINT8 ServicePartitionDiscovered:1;
|
||||
UINT8 ServicePartitionScanRequest:1;
|
||||
UINT8 Reserved: 6;
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 ServicePartitionDiscovered : 1;
|
||||
UINT8 ServicePartitionScanRequest : 1;
|
||||
UINT8 Reserved: 6;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_2;
|
||||
|
||||
typedef struct {
|
||||
UINT8 BmcBootFlagValid: 5;
|
||||
UINT8 Reserved: 3;
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 BmcBootFlagValid : 5;
|
||||
UINT8 Reserved : 3;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_3;
|
||||
|
||||
typedef struct {
|
||||
@@ -267,49 +309,76 @@ typedef struct {
|
||||
#define BIOS_MUX_CONTROL_OVERRIDE_FORCE_TO_BMC 0x01
|
||||
#define BIOS_MUX_CONTROL_OVERRIDE_FORCE_TO_SYSTEM 0x02
|
||||
|
||||
typedef struct {
|
||||
//
|
||||
// Data 1
|
||||
//
|
||||
UINT8 Reserved0:5;
|
||||
UINT8 BiosBootType:1;
|
||||
UINT8 PersistentOptions:1;
|
||||
UINT8 BootFlagValid:1;
|
||||
//
|
||||
// Data 2
|
||||
//
|
||||
UINT8 LockReset:1;
|
||||
UINT8 ScreenBlank:1;
|
||||
UINT8 BootDeviceSelector:4;
|
||||
UINT8 LockKeyboard:1;
|
||||
UINT8 CmosClear:1;
|
||||
//
|
||||
// Data 3
|
||||
//
|
||||
UINT8 ConsoleRedirection:2;
|
||||
UINT8 LockSleep:1;
|
||||
UINT8 UserPasswordBypass:1;
|
||||
UINT8 ForceProgressEventTrap:1;
|
||||
UINT8 BiosVerbosity:2;
|
||||
UINT8 LockPower:1;
|
||||
//
|
||||
// Data 4
|
||||
//
|
||||
UINT8 BiosMuxControlOverride:3;
|
||||
UINT8 BiosSharedModeOverride:1;
|
||||
UINT8 Reserved1:4;
|
||||
//
|
||||
// Data 5
|
||||
//
|
||||
UINT8 DeviceInstanceSelector:5;
|
||||
UINT8 Reserved2:3;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5;
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 Reserved:5;
|
||||
UINT8 BiosBootType:1;
|
||||
UINT8 PersistentOptions:1;
|
||||
UINT8 BootFlagValid:1;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5_DATA_1;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 LockReset:1;
|
||||
UINT8 ScreenBlank:1;
|
||||
UINT8 BootDeviceSelector:4;
|
||||
UINT8 LockKeyboard:1;
|
||||
UINT8 CmosClear:1;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5_DATA_2;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 ConsoleRedirection:2;
|
||||
UINT8 LockSleep:1;
|
||||
UINT8 UserPasswordBypass:1;
|
||||
UINT8 ForceProgressEventTrap:1;
|
||||
UINT8 BiosVerbosity:2;
|
||||
UINT8 LockPower:1;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5_DATA_3;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 BiosMuxControlOverride:3;
|
||||
UINT8 BiosSharedModeOverride:1;
|
||||
UINT8 Reserved:4;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5_DATA_4;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 DeviceInstanceSelector:5;
|
||||
UINT8 Reserved:3;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5_DATA_5;
|
||||
|
||||
typedef struct {
|
||||
UINT8 ChannelNumber:4;
|
||||
UINT8 Reserved:4;
|
||||
UINT8 SessionId[4];
|
||||
UINT8 BootInfoTimeStamp[4];
|
||||
IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5_DATA_1 Data1;
|
||||
IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5_DATA_2 Data2;
|
||||
IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5_DATA_3 Data3;
|
||||
IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5_DATA_4 Data4;
|
||||
IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5_DATA_5 Data5;
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 ChannelNumber:4;
|
||||
UINT8 Reserved:4;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_BOOT_OPTIONS_CHANNEL_NUMBER;
|
||||
|
||||
typedef struct {
|
||||
IPMI_BOOT_OPTIONS_CHANNEL_NUMBER ChannelNumber;
|
||||
UINT8 SessionId[4];
|
||||
UINT8 BootInfoTimeStamp[4];
|
||||
} IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_6;
|
||||
|
||||
typedef struct {
|
||||
@@ -328,13 +397,27 @@ typedef union {
|
||||
IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_7 Parm7;
|
||||
} IPMI_BOOT_OPTIONS_PARAMETERS;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 ParameterVersion:4;
|
||||
UINT8 Reserved:4;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_GET_BOOT_OPTIONS_PARAMETER_VERSION;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 ParameterSelector:7;
|
||||
UINT8 ParameterValid:1;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_GET_BOOT_OPTIONS_PARAMETER_VALID;
|
||||
|
||||
typedef struct {
|
||||
UINT8 CompletionCode;
|
||||
UINT8 ParameterVersion:4;
|
||||
UINT8 Reserved:4;
|
||||
UINT8 ParameterSelector:7;
|
||||
UINT8 ParameterValid:1;
|
||||
UINT8 ParameterData[1];
|
||||
UINT8 CompletionCode;
|
||||
IPMI_GET_BOOT_OPTIONS_PARAMETER_VERSION ParameterVersion;
|
||||
IPMI_GET_BOOT_OPTIONS_PARAMETER_VALID ParameterValid;
|
||||
UINT8 ParameterData[0];
|
||||
} IPMI_GET_BOOT_OPTIONS_RESPONSE;
|
||||
|
||||
//
|
||||
@@ -342,17 +425,23 @@ typedef struct {
|
||||
//
|
||||
#define IPMI_CHASSIS_SET_FRONT_PANEL_BUTTON_ENABLES 0x0A
|
||||
|
||||
typedef struct {
|
||||
UINT8 DisablePoweroffButton:1;
|
||||
UINT8 DisableResetButton:1;
|
||||
UINT8 DisableDiagnosticInterruptButton:1;
|
||||
UINT8 DisableStandbyButton:1;
|
||||
UINT8 Reserved:4;
|
||||
} IPMI_CHASSIS_SET_FRONT_PANEL_BUTTON_ENABLES_REQUEST;
|
||||
|
||||
//
|
||||
// Constants and Structure definitions for "Set front panel button enables" command to follow here
|
||||
//
|
||||
typedef union {
|
||||
struct {
|
||||
UINT8 DisablePoweroffButton:1;
|
||||
UINT8 DisableResetButton:1;
|
||||
UINT8 DisableDiagnosticInterruptButton:1;
|
||||
UINT8 DisableStandbyButton:1;
|
||||
UINT8 Reserved:4;
|
||||
} Bits;
|
||||
UINT8 Uint8;
|
||||
} IPMI_FRONT_PANEL_BUTTON_ENABLES;
|
||||
|
||||
typedef struct {
|
||||
IPMI_FRONT_PANEL_BUTTON_ENABLES FrontPanelButtonEnables;
|
||||
} IPMI_CHASSIS_SET_FRONT_PANEL_BUTTON_ENABLES_REQUEST;
|
||||
|
||||
//
|
||||
// Definitions for Set Power Cycle Interval command
|
||||
|
Reference in New Issue
Block a user