PciRoot

Struct PciRoot 

Source
pub struct PciRoot<C: ConfigurationAccess> { /* private fields */ }
Expand description

The root complex of a PCI bus.

Implementations§

Source§

impl<C: ConfigurationAccess> PciRoot<C>

Source

pub fn new(configuration_access: C) -> Self

Creates a new PciRoot to access a PCI root complex through the given configuration access implementation.

Source

pub fn enumerate_bus(&self, bus: u8) -> BusDeviceIterator<C>

Enumerates PCI devices on the given bus.

Source

pub fn get_status_command( &self, device_function: DeviceFunction, ) -> (Status, Command)

Reads the status and command registers of the given device function.

Source

pub fn set_command(&mut self, device_function: DeviceFunction, command: Command)

Sets the command register of the given device function.

Source

pub fn capabilities( &self, device_function: DeviceFunction, ) -> CapabilityIterator<'_, C>

Gets an iterator over the capabilities of the given device function.

Source

pub fn bars( &mut self, device_function: DeviceFunction, ) -> Result<[Option<BarInfo>; 6], PciError>

Returns information about all the given device function’s BARs.

Source

pub fn bar_info( &mut self, device_function: DeviceFunction, bar_index: u8, ) -> Result<Option<BarInfo>, PciError>

Gets information about the given BAR of the given device function.

Source

pub fn set_bar_32( &mut self, device_function: DeviceFunction, bar_index: u8, address: u32, )

Sets the address of the given 32-bit memory or I/O BAR of the given device function.

Source

pub fn set_bar_64( &mut self, device_function: DeviceFunction, bar_index: u8, address: u64, )

Sets the address of the given 64-bit memory BAR of the given device function.

Trait Implementations§

Source§

impl<C: Debug + ConfigurationAccess> Debug for PciRoot<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<C> Freeze for PciRoot<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for PciRoot<C>
where C: RefUnwindSafe,

§

impl<C> Send for PciRoot<C>
where C: Send,

§

impl<C> Sync for PciRoot<C>
where C: Sync,

§

impl<C> Unpin for PciRoot<C>
where C: Unpin,

§

impl<C> UnwindSafe for PciRoot<C>
where C: UnwindSafe,

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.