usb_ep_align(9)
π usb_ep_align(9) β¨
ok so this page lives in the Kernel API Manual, bestie β that's the manual name, that's where you'll find it. And the vibe? It's the little helper that rounds your buffer size up so it plays nice with your endpoint's maxpacketsize. Periodt. π
πΈ NAME πΈ
usb_ep_align β returns @len aligned to ep's maxpacketsize.
(no cap, that's literally the whole job. tiny function, big main character energy π)
β¨ SYNOPSIS β¨
size_t usb_ep_align (struct usb_ep *ep , size_t len );
two args in, a size_t out. cute, clean, slay. π¦
π«Ά ARGUMENTS π«Ά
epβ the endpoint whose maxpacketsize is used to align len. like, this is the endpoint doing the aligning, she's the standard here πlenβ buffer size's length to align toep's maxpacketsize. the length that's about to get snapped into shape π
π₯ DESCRIPTION π₯
okay so listen: this helper is used to align buffer's size to an ep's maxpacketsize. that's it. that's the function. you hand it an endpoint and a length, and it gives you back that length all lined up with the endpoint's maxpacketsize. the way that this is exactly what you need for buffer sizingβ¦ obsessed. πβ¨
ngl this is the kind of helper you don't appreciate until your transfer is off-by-a-few-bytes and you're crying in the group chat. keep her close. π
π SEE ALSO π
lowkey a whole friend group here, iykyk:
- Kernel file
./include/linux/usb/gadget.hπ§ struct usb_request(9)struct usb_ep_caps(9)struct usb_ep(9)free_usb_request(9)struct usb_gadget(9)usb_ep_align_maybe(9)gadget_is_altset_supported(9)gadget_is_stall_supported(9)gadget_is_zlp_supported(9)gadget_avoids_skb_reserve(9)gadget_is_dualspeed(9)gadget_is_superspeed(9)gadget_is_superspeed_plus(9)gadget_is_otg(9)struct usb_gadget_driver(9)usb_gadget_register_driver_owner(9)usb_gadget_unregister_driver(9)struct usb_string(9)struct usb_gadget_strings(9)usb_free_descriptors(9)
and that's the whole page, bestie β go align something iconic π
this one came from ./include/linux/usb, dated October 2026, and it's filed under usb_ep_align(9). mwah ππ
π¦ 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