STRUCT BCM63XX_UDC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct bcm63xx_udc(9) πŸ’–

okay bestie, so this is a page from the Kernel API Manual and it's literally the blueprint for struct bcm63xx_udc β€” the driver/hardware private context ✨ like, the main character struct of the whole bcm63xx UDC situation. iykyk πŸ’…


✨ NAME ✨

struct bcm63xx_udc β€” the driver/hardware private context. that's it, that's the vibe. it's the little home where the driver keeps all its hardware secrets 🫢


🌸 SYNOPSIS 🌸

struct bcm63xx_udc {
    spinlock_t lock;
    struct device                   *dev;
    struct bcm63xx_usbd_platform_data *pd;
    struct clk                      *usbd_clk;
    struct clk                      *usbh_clk;
    struct usb_gadget               gadget;
    struct usb_gadget_driver        *driver;
    void __iomem                    *usbd_regs;
    void __iomem                    *iudma_regs;
    struct bcm63xx_ep               bep[BCM63XX_NUM_EP];
    struct iudma_ch                 iudma[BCM63XX_NUM_IUDMA];
    int cfg;
    int iface;
    int alt_iface;
    struct bcm63xx_req              ep0_ctrl_req;
    u8 *ep0_ctrl_buf;
    int ep0state;
    struct work_struct              ep0_wq;
    unsigned long                   wedgemap;
    unsigned ep0_req_reset:1;
    unsigned ep0_req_set_cfg:1;
    unsigned ep0_req_set_iface:1;
    unsigned ep0_req_shutdown:1;
    unsigned ep0_req_completed:1;
    struct usb_request              *ep0_reply;
    struct usb_request              *ep0_request;
 };

periodt. copy it exactly, don't you dare rename anything πŸ’€


πŸŽ€ Members πŸŽ€

okay so every single field, in order, no skipping, because we do not gatekeep the details 🧚

  • lock β€” spinlock that mediates access to this struct, and (most) HW regs. one lock to rule them all, very demure πŸŽ€
  • dev β€” the generic Linux device structure.
  • pd β€” platform data (board/port info).
  • usbd_clk β€” clock descriptor for the USB device block.
  • usbh_clk β€” clock descriptor for the USB host block.
  • gadget β€” the USB device.
  • driver β€” the driver for the USB device.
  • usbd_regs β€” base address of the USBD/USB20D block.
  • iudma_regs β€” base address of the USBD's associated IUDMA block.
  • bep β€” array of endpoints, including ep0.
  • iudma β€” array of all IUDMA channels used by this controller.
  • cfg β€” USB configuration number, from SET_CONFIGURATION wValue.
  • iface β€” USB interface number, from SET_INTERFACE wIndex.
  • alt_iface β€” USB alt interface number, from SET_INTERFACE wValue.
  • ep0_ctrl_req β€” request object for bcm63xx_udc-initiated ep0 transactions.
  • ep0_ctrl_buf β€” data buffer for ep0_ctrl_req.
  • ep0state β€” current state of the ep0 state machine. she's always in a state, honestly 😭
  • ep0_wq β€” workqueue struct used to wake up the ep0 state machine.
  • wedgemap β€” bitmap of wedged endpoints. iconic name, no notes πŸ’…
  • ep0_req_reset β€” USB reset is pending.
  • ep0_req_set_cfg β€” need to spoof a SET_CONFIGURATION packet.
  • ep0_req_set_iface β€” need to spoof a SET_INTERFACE packet.
  • ep0_req_shutdown β€” driver is shutting down; requesting ep0 to halt activity.
  • ep0_req_completed β€” ep0 request has completed; worker has not seen it yet. the gossip hasn't reached her yet fr fr πŸ™ˆ
  • ep0_reply β€” pending reply from gadget driver.
  • ep0_request β€” outstanding ep0 request.

🌈 SEE ALSO 🌈

heads up bestie, this is a long list and we're not cutting a single one, she ate and left no crumbs πŸ‘‘

Kernel file ./drivers/usb/gadget/udc/bcm63xx_udc.c struct iudma_ch_cfg(9), struct iudma_ch(9), struct bcm63xx_ep(9), struct bcm63xx_req(9), bcm63xx_ep_dma_select(9), bcm63xx_set_stall(9), bcm63xx_fifo_setup(9), bcm63xx_fifo_reset_ep(9), bcm63xx_fifo_reset(9), bcm63xx_ep_init(9), bcm63xx_ep_setup(9), iudma_write(9), iudma_read(9), iudma_reset_channel(9), iudma_init_channel(9), iudma_init(9), iudma_uninit(9), bcm63xx_set_ctrl_irqs(9), bcm63xx_select_phy_mode(9), bcm63xx_select_pullup(9), bcm63xx_uninit_udc_hw(9), bcm63xx_init_udc_hw(9), bcm63xx_ep_enable(9), bcm63xx_ep_disable(9), bcm63xx_udc_alloc_request(9), bcm63xx_udc_free_request(9), bcm63xx_udc_queue(9), bcm63xx_udc_dequeue(9), bcm63xx_udc_set_halt(9), bcm63xx_udc_set_wedge(9), bcm63xx_ep0_setup_callback(9), bcm63xx_ep0_spoof_set_cfg(9), bcm63xx_ep0_spoof_set_iface(9), bcm63xx_ep0_map_write(9), bcm63xx_ep0_complete(9), bcm63xx_ep0_nuke_reply(9), bcm63xx_ep0_read_complete(9), bcm63xx_ep0_internal_request(9), bcm63xx_ep0_do_setup(9), bcm63xx_ep0_do_idle(9), bcm63xx_ep0_one_round(9), bcm63xx_ep0_process(9), bcm63xx_udc_get_frame(9), bcm63xx_udc_pullup(9), bcm63xx_udc_start(9), bcm63xx_udc_stop(9), bcm63xx_update_cfg_iface(9), bcm63xx_update_link_speed(9), bcm63xx_update_wedge(9), bcm63xx_udc_ctrl_isr(9), bcm63xx_udc_data_isr(9), bcm63xx_udc_init_debugfs(9), bcm63xx_udc_cleanup_debugfs(9), bcm63xx_udc_probe(9), bcm63xx_udc_remove(9)


and that's the whole page, bestie!! 🌟 source is ./drivers/usb/gadget/udc, dated October 2026, and it's serving struct bcm63xx_udc(9) energy from the Kernel API Manual. go forth and be obsessed πŸ’œπŸ¦‹

πŸ“¦ where this page comes from