usb_ep_autoconfig_ss(9)
β¨ usb_ep_autoconfig_ss(9) β¨
okay so bestie, this is a page from the Kernel API Manual and it's literally about picking the perfect endpoint for your USB gadget π strap in.
πΈ NAME πΈ
usb_ep_autoconfig_ss β the girlies' guide to choosing an endpoint that matches both the ep descriptor and the ep companion descriptor π
π¦ SYNOPSIS π¦
struct usb_ep * usb_ep_autoconfig_ss (struct usb_gadget *gadget , struct
usb_endpoint_descriptor *desc , struct usb_ss_ep_comp_descriptor
*ep_comp );
π ARGUMENTS π
gadgetβ the device that the endpoint must belong to. no exceptions, she's loyal like that πdescβ the endpoint descriptor, with the endpoint direction and transfer mode already initialized β¨. for periodic transfers you gotta initialize the maximum packet size too. heads up: this one gets modified on success πep_compβ the endpoint companion descriptor, holding the required number of streams. it will be modified when the chosen EP turns out to support a different number of streams than you asked for π«Ά
π§ DESCRIPTION π§
so this routine steps in for usb_ep_autoconfig when you need superspeed enhancements, lowkey. if those enhancements are required, the FD should call usb_ep_autoconfig_ss directly and hand over that extra ep_comp parameter β that's the whole vibe π
by choosing an endpoint that works with the descriptor you specified, this routine makes writing gadget drivers that play nice with multiple USB device controllers so much easier. the endpoint gets passed later to usb_ep_enable, along with some descriptor. main character energy fr fr π
and ngl, that second descriptor won't always be the same as the first one. example: isochronous endpoints can be autoconfigured for high bandwidth and then used in several lower bandwidth altsettings. also, high speed and full speed descriptors are different. it's giving "it depends" π
β οΈ bestie please examine and test the results of autoconfiguration on your actual 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 combos of driver and hardware just won't be able to autoconfigure β and that's not a skill issue, that's just reality π
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, and the bmAttribute field in the ep companion descriptor is updated with the assigned number of streams if it's different from the original value π. to stop the endpoint from being handed out by a later autoconfig call, it claims it by assigning ep->claimed to true β periodt, she's taken π₯
on failure, this returns a null endpoint descriptor. and yes, that's the whole answer π
π SEE ALSO π
- Kernel file
./drivers/usb/gadget/epautoconf.cπ usb_ep_autoconfig(9)usb_ep_autoconfig_release(9)usb_ep_autoconfig_reset(9)
okay that's the whole page, no cap π«Ά this lil' slice of kernel API manual magic lives down in ./drivers/usb/gadget and it's dated October 2026 β screenshot it, send it to the group chat, and go autoconfigure something iconic πβ
π¦ 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