ipmi

package
v7.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package ipmi implements functions to communicate with the OpenIPMI driver interface. For a detailed description of OpenIPMI, see http://openipmi.sourceforge.net/IPMI.pdf

Index

Constants

View Source
const (

	// IPM Device "Global" Commands
	BMC_GET_DEVICE_ID Command = 0x01

	// BMC Device and Messaging Commands
	BMC_SET_WATCHDOG_TIMER     Command = 0x24
	BMC_GET_WATCHDOG_TIMER     Command = 0x25
	BMC_SET_GLOBAL_ENABLES     Command = 0x2E
	BMC_GET_GLOBAL_ENABLES     Command = 0x2F
	SET_SYSTEM_INFO_PARAMETERS Command = 0x58
	BMC_ADD_SEL                Command = 0x44

	// Chassis Device Commands
	BMC_GET_CHASSIS_STATUS Command = 0x01

	// SEL device Commands
	BMC_GET_SEL_INFO Command = 0x40

	//LAN Device Commands
	BMC_GET_LAN_CONFIG Command = 0x02

	IPM_WATCHDOG_NO_ACTION    = 0x00
	IPM_WATCHDOG_SMS_OS       = 0x04
	IPM_WATCHDOG_CLEAR_SMS_OS = 0x10

	ADTL_SEL_DEVICE         = 0x04
	EN_SYSTEM_EVENT_LOGGING = 0x08

	// SEL
	// STD_TYPE  = 0x02
	OEM_NTS_TYPE = 0xFB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChassisStatus

type ChassisStatus struct {
	CurrentPowerState byte
	LastPowerEvent    byte
	MiscChassisState  byte
	FrontPanelButton  byte
}

type Command

type Command byte

Command is the command code for a given message.

type DevID

type DevID struct {
	DeviceID          byte
	DeviceRevision    byte
	FwRev1            byte
	FwRev2            byte
	IpmiVersion       byte
	AdtlDeviceSupport byte
	ManufacturerID    [3]byte
	ProductID         [2]byte
	AuxFwRev          [4]byte
}

type Event

type Event struct {
	RecordID   uint16
	RecordType uint8
	StandardEvent
	OEMTsEvent
	OEMNontsEvent
}

Event is included three kinds of events, Standard, OEM timestamped and OEM non-timestamped

The record type decides which event should be used

type IPMI

type IPMI struct {
	*os.File
}

IPMI represents access to the IPMI interface.

func Open

func Open(devnum int) (*IPMI, error)

Open a channel to an IPMI device /dev/ipmi{devnum}.

func (*IPMI) EnableSEL

func (i *IPMI) EnableSEL() (bool, error)

func (*IPMI) GetChassisStatus

func (i *IPMI) GetChassisStatus() (*ChassisStatus, error)

func (*IPMI) GetDeviceID

func (i *IPMI) GetDeviceID() (*DevID, error)

func (*IPMI) GetLanConfig

func (i *IPMI) GetLanConfig(channel byte, param byte) ([]byte, error)

func (*IPMI) GetSELInfo

func (i *IPMI) GetSELInfo() (*SELInfo, error)

func (*IPMI) LogSystemEvent

func (i *IPMI) LogSystemEvent(e *Event) error

LogSystemEvent adds an SEL (System Event Log) entry.

func (*IPMI) RawCmd

func (i *IPMI) RawCmd(param []byte) ([]byte, error)

func (*IPMI) RawSendRecv

func (i *IPMI) RawSendRecv(msg Msg) ([]byte, error)

RawSendRecv sends the IPMI message, receives the response, and returns the response data.

func (*IPMI) SendRecv

func (i *IPMI) SendRecv(netfn NetFn, cmd Command, data []byte) ([]byte, error)

SendRecv sends the IPMI message, receives the response, and returns the response data. This is recommended for use unless the user must be able to specify the data pointer and length on their own.

func (*IPMI) SetSystemFWVersion

func (i *IPMI) SetSystemFWVersion(version string) error

SetSystemFWVersion sets the provided system firmware version to BMC via IPMI.

func (*IPMI) ShutoffWatchdog

func (i *IPMI) ShutoffWatchdog() error

func (*IPMI) WatchdogRunning

func (i *IPMI) WatchdogRunning() (bool, error)

type Msg

type Msg struct {
	Netfn   NetFn
	Cmd     Command
	DataLen uint16
	Data    unsafe.Pointer
}

Msg is the full IPMI message to be sent.

type NetFn

type NetFn byte

NetFn is the network function of the class of message being sent.

type OEMNontsEvent

type OEMNontsEvent struct {
	OEMNontsDefinedData [13]uint8
}

OEMNonTsEvent is a non-timestamped OEM-custom event.

It holds 13 bytes of OEM-defined arbitrary data.

type OEMTsEvent

type OEMTsEvent struct {
	Timestamp        uint32
	ManfID           [3]uint8
	OEMTsDefinedData [6]uint8
}

OEMTsEvent is a timestamped OEM-custom event.

It holds 6 bytes of OEM-defined arbitrary data.

type SELInfo

type SELInfo struct {
	Version     byte
	Entries     uint16
	FreeSpace   uint16
	LastAddTime uint32
	LastDelTime uint32
	OpSupport   byte
}

type StandardEvent

type StandardEvent struct {
	Timestamp    uint32
	GenID        uint16
	EvMRev       uint8
	SensorType   uint8
	SensorNum    uint8
	EventTypeDir uint8
	EventData    [3]uint8
}

StandardEvent is a standard systemevent.

The data in this event should follow IPMI spec

Directories

Path Synopsis
Package blobs implements OpenBMC IPMI Blob Protocol commands.
Package blobs implements OpenBMC IPMI Blob Protocol commands.
Package ocp implements OCP/Facebook-specific IPMI client functions.
Package ocp implements OCP/Facebook-specific IPMI client functions.

Jump to

Keyboard shortcuts

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