tb_tunnel_alloc_dp(9)
π 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's0, 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. also0if 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
- 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