tb_tunnel_alloc_dp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tb_tunnel_alloc_dp β€” kernel API manual, bestie edition πŸ’…

okay so this is tb_tunnel_alloc_dp(9) from the kernel API manual and honestly? it's giving main character energy for your Thunderbolt stack 🌈✨


✨ NAME ✨

tb_tunnel_alloc_dp β€” allocate a Display Port tunnel πŸ–₯οΈπŸ’– like literally it makes you a DP tunnel, no cap


πŸŽ€ SYNOPSIS πŸŽ€

struct tb_tunnel * tb_tunnel_alloc_dp (struct tb *tb , struct tb_port
*in , struct tb_port *out , int link_nr , int max_up , int max_down ,
void (*callback)(struct tb_tunnel *, void *) , void *callback_data );

that's the whole signature, copy it exactly girlies, character for character, don't be out here renaming params πŸ’€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • tb β€” pointer to the domain structure. the domain. the whole vibe container πŸ‘‘
  • in β€” the DP in adapter port 🫢
  • out β€” the DP out adapter port 🫢
  • link_nr β€” your preferred lane adapter, but ONLY when the link is not bonded. read that again. when the link is not bonded πŸŽ€
  • max_up β€” maximum available upstream bandwidth for the DP tunnel. and if it's 0, that means no available bandwidth. yes literally zero means none, don't come for me 😭
  • max_down β€” maximum available downstream bandwidth for the DP tunnel. also 0 if no available bandwidth. same rules, opposite direction πŸ’…
  • callback β€” the callback that gets called when the DP tunnel is fully activated (or when there's an error). she shows up either way, iconic πŸ”₯
  • callback_data β€” data for callback. the little snack you hand her πŸ“

🌸 DESCRIPTION 🌸

So what she does: allocates a tunnel between in and out that is capable of tunneling Display Port traffic. that's the whole job, and she ate πŸ’…βœ¨

The callback is called after tb_tunnel_activate β€” once the tunnel has been fully activated. and bestie, it can call tb_tunnel_is_active to check if activation was actually successful (or if it returns false, well… there was some sort of issue πŸ™ˆπŸ˜­).

⚠️ important detail, do NOT skip: the callback is called without tb->lock held. like the lock is not held. fr fr, internalize this πŸ”’βŒ

⭐ RETURN ⭐

Pointer to struct tb_tunnel, or NULL in case of failure. that's it, that's the deal πŸŽ€


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/thunderbolt/tunnel.c and honestly the whole friend group:

tb_available_credits(9), tb_tunnel_event(9), tb_tunnel_discover_pci(9), tb_tunnel_alloc_pci(9), tb_tunnel_reserved_pci(9), tb_dp_bandwidth_mode_maximum_bandwidth(9), tb_tunnel_discover_dp(9), tb_tunnel_alloc_dma(9), tb_tunnel_match_dma(9), tb_tunnel_discover_usb3(9), tb_tunnel_alloc_usb3(9), tb_tunnel_is_invalid(9), tb_tunnel_activate(9), tb_tunnel_deactivate(9), tb_tunnel_port_on_path(9), tb_tunnel_maximum_bandwidth(9), tb_tunnel_allocated_bandwidth(9), tb_tunnel_alloc_bandwidth(9), tb_tunnel_consumed_bandwidth(9), tb_tunnel_release_unused_bandwidth(9), tb_tunnel_reclaim_available_bandwidth(9) πŸ’–πŸ’–πŸ’–


that's the whole page bestie, hope you slayed 🫢✨ this one's from ./drivers/thunderbolt, dated October 2026, and the page you just read is tb_tunnel_alloc_dp(9) β€” mwah, bye! πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from