chassis

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemPowerStateS0G0       uint8 = 0x00
	SystemPowerStateS1         uint8 = 0x01
	SystemPowerStateS2         uint8 = 0x02
	SystemPowerStateS3         uint8 = 0x03
	SystemPowerStateS4         uint8 = 0x04
	SystemPowerStateS5G2       uint8 = 0x05
	SystemPowerStateS4S5       uint8 = 0x06
	SystemPowerStateG3         uint8 = 0x07
	SystemPowerStateSleeping   uint8 = 0x08
	SystemPowerStateG1Sleeping uint8 = 0x09
	SystemPowerStateOverride   uint8 = 0x0a
	SystemPowerStateLegacyOn   uint8 = 0x20
	SystemPowerStateLegacyOff  uint8 = 0x21
	SystemPowerStateUnknown    uint8 = 0x2a
	SystemPowerStateNoChange   uint8 = 0x7f
)
View Source
const (
	DevicePowerStateD0       uint8 = 0x00
	DevicePowerStateD1       uint8 = 0x01
	DevicePowerStateD2       uint8 = 0x02
	DevicePowerStateD3       uint8 = 0x03
	DevicePowerStateUnknown  uint8 = 0x2a
	DevicePowerStateNoChange uint8 = 0x7f
)

Variables

View Source
var SupportedPowerRestorePolicies = []string{
	"always-off", "always-on", "previous",
}

Functions

This section is empty.

Types

type ChassisControl

type ChassisControl uint8
const (
	ChassisControlPowerDown           ChassisControl = 0 // down, off
	ChassisControlPowerUp             ChassisControl = 1
	ChassisControlPowerCycle          ChassisControl = 2
	ChassisControlHardReset           ChassisControl = 3
	ChassisControlDiagnosticInterrupt ChassisControl = 4
	ChassisControlSoftShutdown        ChassisControl = 5
)

type ChassisControlRequest

type ChassisControlRequest struct {
	ChassisControl ChassisControl
}

28.3 Chassis Control Command

func (*ChassisControlRequest) Command

func (req *ChassisControlRequest) Command() types.Command

func (*ChassisControlRequest) Pack

func (req *ChassisControlRequest) Pack() []byte

func (*ChassisControlRequest) Unpack

func (req *ChassisControlRequest) Unpack(msg []byte) error

Unpack parses a Chassis Control request body (§28.3): a single byte whose lower nibble is the action. Upper nibble is reserved and ignored.

type ChassisControlResponse

type ChassisControlResponse struct {
}

func (*ChassisControlResponse) Format

func (res *ChassisControlResponse) Format() string

func (*ChassisControlResponse) Unpack

func (res *ChassisControlResponse) Unpack(msg []byte) error

type ChassisIdentifyRequest

type ChassisIdentifyRequest struct {
	IdentifyInterval uint8
	ForceIdentifyOn  bool
}

28.5 Chassis Identify Command. Causes the chassis to physically identify itself (blinking lights, beeps, LCD panel, etc.).

func (*ChassisIdentifyRequest) Command

func (req *ChassisIdentifyRequest) Command() types.Command

func (*ChassisIdentifyRequest) Pack

func (req *ChassisIdentifyRequest) Pack() []byte

type ChassisIdentifyResponse

type ChassisIdentifyResponse struct {
}

func (*ChassisIdentifyResponse) Format

func (res *ChassisIdentifyResponse) Format() string

func (*ChassisIdentifyResponse) Unpack

func (res *ChassisIdentifyResponse) Unpack(msg []byte) error

type ChassisIdentifyState

type ChassisIdentifyState uint8
const (
	ChassisIdentifyStateOff          ChassisIdentifyState = 0
	ChassisIdentifyStateTemporaryOn  ChassisIdentifyState = 1
	ChassisIdentifyStateIndefiniteOn ChassisIdentifyState = 2
)

func (ChassisIdentifyState) String

func (c ChassisIdentifyState) String() string

type ChassisResetRequest

type ChassisResetRequest struct {
}

28.4 Chassis Reset Command. This command was used with early versions of the ICMB. It has been superseded by the Chassis Control command. For host systems, this corresponds to a system hard reset.

func (*ChassisResetRequest) Command

func (req *ChassisResetRequest) Command() types.Command

func (*ChassisResetRequest) Pack

func (req *ChassisResetRequest) Pack() []byte

type ChassisResetResponse

type ChassisResetResponse struct {
}

func (*ChassisResetResponse) Format

