tb_ctl_alloc(9)
β¨ tb_ctl_alloc(9) β¨
ok so bestie, welcome to the Kernel API Manual π this one's a function page β tb_ctl_alloc β and it's literally the glow-up moment where a control channel gets born π
πΈ NAME πΈ
tb_ctl_alloc β allocate a control channel
yeah that's it, that's the whole vibe. it allocates a control channel. slay π
π¦ SYNOPSIS π¦
struct tb_ctl * tb_ctl_alloc (struct tb_nhi *nhi , int index , int
timeout_msec , event_cb cb , void *cb_data );
look at her go π five whole arguments, she's high maintenance but she's worth it.
π ARGUMENTS π
nhiβ Pointer to NHI. that's the NHI, and you're handing over a pointer to it. iconic.indexβ Domain number πtimeout_msecβ the default timeout used with non-raw control messages β±οΈ like, raw ones do their own thing, but these babies use this.cbβ Callback called for plug events π every hot plug event, she's there.cb_dataβ Data passed tocbπ«Ά whatever you hand her here, she hands right back to your callback.
π§ DESCRIPTION π§
So here's the whole tea, bestie: cb will be invoked once for every hot plug event. once. per. event. periodt π₯
that's it. that's the description. no cap, that's genuinely all she wrote.
β RETURN β
Returns a pointer to struct tb_ctl π β or NULL on failure π (iykyk, always check your pointers, don't be that girl).
π SEE ALSO π
- Kernel file
./drivers/thunderbolt/ctl.c struct tb_ctl(9)tb_cfg_request_alloc(9)tb_cfg_request_get(9)tb_cfg_request_put(9)tb_cfg_request(9)tb_cfg_request_cancel(9)tb_cfg_request_sync(9)tb_ctl_free(9)tb_ctl_start(9)tb_ctl_stop(9)tb_cfg_ack_notification(9)tb_cfg_ack_plug(9)tb_cfg_reset(9)tb_cfg_read_raw(9)tb_cfg_write_raw(9)tb_cfg_get_upstream_port(9)
the whole friend group fr fr π«Ά go read them all, they're all serving.
π reminder bestie: this came out of ./drivers/thunderbolt and it's dated October 2026 β so like, write it down, cite it, or whatever it is you do with manpage dates. mwah πβ¨
ok bye ily, go allocate something π¦π
π¦ 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