tb_ring_alloc_rx(9)
π tb_ring_alloc_rx(9) β Kernel API Manual π
okay so bestie, welcome to the Kernel API Manual entry for tb_ring_alloc_rx(9) β yes that's the page name, we're literally in the kernel docs rn and it's giving main character energy π
β¨ NAME β¨
tb_ring_alloc_rx β allocate a DMA ring for receive π¦
Like, you're building a lil ring buffer so the hardware can slide received frames into it. That's the whole vibe.
πΈ SYNOPSIS πΈ
struct tb_ring * tb_ring_alloc_rx (struct tb_nhi *nhi , int hop , int size , unsigned int flags , int e2e_tx_hop , u16 sof_mask , u16 eof_mask , void (*start_poll)(void *) , void *poll_data );
bestie look at all those params π it's a lot but we're gonna go through every single one, no skipping, periodt.
π ARGUMENTS π
nhiβ pointer to the NHI that the ring is gonna be allocated on. that's your nexus, your home base πhopβ the HopID (that's the ring) you wanna allocate. pass-1if you want it auto-allocated, and honestly the kernel will pick for you, slay β¨sizeβ number of entries in the ring. size matters, iykyk πflagsβ flags for the ring, the little toggles that change how it behaves ποΈe2e_tx_hopβ the transmit HopID to use when E2E is enabled inflags. only relevant when that flag's on, so don't stress otherwise π«Άsof_maskβ mask of PDF values that start a frame πeof_maskβ mask of PDF values that end a frame πstart_pollβ if this is not NULL, the ring will call this function when an interrupt is triggered and masked, instead of the callback in each Rx frame. so it's like, the alternative path, okurrr π₯poll_dataβ optional data that gets passed tostart_poll. optional bestie, no pressure π
β RETURN β
pointer to struct tb_ring, and NULL otherwise π so like... always check, fr fr. if you get NULL something went sideways.
ngl, dereferencing a NULL here would be a bad time. do the vibe check first π
π SEE ALSO π
kernel file ./drivers/thunderbolt/nhi.c, plus all these lil friends of ours:
tb_ring_poll(9)tb_ring_poll_complete(9)tb_ring_alloc_tx(9)tb_ring_start(9)tb_ring_flush(9)tb_ring_stop(9)tb_ring_throttling(9)nhi_mailbox_cmd(9)nhi_mailbox_mode(9)
go read those next bestie, they're literally the rest of the story π§
and that's the page!! π this one lives at ./drivers/thunderbolt and it's dated October 2026 β go off, future kernel docs π mwah, see you in the group chat πβ¨
π¦ 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