dwc3_send_gadget_ep_cmd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 sent
  • params β€” 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 within 50us ⏱️). 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


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