pci_add_dynid(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’– 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 โญ

  • 0 on success ๐ŸŽ‰
  • -errno on failure ๐Ÿ˜ญ

๐Ÿ”ฎ SEE ALSO ๐Ÿ”ฎ

Kernel file ./drivers/pci/pci-driver.c โ€” plus the whole friend group ๐Ÿซถ:


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