Documentation ¶
Index ¶
- Constants
- Variables
- func LoadDeviceFile(files string) (DevConfigs, DevGroups, error)
- func ValidateDeviceFile(file string) (DevConfigs, DevGroups, error)
- type BindInfo
- type DevClassID
- type DevConfigs
- type DevGroups
- type DevSubClassID
- type DeviceClass
- type DeviceConfig
- type DeviceID
- type DeviceList
- type SDeviceID
- type SVendorID
- type VendorID
Constants ¶
View Source
const ( NetworkGroup string = "NetworkGroup" CryptoGroup string = "CryptoGroup" DMAGroup string = "DMAGroup" EventdevGroup string = "EventdevGroup" MempoolGroup string = "MempoolGroup" CompressGroup string = "CompressGroup" )
Group constant strings
Variables ¶
View Source
var DeviceClassNames = map[DevClassID]string{
UnclassifiedDevice: "UnclassifiedDevice",
MassStorageController: "MassStorageController",
NetworkController: "NetworkController",
DisplayController: "DisplayController",
MultimediaController: "MultimediaController",
MemoryController: "MemoryController",
BridgeController: "BridgeController",
CommunicationController: "CommunicationController",
GenericSystemPeripheral: "GenericSystemPeripheral",
InputDeviceController: "InputDeviceController",
DockingStation: "DockingStation",
ProcessorClass: "ProcessorClass",
SerialBusController: "SerialBusController",
WirelessController: "WirelessController",
IntelligentController: "IntelligentController",
SatelliteCommunicationController: "SatelliteCommunicationController",
EncryptionController: "EncryptionController",
SignalProcessingController: "SignalProcessingController",
ProcessingAccelerators: "ProcessingAccelerators",
NonEssentialInstrumentation: "NonEssentialInstrumentation",
Coprocessor: "Coprocessor",
}
DeviceClassNames in string format
View Source
var UioModules = []string{"igb_uio", "vfio-pci", "uio_pci_generic"}
UioModules supported
View Source
var ValidGroups = []string{ NetworkGroup, CryptoGroup, DMAGroup, EventdevGroup, MempoolGroup, CompressGroup, }
ValidGroups currently allowed
Functions ¶
func LoadDeviceFile ¶
func LoadDeviceFile(files string) (DevConfigs, DevGroups, error)
LoadDeviceFile and create the config and groups
func ValidateDeviceFile ¶
func ValidateDeviceFile(file string) (DevConfigs, DevGroups, error)
ValidateDeviceFile is a valid TOML file for devbind
Types ¶
type BindInfo ¶
type BindInfo struct { Devices DeviceList CfgDevices DevConfigs Groups DevGroups }
BindInfo - Device Binding information
func (*BindInfo) FindDevicesByDeviceClass ¶
func (db *BindInfo) FindDevicesByDeviceClass(name string, devClasses []*DeviceConfig) map[string]*DeviceClass
FindDevicesByDeviceClass all devices matching the given device class
type DevClassID ¶
type DevClassID string
DevClassID value
const ( UnclassifiedDevice DevClassID = "00" MassStorageController DevClassID = "01" NetworkController DevClassID = "02" DisplayController DevClassID = "03" MultimediaController DevClassID = "04" MemoryController DevClassID = "05" BridgeController DevClassID = "06" CommunicationController DevClassID = "07" GenericSystemPeripheral DevClassID = "08" InputDeviceController DevClassID = "09" DockingStation DevClassID = "0a" ProcessorClass DevClassID = "0b" SerialBusController DevClassID = "0c" WirelessController DevClassID = "0d" IntelligentController DevClassID = "0e" SatelliteCommunicationController DevClassID = "0f" EncryptionController DevClassID = "10" SignalProcessingController DevClassID = "11" ProcessingAccelerators DevClassID = "12" NonEssentialInstrumentation DevClassID = "13" Coprocessor DevClassID = "40" )
PCI Device class values
type DevConfigs ¶
type DevConfigs map[string]*DeviceConfig
DevConfigs is list of devices in devices.toml
type DevGroups ¶
type DevGroups map[string][]*DeviceConfig
DevGroups is the map of devices to a group name
type DeviceClass ¶
type DeviceClass struct { Slot string Class struct { ID DevClassID Sub DevSubClassID Str string } Vendor struct { ID VendorID Str string } Device struct { ID DeviceID Str string } SVendor struct { ID SVendorID Str string } SDevice struct { ID SDeviceID Str string } Rev string Driver string Module string Unused string Interface string NumaNode string SSHIf string Active bool }
DeviceClass - Network Class information
type DeviceConfig ¶
type DeviceConfig struct { Group string `toml:"group"` Desc string `toml:"desc"` Class struct { ID DevClassID `toml:"devclass"` Sub DevSubClassID `toml:"subclass"` } `toml:"class"` Vendor VendorID `toml:"vendor_id"` Device DeviceID `toml:"device_id"` SVendor SVendorID `toml:"svendor_id"` SDevice SDeviceID `toml:"sdevice_id"` }
DeviceConfig - Network Class information
type DeviceList ¶
type DeviceList map[string]*DeviceClass
DeviceList is a list of all devices found in system
Click to show internal directories.
Click to hide internal directories.