usb_ep_autoconfig(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ 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