STRUCT CDNSP_RING(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct cdnsp_ring(9) β€” Kernel API Manual, but make it make sense πŸŽ€

okay so bestie, welcome to the struct cdnsp_ring glow-up ✨ β€” this is the kernel API manual page, and honestly? she's the blueprint for describing a transfer, command or event ring. literally the ring's whole personality in one struct πŸ¦‹


🌸 NAME 🌸

struct cdnsp_ring β€” the tea on describing a transfer, command or event ring. periodt πŸ’…


✨ SYNOPSIS ✨

the vibes, verbatim πŸ‘‘

struct cdnsp_ring {
    struct cdnsp_segment *first_seg;
    struct cdnsp_segment *last_seg;
    union cdnsp_trb  *enqueue;
    struct cdnsp_segment *enq_seg;
    union cdnsp_trb  *dequeue;
    struct cdnsp_segment *deq_seg;
    struct list_head td_list;
    u32 cycle_state;
    unsigned int stream_id;
    unsigned int stream_active;
    unsigned int stream_rejected;
    int num_tds;
    unsigned int num_segs;
    unsigned int num_trbs_free;
    unsigned int bounce_buf_len;
    enum cdnsp_ring_type type;
    bool last_td_was_short;
    struct radix_tree_root *trb_address_map;
 };

🫢 MEMBERS 🫢

every single field, none skipped, we do not ghost members in this house 😀

  • first_seg β€” the first segment on the transfer ring. first in line, main character energy πŸ‘‘
  • last_seg β€” the last segment on the transfer ring. closing the group chat πŸ’€
  • enqueue β€” the SW enqueue pointer address.
  • enq_seg β€” the SW enqueue segment address.
  • dequeue β€” the SW dequeue pointer address.
  • deq_seg β€” the SW dequeue segment address.
  • td_list β€” the transfer descriptor list associated with this ring. it's giving "organized bestie" πŸŽ€
  • cycle_state β€” the current cycle bit. so here's the lore: you write the cycle state into the TRB cycle field to hand ownership of the TRB over to the device controller (that's if we're the producer), or to check whether we own the TRB (that's if we're the consumer). lowkey the whole trust fall of the ring 🫱
  • stream_id β€” the stream id.
  • stream_active β€” the stream is active β€” a PRIME packet has been detected ✨
  • stream_rejected β€” this ring has been rejected by host 😭 not the rejection arc
  • num_tds β€” number of TDs associated with the ring.
  • num_segs β€” number of segments.
  • num_trbs_free β€” number of free TRBs on the ring.
  • bounce_buf_len β€” length of the bounce buffer.
  • type β€” ring type: event, transfer, or command ring. (and yeah, the original page also tucks last_td_was_short β€” TD is short TD β€” onto this very line, so here it is, no gatekeeping πŸ™ˆ)
  • last_td_was_short β€” TD is short TD. that's the description, and yes it's the field that lives in the struct β€” the manpage just glued its description onto the type entry above. told you, iykyk πŸ’…
  • trb_address_map β€” for mapping physical TRB addresses to segments in stream rings. the matchmaker of the struct, fr fr 🧚

🌈 SEE ALSO 🌈

all her friends, and we are not leaving anyone out of the group chat 🫢

  • Kernel file ./drivers/usb/cdns3/cdnsp-gadget.h
  • struct cdnsp_cap_regs(9)
  • struct cdnsp_op_regs(9)
  • struct cdnsp_port_regs(9)
  • struct cdnsp_intr_reg(9)
  • struct cdnsp_run_regs(9)
  • struct cdnsp_rev_cap(9)
  • struct cdnsp_doorbell_array(9)
  • struct cdnsp_container_ctx(9)
  • struct cdnsp_slot_ctx(9)
  • struct cdnsp_ep_ctx(9)
  • struct cdnsp_stream_info(9)
  • struct cdnsp_ep(9)
  • struct cdnsp_device_context_array(9)
  • struct cdnsp_transfer_event(9)
  • struct cdnsp_link_trb(9)
  • struct cdnsp_event_cmd(9)
  • struct cdnsp_segment(9)
  • struct cdnsp_td(9)
  • struct cdnsp_dequeue_state(9)
  • struct cdnsp_erst_entry(9)
  • struct cdnsp_erst(9)
  • struct cdnsp_request(9)
  • struct cdnsp_port(9)
  • struct cdnsp_device(9)
  • next_request(9)

and that's the whole page bestie, ate and left no crumbs πŸ“ this little love letter lives over in ./drivers/usb/cdns3, dated October 2026, and it's filed under struct cdnsp_ring(9) β€” go be iconic with it πŸ’œβœ¨

πŸ“¦ where this page comes from