tb_ring_alloc_rx(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 -1 if 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 in flags. 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 to start_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:

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