usb_ep_autoconfig(9)
π¦ usb_ep_autoconfig(9) β Kernel API Manual π¦
okay bestie, buckle up: this is the page for usb_ep_autoconfig(9) from the Kernel API Manual, and it is literally about choosing an endpoint that matches the descriptor you hand it. no cap, it's giving gadget-driver matchmaker energy. π
β¨ NAME β¨
usb_ep_autoconfig β choose an endpoint matching the descriptor.
π SYNOPSIS π
struct usb_ep * usb_ep_autoconfig (struct usb_gadget *gadget , struct
usb_endpoint_descriptor *desc );
πΈ ARGUMENTS πΈ
gadgetβ the device that the endpoint must belong to.descβ endpoint descriptor, with endpoint direction and transfer mode initialized. For periodic transfers, the maximum packet size must also be initialized. This is modified on success. π«Ά
π DESCRIPTION π
okay so here's the vibe: by choosing an endpoint to use with the specified descriptor, this routine simplifies writing gadget drivers that work with multiple USB device controllers. The endpoint would be passed later to usb_ep_enable, along with some descriptor.
That second descriptor won't always be the same as the first one. For example, isochronous endpoints can be autoconfigured for high bandwidth, and then used in several lower bandwidth altsettings. Also, high and full speed descriptors will be different. π
Be sure to examine and test the results of autoconfiguration on your hardware. This code may not make the best choices about how to use the USB controller, and it can't know all the restrictions that may apply. Some combinations of driver and hardware won't be able to autoconfigure. π
On success, this returns a claimed usb_ep, and modifies the endpoint descriptor bEndpointAddress. For bulk endpoints, the wMaxPacket value is initialized as if the endpoint were used at full speed. Because of that the users must consider adjusting the autoconfigured descriptor. To prevent the endpoint from being returned by a later autoconfig call, claims it by assigning ep->claimed to true. π
On failure, this returns a null endpoint descriptor. π
π SEE ALSO π
Kernel file ./drivers/usb/gadget/epautoconf.c, plus usb_ep_autoconfig_ss(9), usb_ep_autoconfig_release(9), and usb_ep_autoconfig_reset(9).
mwah π this has been usb_ep_autoconfig(9), source/version ./drivers/usb/gadget, dated October 2026. now go slay those endpoints, bestie π«Άβ¨
π¦ 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