pub struct EndpointHeader(/* private fields */);
Expand description

Endpoints have a Type-0 header, so the remainder of the header is of the form:

    32                           16                              0
    +-----------------------------------------------------------+ 0x00
    |                                                           |
    |                Predefined region of header                |
    |                                                           |
    |                                                           |
    +-----------------------------------------------------------+
    |                  Base Address Register 0                  | 0x10
    |                                                           |
    +-----------------------------------------------------------+
    |                  Base Address Register 1                  | 0x14
    |                                                           |
    +-----------------------------------------------------------+
    |                  Base Address Register 2                  | 0x18
    |                                                           |
    +-----------------------------------------------------------+
    |                  Base Address Register 3                  | 0x1c
    |                                                           |
    +-----------------------------------------------------------+
    |                  Base Address Register 4                  | 0x20
    |                                                           |
    +-----------------------------------------------------------+
    |                  Base Address Register 5                  | 0x24
    |                                                           |
    +-----------------------------------------------------------+
    |                  CardBus CIS Pointer                      | 0x28
    |                                                           |
    +----------------------------+------------------------------+
    |       Subsystem ID         |    Subsystem vendor ID       | 0x2c
    |                            |                              |
    +----------------------------+------------------------------+
    |               Expansion ROM Base Address                  | 0x30
    |                                                           |
    +--------------------------------------------+--------------+
    |                 Reserved                   | Capabilities | 0x34
    |                                            |   Pointer    |
    +--------------------------------------------+--------------+
    |                         Reserved                          | 0x38
    |                                                           |
    +--------------+--------------+--------------+--------------+
    |   Max_Lat    |   Min_Gnt    |  Interrupt   |  Interrupt   | 0x3c
    |              |              |   pin        |   line       |
    +--------------+--------------+--------------+--------------+

Implementations§

source§

impl EndpointHeader

source

pub fn from_header( header: PciHeader, access: &impl ConfigRegionAccess ) -> Option<EndpointHeader>

source

pub fn header(&self) -> PciHeader

source

pub fn status(&self, access: &impl ConfigRegionAccess) -> StatusRegister

source

pub fn command(&self, access: &impl ConfigRegionAccess) -> CommandRegister

source

pub fn update_command<F>(&self, access: &impl ConfigRegionAccess, f: F)

source

pub fn capability_pointer(&self, access: &impl ConfigRegionAccess) -> u16

source

pub fn capabilities<'a, T: ConfigRegionAccess>( &self, access: &'a T ) -> CapabilityIterator<'a, T>

source

pub fn subsystem( &self, access: &impl ConfigRegionAccess ) -> (SubsystemId, SubsystemVendorId)

source

pub fn bar(&self, slot: u8, access: &impl ConfigRegionAccess) -> Option<Bar>

Get the contents of a BAR in a given slot. Empty bars will return None.

§Note

64-bit memory BARs use two slots, so if one is decoded in e.g. slot #0, this method should not be called for slot #1

source

pub unsafe fn write_bar( &mut self, slot: u8, access: &impl ConfigRegionAccess, value: usize ) -> Result<(), BarWriteError>

Write to a BAR, setting the address for a device to use. The supplied value must be a valid BAR value (refer to the PCIe specification for requirements) and must be of the correct size (i.e. no larger than u32::MAX for 32-bit BARs). In the case of a 64-bit BAR, the supplied slot should be the first slot of the pair.

source

pub fn interrupt( &self, access: &impl ConfigRegionAccess ) -> (InterruptPin, InterruptLine)

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

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

Performs the conversion.
source§

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.
source§

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

Performs the conversion.