pub struct PciScanner<'a> {
config: PciConfig,
bus: &'a PciBus,
}Expand description
PCI scanner
Handles scanning the PCI bus tree to discover devices.
Fields§
§config: PciConfigPCI configuration space accessor
bus: &'a PciBusBus manager reference
Implementations§
Source§impl<'a> PciScanner<'a>
impl<'a> PciScanner<'a>
Sourcepub fn scan(&self) -> Vec<PciDeviceInfo>
pub fn scan(&self) -> Vec<PciDeviceInfo>
Scan the entire PCI bus tree
This scans all possible bus/device/function combinations and discovers present devices.
§Returns
Vector of discovered PCI devices
Sourcefn scan_bus(
&self,
bus: u8,
devices: &mut Vec<PciDeviceInfo>,
id_counter: &mut usize,
)
fn scan_bus( &self, bus: u8, devices: &mut Vec<PciDeviceInfo>, id_counter: &mut usize, )
Scan a single PCI bus
Sourcefn scan_device(
&self,
bus: u8,
device: u8,
devices: &mut Vec<PciDeviceInfo>,
id_counter: &mut usize,
)
fn scan_device( &self, bus: u8, device: u8, devices: &mut Vec<PciDeviceInfo>, id_counter: &mut usize, )
Scan a single PCI device
Sourcefn probe_function(
&self,
bus: u8,
device: u8,
function: u8,
id_counter: &mut usize,
) -> Option<PciDeviceInfo>
fn probe_function( &self, bus: u8, device: u8, function: u8, id_counter: &mut usize, ) -> Option<PciDeviceInfo>
Probe a specific PCI function
Sourcefn generate_device_name(
_vendor_id: u16,
_device_id: u16,
_bus: u8,
_device: u8,
_function: u8,
) -> &'static str
fn generate_device_name( _vendor_id: u16, _device_id: u16, _bus: u8, _device: u8, _function: u8, ) -> &'static str
Generate a device name from vendor and device IDs
This is a simplified implementation. A real implementation would maintain a static string pool or use a more sophisticated naming scheme.