tb_for_each_port_on_path(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌈 tb_for_each_port_on_path(9) β€” like, the actual Kernel API Manual, bestie ✨

okay so picture this: you're deep in the Thunderbolt driver, you're in ./drivers/thunderbolt/tb.h, and you need to look at every single port along a path. That's this. This is the one. This is tb_for_each_port_on_path(9) from the Kernel API Manual and honestly? iconic. πŸ’…


✨ NAME ✨

tb_for_each_port_on_path β€” iterate over each port on path πŸ¦‹

like, one port at a time, all the way down the path. no cap.


πŸŽ€ SYNOPSIS πŸŽ€

tb_for_each_port_on_path (src , dst , p );

three things go in, the walking happens, you get your ports. periodt. πŸ’–


🌸 ARGUMENTS 🌸

  • src β€” the source port, aka where the path starts. our beginning. main character energy. πŸ‘‘
  • dst β€” the destination port, aka where the path ends up. the whole point of the journey. ⭐
  • p β€” the port that gets used as the iterator. it's the little guy that moves along while you loop, so don't go messing with it mid-iteration, iykyk. πŸ”₯

πŸ’œ DESCRIPTION πŸ’œ

It walks over each port on the path from src to dst. πŸšΆβ€β™€οΈ

That's it. That's the whole vibe. You give it a start, you give it an end, you give it an iterator, and it hands you the ports along the way one by one. lowkey perfect.


🫢 SEE ALSO 🫢

the whole friend group showed up, fr fr. everything below lives in the kernel file ./drivers/thunderbolt/tb.h:


ok that's the whole page bestie, go iterate some ports responsibly πŸ’€

and that's a wrap!! πŸŽ€ this little gem comes from ./drivers/thunderbolt, dated October 2026, and it's tb_for_each_port_on_path(9) forever and always. mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from