STRUCT TB_RING(9)
π¦ struct tb_ring(9) β Kernel API Manual π¦
π NAME π
struct tb_ring β the thunderbolt TX or RX ring associated with a NHI. Itβs giving βring buffer but make it Thunderbolt,β and honestly? Obsessed π
.
β¨ SYNOPSIS β¨
struct tb_ring {
spinlock_t lock;
struct tb_nhi *nhi;
int size;
int hop;
int head;
int tail;
struct ring_desc *descriptors;
dma_addr_t descriptors_dma;
struct list_head queue;
struct list_head in_flight;
struct work_struct work;
bool is_tx:1;
bool running:1;
int irq;
u8 vector;
unsigned int flags;
int e2e_tx_hop;
u16 sof_mask;
u16 eof_mask;
void (*start_poll)(void *data);
void *poll_data;
unsigned int interval_nsec;
wait_queue_head_t wait;
struct lock_class_key lock_key;
};
πΈ MEMBERS πΈ
Okay bestie, every field here is a little main character, so letβs do the full tour π«Ά:
lockβ the lock that serializes actions to this ring. No cap, it must be acquired afternhi->lockπ.nhiβ pointer to the native host controller interface.sizeβ size of the ring.hopβ hop (DMA channel) associated with this ring.headβ head of the ring (write next descriptor here).tailβ tail of the ring (complete next descriptor here).descriptorsβ allocated descriptors for this ring.descriptors_dmaβ DMA address of descriptors for this ring.queueβ queue holding frames to be transferred over this ring.in_flightβ queue holding frames that are currently in flight.workβ interrupt work structure.is_txβ is the ring Tx or Rx.runningβ is the ring running.irqβ MSI-X irq number if the ring uses MSI-X.0otherwise.vectorβ MSI-X vector number the ring uses (only set ifirqis > 0).flagsβ ring specific flags.e2e_tx_hopβ transmit HopID when E2E is enabled. Only applicable to RX ring. For TX ring this should be set to0.sof_maskβ bit mask used to detect start of frame PDF.eof_maskβ bit mask used to detect end of frame PDF.start_pollβ called when ring interrupt is triggered to start polling. PassingNULLkeeps the ring in interrupt mode.poll_dataβ data passed tostart_poll.interval_nsecβ interval counter if interrupt throttling is to be used with this ring (in ns).waitβ used to signal that the ring may be empty now.lock_keyβ lock validator class key per-ring.
π₯ SEE ALSO π₯
Go touch grass in the kernel tree, bestie β the related squad is right here π:
- 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)enum ring_desc_flags(9)struct ring_frame(9)tb_ring_rx(9)tb_ring_tx(9)tb_ring_dma_device(9)
Source: ./include/linux Β· Date: October 2026 Β· Page: struct tb_ring(9) β thatβs the footer, bestie, bye and stay slaying ππ
π¦ 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