Struct pci_driver::config::PciConfig
source · [−]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
sourceimpl<'a> PciConfig<'a>
impl<'a> PciConfig<'a>
pub fn vendor_id(&self) -> PciRegisterRo<'a, u16>
pub fn device_id(&self) -> PciRegisterRo<'a, u16>
pub fn command(&self) -> PciCommand<'a>
pub fn status(&self) -> PciStatus<'a>
pub fn revision_id(&self) -> PciRegisterRo<'a, u8>
pub fn class_code(&self) -> PciClassCode<'a>
pub fn cache_line_size(&self) -> PciRegisterRw<'a, u8>
pub fn latency_timer(&self) -> PciRegisterRo<'a, u8>
pub fn header_type(&self) -> PciHeaderType<'a>
pub fn bist(&self) -> PciBist<'a>
pub fn cardbus_cis_pointer(&self) -> PciRegisterRo<'a, u32>
pub fn subsystem_vendor_id(&self) -> PciRegisterRo<'a, u16>
pub fn subsystem_id(&self) -> PciRegisterRo<'a, u16>
pub fn interrupt_line(&self) -> PciRegisterRw<'a, u8>
pub fn interrupt_pin(&self) -> PciRegisterRo<'a, u8>
pub fn min_gnt(&self) -> PciRegisterRo<'a, u8>
pub fn max_lat(&self) -> PciRegisterRo<'a, u8>
sourceimpl<'a> PciConfig<'a>
impl<'a> PciConfig<'a>
sourcepub fn capabilities(&self) -> Result<PciCapabilities<'a>>
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.
sourcepub fn extended_capabilities(&self) -> Result<PciExtendedCapabilities<'a>>
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
sourceimpl<'a> AsPciSubregion<'a> for PciConfig<'a>
impl<'a> AsPciSubregion<'a> for PciConfig<'a>
sourcefn as_subregion(&self) -> PciSubregion<'a>
fn as_subregion(&self) -> PciSubregion<'a>
Returns a PciSubregion corresponding to self.
sourcefn subregion(&self, range: impl RangeBounds<u64>) -> PciSubregion<'a>
fn subregion(&self, range: impl RangeBounds<u64>) -> PciSubregion<'a>
Returns a PciSubregion corresponding to a range of self.
sourceimpl<'a> BackedByPciSubregion<'a> for PciConfig<'a>
impl<'a> BackedByPciSubregion<'a> for PciConfig<'a>
sourcefn backed_by(as_subregion: impl AsPciSubregion<'a>) -> Self
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.
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T> PciRegion for Twhere
T: AsPciSubregion<'a> + Debug + Send + Sync,
impl<'a, T> PciRegion for Twhere
T: AsPciSubregion<'a> + Debug + Send + Sync,
sourcefn permissions(&self) -> Permissions
fn permissions(&self) -> Permissions
Whether the region may be read, written, or both.
sourcefn as_ptr(&self) -> Option<*const u8>
fn as_ptr(&self) -> Option<*const u8>
Returns a const pointer to the beginning of the PciRegion. Read more
sourcefn as_mut_ptr(&self) -> Option<*mut u8>
fn as_mut_ptr(&self) -> Option<*mut u8>
Returns a mut pointer to the beginning of the PciRegion. Read more
sourcefn read_bytes(&self, offset: u64, buffer: &mut [u8]) -> Result<(), Error>
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