tb_tunnel_discover_usb3(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tb_tunnel_discover_usb3(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so picture this: you're deep in the kernel, right, and there's this thing called tb_tunnel_discover_usb3 and it is literally the function that goes looking for USB3 tunnels that already exist. not making new ones, not tearing them down β€” just finding the ones that are already out there living their truth. detective energy fr fr πŸ•΅οΈβ€β™€οΈβœ¨


✨ NAME ✨

tb_tunnel_discover_usb3 β€” Discover existing USB3 tunnels πŸ’–

like, the name says it all. discover. existing. USB3 tunnels. no cap.


🌸 SYNOPSIS 🌸

struct tb_tunnel * tb_tunnel_discover_usb3 (struct tb *tb , struct
tb_port *down , bool alloc_hopid );

yep that's the whole signature, exactly like that, line break and all 🫢 the way it returns a struct tb_tunnel *… iconic.


πŸ¦‹ ARGUMENTS πŸ¦‹

  • tb β€” Pointer to the domain structure 🌈 this is your domain, your whole world, the context everything lives in.
  • down β€” USB3 downstream adapter ⬇️ the downstream one, specifically. not upstream. downstream. keep that straight bestie.
  • alloc_hopid β€” Allocate HopIDs from visited ports πŸŽ€ this is a bool, so it's yes-or-no vibes: do we grab HopIDs from the ports we visit or not.

πŸ’… DESCRIPTION πŸ’…

okay here's the whole deal, and it's honestly pretty short and sweet:

If down adapter is active, follows the tunnel to the USB3 upstream adapter and back. πŸ”

that's it. that's the function. if it's active β€” big if, the vibes check has to pass first β€” then it walks the tunnel all the way over to the USB3 upstream adapter and then comes right back. round trip. main character journey. periodt. πŸ‘‘


⭐ RETURN ⭐

Pointer to struct tb_tunnel or NULL if there was no tunnel. πŸ’€

so either you get a nice shiny pointer to a struct tb_tunnel, or you get NULL because there was, in fact, no tunnel. no tunnel, no pointer, no problem. always check for NULL, bestie, i'm begging πŸ™ˆ


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/thunderbolt/tunnel.c β€” that's the source of truth, go read it if you want the real real πŸ‘€

and then the whole friend group, in the order the manpage lists them:

that's the whole circle. go say hi 🫢✨


ngl this one's a short read, so if you blinked you missed it. but every single argument, the return value, and the "is it active tho" condition are all right here β€” nothing skipped, nothing summarised πŸ’œ

and that's a wrap!! πŸŽ€ this page lives under ./drivers/thunderbolt and it's dated October 2026, and the page itself is tb_tunnel_discover_usb3(9) in case you forgot where you were. slay, go read some tunnel source, ily, bye πŸ’–πŸŒˆβ­

πŸ“¦ where this page comes from