tb_ring_rx(9)
π 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->sizeframe->flagsframe->eofframe->sof
so your callback gets the whole picture, slay π
β οΈ plot twist: ifring_stopgets called after the packet has been enqueued, thenframe->callbackwill be called withcanceledset totrue. so like, your callback can get hit with the cancel vibe even though you enqueued first β that's just how it goes π
π₯ RETURN π₯
-ESHUTDOWNβ ifring_stophas 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
- 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