Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lookup ¶
Lookup takes PCI hex (as strings) vendor and device ID values and returns human readable labels for both the vendor and device. Returns the input ID value if if label is not found in the ids map.
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. We don't provide an option to do type I or PCIe MMIO config stuff.
Types ¶
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.