func (res *ChassisResetResponse) Format() string

func (*ChassisResetResponse) Unpack

func (res *ChassisResetResponse) Unpack(msg []byte) error

type DevicePowerState

type DevicePowerState uint8

func (DevicePowerState) String

func (s DevicePowerState) String() string

type GetACPIPowerStateRequest

type GetACPIPowerStateRequest struct {
}

20.7 Get ACPI Power State Command. Returns the present ACPI power state of the system.

func (*GetACPIPowerStateRequest) Command

func (req *GetACPIPowerStateRequest) Command() types.Command

func (*GetACPIPowerStateRequest) Pack

func (req *GetACPIPowerStateRequest) Pack() []byte

type GetACPIPowerStateResponse

type GetACPIPowerStateResponse struct {
	SystemPowerState SystemPowerState
	DevicePowerState DevicePowerState
}

func (*GetACPIPowerStateResponse) Format

func (res *GetACPIPowerStateResponse) Format() string

func (*GetACPIPowerStateResponse) Unpack

func (res *GetACPIPowerStateResponse) Unpack(msg []byte) error

type GetChassisCapabilitiesRequest

type GetChassisCapabilitiesRequest struct {
}

func (*GetChassisCapabilitiesRequest) Command

func (*GetChassisCapabilitiesRequest) Pack

func (req *GetChassisCapabilitiesRequest) Pack() []byte

type GetChassisCapabilitiesResponse

type GetChassisCapabilitiesResponse struct {
	ProvidePowerInterlock      bool
	ProvideDiagnosticInterrupt bool
	ProvideFrontPanelLockout   bool
	ProvideIntrusionSensor     bool

	// Chassis FRU Device
	FRUDeviceAddress uint8

	SDRDeviceAddress uint8

	SELDeviceAddress uint8

	SystemManagementDeviceAddress uint8

	//  If this field is not provided, the address is assumed to be the BMC address (20h).
	BridgeDeviceAddress uint8
}

func (*GetChassisCapabilitiesResponse) Format

func (res *GetChassisCapabilitiesResponse) Format() string

func (*GetChassisCapabilitiesResponse) Unpack

func (res *GetChassisCapabilitiesResponse) Unpack(msg []byte) error

type GetChassisStatusRequest

type GetChassisStatusRequest struct {
}

28.2 Get Chassis Status Command

func (*GetChassisStatusRequest) Command

func (req *GetChassisStatusRequest) Command() types.Command

func (*GetChassisStatusRequest) Pack

func (req *GetChassisStatusRequest) Pack() []byte

type GetChassisStatusResponse

type GetChassisStatusResponse struct {
	// Current Power State
	PowerRestorePolicy PowerRestorePolicy
	PowerControlFault  bool // Controller attempted to turn system power on or off, but system did not enter desired state.
	PowerFault         bool // fault detected in main power subsystem
	InterLock          bool // chassis is presently shut down because a chassis	panel interlock switch is active
	PowerOverload      bool // system shutdown because of power overload condition.
	PowerIsOn          bool // 系统电源:上电

	// Last Power Event
	LastPowerOnByCommand                   bool
	LastPowerDownByPowerFault              bool
	LastPowerDownByPowerInterlockActivated bool
	LastPowerDownByPowerOverload           bool
	ACFailed                               bool

	// Misc. Chassis State
	ChassisIdentifySupported bool
	ChassisIdentifyState     ChassisIdentifyState
	CollingFanFault          bool
	DriveFault               bool
	FrontPanelLockoutActive  bool // (power off and reset via chassis push-buttons disabled. 前面板锁定)
	ChassisIntrusionActive   bool // 机箱入侵:(机箱盖被打开)

	// Front Panel Button Capabilities and disable/enable status (Optional)
	SleepButtonDisableAllowed      bool
	DiagnosticButtonDisableAllowed bool
	ResetButtonDisableAllowed      bool
	PoweroffButtonDisableAllowed   bool
	SleepButtonDisabled            bool
	DiagnosticButtonDisabled       bool
	ResetButtonDisabled            bool
	PoweroffButtonDisabled         bool
}

func (*GetChassisStatusResponse) Format

func (res *GetChassisStatusResponse) Format() string

func (*GetChassisStatusResponse) Pack

func (res *GetChassisStatusResponse) Pack() []byte

Pack serialises the response per the bit layout in §28.2 Table 28-3, the inverse of GetChassisStatusResponse.Unpack. Byte 3 (front-panel button disables) is always emitted per spec: "Return as 00h if the panel button disable function is not supported."

