usb_ep_disable(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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