config_ep_by_speed_and_alt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 fr
  • f β€” usb function, she's the function in question
  • _ep β€” the endpoint to configure, the one getting the glow-up
  • alt β€” alternate setting number, a u8, 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 πŸ‘‘


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