dwc2_hsotg_write_fifo(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ dwc2_hsotg_write_fifo(9) ✨

okay so this is a page from the Kernel API Manual bestie, and we're talking about dwc2_hsotg_write_fifo β€” the little function that shoves packet data into the TxFIFO πŸ’…


🌸 NAME 🌸

dwc2_hsotg_write_fifo β€” write packet Data to the TxFIFO πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int dwc2_hsotg_write_fifo (struct dwc2_hsotg *hsotg , struct
dwc2_hsotg_ep *hs_ep , struct dwc2_hsotg_req *hs_req );

πŸ’– ARGUMENTS πŸ’–

  • hsotg β€” the controller state, aka the whole vibe of the controller 🫢
  • hs_ep β€” the endpoint we're gonna write for ✨
  • hs_req β€” the request to write data for, the actual assignment πŸ’Œ

πŸ‘‘ DESCRIPTION πŸ‘‘

So the way this works: this function gets called when the TxFIFO actually has some space in it to hold a new transmission, and we've got something to hand over to it. No space, no entry β€” it's giving exclusive club energy πŸ™ˆ

The actual setup of the data size happens somewhere else entirely, so literally all we have to do here is actually write the data. That's it. That's the job. Lowkey iconic for how simple it is πŸ’…

The return value is zero if there's more space (or if nothing was done at all β€” sometimes we simply don't move, no cap), and otherwise -ENOSPC gets returned if the FIFO space was used up 🫠

Heads up bestie: this routine is only needed for PIO. Not DMA. PIO only. Don't come for me on this one 😭

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/usb/dwc2/gadget.c β€” the whole friend group lives here 🏠


and that's the page bestie, go forth and write ur FIFO data πŸ’…βœ¨

source dir ./drivers/usb/dwc2 Β· October 2026 Β· dwc2_hsotg_write_fifo(9) πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from