STRUCT USB_UDC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, welcome to the struct usb_udc(9) page from the Kernel API Manual β€” and the whole vibe is struct usb_udc β€” describes one usb device controller. That's it, that's the NAME section, and yes we're keeping it cute and exact. πŸŽ€


✨ SYNOPSIS ✨

struct usb_udc {
    struct usb_gadget_driver        *driver;
    struct usb_gadget               *gadget;
    void (*gadget_release)(struct device *dev);
    struct device                   dev;
    struct list_head                list;
    bool vbus;
    bool started;
    bool allow_connect;
    struct work_struct              vbus_work;
    struct mutex                    connect_lock;
 };

🫢 Members 🫢

  • driver β€” the gadget driver pointer. For use by the class code. slay, noted πŸ’…
  • gadget β€” the gadget. For use by the class code. iconic.
  • gadget_release β€” the gadget's release routine. no cap.
  • dev β€” the child device to the actual controller.
  • list β€” for use by the udc class driver.
  • vbus β€” for udcs who care about vbus status, this value is real vbus status; for udcs who do not care about vbus status, this value is always true.
  • started β€” the UDC's started state. True if the UDC had started.
  • allow_connect β€” Indicates whether UDC is allowed to be pulled up. Set/cleared by gadget_(un)bind_driver after gadget driver is bound or unbound.
  • vbus_work β€” work routine to handle VBUS status change notifications.
  • connect_lock β€” protects udc->started, gadget->connect, gadget->allow_connect and gadget->deactivate. The routines usb_gadget_connect_locked, usb_gadget_disconnect_locked, usb_udc_connect_control_locked, usb_gadget_udc_start_locked and usb_gadget_udc_stop_locked are called with this lock held.

🌸 DESCRIPTION 🌸

okay so this represents the internal data structure which is used by the UDC-class to hold information about udc driver and gadget together. one little struct, holding the udc driver + gadget info together β€” bestie behavior fr fr πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, bestie β€” full list, no skips, no cap:


okay that's the whole page, mwah πŸ’‹ β€” from the ./drivers/usb/gadget/udc source, October 2026, struct usb_udc(9) in the Kernel API Manual. byeeee πŸ¦‹πŸ’…

πŸ“¦ where this page comes from