tb_tunnel_discover_dp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ tb_tunnel_discover_dp(9) ✨

okay so bestie, welcome to the Kernel API Manual for tb_tunnel_discover_dp(9) β€” yes that's the whole title, yes it's a mouthful, no we're not changing it πŸ’… this is the Thunderbolt tunnel girlies' page and it's lowkey iconic.


πŸ¦‹ NAME πŸ¦‹

tb_tunnel_discover_dp β€” the little function that goes and discovers the Display Port tunnels that already exist πŸ‘€βœ¨ like it's not making new ones, it's just finding the ones already vibing there.


πŸŽ€ SYNOPSIS πŸŽ€

struct tb_tunnel * tb_tunnel_discover_dp (struct tb *tb , struct tb_port
*in , bool alloc_hopid , void (*callback)(struct tb_tunnel *, void *) ,
void *callback_data );

that's the whole signature, copied exactly, do not come for me 🫢


🌸 ARGUMENTS 🌸

  • tb β€” pointer to the domain structure 🏠 the whole neighborhood basically.
  • in β€” the DP in adapter πŸ’– the starting point of the adventure.
  • alloc_hopid β€” a bool; if true, allocate HopIDs from the visited ports ✨ (HopIDs from the ports it visited, specifically β€” not from anywhere, don't get it twisted).
  • callback β€” the callback that gets called when the DP tunnel is fully activated πŸ”₯ (or when there's an error 😭 β€” yes, errors count too, it still calls you back).
  • callback_data β€” the data that gets passed to that callback 🎁 your little gift bag of context.

πŸ’œ DESCRIPTION πŸ’œ

so here's the vibe: if the in adapter is active, this function follows the tunnel all the way to the DP out adapter β€” and then back πŸ”πŸ¦‹ like a little round trip, a there-and-back-again situation.

It returns the discovered tunnel, or NULL if there was no tunnel at all πŸ™ˆ (which, honestly, valid β€” sometimes the tunnel just isn't there).

And for how the callback works? See tb_tunnel_alloc_dp. that's where the callback lore lives, iykyk πŸ‘‘


⭐ RETURN ⭐

Pointer to struct tb_tunnel β€” or NULL if no tunnel was found πŸ’€ that's it, that's the return.


🌈 SEE ALSO 🌈

the manpage says go read these, and honestly? main character reading list πŸ‘‘:

Kernel file ./drivers/thunderbolt/tunnel.c, plus:


and that's the page fr fr 🫢 this whole thing lives in ./drivers/thunderbolt and it's dated October 2026 β€” so yeah, future-coded manual page, we love to see it βœ¨πŸŽ€ bye bestie! πŸ’–

πŸ“¦ where this page comes from