dwc3_gadget_set_test_mode(9)
π 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:
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_send_gadget_ep_cmd(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 π§ 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
- 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