STRUCT TB_RING(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ 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 after nhi->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. 0 otherwise.
  • vector β€” MSI-X vector number the ring uses (only set if irq is > 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 to 0.
  • 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. Passing NULL keeps the ring in interrupt mode.
  • poll_data β€” data passed to start_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