PCI_FIND_NEXT_CAP(9)
π PCI_FIND_NEXT_CAP(9) β like, the kernel API manual bestie π
okay so this is a page from the Kernel API Manual, and we're talking about PCI_FIND_NEXT_CAP β the little macro that goes hunting for a PCI standard capability. no cap, it's lowkey iconic once you get it. let's go π«Ά
β¨ NAME β¨
PCI_FIND_NEXT_CAP β bestie's official way to find a PCI standard capability π
πΈ SYNOPSIS πΈ
PCI_FIND_NEXT_CAP (read_cfg , start , cap , prev_ptr , args... );
literally just call it like that, exactly like that, don't get cute with it π
π¦ ARGUMENTS π¦
read_cfgβ a function pointer for reading PCI config space. yes, pointer to a function, it's giving callback energy πstartβ the starting position where the search begins. where we're picking up the hunt π₯capβ the capability ID you're trying to find. the whole reason we're here πprev_ptrβ a pointer used to store the position of the preceding capability. (optional, so no pressure π)argsβ the arguments you pass along to theread_cfgfunction. hand them over, she'll deal with it π
π DESCRIPTION π
so basically she searches the capability list in PCI config space looking for cap. super chill, super focused π§
if it's found, she updates *prev_ptr with the position of the preceding capability β but only if prev_ptr != NULL, okay? don't come for her if you passed a null, she checked π
and the best part: it implements TTL (time-to-live) protection against infinite loops. so if the capability list is being a messy little gremlin and looping forever, TTL says "not today bestie" and stops it ππ₯
β RETURN β
you get the position of the capability if it's found β and 0 otherwise. that's it, that's the whole vibe check β
π SEE ALSO π
kernel file ./drivers/pci/pci.h, plus the whole friend group:
PCI_FIND_NEXT_EXT_CAP(9)pci_bar_index_is_valid(9)pci_id_from_device(9)pci_match_one_id(9)pci_resource_num(9)pci_dev_set_io_state(9)struct aer_err_info(9)
and the directory squad: ./drivers/pci π«Ά
that's the whole page, bestie β go find those capabilities, slay, and remember: TTL said no infinite loops in this house π β¨
signing off from ./drivers/pci, dated October 2026, per the PCI_FIND_NEXT_CAP(9) era of the Kernel API Manual β ily, stay iconic ππ
π¦ 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