PCI_FIND_NEXT_EXT_CAP(9)
π PCI_FIND_NEXT_EXT_CAP(9) β like, the extended capability hunter
okay so bestie, welcome to the Kernel API Manual β¨ this one's a function-style macro situation and honestly? she's iconic. her whole job is finding a PCI extended capability for you. no cap. π
πΈ NAME πΈ
PCI_FIND_NEXT_EXT_CAP β the girl who goes and finds a PCI extended capability for you π
β¨ SYNOPSIS β¨
PCI_FIND_NEXT_EXT_CAP (read_cfg , start , cap , prev_ptr , args... );
like, that's the whole call. yes it's a macro, yes it takes varargs, yes we're living. π¦
π ARGUMENTS π
read_cfgβ a function pointer for reading PCI config space. that's your little reader helper, she does the actual reading π«Άstartβ where to begin the search. pass0for the very first search, like starting a fresh scroll πcapβ the extended capability ID you're hunting for. the one. the main character πprev_ptrβ pointer where we stash the position of the preceding capability. it's optional, no pressure πargsβ extra arguments you pass along toread_cfg. hand 'em over π
π₯ DESCRIPTION π₯
so what she does is: search the extended capability list in PCI config space to find cap π
if she finds it, she updates *prev_ptr with the position of the preceding capability β but only if prev_ptr != NULL, like, don't be passing garbage bestie π«Ά
and the part that ate: she implements TTL protection against infinite loops using a calculated maximum search count. so no matter how cursed the config space is, she is NOT looping forever. periodt. πβ¨
β RETURN β
the position of the capability if it's found β otherwise 0. that's it, that's the vibe check π
fr fr: 0 means not found, not "found at zero". don't get it twisted bestie π
π¦ SEE ALSO π¦
- Kernel file
./drivers/pci/pci.h PCI_FIND_NEXT_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)
like, go read those too, iykyk ππ
and that's the page!! this little icon lives in ./drivers/pci and the version/date stamp says October 2026 β so yeah, she's from the future and she's still slaying π§ββοΈπ mwah, ily, go find those capabilities β¨π
π¦ 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