func (*GetChassisStatusResponse) Unpack

func (res *GetChassisStatusResponse) Unpack(msg []byte) error

type GetPOHCounterRequest

type GetPOHCounterRequest struct {
}

28.14 Get POH Counter Command. Returns the Power-On Hours counter reading and counts per hour.

func (*GetPOHCounterRequest) Command

func (req *GetPOHCounterRequest) Command() types.Command

func (*GetPOHCounterRequest) Pack

func (req *GetPOHCounterRequest) Pack() []byte

type GetPOHCounterResponse

type GetPOHCounterResponse struct {
	MinutesPerCount uint8
	CounterReading  uint32
}

func (*GetPOHCounterResponse) Format

func (res *GetPOHCounterResponse) Format() string

func (*GetPOHCounterResponse) Minutes

func (res *GetPOHCounterResponse) Minutes() uint32

func (*GetPOHCounterResponse) Unpack

func (res *GetPOHCounterResponse) Unpack(msg []byte) error

type GetSystemBootOptionsParamRequest

type GetSystemBootOptionsParamRequest struct {
	ParamSelector types.BootOptionParamSelector
	SetSelector   uint8
	BlockSelector uint8
}

28.13 Get System Boot Options Command

func (*GetSystemBootOptionsParamRequest) Command

func (*GetSystemBootOptionsParamRequest) Pack

func (req *GetSystemBootOptionsParamRequest) Pack() []byte

type GetSystemBootOptionsParamResponse

type GetSystemBootOptionsParamResponse struct {
	ParameterVersion uint8

	// [7] - 1b = mark parameter invalid / locked
	// 0b = mark parameter valid / unlocked
	ParameterInValid bool
	// [6:0] - boot option parameter selector
	ParamSelector types.BootOptionParamSelector

	ParamData []byte // origin parameter data
}

func (*GetSystemBootOptionsParamResponse) Format

func (*GetSystemBootOptionsParamResponse) Unpack

func (res *GetSystemBootOptionsParamResponse) Unpack(msg []byte) error

type GetSystemRestartCauseRequest

type GetSystemRestartCauseRequest struct {
}

28.11 Get System Restart Cause Command

func (*GetSystemRestartCauseRequest) Command

func (*GetSystemRestartCauseRequest) Pack

func (req *GetSystemRestartCauseRequest) Pack() []byte

type GetSystemRestartCauseResponse

type GetSystemRestartCauseResponse struct {
	SystemRestartCause SystemRestartCause
	ChannelNumber      uint8
}

func (*GetSystemRestartCauseResponse) Format

func (res *GetSystemRestartCauseResponse) Format() string

func (*GetSystemRestartCauseResponse) Unpack

func (res *GetSystemRestartCauseResponse) Unpack(msg []byte) error

type PowerRestorePolicy

type PowerRestorePolicy uint8

PowerRestorePolicy 通电开机策略

const (
	PowerRestorePolicyAlwaysOff PowerRestorePolicy = 0 // 保持下电(关机)
	PowerRestorePolicyPrevious  PowerRestorePolicy = 1 // 与之前保持一致(恢复断电前状态)
	PowerRestorePolicyAlwaysOn  PowerRestorePolicy = 2 // 保持上电(开机)
)

func (PowerRestorePolicy) String

func (p PowerRestorePolicy) String() string

type SetACPIPowerStateRequest

type SetACPIPowerStateRequest struct {
	SetSystemPowerState bool // false means don't change system power state
	SystemPowerState    SystemPowerState
	SetDevicePowerState bool // false means don't change device power state
	DevicePowerState    DevicePowerState
}

20.6 Set ACPI Power State Command. Allows system software to report the present ACPI power state to a controller.

func (*SetACPIPowerStateRequest) Command

func (req *SetACPIPowerStateRequest) Command() types.Command

func (*SetACPIPowerStateRequest) Pack

func (req *SetACPIPowerStateRequest) Pack() []byte

type SetACPIPowerStateResponse

type SetACPIPowerStateResponse struct {
}

func (*SetACPIPowerStateResponse) Format

func (res *SetACPIPowerStateResponse) Format() string

func (*SetACPIPowerStateResponse) Unpack

func (res *SetACPIPowerStateResponse) Unpack(msg []byte) error

type SetChassisCapabilitiesRequest

type SetChassisCapabilitiesRequest struct {
	ProvideFrontPanelLockout bool
	ProvideIntrusionSensor   bool

	FRUDeviceAddress uint8

	SDRDeviceAddress uint8

	SELDeviceAddress uint8

	SystemManagementDeviceAddress uint8

	BridgeDeviceAddress uint8
}

