pub struct PciConfig<'a> { /* private fields */ }
Expand description

This lets you interact with the config space (conventional or extended) of a PCI device.

This doesn’t have a definite length because we want to preserve the PciSubregion over the whole of config space.

Implementations§

source§

impl<'a> PciConfig<'a>

source

pub fn vendor_id(&self) -> PciRegisterRo<'a, u16>

source

pub fn device_id(&self) -> PciRegisterRo<'a, u16>

source

pub fn command(&self) -> PciCommand<'a>

source

pub fn status(&self) -> PciStatus<'a>

source

pub fn revision_id(&self) -> PciRegisterRo<'a, u8>

source

pub fn class_code(&self) -> PciClassCode<'a>

source

pub fn cache_line_size(&self) -> PciRegisterRw<'a, u8>

source

pub fn latency_timer(&self) -> PciRegisterRo<'a, u8>

source

pub fn header_type(&self) -> PciHeaderType<'a>

source

pub fn bist(&self) -> PciBist<'a>

source

pub fn cardbus_cis_pointer(&self) -> PciRegisterRo<'a, u32>

source

pub fn subsystem_vendor_id(&self) -> PciRegisterRo<'a, u16>

source

pub fn subsystem_id(&self) -> PciRegisterRo<'a, u16>

source

pub fn interrupt_line(&self) -> PciRegisterRw<'a, u8>

source

pub fn interrupt_pin(&self) -> PciRegisterRo<'a, u8>

source

pub fn min_gnt(&self) -> PciRegisterRo<'a, u8>

source

pub fn max_lat(&self) -> PciRegisterRo<'a, u8>

source§

impl<'a> PciConfig<'a>

source

pub fn capabilities(&self) -> Result<PciCapabilities<'a>>

Returns a thing that lets you access the PCI Capabilities.

Calling this will (re)scan all Capabilities, which is why it can fail.

source

pub fn extended_capabilities(&self) -> Result<PciExtendedCapabilities<'a>>

Returns a thing that lets you access the PCI Extended Capabilities.

Calling this will (re)scan all Extended Capabilities, which is why it can fail.

Trait Implementations§

source§

impl<'a> AsPciSubregion<'a> for PciConfig<'a>

source§

fn as_subregion(&self) -> PciSubregion<'a>

Returns a PciSubregion corresponding to self.
source§

fn subregion(&self, range: impl RangeBounds<u64>) -> PciSubregion<'a>

Returns a PciSubregion corresponding to a range of self.
source§

impl<'a> BackedByPciSubregion<'a> for PciConfig<'a>

source§

fn backed_by(as_subregion: impl AsPciSubregion<'a>) -> Self

Does not check whether the subregion is big enough. If it isn’t, accesses may later fail.
source§

impl<'a> Clone for PciConfig<'a>

source§

fn clone(&self) -> PciConfig<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PciConfig<'_>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'a> Copy for PciConfig<'a>

Auto Trait Implementations§

§

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

§

impl<'a> Send for PciConfig<'a>

§

impl<'a> Sync for PciConfig<'a>

§

impl<'a> Unpin for PciConfig<'a>

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<'a, T> PciRegion for Twhere T: AsPciSubregion<'a> + Debug + Send + Sync,

source§

fn len(&self) -> u64

The length of the region in bytes.
source§

fn permissions(&self) -> Permissions

Whether the region may be read, written, or both.
source§

fn as_ptr(&self) -> Option<*const u8>

Returns a const pointer to the beginning of the PciRegion. Read more
source§

fn as_mut_ptr(&self) -> Option<*mut u8>

Returns a mut pointer to the beginning of the PciRegion. Read more
source§

fn read_bytes(&self, offset: u64, buffer: &mut [u8]) -> Result<(), Error>

Read from a contiguous range of the region into a byte buffer. Read more
source§

fn read_u8(&self, offset: u64) -> Result<u8, Error>

Read an u8 at the given byte offset from the beginning of the PciRegion. Read more
source§

fn write_u8(&self, offset: u64, value: u8) -> Result<(), Error>

Write an u8 at the given byte offset from the beginning of the PciRegion. Read more
source§

fn read_le_u16(&self, offset: u64) -> Result<u16, Error>

Read a little-endian u16 at the given byte offset from the beginning of the PciRegion. Read more
source§

fn write_le_u16(&self, offset: u64, value: u16) -> Result<(), Error>

Write a little-endian u16 at the given byte offset from the beginning of the PciRegion. Read more
source§

fn read_le_u32(&self, offset: u64) -> Result<u32, Error>

Read a little-endian u32 at the given byte offset from the beginning of the PciRegion. Read more
source§

fn write_le_u32(&self, offset: u64, value: u32) -> Result<(), Error>

Write a little-endian u32 at the given byte offset from the beginning of the PciRegion. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.