pub struct PciCommonHeader {
pub device_id: u16,
pub vendor_id: u16,
pub status: u16,
pub command: u16,
pub class_code: u8,
pub subclass_code: u8,
pub prog_iface_code: u8,
pub revision_id: u8,
pub bist: u8,
pub header_type: u8,
pub latency_timer: u8,
pub cache_line_size: u8,
}
Expand description
The header that is common for all 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 |
+----------+---------+-------------+--------------+----------------+----------------+
| 0x0 | 0x0 | Device ID | Vendor ID |
| 0x1 | 0x4 | Status | Command |
| 0x2 | 0x8 | Class code | Subclass | Prog IF | Revision ID |
| 0x3 | 0xC | BIST | Header type | Latency Timer | Cache Line Size|
+----------+---------+-------------+--------------+----------------+----------------+
Fields§
§device_id: u16
§vendor_id: u16
§status: u16
§command: u16
§class_code: u8
§subclass_code: u8
§prog_iface_code: u8
§revision_id: u8
§bist: u8
§header_type: u8
§latency_timer: u8
§cache_line_size: u8
Implementations§
Source§impl PciCommonHeader
impl PciCommonHeader
Sourcepub const MAX_HEADER_LEN: usize = 72usize
pub const MAX_HEADER_LEN: usize = 72usize
The maximum legth of the data of PCI headers parsed by this crate.
Sourcepub const COMMON_HEADER_LEN: usize = 16usize
pub const COMMON_HEADER_LEN: usize = 16usize
The length of the common header in PCI configuration space.
Sourcepub fn with_bytes(bytes: &[u8]) -> Result<Self, PciInfoError>
pub fn with_bytes(bytes: &[u8]) -> Result<Self, PciInfoError>
Reads the common header from a slice containing the bytes of the PCI configuration space for this device.
Trait Implementations§
Source§impl Clone for PciCommonHeader
impl Clone for PciCommonHeader
Source§fn clone(&self) -> PciCommonHeader
fn clone(&self) -> PciCommonHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for PciCommonHeader
impl RefUnwindSafe for PciCommonHeader
impl Send for PciCommonHeader
impl Sync for PciCommonHeader
impl Unpin for PciCommonHeader
impl UnwindSafe for PciCommonHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more