STRUCT DWC2_HSOTG_EP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, welcome to the struct dwc2_hsotg_ep(9) page from the Kernel API Manual ✨ this whole thing is the driver endpoint definition, and we're gonna walk through every single member like it's a group-chat recap. no skipping, no cap πŸ’…


✨ SYNOPSIS ✨

here's the struct in all its iconic glory, copied exactly β€” she's sensitive about formatting, so don't touch:

       struct dwc2_hsotg_ep {
           struct usb_ep           ep;
           struct list_head        queue;
           struct dwc2_hsotg       *parent;
           struct dwc2_hsotg_req    *req;
           struct dentry           *debugfs;
           unsigned long           total_data;
           unsigned int            size_loaded;
           unsigned int            last_load;
           unsigned int            fifo_load;
           unsigned short          fifo_size;
           unsigned short          fifo_index;
           unsigned char           dir_in;
           unsigned char           map_dir;
           unsigned char           index;
           unsigned char           mc;
           u16 interval;
           unsigned int            halted:1;
           unsigned int            periodic:1;
           unsigned int            isochronous:1;
           unsigned int            send_zlp:1;
           unsigned int            wedged:1;
           unsigned int            target_frame;
         #define TARGET_FRAME_INITIAL   0xFFFFFFFF;
           bool frame_overrun;
           dma_addr_t desc_list_dma;
           struct dwc2_dma_desc    *desc_list;
           u8 desc_count;
           unsigned int            next_desc;
           unsigned int            compl_desc;
           char name[10];
        };

literally every field is right there. periodt 🫢


🧚 Members 🧚

  • ep β€” the gadget-layer representation of the endpoint. main character energy.
  • queue β€” the queue of requests for this endpoint. it's giving "line starts here" πŸ’…
  • parent β€” a reference back to the parent device structure. gotta know where you came from.
  • req β€” the current request that the endpoint is processing. this is used to indicate a request has been loaded onto the endpoint and has yet to be completed β€” maybe because data still needs to move, or simply because we're awaiting an ack from the core that all the data has been completed. lowkey suspenseful 😭
  • debugfs β€” the file entry for the debugfs file for this endpoint. debug girlie representation ✨
  • total_data β€” the total number of data bytes done. she's counting.
  • size_loaded β€” the last loaded size for DxEPTSIZE for periodic IN.
  • last_load β€” the offset of data for the last start of request.
  • fifo_load β€” the amount of data loaded into the FIFO (periodic IN).
  • fifo_size β€” the size of the FIFO (for periodic IN endpoints).
  • fifo_index β€” for Dedicated FIFO operation, only FIFO0 can be used for EP0. noted.
  • dir_in β€” set to true if this endpoint is of the IN direction, which means it is sending data to the Host.
  • map_dir β€” set to the value of dir_in when the DMA buffer is mapped.
  • index β€” the index for the endpoint registers.
  • mc β€” Multi Count β€” number of transactions per microframe.
  • interval β€” interval for periodic endpoints, in frames or microframes.
  • halted β€” set if the endpoint has been halted. πŸ›‘
  • periodic β€” set if this is a periodic ep, such as Interrupt.
  • isochronous β€” set if this is a isochronous ep.
  • send_zlp β€” set if we need to send a zero-length packet. tiny but powerful.
  • wedged β€” set if ep is wedged. oh no πŸ’€
  • target_frame β€” targeted frame num to setup next ISOC transfer. also, the struct carries #define TARGET_FRAME_INITIAL 0xFFFFFFFF; right there in the synopsis, iconic.
  • frame_overrun β€” indicates SOF number overrun in DSTS.
  • desc_list_dma β€” the DMA address of descriptor chain currently in use.
  • desc_list β€” pointer to descriptor DMA chain head currently in use.
  • desc_count β€” count of entries within the DMA descriptor chain of EP.
  • next_desc β€” index of next free descriptor in the ISOC chain under SW control.
  • compl_desc β€” index of next descriptor to be completed by xFerComplete.
  • name β€” the name array passed to the USB core. char name[10], bestie β€” ten characters of pure identity πŸ’–

🌸 Description 🌸

so this is the driver's state for each registered endpoint, allowing it to keep track of transactions that need doing. each endpoint has a lock to protect the state, to try and avoid using an overall lock for the host controller as much as possible. slay for not making everything one giant lock, honestly πŸ‘‘

for periodic IN endpoints, we have fifo_size and fifo_load to try and keep track of the amount of data in the periodic FIFO for each of these β€” because we don't have a status register that tells us how much is in each of them. 😭 and yes, the original note says this may actually be useless information, as in shared-fifo mode periodic IN acts like a single-frame packet buffer than a fifo. we respect the source's exact vibe.


πŸ’… SEE ALSO πŸ’…

  • Kernel file ./drivers/usb/dwc2/core.h
  • struct dwc2_hsotg_req(9)
  • struct dwc2_core_params(9)
  • struct dwc2_hw_params(9)
  • struct dwc2_gregs_backup(9)
  • struct dwc2_dregs_backup(9)
  • struct dwc2_hregs_backup(9)
  • struct dwc2_hsotg(9)

mwah πŸ’‹ this page lives at ./drivers/usb/dwc2, dated October 2026, and it's all about struct dwc2_hsotg_ep(9) β€” bye bestie, go read some endpoint registers for me 🫢✨

πŸ“¦ where this page comes from