BDF
BDF (or B/D/F) stands for Bus, Device, Function. It is a 16 bit number that locates a
device's function.
- The PCI specification permits a system to host up to 256 buses (8 bits).
- Each bus can have up to 32 devices (5 bits).
- Each device can have up to 8 functions (3 bits), of which function 0 must be present
Usually, the BDF is represented in hexadecimal whose values are separated by a colon and a dot (for example 00:1f.2
).
The BDF can be printed with
lspci
.
Apparently, in the world of fonts, BDF stands for Glyph Bitmap Distribution Format.
Domains
If there are multiple PCI controlers, these can be distingiushed by a so-called domain (sometimes also called segment):
[domain:]bus:device:function
A domain supports up to 256 buses.
Vendor and device ID
Every PCI has a unique vendor and device ID.
The device number distinguishes between PCI devices with the same vendor and device ID.
Accessing the PCI configuration space
In the x86 architecture, the
PCI configuration space is accessed with the
0xcf8
(address) and
0xcfc
(data) I/O ports.
/*
* A PCI configuration space access via PIO 0xCF8 and 0xCFC normally has two
* following steps:
* 1) writes address into 0xCF8 port
* 2) accesses data in/from 0xCFC
* This function combines such paired PCI configuration space I/O requests into
* one ACRN_IOREQ_TYPE_PCICFG type I/O request and continues the processing.
*/
The Kernel source file
arch/x86/pci/direct.c
contains functionality for «low-level direct config space access».