tb_port_next_cap(9)
π tb_port_next_cap(9) β like, the Kernel API Manual bestie β¨
okay so real talk, this little icon lives in the Kernel API Manual and honestly? she's doing the most for the Thunderbolt crowd π¦
β¨ NAME β¨
tb_port_next_cap β returns the next capability in the linked list. that's it, that's the vibe π
πΈ SYNOPSIS πΈ
int tb_port_next_cap (struct tb_port *port , unsigned int offset );
π«Ά ARGUMENTS π«Ά
portβ the port you're hunting a capability for πoffsetβ the previous capability offset. pass0to start from the beginning, no cap π§
π DESCRIPTION π
so what she actually does: she finds the dword offset of the next capability in the port config space capability list. lowkey iconic.
and when you hand her 0 in the offset parameter? she gives you the first entry instead. if it exists, that is β no promises if the list is empty, bestie π
π₯ RETURN π₯
- Double word offset of the first or next capability β on success, slay π
0β if no next capability is found. she looked, it's not there, moving on π- Negative errno β some other error happened. yeah. that kind of day π
π SEE ALSO π
kernel file ./drivers/thunderbolt/cap.c, plus the whole friend group: tb_port_find_cap(9), tb_switch_next_cap(9), tb_switch_find_cap(9), tb_switch_find_vse_cap(9) β go say hi π«Άβ¨
ngl, if you're chaining these calls, remember 0 means "start over" β don't come for me if you accidentally restart the list, that's on you bestie π
mwah, that's a wrap π this page came straight out of ./drivers/thunderbolt, dated October 2026, and it's tb_port_next_cap(9) β periodt π
π¦ 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