usb_ep_disable(9)
π usb_ep_disable(9) β bestie, we're shutting the endpoint DOWN
okay so this is a page from the Kernel API Manual (yes, the Kernel API Manual β the serious one, not the syscall one) and it's about usb_ep_disable, aka the "we're so done here" call for a USB endpoint. β¨
π NAME π
usb_ep_disable β the endpoint is no longer usable. that's it, that's the whole vibe check. π
πΈ SYNOPSIS πΈ
int usb_ep_disable (struct usb_ep *ep );
π¦ ARGUMENTS π¦
epβ the endpoint being unconfigured π«Ά. Important: it may not be the endpoint named"ep0". like, don't even try it, bestie, that one's special. π
π₯ DESCRIPTION π₯
okay so ground rules first: no other task may be using this endpoint when you call this. literally nobody else, we need the whole room clear. π
any pending and uncompleted requests will complete with a status indicating disconnect β that's -ESHUTDOWN, ngl that name is giving "we're so over" π β and all of that happens before this call returns. so by the time it hands back control, the stragglers are gone.
and then, gadget drivers: you must call usb_ep_enable again before queueing requests to the endpoint. no shortcuts, no "but it's still warm", none of that. π
this routine may be called in an atomic (interrupt) context. yup, even mid-interrupt, she's fine. icon behaviour. β¨
it returns zero, or a negative error code. so like, either "slay, we're done" or "something went sideways". π
π SEE ALSO π
the whole friend group, fr fr β every single one:
Kernel file ./drivers/usb/gadget/udc/core.c struct usb_udc(9), usb_ep_set_maxpacket_limit(9), usb_ep_enable(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)
π source check: this one lives over in ./drivers/usb/gadget/udc, dated October 2026. remember that date for the quiz, bestie. π
and that's the page!! go forth and unconfigure responsibly, 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