pub struct PciDeviceDriver {
name: &'static str,
id_table: Vec<PciDeviceId>,
probe_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>,
remove_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>,
}Expand description
PCI device driver
Implements the DeviceDriver trait for PCI devices.
Fields§
§name: &'static strDriver name
id_table: Vec<PciDeviceId>List of PCI device IDs this driver supports
probe_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>Probe function
remove_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>Remove function
Implementations§
Source§impl PciDeviceDriver
impl PciDeviceDriver
Sourcepub fn new(
name: &'static str,
id_table: Vec<PciDeviceId>,
probe_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>,
remove_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>,
) -> Self
pub fn new( name: &'static str, id_table: Vec<PciDeviceId>, probe_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>, remove_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>, ) -> Self
Create a new PCI device driver
§Arguments
name- Driver nameid_table- List of supported PCI device IDsprobe_fn- Function to probe devicesremove_fn- Function to remove devices
Sourcepub fn id_table(&self) -> &[PciDeviceId]
pub fn id_table(&self) -> &[PciDeviceId]
Get the device ID table
Sourcepub fn matches_device(&self, device: &PciDeviceInfo) -> bool
pub fn matches_device(&self, device: &PciDeviceInfo) -> bool
Check if this driver matches a PCI device