mei

package
v0.7.0 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: 10 Imported by: 0

Documentation

Overview

Package mei implements a wrapper on top of Linux's MEI (Intel ME Interface, formerly known as HECI). This module requires Linux, and the `mei_me` driver. Once loaded, this driver will expose a `/dev/mei0` device, that can be accessed through this library.

Index

Constants

This section is empty.

Variables

View Source
var DefaultMEIDevicePath = "/dev/mei0"

DefaultMEIDevicePath is the path of the default MEI device. This file will be present if the "mei_me" kernel module is loaded.

View Source
var (
	IoctlMEIConnectClient = ioctl.IOWR('H', 0x01, uintptr(len(ClientGUID{})))
)

see include/uapi/linux/mei.h

View Source
var (
	// "8e6a6715-9abc-4043-88ef-9e39c6f63e0f"
	MKHIGuid = ClientGUID{0x15, 0x67, 0x6a, 0x8e, 0xbc, 0x9a, 0x43, 0x40, 0x88, 0xef, 0x9e, 0x39, 0xc6, 0xf6, 0x3e, 0xf}
)

HECIGuids maps the known HECI GUIDs to their values. The MEI interface wants little-endian. See all the GUIDs at https://github.com/intel/lms/blob/master/MEIClient/Include/HECI_if.h

Functions

func GetMeiPciDevice

func GetMeiPciDevice() (*pci.PCI, error)

GetMeiPciDevice will return the MEI PCI device object after scanning the PCI bus.

Types

type ClientGUID

type ClientGUID [16]byte

ClientGUID is the data buffer to pass to `ioctl` to connect to MEI. See include/uapi/linux/mei.h .

type ClientProperties

type ClientProperties [6]byte

ClientProperties is the data buffer returned by `ioctl` after connecting to MEI. See include/uapi/linux/mei.h .

func (ClientProperties) MaxMsgLength

func (c ClientProperties) MaxMsgLength() uint32

MaxMsgLength is the maximum size of a message for this client.

func (ClientProperties) ProtocolVersion

func (c ClientProperties) ProtocolVersion() uint8

ProtocolVersion is this client's protocol version.

type MEI

type MEI struct {
	ClientProperties ClientProperties
	// contains filtered or unexported fields
}

MEI represents an Intel ME Interface object.

func OpenMEI

func OpenMEI(meiPath string, guid ClientGUID) (*MEI, error)

OpenMEI opens the specified MEI device, using the client type defined by GUID. See `HECIGuids` in this package.

func (*MEI) Close

func (m *MEI) Close() error

Close closes the MEI device, if open, and does nothing otherwise.

func (*MEI) Read

func (m *MEI) Read(p []byte) (int, error)

Read reads from the MEI file descriptor.

func (*MEI) Write

func (m *MEI) Write(p []byte) (int, error)

Write writes to the MEI file descriptor.

type MKHIClient

type MKHIClient struct {
	MEI *MEI
}

MKHIClient is a client to send MKHI commands via MEI.

func OpenMKHI

func OpenMKHI(meiPath string) (*MKHIClient, error)

OpenMKHI opens an MKHI client connection.

func (*MKHIClient) Close

func (m *MKHIClient) Close() error

Close closes an MKHI client connection.

func (*MKHIClient) EnableHMRFPO

func (m *MKHIClient) EnableHMRFPO() error

EnableHMRFPO enables the HMRFPO (Host ME Region Flash Protection Override) via CSE, see cse_hmrfpo_enable at https://github.com/coreboot/coreboot/blob/b8b8ec832360ada5a313f10938bb6cfc310a11eb/src/soc/intel/common/block/include/intelblocks/cse.h#L64

func (*MKHIClient) IsHMRFPOEnableAllowed

func (m *MKHIClient) IsHMRFPOEnableAllowed() (bool, error)

IsHMRFPOEnableAllowed queries whether the HMRFPO enable is allowed.

Jump to

Keyboard shortcuts

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