usb_gadget_udc_set_speed(9)
β¨ NAME β¨
usb_gadget_udc_set_speed β bestie, this one straight up tells the USB device controller what speeds the current driver actually supports π β¨ (it's page 9 of the Kernel API Manual, iykyk)
πΈ SYNOPSIS πΈ
void usb_gadget_udc_set_speed (struct usb_udc *udc , enum
usb_device_speed speed );
No cap, that's the whole signature. Two args, void return, in and out. π«Ά
π ARGUMENTS π
udcβ the device we're setting the maximum speed on. That's the one, that's the main character πspeedβ the maximum speed it's allowed to run at. Like a speed limit but for USB, and honestly way more respected π¦
π¦ DESCRIPTION π¦
Okay so here's the vibe: this call gets issued by the UDC Class driver before it calls usb_gadget_udc_start_locked β like a little pre-game check-in π§ β and the whole point is to make sure we don't try to connect at speeds the gadget driver doesn't support.
Literally it's the "hey bestie, are we actually allowed to go this fast?" conversation. If you skip it, you might link up at a speed your gadget driver has zero business running at, and that's giving π energy. So we check first. Periodt.
β SEE ALSO β
Kernel file ./drivers/usb/gadget/udc/core.c β and the whole friend group:
struct usb_udc(9)usb_ep_set_maxpacket_limit(9)usb_ep_enable(9)usb_ep_disable(9)usb_ep_alloc_request(9)usb_ep_free_request(9)usb_ep_queue(9)usb_ep_dequeue(9)usb_ep_set_halt(9)usb_ep_clear_halt(9)usb_ep_set_wedge(9)usb_ep_fifo_status(9)usb_ep_fifo_flush(9)usb_gadget_frame_number(9)usb_gadget_wakeup(9)usb_gadget_set_remote_wakeup(9)usb_gadget_set_selfpowered(9)usb_gadget_clear_selfpowered(9)usb_gadget_vbus_connect(9)usb_gadget_vbus_draw(9)usb_gadget_vbus_disconnect(9)usb_gadget_connect(9)usb_gadget_disconnect(9)usb_gadget_deactivate(9)usb_gadget_activate(9)usb_gadget_giveback_request(9)gadget_find_ep_by_name(9)usb_gadget_check_config(9)usb_udc_vbus_handler(9)usb_gadget_udc_reset(9)usb_gadget_udc_start_locked(9)usb_gadget_udc_stop_locked(9)usb_gadget_enable_async_callbacks(9)usb_gadget_disable_async_callbacks(9)usb_udc_release(9)usb_initialize_gadget(9)usb_add_gadget(9)usb_add_gadget_udc_release(9)usb_get_gadget_udc_name(9)usb_add_gadget_udc(9)usb_del_gadget(9)usb_del_gadget_udc(9)
Mwah π β this lil page lives in ./drivers/usb/gadget/udc and it's dated October 2026. Go read the source, it ate. ππ
π¦ 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