Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BusReader ¶
type BusReader interface { // Read returns Devices, possibly filter by a provided ...Filter Read(...Filter) (Devices, error) }
BusReader is the interface for reading device names for a given bus.
func NewBusReader ¶
NewBusReader returns a BusReader, given a ...glob to match PCI devices against. If it can't glob in pciPath/g then it returns an error. For convenience, we use * as the glob if none are supplied. We don't provide an option to do type I or PCIe MMIO config stuff.
type Devices ¶
type Devices []*PCI
Devices contains a slice of one or more PCI devices
func (Devices) ReadConfig ¶
ReadConfig reads the config info for all the devices.
func (Devices) ReadConfigRegister ¶
ReadConfigRegister reads the config info for all the devices.
func (Devices) SetVendorDeviceName ¶
func (d Devices) SetVendorDeviceName()
SetVendorDeviceName sets all numeric IDs of all the devices using the pci device SetVendorDeviceName.
type PCI ¶
type PCI struct { Addr string Vendor string `pci:"vendor"` Device string `pci:"device"` VendorName string DeviceName string FullPath string ExtraInfo []string }
PCI is a PCI device. We will fill this in as we add options. For now it just holds two uint16 per the PCI spec.
func (*PCI) ReadConfig ¶
ReadConfig reads the config space and adds it to ExtraInfo as a hexdump.
func (*PCI) ReadConfigRegister ¶
ReadConfigRegister reads a configuration register of size 8, 16, 32, or 64. It will only work on little-endian machines.
func (*PCI) SetVendorDeviceName ¶
func (p *PCI) SetVendorDeviceName()
SetVendorDeviceName changes VendorName and DeviceName from a name to a number, if possible.