PciScanner

Struct PciScanner 

Source
pub struct PciScanner<'a> {
    config: PciConfig,
    bus: &'a PciBus,
}
Expand description

PCI scanner

Handles scanning the PCI bus tree to discover devices.

Fields§

§config: PciConfig

PCI configuration space accessor

§bus: &'a PciBus

Bus manager reference

Implementations§

Source§

impl<'a> PciScanner<'a>

Source

pub fn new(bus: &'a PciBus) -> Self

Create a new PCI scanner

§Arguments
  • bus - Reference to the PCI bus manager
Source

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

Source

fn scan_bus( &self, bus: u8, devices: &mut Vec<PciDeviceInfo>, id_counter: &mut usize, )

Scan a single PCI bus

Source

fn scan_device( &self, bus: u8, device: u8, devices: &mut Vec<PciDeviceInfo>, id_counter: &mut usize, )

Scan a single PCI device

Source

fn probe_function( &self, bus: u8, device: u8, function: u8, id_counter: &mut usize, ) -> Option<PciDeviceInfo>

Probe a specific PCI function

Source

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.

Auto Trait Implementations§

§

impl<'a> Freeze for PciScanner<'a>

§

impl<'a> !RefUnwindSafe for PciScanner<'a>

§

impl<'a> Send for PciScanner<'a>

§

impl<'a> Sync for PciScanner<'a>

§

impl<'a> Unpin for PciScanner<'a>

§

impl<'a> !UnwindSafe for PciScanner<'a>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.