ipmi

package
v0.0.0-...-ba47a78 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Bits and pieces from asm-generic/ioctl.h

Package ipmi implements functions to communicate with the OpenIPMI driver interface.

Index

Constants

View Source
const (

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

Variables

This section is empty.

Functions

func IO

func IO(t int, nr int) int

func IOR

func IOR(t int, nr int, size int) int

func IOWR

func IOWR(t int, nr int, size int) int

func Ioctl

func Ioctl(fd uintptr, name int, data unsafe.Pointer) syscall.Errno

Types

type ChassisStatus

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

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
}

func Open

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

func (*IPMI) ClearCMOSClearValidBits

func (i *IPMI) ClearCMOSClearValidBits(data []byte) error

Set BIOS boot order with both CMOS clear and valid bits cleared

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) IsCMOSClearSet

func (i *IPMI) IsCMOSClearSet() (bool, []byte, error)

Get BIOS boot order data and check if CMOS clear bit and valid bit are both set

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) 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 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

Jump to

Keyboard shortcuts

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