PciBus

Struct PciBus 

Source
pub struct PciBus {
    ecam_base: usize,
    ecam_size: usize,
    devices: Mutex<Vec<PciDeviceInfo>>,
}
Expand description

PCI bus manager

Manages PCI device discovery and configuration space access.

Fields§

§ecam_base: usize

ECAM (Enhanced Configuration Access Mechanism) base address

§ecam_size: usize

ECAM region size in bytes

§devices: Mutex<Vec<PciDeviceInfo>>

List of discovered PCI devices

Implementations§

Source§

impl PciBus

Source

pub fn scan(&self)

Scan the PCI bus and discover all devices

This is a convenience method that creates a scanner and performs the scan, storing discovered devices in the bus manager.

Source

pub fn scan_and_register(&self)

Scan the PCI bus and register devices with the DeviceManager

This scans for PCI devices and registers them with the global device manager so they can be matched with drivers.

Source§

impl PciBus

Source

pub const fn new(ecam_base: usize, ecam_size: usize) -> Self

Create a new PCI bus manager

§Arguments
  • ecam_base - Physical address of the ECAM region
  • ecam_size - Size of the ECAM region in bytes
§Returns

A new PciBus instance

Source

pub const fn ecam_base(&self) -> usize

Get the ECAM base address

Source

pub const fn ecam_size(&self) -> usize

Get the ECAM size

Source

pub fn is_valid_address(&self, addr: &PciAddress) -> bool

Check if a PCI address is within the ECAM region

Source

pub fn devices(&self) -> Vec<PciDeviceInfo>

Get the list of discovered devices

Source

pub fn add_device(&self, device: PciDeviceInfo)

Add a device to the list of discovered devices

Auto Trait Implementations§

§

impl !Freeze for PciBus

§

impl !RefUnwindSafe for PciBus

§

impl Send for PciBus

§

impl Sync for PciBus

§

impl Unpin for PciBus

§

impl UnwindSafe for PciBus

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.