tb_tunnel_event(9)
π tb_tunnel_event(9)
okay so this is a page from the Kernel API Manual β it's tb_tunnel_event(9), and bestie, it's a tiny little function with a big job: telling userspace that something happened in the tunnel world. let's get into it π
β¨ NAME β¨
tb_tunnel_event β notify userspace about a tunneling event
like, it's the messenger. it does not tunnel. it just tells people about tunneling. main character energy of the announcement, not the event π
π¦ SYNOPSIS π¦
void tb_tunnel_event (struct tb *tb , enum tb_tunnel_event event , enum
tb_tunnel_type type , const struct tb_port *src_port , const struct
tb_port *dst_port );
five arguments, returns nothing (void), it's giving "I just do the thing and leave" π
πΈ ARGUMENTS πΈ
tbβ the domain where the event occurred. like, the whole neighborhood ποΈeventβ the event that happened. the actual tea βtypeβ the type of the tunnel in question. what kind of tunnel we're talking about here πsrc_portβ the tunnel source port. can beNULL(it's allowed to not know, no pressure) πdst_portβ the tunnel destination port. also can beNULL(same vibe) π«Ά
β DESCRIPTION β
so what it does is, it notifies userspace about a tunneling event in the domain. and here's the iconic part: the tunnel does not need to exist. fr fr. that's not a bug, that's the whole point β for example, the tunnel was not activated because there is not enough bandwidth π so we still wanna tell userspace "hey, this was a thing that could've happened," and this function is how we do it.
now the detail work, and this is the bit you gotta remember:
- if
src_portanddst_portare given β it fills in the fullTUNNEL_DETAILSenvironment variable π₯ full send, all the details - otherwise β it uses the shorter one, which is just the tunnel type π
that's it. that's the whole function. short, sweet, slays, periodt π
π SEE ALSO π
kernel file ./drivers/thunderbolt/tunnel.c β and the whole tunnel girlie friend group:
tb_available_credits(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_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)
and that's the page!! sourced from ./drivers/thunderbolt, dated October 2026 β go read the source bestie, it's right there, and it's literally only a few lines ππ¦β¨
π¦ 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