config_ep_by_speed(9)
π config_ep_by_speed(9) β like, the Kernel API Manual page, bestie
okay so real talk, this is config_ep_by_speed(9) from the Kernel API Manual and it's honestly such a main character function. it sets up your endpoint for whatever speed your gadget is doing, no cap. let's get into it π
β¨ NAME β¨
config_ep_by_speed β configures the given endpoint according to gadget speed. that's it, that's the vibe. π¦
πΈ SYNOPSIS πΈ
int config_ep_by_speed (struct usb_gadget *g , struct usb_function *f ,
struct usb_ep *_ep );
literally the whole signature, copied exactly, don't come for me π
π ARGUMENTS π
gβ pointer to the gadget. yeah, the whole gadget. iconic.fβ the usb function. the function in question, the one doing the work π«Ά_epβ the endpoint to configure. this is the one getting its glow-up β¨
π RETURN π
an error code, bestie. and 0 on success β that's the one you want, the 0, the good ending π
π₯ DESCRIPTION π₯
okay so here's the tea β β this function chooses the right descriptors for a given endpoint according to gadget speed, and then saves that in the endpoint desc field. like it's matching the outfit to the occasion, iykyk.
and if the endpoint already has a descriptor assigned to it? not me just overwriting it π β it overwrites it with the currently corresponding descriptor. rude but efficient. periodt.
also the endpoint maxpacket field gets updated according to the chosen descriptor. so everything stays consistent, fr fr. π
β NOTE β
the supplied function should hold all the descriptors for supported speeds. like, all of them. don't show up with a partial wardrobe and expect this to slay π
π§ SEE ALSO π§
- Kernel file
./drivers/usb/gadget/composite.c struct usb_os_string(9)function_descriptors(9)next_desc(9)config_ep_by_speed_and_alt(9)usb_add_function(9)usb_function_deactivate(9)usb_function_activate(9)usb_interface_id(9)usb_func_wakeup(9)bos_desc(9)usb_add_config(9)usb_string_id(9)usb_string_ids_tab(9)usb_gstrings_attach(9)usb_string_ids_n(9)usb_composite_probe(9)usb_composite_unregister(9)usb_composite_setup_continue(9)
that's the whole friend group, go say hi π«Άπ
ngl if you skip the NOTE section you're gonna have a bad time. just saying. π
and that's the page!! this little gem lives in ./drivers/usb/gadget, dated October 2026 π« sending you off with a cute lil sign-off β mwah, go configure 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