STRUCT DWC2_QTD(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, this page lives in the Kernel API Manual, and it's all about struct dwc2_qtd β€” aka the Software queue transfer descriptor (QTD). That's the whole vibe. πŸ’–

🌸 SYNOPSIS 🌸

here's the struct in all its main-character glory, no cap:

struct dwc2_qtd {
    enum dwc2_control_phase control_phase;
    u8 in_process;
    u8 data_toggle;
    u8 complete_split;
    u8 isoc_split_pos;
    u16 isoc_frame_index;
    u16 isoc_split_offset;
    u16 isoc_td_last;
    u16 isoc_td_first;
    u32 ssplit_out_xfer_count;
    u8 error_count;
    u8 n_desc;
    u16 isoc_frame_index_last;
    u16 num_naks;
    struct dwc2_hcd_urb *urb;
    struct dwc2_qh *qh;
    struct list_head qtd_list_entry;
};

πŸŽ€ Members πŸŽ€

okay these are the fields, and yes we're going through every single one because that's the assignment πŸ’…

  • control_phase β€” Current phase for control transfers (Setup, Data, or Status). Literally the phase moment.
  • in_process β€” Indicates if this QTD is currently processed by HW.
  • data_toggle β€” Determines the PID of the next data packet for the data phase of control transfers. Ignored for other transfer types. One of the following values:
    • DWC2_HC_PID_DATA0
    • DWC2_HC_PID_DATA1
  • complete_split β€” Keeps track of the current split type for FS/LS endpoints on a HS Hub.
  • isoc_split_pos β€” Position of the ISOC split in full/low speed.
  • isoc_frame_index β€” Index of the next frame descriptor for an isochronous transfer. A frame descriptor describes the buffer position and length of the data to be transferred in the next scheduled (micro)frame of an isochronous transfer. It also holds status for that transaction. The frame index starts at 0.
  • isoc_split_offset β€” Position of the ISOC split in the buffer for the current frame.
  • isoc_td_last β€” Index of last activated isochronous transfer descriptor in Descriptor DMA mode.
  • isoc_td_first β€” Index of first activated isochronous transfer descriptor in Descriptor DMA mode.
  • ssplit_out_xfer_count β€” How many bytes transferred during SSPLIT OUT.
  • error_count β€” Holds the number of bus errors that have occurred for a transaction within this transfer.
  • n_desc β€” Number of DMA descriptors for this QTD.
  • isoc_frame_index_last β€” Last activated frame (packet) index, used in descriptor DMA mode only.
  • num_naks β€” Number of NAKs received on this QTD.
  • urb β€” URB for this transfer.
  • qh β€” Queue head for this QTD.
  • qtd_list_entry β€” For linking to the QH's list of QTDs.

πŸ¦‹ Description πŸ¦‹

So a Queue Transfer Descriptor (QTD) holds the state of a bulk, control, interrupt, or isochronous transfer. A single QTD is created for each URB (of one of these types) submitted to the HCD. The transfer associated with a QTD may require one or multiple transactions. Periodt. ✨

A QTD is linked to a Queue Head, which is entered in either the non-periodic or periodic schedule for execution. When a QTD is chosen for execution, some or all of its transactions may be executed. After execution, the state of the QTD is updated. The QTD may be retired if all its transactions are complete or if an error occurred. Otherwise, it remains in the schedule so more transactions can be executed later. 🫢

πŸ’… SEE ALSO πŸ’…

Kernel file ./drivers/usb/dwc2/hcd.h is the spot, and these are the linked besties:


source/version: ./drivers/usb/dwc2 Β· date: October 2026 Β· page: struct dwc2_qtd(9) β€” mwah, that's the whole page, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from