config_ep_by_speed_and_alt(9)
π config_ep_by_speed_and_alt(9) β kernel API manual realness β¨
okay so this is a kernel API manual page, bestie, and the function in question is config_ep_by_speed_and_alt β it literally configures the given endpoint according to gadget speed. no cap, that's the whole ~vibe~ of the NAME section. π
πΈ SYNOPSIS πΈ
int config_ep_by_speed_and_alt (struct usb_gadget *g , struct usb_function *f , struct usb_ep *_ep , u8 alt );
that's the whole signature, copy it exactly pls, we don't freestyle here π
π¦ ARGUMENTS π¦
gβ pointer to the gadget, your main character struct frfβ usb function, she's the function in question_epβ the endpoint to configure, the one getting the glow-upaltβ alternate setting number, au8, keep her typed correctly
β RETURN β
returns an error code β and 0 on success, which is the only number we're emotionally invested in honestly π«Ά
π DESCRIPTION π
so what does she actually do? This function chooses the right descriptors for a given endpoint according to gadget speed, and saves it in the endpoint desc field. iconic behavior, no notes.
and if the endpoint already has a descriptor assigned to it β that's right, she overwrites it with the currently corresponding descriptor. not me casually replacing your descriptor π it's fine, it's intentional, it's in the spec.
also bestie, the endpoint maxpacket field gets updated according to the chosen descriptor. so the maxpacket stays in sync with whatever descriptor got picked β slay. β¨
π NOTE π
the supplied function should hold all the descriptors for supported speeds β like, all of them, every speed, no leaving some at home. this is a hard requirement, not a suggestion, iykyk π
π SEE ALSO π
Kernel file ./drivers/usb/gadget/composite.c β that's where the lore lives, go read her π
struct usb_os_string(9)function_descriptors(9)next_desc(9)config_ep_by_speed(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)
okay that's the page!! π this gem comes to you from ./drivers/usb/gadget, dated October 2026, and the page is β say it with me β config_ep_by_speed_and_alt(9). periodt. π¦β¨
π¦ 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