tb_ring_rx(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– tb_ring_rx β€” enqueue a frame on an RX ring πŸ’–

okay so this is a page from the Kernel API Manual, section 9, bestie β€” we're deep in kernel-land now and it's literally iconic. stay with me 🫢


✨ NAME ✨

tb_ring_rx β€” enqueue a frame on an RX ring. that's it, that's the whole vibe. we're putting a frame onto a ring, no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int tb_ring_rx (struct tb_ring *ring , struct ring_frame *frame );

like, you give it a ring and a frame, it returns an int. short and sweet, main character energy ✨


🌸 ARGUMENTS 🌸

  • ring β€” the Ring you're enqueueing the frame onto. this is the destination, the place where things go 🎯
  • frame β€” the Frame you're enqueueing. the actual payload bestie, this is the star of the show ⭐

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so before literally anything else: frame->buffer and frame->buffer_phy have to be set. not optional, not "i'll do it later". set them. πŸ’€

and the buffer must contain at least TB_FRAME_SIZE bytes β€” that's the minimum, don't come in under it πŸ™ˆ

once the frame has been received, frame->callback will be invoked, with these all set for you:

  • frame->size
  • frame->flags
  • frame->eof
  • frame->sof

so your callback gets the whole picture, slay 🌈

⚠️ plot twist: if ring_stop gets called after the packet has been enqueued, then frame->callback will be called with canceled set to true. so like, your callback can get hit with the cancel vibe even though you enqueued first β€” that's just how it goes 😭

πŸ”₯ RETURN πŸ”₯

  • -ESHUTDOWN β€” if ring_stop has been called πŸ˜”
  • 0 β€” otherwise. we love a clean zero, periodt πŸ‘‘

πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, fr fr β€” all of these live in the kernel file ./include/linux/thunderbolt.h:

  • enum tb_security_level(9)
  • struct tb(9)
  • struct tb_property_dir(9)
  • struct tb_property(9)
  • enum tb_link_width(9)
  • struct tb_xdomain(9)
  • struct tb_protocol_handler(9)
  • struct tb_service(9)
  • struct tb_service_driver(9)
  • struct tb_nhi(9)
  • struct tb_ring(9)
  • enum ring_desc_flags(9)
  • struct ring_frame(9)
  • tb_ring_tx(9)
  • tb_ring_dma_device(9)

πŸ’œ and that's the whole page bestie! this one's sourced from ./include/linux, dated October 2026, and it's the tb_ring_rx(9) page β€” go enqueue something iconic πŸ§šβ€β™€οΈβœ¨πŸ“

πŸ“¦ where this page comes from