Skip to main content

Header

Struct Header 

Source
pub struct Header {
Show 14 fields pub vendor_id: u16, pub device_id: u16, pub command: Command, pub status: Status<'P'>, pub revision_id: u8, pub class_code: ClassCode, pub cache_line_size: u8, pub latency_timer: u8, pub is_multi_function: bool, pub header_type: HeaderType, pub bist: BuiltInSelfTest, pub capabilities_pointer: u8, pub interrupt_line: u8, pub interrupt_pin: InterruptPin,
}
Expand description

Main structure

Fields§

§vendor_id: u16

Identifies the manufacturer of the device. Where valid IDs are allocated by PCI-SIG to ensure uniqueness and 0xFFFF is an invalid value that will be returned on read accesses to Configuration Space registers of non-existent devices.

§device_id: u16

Identifies the particular device. Where valid IDs are allocated by the vendor

§command: Command§status: Status<'P'>§revision_id: u8

Device specific revision identifier.

§class_code: ClassCode§cache_line_size: u8

Specifies the system cache line size in 32-bit units. A device can limit the number of cacheline sizes it can support, if a unsupported value is written to this field, the device will behave as if a value of 0 was written.

§latency_timer: u8

Specifies the latency timer in units of PCI bus clocks.

§is_multi_function: bool

Used to identify a multi-function device

§header_type: HeaderType§bist: BuiltInSelfTest§capabilities_pointer: u8

Used to point to a linked list of new capabilities implemented by this device

§interrupt_line: u8

Specifies which input of the system interrupt controllers the device’s interrupt pin is connected to and is implemented by any device that makes use of an interrupt pin. For the x86 architecture this register corresponds to the PIC IRQ numbers 0-15 (and not I/O APIC IRQ numbers) and a value of 0xFF defines no connection.

§interrupt_pin: InterruptPin

Implementations§

Source§

impl Header

Source

pub const TOTAL_SIZE: usize = 0x40

Predefined header region is 64 bytes long

Source

pub const COMMON_SIZE: usize = 0x10

The first 16 bytes are defined the same for all types of devices

Trait Implementations§

Source§

impl Clone for Header

Source§

fn clone(&self) -> Header

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Header

Source§

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

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

impl Eq for Header

Source§

impl From<[u8; 64]> for Header

Source§

fn from(bytes: [u8; 64]) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Header

Source§

fn eq(&self, other: &Header) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Header

Source§

impl TryFrom<&[u8]> for Header

Source§

type Error = TryFromSliceError

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

fn try_from(slice: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.

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> AsPrimitive<()> for T

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, U> LsbInto<U> for T
where U: FromLsb<T>,

Source§

fn lsb_into(self) -> U

Source§

impl<T, U> MsbInto<U> for T
where U: FromMsb<T>,

Source§

fn msb_into(self) -> U

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.