func (*SetChassisCapabilitiesRequest) Command

func (*SetChassisCapabilitiesRequest) Pack

func (req *SetChassisCapabilitiesRequest) Pack() []byte

type SetChassisCapabilitiesResponse

type SetChassisCapabilitiesResponse struct {
}

func (*SetChassisCapabilitiesResponse) Format

func (res *SetChassisCapabilitiesResponse) Format() string

func (*SetChassisCapabilitiesResponse) Unpack

func (res *SetChassisCapabilitiesResponse) Unpack(msg []byte) error

type SetFrontPanelEnablesRequest

type SetFrontPanelEnablesRequest struct {
	DisableSleepButton      bool
	DisableDiagnosticButton bool
	DisableResetButton      bool
	DisablePoweroffButton   bool
}

28.6 Set Front Panel Enables. Enables or disables front-panel buttons.

func (*SetFrontPanelEnablesRequest) Command

func (req *SetFrontPanelEnablesRequest) Command() types.Command

func (*SetFrontPanelEnablesRequest) Pack

func (req *SetFrontPanelEnablesRequest) Pack() []byte

type SetFrontPanelEnablesResponse

type SetFrontPanelEnablesResponse struct {
}

func (*SetFrontPanelEnablesResponse) Format

func (res *SetFrontPanelEnablesResponse) Format() string

func (*SetFrontPanelEnablesResponse) Unpack

func (res *SetFrontPanelEnablesResponse) Unpack(msg []byte) error

type SetPowerCycleIntervalRequest

type SetPowerCycleIntervalRequest struct {
	IntervalInSec uint8
}

func (*SetPowerCycleIntervalRequest) Command

func (*SetPowerCycleIntervalRequest) Pack

func (req *SetPowerCycleIntervalRequest) Pack() []byte

type SetPowerCycleIntervalResponse

type SetPowerCycleIntervalResponse struct {
}

func (*SetPowerCycleIntervalResponse) Format

func (res *SetPowerCycleIntervalResponse) Format() string

func (*SetPowerCycleIntervalResponse) Unpack

func (res *SetPowerCycleIntervalResponse) Unpack(msg []byte) error

type SetPowerRestorePolicyRequest

type SetPowerRestorePolicyRequest struct {
	PowerRestorePolicy
}

28.8 Set Power Restore Policy Command

func (*SetPowerRestorePolicyRequest) Command

func (*SetPowerRestorePolicyRequest) Pack

func (req *SetPowerRestorePolicyRequest) Pack() []byte

type SetPowerRestorePolicyResponse

type SetPowerRestorePolicyResponse struct {
	SupportPolicyAlwaysOn  bool // chassis supports always powering up after AC/mains returns
	SupportPolicyPrevious  bool // chassis supports restoring power to state that was in effect when AC/mains was lost
	SupportPolicyAlwaysOff bool // chassis supports staying powered off after AC/mains returns
}

func (*SetPowerRestorePolicyResponse) Format

func (res *SetPowerRestorePolicyResponse) Format() string

func (*SetPowerRestorePolicyResponse) Unpack

func (res *SetPowerRestorePolicyResponse) Unpack(msg []byte) error

type SetSystemBootOptionsParamRequest

type SetSystemBootOptionsParamRequest struct {
	// Parameter valid
	//  - 1b = mark parameter invalid / locked
	//  - 0b = mark parameter valid / unlocked
	MarkParameterInvalid bool
	// [6:0] - boot option parameter selector
	ParamSelector types.BootOptionParamSelector

	ParamData []byte
}

28.12 Set System Boot Options Command. Sets parameters that direct system boot following power up or reset. Boot flags apply for one restart; system BIOS should read them from the BMC and then clear the flags.

func (*SetSystemBootOptionsParamRequest) Command

func (*SetSystemBootOptionsParamRequest) Pack

func (req *SetSystemBootOptionsParamRequest) Pack() []byte

type SetSystemBootOptionsParamResponse

type SetSystemBootOptionsParamResponse struct {
}

func (*SetSystemBootOptionsParamResponse) Format

func (*SetSystemBootOptionsParamResponse) Unpack

func (res *SetSystemBootOptionsParamResponse) Unpack(msg []byte) error

type SystemRestartCause

type SystemRestartCause uint8

func (SystemRestartCause) String

func (c SystemRestartCause) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL