dwc3_send_gadget_ep_cmd(9)
π
dwc3_send_gadget_ep_cmd β¨
okay so this is a kernel API manual page (like, the dwc3_send_gadget_ep_cmd(9) one, bestie) and it's literally all about issuing an endpoint command. no cap, it's giving "USB gadget controller core" energy and honestly? iconic. let's get into it π
π¦ SYNOPSIS
int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd,
struct dwc3_gadget_ep_cmd_params *params);
πΈ ARGUMENTS
depβ the endpoint that the command is gonna be issued to π―cmdβ the command itself, like the actual thing being sentparamsβ the parameters that go with the command, iykyk
β¨ DESCRIPTION
okay so first things first: the caller should handle locking. that's on you, not on this function, fr fr. π
So this function will issue cmd with the given params to dep and then wait for it to complete. like, it's not gonna just fire and forget, it's gonna sit there and wait for the whole thing to finish π
Now here's the tea according to the programming guide β if the link state is in L1/L2/U3, then sending the Start Transfer command may not complete. yeah. awkward. π The programming guide suggested bringing the link state back to ON/U0 first by doing a remote wakeup before sending the command.
π¨ BUT bestie listen: don't initiate remote wakeup when the user/function does not send a wakeup request via wakeup ops. like, do not. So the vibe is: send the command when it's allowed. periodt. π
π₯ NOTES
- For L1 link state, issuing a command requires the clearing of
GUSB2PHYCFG.SUSPENDUSB2, which turns on the signal needed to complete the given command (usually within50usβ±οΈ). This should happen within the command timeout set by the driver. No additional step is needed β slay, that's it. β¨ - For L2 or U3 link state, the gadget is in USB suspend π΄. Care should be taken when sending the Start Transfer command to ensure that it's done after USB resume. like, don't send it while it's napping, okay? π«Ά
π SEE ALSO
- Kernel file
./drivers/usb/dwc3/gadget.c dwc3_gadget_set_test_mode(9)dwc3_gadget_get_link_state(9)dwc3_gadget_set_link_state(9)dwc3_ep_inc_trb(9)dwc3_ep_inc_enq(9)dwc3_ep_inc_deq(9)dwc3_gadget_giveback(9)dwc3_send_gadget_generic_command(9)dwc3_gadget_start_config(9)dwc3_gadget_calc_tx_fifo_size(9)dwc3_gadget_calc_ram_depth(9)dwc3_gadget_clear_tx_fifos(9)__dwc3_gadget_ep_enable(9)__dwc3_gadget_ep_disable(9)dwc3_ep_prev_trb(9)dwc3_prepare_one_trb(9)dwc3_prepare_last_sg(9)__dwc3_stop_active_transfer(9)dwc3_gadget_start_isoc_quirk(9)dwc3_gadget_setup_nump(9)dwc3_gadget_check_config(9)dwc3_gadget_init(9)
and that's the whole page bestie, no crumbs left π this lil' manual lives in ./drivers/usb/dwc3 and it's dated October 2026 β so go forth and issue those endpoint commands responsibly, mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms