usb_add_gadget_udc(9)
π usb_add_gadget_udc(9) π
okay so you're in the Kernel API Manual, bestie, and this page is literally all about usb_add_gadget_udc β the function that adds a new gadget to the udc class driver list. yes it's giving kernel-internals energy, but stay with me, it's actually so simple π«Ά
β¨ NAME β¨
usb_add_gadget_udc β adds a new gadget to the udc class driver list π
πΈ SYNOPSIS πΈ
int usb_add_gadget_udc (struct device *parent , struct usb_gadget *gadget );
π ARGUMENTS π
parentβ the parent device of this udc. normally it's the controller driver's device, like that's its whole thing πgadgetβ the gadget being added to the list, the main character of this operation fr fr β¨
π¦ DESCRIPTION π¦
returns zero on success, negative errno otherwise. that's it. that's the whole description, no cap π zero = slay, negative = not slay, and you get an errno to tell you why π₯
π SEE ALSO π
the kernel file is ./drivers/usb/gadget/udc/core.c, and the whole friend group is here so let's go π
struct usb_udc(9), usb_ep_set_maxpacket_limit(9), usb_ep_enable(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_del_gadget(9), usb_del_gadget_udc(9)
lowkey read the whole list before you go poking at gadget code, bestie β these are all siblings in the same little kernel family π§
β that's the page!! sourced from ./drivers/usb/gadget/udc, dated October 2026, filed under usb_add_gadget_udc(9) β periodt, go add your gadget ππΈ
π¦ 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