Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
func AddressFromString ¶
Given a string address, returns a complete Address struct, filled in with domain, bus, slot and function components. The address string may either be in $BUS:$SLOT.$FUNCTION (BSF) format or it can be a full PCI address that includes the 4-digit $DOMAIN information as well: $DOMAIN:$BUS:$SLOT.$FUNCTION.
Returns "" if the address string wasn't a valid PCI address.
type Device ¶
type Device struct { // The PCI address of the device Address string `json:"address"` Vendor *pcidb.Vendor `json:"vendor"` Product *pcidb.Product `json:"product"` Subsystem *pcidb.Product `json:"subsystem"` // optional subvendor/sub-device information Class *pcidb.Class `json:"class"` // optional sub-class for the device Subclass *pcidb.Subclass `json:"subclass"` // optional programming interface ProgrammingInterface *pcidb.ProgrammingInterface `json:"programming_interface"` }
func (*Device) MarshalJSON ¶
NOTE(jaypipes) Device has a custom JSON marshaller because we don't want to serialize the entire PCIDB information for the Vendor (which includes all of the vendor's products, etc). Instead, we simply serialize the ID and human-readable name of the vendor, product, class, etc.
type Info ¶
type Info struct { // hash of class ID -> class information Classes map[string]*pcidb.Class // hash of vendor ID -> vendor information Vendors map[string]*pcidb.Vendor // hash of vendor ID + product/device ID -> product information Products map[string]*pcidb.Product // contains filtered or unexported fields }
func New ¶
New returns a pointer to an Info struct that contains information about the PCI devices on the host system
func (*Info) GetDevice ¶
GetDevice returns a pointer to a Device struct that describes the PCI device at the requested address. If no such device could be found, returns nil
func (*Info) ListDevices ¶
ListDevices returns a list of pointers to Device structs present on the host system