dwc3_gadget_set_test_mode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dwc3_gadget_set_test_mode πŸ’…

okay so real talk, this is a page straight out of the Kernel API Manual, section 9, and it's all about one little function that enables usb2 test modes ✨ like it's literally the hype-woman for USB2 test mode, no cap.


🌸 SYNOPSIS 🌸

int dwc3_gadget_set_test_mode (struct dwc3 *dwc , int mode );

yep that's the whole vibe check right there β€” you hand it your context struct and a mode, it hands you back an int. iconic. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dwc β€” pointer to our context structure 🫢 (yes, our context structure, we're all in this together bestie)
  • mode β€” the mode to set (J, K SE0 NAK, Force Enable) β€” those are the literal options, don't come for me, I'm just the messenger πŸ’…

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea β˜• β€” Caller should take care of locking. that's on you, bestie, this function is not doing it for you, it's giving main character energy but not that much main character energy. πŸ”₯

and then: this function will return 0 on success, or -EINVAL if a wrong Test Selector is passed. so if you get -EINVAL back, that's the universe telling you your Test Selector was not it πŸ™ˆ literally the vibe check failed.

⚠️ no cap: locking is the caller's whole entire job here. do not skip it, do not pass go.

πŸ’œ SEE ALSO πŸ’œ

okay this list is long long, but we're listing every single one because they're all family, periodt. πŸ’–

Kernel file ./drivers/usb/dwc3/gadget.c:


and that's the whole page, bestie 🧚 go forth and set those test modes responsibly πŸ’…

source: ./drivers/usb/dwc3 · dated October 2026 · this has been your girl on the manpage beat, mwah 🫢

πŸ“¦ where this page comes from