STRUCT PCI_DRIVER(9)
π NAME π
Okay bestie, this is struct pci_driver(9) from the Kernel API Manual. Itβs the PCI driver structure β the blueprint itself, no cap.
β¨ SYNOPSIS β¨
struct pci_driver {
const char *name;
const struct pci_device_id *id_table;
int (*probe)(struct pci_dev *dev, const struct pci_device_id *id);
void (*remove)(struct pci_dev *dev);
int (*suspend)(struct pci_dev *dev, pm_message_t state);
int (*resume)(struct pci_dev *dev);
void (*shutdown)(struct pci_dev *dev);
int (*sriov_configure)(struct pci_dev *dev, int num_vfs);
int (*sriov_set_msix_vec_count)(struct pci_dev *vf, int
msix_vec_count);
u32 (*sriov_get_vf_total_msix)(struct pci_dev *pf);
const struct pci_error_handlers *err_handler;
const struct attribute_group **groups;
const struct attribute_group **dev_groups;
struct device_driver driver;
struct pci_dynids dynids;
bool driver_managed_dma;
};
π― Members π―
Member-by-member, bestie β every single one is here:
nameβ Driver name. Simple, iconic, does what it says.id_tableβ Pointer to table of device IDs the driver is interested in. Most drivers should export this table usingMODULE_DEVICE_TABLE(pci,...).probeβ This probing function gets called (during execution ofpci_register_driverfor already existing devices or later if a new device gets inserted) for all PCI devices which match the ID table and are not "owned" by the other drivers yet. This function gets passed astruct pci_devfor each device whose entry in the ID table matches the device. The probe function returns zero when the driver chooses to take "ownership" of the device or an error code (negative number) otherwise. Thepci_device_idparameter is only valid during probe. The probe function always gets called from process context, so it can sleep. π€removeβ The remove function gets called whenever a device being handled by this driver is removed (either during deregistration of the driver or when it's manually pulled out of a hot-pluggable slot). The remove function always gets called from process context, so it can sleep. π΄suspendβ Put device into low power state.resumeβ Wake device from low power state. (Please seeDocumentation/power/pci.rstfor descriptions of PCI Power Management and the related functions.)shutdownβ Hook intoreboot_notifier_list(kernel/sys.c). Intended to stop any idling DMA operations. Useful for enabling wake-on-lan (NIC) or changing the power state of a device before reboot. e.g.drivers/net/e100.c.sriov_configureβ Optional driver callback to allow configuration of number of VFs to enable via sysfssriov_numvfsfile.sriov_set_msix_vec_countβ PF Driver callback to change number of MSI-X vectors on a VF. Triggered via sysfssriov_vf_msix_count. This will change MSI-X Table Size in the VF Message Control registers.sriov_get_vf_total_msixβ PF driver callback to get the total number of MSI-X vectors available for distribution to the VFs.err_handlerβ SeeDocumentation/PCI/pci-error-recovery.rst.groupsβ Sysfs attribute groups.dev_groupsβ Attributes attached to the device that will be created once it is bound to the driver.driverβ Driver model structure.dynidsβ List of dynamically added device IDs.driver_managed_dmaβ Device driver doesn't use kernel DMA API for DMA. For most device drivers, no need to care about this flag as long as all DMAs are handled through the kernel DMA API. For some special ones, for example VFIO drivers, they know how to manage the DMA themselves and set this flag so that the IOMMU layer will allow them to setup and manage their own I/O address space.
π SEE ALSO π
Kernel file ./include/linux/pci.h β and the whole cross-reference squad:
enum pci_interrupt_pin(9)pci_channel_state_t(9)pci_is_bridge(9)pci_is_vga(9)pci_is_display(9)PCI_DEVICE(9)PCI_DEVICE_DRIVER_OVERRIDE(9)PCI_DRIVER_OVERRIDE_DEVICE_VFIO(9)PCI_DEVICE_SUB(9)PCI_DEVICE_CLASS(9)PCI_VDEVICE(9)PCI_VDEVICE_SUB(9)PCI_DEVICE_DATA(9)pcie_capability_clear_and_set_word(9)pci_bus_for_each_resource(9)module_pci_driver(9)builtin_pci_driver(9)pci_irq_type(9)pci_irqd_intx_xlate(9)pci_resource_is_io(9)pci_resource_is_mem(9)pci_pcie_cap(9)pci_is_pcie(9)pcie_caps_reg(9)pci_pcie_type(9)pcie_find_root_port(9)pci_vpd_alloc(9)pci_vpd_find_id_string(9)pci_vpd_find_ro_info_keyword(9)pci_vpd_check_csum(9)pci_ari_enabled(9)pci_is_thunderbolt_attached(9)
Signed, sealed, and slaying from the ./include/linux source β October 2026 β struct pci_driver(9) π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms