Struct PciGenericDeviceHeader

Source
pub struct PciGenericDeviceHeader {
    pub base_addr: [u32; 6],
    pub cardbus_cis_ptr: u32,
    pub subsystem_device_id: u16,
    pub subsystem_vendor_id: u16,
    pub expansion_rom_base_addr: u32,
    pub capabilities_ptr: u16,
    pub max_latency: u8,
    pub min_grant: u8,
    pub interrupt_pin: u8,
    pub interrupt_line: u8,
}
Expand description

The header for generic PCI devices.

All fields are the raw values of every non-reserved register part in the configuration space.

The format of the header in PCI configuration space is the following.

+----------+---------+-------------+--------------+----------------+----------------+
| Register | Offset  | Bits 31-24  | Bits 23-16   | Bits 15-8      | Bits 7-0       |
+----------+---------+-------------+--------------+----------------+----------------+
|   0x4    |   0x10  |                 Base address #0 (BAR0)                       |
|   0x5    |   0x14  |                 Base address #1 (BAR1)                       |
|   0x6    |   0x18  |                 Base address #2 (BAR2)                       |
|   0x7    |   0x1C  |                 Base address #3 (BAR3)                       |
|   0x8    |   0x20  |                 Base address #4 (BAR4)                       |
|   0x9    |   0x24  |                 Base address #5 (BAR5)                       |
|   0xA    |   0x28  |                 Cardbus CIS Pointer                          |
|   0xB    |   0x2C  |    Subsystem ID            |     Subsystem Vendor ID         |
|   0xC    |   0x30  |             Expansion ROM base address                       |
|   0xD    |   0x34  |                  Reserved  | Capabilities Pointer            |
|   0xE    |   0x38  |                         Reserved                             |
|   0xF    |   0x3C  | Max latency |   Min Grant  | Interrupt PIN  | Interrupt Line |
+----------+---------+-------------+--------------+----------------+----------------+

Fields§

§base_addr: [u32; 6]§cardbus_cis_ptr: u32§subsystem_device_id: u16§subsystem_vendor_id: u16§expansion_rom_base_addr: u32§capabilities_ptr: u16§max_latency: u8§min_grant: u8§interrupt_pin: u8§interrupt_line: u8

Implementations§

Source§

impl PciGenericDeviceHeader

Source

pub const LENGTH: usize = 64usize

Source

pub const ID: u8 = 0u8

Trait Implementations§

Source§

impl Clone for PciGenericDeviceHeader

Source§

fn clone(&self) -> PciGenericDeviceHeader

Returns a duplicate 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 PciGenericDeviceHeader

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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

Source§

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>,

Source§

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.