pci_get_base_class(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pci_get_base_class(9) β€” from the Kernel API Manual πŸ’…

okay so bestie, this is the page for pci_get_base_class from the Kernel API Manual. It is literally the function that searches for a PCI device by matching against the base class code only. No cap. πŸŽ€


πŸŽ€ NAME πŸŽ€

pci_get_base_class β€” searching for a PCI device by matching against the base class code only. That is the whole vibe: base class code only, no extra matching drama. ✨

✨ SYNOPSIS ✨

struct pci_dev * pci_get_base_class (unsigned int class , struct pci_dev
       *from );

🫢 ARGUMENTS 🫢

  • class β€” search for a PCI device with this base class code.
  • from β€” previous PCI device found in search, or NULL for a new search.

πŸ’– DESCRIPTION πŸ’–

So the way this works is: it iterates through the list of known PCI devices. If a PCI device is found with a matching base class code, the reference count to the device is incremented. See pci_match_one_id to figure out how this works β€” no gatekeeping. πŸ¦‹

A new search is initiated by passing NULL as the from argument. Otherwise, if from is not NULL, searches continue from the next device on the global list. And the reference count for from is always decremented if it is not NULL. Like, always always. Periodt. πŸ’…

πŸ”₯ RETURN πŸ”₯

A pointer to a matched PCI device, NULL otherwise. That is it. That is the return. ✨

🌈 SEE ALSO 🌈

Kernel file ./drivers/pci/search.c and the whole friend group:


okay bye bestie, this page lives under source path ./drivers/pci, dated October 2026, and the manual page is pci_get_base_class(9) πŸ’œβœ¨

πŸ“¦ where this page comes from