tb_port_next_cap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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. pass 0 to 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