pci

package
v6.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDeviceIsUSB = fmt.Errorf("Device is USB instead of PCI")

ErrDeviceIsUSB is returned when dealing with a USB device.

Functions

func DeviceDriverOverride

func DeviceDriverOverride(pciDev Device, driverOverride string) error

DeviceDriverOverride unbinds the device, sets the driver override preference, then probes the device, and waits for it to be activated with the specified driver.

func DeviceIOMMUGroup

func DeviceIOMMUGroup(slotName string) (uint64, error)

DeviceIOMMUGroup returns the IOMMU group for a PCI device.

func DeviceProbe

func DeviceProbe(pciDev Device) error

DeviceProbe probes a PCI device using its PCI Slot Name.

func DeviceSetDriverOverride

func DeviceSetDriverOverride(pciDev Device, driverOverride string) error

DeviceSetDriverOverride registers an override driver for a PCI device using its PCI Slot Name.

func DeviceUnbind

func DeviceUnbind(pciDev Device) error

DeviceUnbind unbinds a PCI device from the OS using its PCI Slot Name.

func NormaliseAddress

func NormaliseAddress(addr string) string

NormaliseAddress converts common PCI address notation to the kernel's notation.

Types

type Device

type Device struct {
	ID       string
	SlotName string
	Driver   string
}

Device represents info about a PCI uevent device.

func ParseUeventFile

func ParseUeventFile(ueventFilePath string) (Device, error)

ParseUeventFile returns the PCI device info for a given uevent file.

Jump to

Keyboard shortcuts

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