usb_ep_autoconfig_ss(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 πŸ“


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