usb_ep_enable(9)
π usb_ep_enable(9) β like, the Kernel API Manual page, bestie β¨
okay so this is a page from the Kernel API Manual, section 9 of the man pages (usb_ep_enable(9)), and it's literally all about making an endpoint usable. buckle up π
π¦ NAME
usb_ep_enable β configure endpoint, making it usable π
β¨ SYNOPSIS
int usb_ep_enable (struct usb_ep *ep );
that's it. that's the whole vibe. one arg, one int back. slay.
π ARGUMENTS
epβ the endpoint being configured. and listen, it may not be the endpoint named"ep0"π ββοΈ like, that one's off limits, do not come for ep0. drivers discover endpoints through theep_listof ausb_gadget. iykyk.
π DESCRIPTION
so when configurations get set, or when interface settings change, the driver will enable or disable the relevant endpoints. that's the whole cycle. and while an endpoint is enabled, it may be used for i/o β until the driver receives a disconnect from the host, or until the endpoint gets disabled. either one, and we're done here π
the ep0 implementation (which is the thing that actually calls this routine, no cap) must ensure that the hardware capabilities of each endpoint match the descriptor provided for it. that's a hard must, bestie, not a suggestion. for example: an endpoint named "ep2in-bulk" would be usable for interrupt transfers as well as bulk β but it likely couldn't be used for iso transfers or for endpoint 14. like, it just doesn't have the range π some endpoints are fully configurable though, with more generic names like "ep-a". those are the flexible ones, main character energy π
(remember that for USB, "in" means "towards the USB host". yes i know that's backwards from what your brain wants. write it down. put it on a sticky note. π«Ά)
β‘ note note note: This routine may be called in an atomic (interrupt) context. so keep it chill in there, no sleeping, okay?
and what does it give you back? it returns zero, or a negative error code. that's it. zero means we ate. negative means π
π₯ SEE ALSO
literally the whole friend group, go say hi π β Kernel file ./drivers/usb/gadget/udc/core.c, plus:
struct usb_udc(9)usb_ep_set_maxpacket_limit(9)usb_ep_disable(9)usb_ep_alloc_request(9)usb_ep_free_request(9)usb_ep_queue(9)usb_ep_dequeue(9)usb_ep_set_halt(9)usb_ep_clear_halt(9)usb_ep_set_wedge(9)usb_ep_fifo_status(9)usb_ep_fifo_flush(9)usb_gadget_frame_number(9)usb_gadget_wakeup(9)usb_gadget_set_remote_wakeup(9)usb_gadget_set_selfpowered(9)usb_gadget_clear_selfpowered(9)usb_gadget_vbus_connect(9)usb_gadget_vbus_draw(9)usb_gadget_vbus_disconnect(9)usb_gadget_connect(9)usb_gadget_disconnect(9)usb_gadget_deactivate(9)usb_gadget_activate(9)usb_gadget_giveback_request(9)gadget_find_ep_by_name(9)usb_gadget_check_config(9)usb_udc_vbus_handler(9)usb_gadget_udc_reset(9)usb_gadget_udc_start_locked(9)usb_gadget_udc_stop_locked(9)usb_gadget_udc_set_speed(9)usb_gadget_enable_async_callbacks(9)usb_gadget_disable_async_callbacks(9)usb_udc_release(9)usb_initialize_gadget(9)usb_add_gadget(9)usb_add_gadget_udc_release(9)usb_get_gadget_udc_name(9)usb_add_gadget_udc(9)usb_del_gadget(9)usb_del_gadget_udc(9)
β¨ and that's the page!! β¨ it lives in ./drivers/usb/gadget/udc, it's dated October 2026, and it's filed under usb_ep_enable(9) β go enable some endpoints responsibly, ily, bye ππ¦π
π¦ 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