STRUCT PXA_UDC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ NAME πŸ¦‹

ok so this is struct pxa_udc(9) from the Kernel API Manual, and bestie, it's literally the udc structure. like, the whole thing. the main character struct itself. periodt πŸ’…


✨ SYNOPSIS ✨

here's the glow-up, laid out exactly how the kernel gods wrote it:

struct pxa_udc {
    void __iomem                            *regs;
    int irq;
    struct clk                              *clk;
    struct usb_gadget                       gadget;
    struct usb_gadget_driver                *driver;
    struct device                           *dev;
    struct gpio_desc                        *gpiod;
    struct usb_phy                          *transceiver;
    enum ep0_state                          ep0state;
    struct udc_stats                        stats;
    struct udc_usb_ep
udc_usb_ep[NR_USB_ENDPOINTS];
    struct pxa_ep                           pxa_ep[NR_PXA_ENDPOINTS];
    unsigned enabled:1;
    unsigned pullup_on:1;
    unsigned pullup_resume:1;
    unsigned vbus_sensed:1;
    unsigned config:2;
    unsigned last_interface:3;
    unsigned last_alternate:3;
  #ifdef CONFIG_PM;
    unsigned udccsr0;
  #endif;
 };
ngl that one line that just goes struct udc_usb_ep and then drops udc_usb_ep[NR_USB_ENDPOINTS]; on the next line is so real of it. we respect the formatting choices here 🫢

πŸ’… Members πŸ’…

okay, field-by-field tour, no skips, no cap:

  • regs β€” mapped IO space ✨
  • irq β€” udc irq
  • clk β€” udc clock
  • driver β€” bound gadget (zero, g_ether, g_mass_storage, ...) β€” yeah, the whole little gadget fam πŸŽ€
  • dev β€” device
  • gpiod β€” gpio descriptor of gpio for D+ pullup (or NULL if none)
  • transceiver β€” external transceiver to handle vbus sense and D+ pullup
  • ep0state β€” control endpoint state machine state
  • stats β€” statistics on udc usage
  • udc_usb_ep β€” array of usb endpoints offered by the gadget
  • pxa_ep β€” array of pxa available endpoints
  • enabled β€” UDC was enabled by a previous udc_enable
  • pullup_on β€” if pullup resistor connected to D+ pin
  • pullup_resume β€” if pullup resistor should be connected to D+ pin on resume
  • config β€” UDC active configuration
  • last_interface β€” UDC interface of the last SET_INTERFACE host request
  • last_alternate β€” UDC altsetting of the last SET_INTERFACE host request
  • udccsr0 β€” save of udccsr0 in case of suspend 😴
also lowkey living for the bitfield energy on enabled:1, pullup_on:1, pullup_resume:1, vbus_sensed:1, config:2, last_interface:3, last_alternate:3 β€” tiny numbers, huge vibes 🧚

πŸ”₯ SEE ALSO πŸ”₯

go peek at the kernel file ./drivers/usb/gadget/udc/pxa27x_udc.h and its friends: struct udc_usb_ep(9), struct pxa_ep(9), struct pxa27x_request(9). iykyk πŸ’œ


and that's the whole page bestie, slay πŸŒˆπŸ’– β€” straight out of ./drivers/usb/gadget/udc, dated October 2026, filed under struct pxa_udc(9). go off, king πŸ‘‘βœ¨

πŸ“¦ where this page comes from