wire / wire-format / pcie-config-space
PCIe configuration space is 4KB per device (256 bytes for legacy PCI). The Type 0 header (for endpoints): Vendor ID (2), Device ID (2), Command (2), Status (2), Revision ID (1), Class Code (3), Cache Line Size (1), Latency Timer (1), Header Type (1), BIST (1), BAR0-5 (6 x 4 bytes), CardBus CIS Pointer (4), Subsystem Vendor ID (2), Subsystem ID (2), Expansion ROM Base Address (4), Capabilities Pointer (1), Reserved (3), Interrupt Line (1), Interrupt Pin (1), Min Grant (1), Max Latency (1).
aka: PCIe configuration space (Type 0 header)
spec: PCI Express Base Specification
PCIe configuration space is 4KB per device (256 bytes for legacy PCI). The Type 0 header (for endpoints): Vendor ID (2), Device ID (2), Command (2), Status (2), Revision ID (1), Class Code (3), Cache Line Size (1), Latency Timer (1), Header Type (1), BIST (1), BAR0-5 (6 x 4 bytes), CardBus CIS Pointer (4), Subsystem Vendor ID (2), Subsystem ID (2), Expansion ROM Base Address (4), Capabilities Pointer (1), Reserved (3), Interrupt Line (1), Interrupt Pin (1), Min Grant (1), Max Latency (1).
| field | size | meaning |
|---|---|---|
| Vendor ID | 2 bytes | Vendor identifier (assigned by PCI-SIG). 0xFFFF = no device. |
| Device ID | 2 bytes | Device identifier (assigned by vendor). |
| Command | 2 bytes | Bus master, memory/IO space enable, interrupt disable, etc. |
| Status | 2 bytes | Capabilities list, 66MHz capable, fast B2B, DEVSEL timing, etc. |
| Revision ID | 1 byte | Device revision. |
| Class Code | 3 bytes | Base class (1) + subclass (1) + programming interface (1). E.g., 0x02 0x00 0x00 = network controller (Ethernet). |
| Header Type | 1 byte | 0x00 = endpoint, 0x01 = bridge, 0x02 = CardBus bridge. Bit 7 = multi-function. |
| BAR0-5 | 6 x 4 bytes | Base Address Registers: memory or I/O space, size, and prefetchable flag. |
| Capabilities Pointer | 1 byte | Offset to the capabilities list (in config space). |
| Interrupt Line | 1 byte | Interrupt line (IRQ) routed to the device. |
| Interrupt Pin | 1 byte | Interrupt pin (INTA#-INTD#) used by the device. |
example:
86 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
PCIe config space: Vendor ID 0x8086 (Intel), Device ID 0x0000
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/pcie-config-space
or /wire-format/pcie-config-space.json