pci_add_dynid(9)
๐ pci_add_dynid(9) ๐
okay bestie, welcome to the Kernel API Manual โจ this one lives in pci_add_dynid(9) and it's genuinely such a slay little function โ it's the one that lets a PCI driver pick up a brand-new device ID at runtime and then go re-check every device like "wait, do I match this one now?" ๐
๐ธ NAME ๐ธ
pci_add_dynid โ add a new PCI device ID to this driver and re-probe devices ๐
๐ฆ SYNOPSIS ๐ฆ
int pci_add_dynid (struct pci_driver *drv , unsigned int vendor ,
unsigned int device , unsigned int subvendor , unsigned int subdevice ,
unsigned int class , unsigned int class_mask , unsigned long driver_data
);
like, yes, that's a lot of arguments, but honestly? each one is iconic in its own way ๐
โจ ARGUMENTS โจ
drvโ the target pci driver ๐ฏ the one we're gonna hand this new ID to.vendorโ PCI vendor ID ๐ท๏ธdeviceโ PCI device ID ๐ท๏ธsubvendorโ PCI subvendor ID ๐ท๏ธsubdeviceโ PCI subdevice ID ๐ท๏ธclassโ PCI class ๐๏ธclass_maskโ PCI class mask ๐ญdriver_dataโ private driver data ๐ the driver's own lil stash of info.
๐ง DESCRIPTION ๐ง
So here's the vibe: this adds a new dynamic pci device ID to this driver, and then it makes the driver probe for all devices again ๐ฅ like it goes back around the whole bus and re-checks everything. main character energy fr fr.
โ ๏ธ caveat cutie: drv must have been registered prior to calling this function. no registering after, no skipping, that's the rule ๐
๐ CONTEXT ๐
Does GFP_KERNEL allocation. so like, it can sleep ๐ด โ keep that in mind iykyk.
โญ RETURN โญ
0on success ๐-errnoon failure ๐ญ
๐ฎ SEE ALSO ๐ฎ
Kernel file ./drivers/pci/pci-driver.c โ plus the whole friend group ๐ซถ:
do_pci_add_dynid(9)do_pci_match_id(9)pci_match_id(9)pci_match_device(9)new_id_store(9)remove_id_store(9)__pci_device_probe(9)pci_restore_standard_config(9)__pci_register_driver(9)pci_unregister_driver(9)pci_dev_driver(9)pci_bus_match(9)pci_dev_get(9)pci_dev_put(9)pci_uevent_ers(9)pci_dma_configure(9)
mwah ๐ that's the whole page โ brought to you by the fine folks at ./drivers/pci, dated October 2026, in the pci_add_dynid(9) era. go forth and add those dynids bestie ๐ฆ๐
๐ฆ 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