tb_switch_next_cap(9)
π tb_switch_next_cap β the kernel API manual, but make it cute
okay so bestie, welcome to tb_switch_next_cap from the Kernel API Manual. this one is a tiny little function that walks a linked list of capabilities on a Thunderbolt switch, and honestly? she's short but she delivers. let's get into it β¨
β¨ NAME β¨
tb_switch_next_cap β return the next capability in the linked list π¦
πΈ SYNOPSIS πΈ
int tb_switch_next_cap (struct tb_switch *sw , unsigned int offset );
that's it. that's the whole signature. two arguments, one int coming back at you. no cap. π
π ARGUMENTS π
swβ the switch we're finding the capability for. this is your main character right here πoffsetβ the previous capability offset, and listen: pass0for the start. like, literally0. that's your "beginning of the list" vibe π
π§ DESCRIPTION π§
so what she does is find the dword offset of the next capability in the port config space capability list. yep β the next one in the chain, the linked-list energy is real π₯
and here's the cute part: when you pass 0 in the offset parameter, the first entry will be returned, if it exists. so 0 is basically the "take me to the top of the list" button π«Ά
β RETURN β
- Double word offset of the first or next capability β on success π
0β if no next capability is found. she looked, bestie, and there was nothing there π- Negative errno β another error occurred. not the vibe, but she's telling you anyway π
π¦ SEE ALSO π¦
- kernel file
./drivers/thunderbolt/cap.c tb_port_next_cap(9)tb_port_find_cap(9)tb_switch_find_cap(9)tb_switch_find_vse_cap(9)
all her besties, all in the same friend group, all worth a read πβ¨
okay that's the whole page, no gatekeeping π this icon lives in ./drivers/thunderbolt, she's dated October 2026, and the header/footer energy is pure Kernel API Manual + tb_switch_next_cap(9). go forth and walk that capability list, 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