STRUCT PCH_UDC_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so before we even start β€” this is a page from the Kernel API Manual, bestie. yes, the kernel. we're in the big leagues now. grab a lil beverage πŸ“, because this struct is the whole personality of the PCH USB device and it has a LOT going on.


✨ NAME ✨

struct pch_udc_dev β€” the structure holding complete information of the PCH USB device. like, not a vibe, not a summary, the complete information. she's thorough πŸ’…


🌸 SYNOPSIS 🌸

struct pch_udc_dev {
    struct usb_gadget               gadget;
    struct usb_gadget_driver        *driver;
    struct pci_dev                  *pdev;
    struct pch_udc_ep               ep[PCH_UDC_EP_NUM];
    spinlock_t lock;
    unsigned stall:1, prot_stall:1, suspended:1, connected:1,
vbus_session:1, set_cfg_not_acked:1, waiting_zlp_ack:1;
    struct dma_pool         *data_requests;
    struct dma_pool         *stp_requests;
    dma_addr_t dma_addr;
    struct usb_ctrlrequest          setup_data;
    void __iomem                    *base_addr;
    unsigned short                  bar;
    struct pch_udc_cfg_data         cfg_data;
    struct pch_vbus_gpio_data       vbus_gpio;
 };

yes the indentation of that bitfield line is like that in the original. we don't touch it. we respect it. ✨


πŸŽ€ Members πŸŽ€

okay so this is the part where we meet the whole cast. main character energy all around, honestly.

  • gadget β€” gadget driver data. the moment. the core.
  • driver β€” reference to the gadget driver bound. bound as in attached, not as in a book, bestie 😭
  • pdev β€” reference to the PCI device.
  • ep β€” array of endpoints. plural. many of them. iconic.
  • lock β€” protects all state. literally the bouncer at the club, nobody gets through without her πŸ”₯
  • stall β€” stall requested.
  • prot_stall β€” protcol stall requested. (yes "protcol". that's how it's spelled here. we are simply reporting the facts 🫢)
  • suspended β€” driver in suspended state.
  • connected β€” gadget driver associated.
  • vbus_session β€” required vbus_session state.
  • set_cfg_not_acked β€” pending acknowledgement 4 setup. (the "4" is doing a lot of work here, lowkey)
  • waiting_zlp_ack β€” pending acknowledgement 4 ZLP.
  • data_requests β€” DMA pool for data requests.
  • stp_requests β€” DMA pool for setup requests.
  • dma_addr β€” DMA pool for received.
  • setup_data β€” received setup data.
  • base_addr β€” for mapped device memory.
  • bar β€” PCI BAR used for mapped device memory.
  • cfg_data β€” current cfg, intf, and alt in use.
  • vbus_gpio β€” GPIO informaton for detecting VBUS. (again: "informaton". we stan a consistent typo tbh πŸ’€)

πŸ¦‹ SEE ALSO πŸ¦‹

starting off with the source, because duh:

Kernel file ./drivers/usb/gadget/udc/pch_udc.c struct pch_udc_data_dma_desc(9), struct pch_udc_stp_dma_desc(9), struct pch_udc_cfg_data(9), struct pch_udc_ep(9), struct pch_vbus_gpio_data(9), struct pch_udc_request(9), pch_udc_csr_busy(9), pch_udc_write_csr(9), pch_udc_read_csr(9), pch_udc_rmt_wakeup(9), pch_udc_get_frame(9), pch_udc_clear_selfpowered(9), pch_udc_set_selfpowered(9), pch_udc_set_disconnect(9), pch_udc_clear_disconnect(9), pch_udc_reconnect(9), pch_udc_vbus_session(9), pch_udc_ep_set_stall(9), pch_udc_ep_clear_stall(9), pch_udc_ep_set_trfr_type(9), pch_udc_ep_set_bufsz(9), pch_udc_ep_set_maxpkt(9), pch_udc_ep_set_subptr(9), pch_udc_ep_set_ddptr(9), pch_udc_ep_set_pd(9), pch_udc_ep_set_rrdy(9), pch_udc_ep_clear_rrdy(9), pch_udc_set_dma(9), pch_udc_clear_dma(9), pch_udc_set_csr_done(9), pch_udc_disable_interrupts(9), pch_udc_enable_interrupts(9), pch_udc_disable_ep_interrupts(9), pch_udc_enable_ep_interrupts(9), pch_udc_read_device_interrupts(9), pch_udc_write_device_interrupts(9), pch_udc_read_ep_interrupts(9), pch_udc_write_ep_interrupts(9), pch_udc_read_device_status(9), pch_udc_read_ep_control(9), pch_udc_clear_ep_control(9), pch_udc_read_ep_status(9), pch_udc_clear_ep_status(9), pch_udc_ep_set_nak(9), pch_udc_ep_clear_nak(9), pch_udc_ep_fifo_flush(9), pch_udc_ep_enable(9), pch_udc_ep_disable(9), pch_udc_wait_ep_stall(9), pch_udc_init(9), pch_udc_exit(9), pch_udc_pcd_get_frame(9), pch_udc_pcd_wakeup(9), pch_udc_pcd_selfpowered(9), pch_udc_pcd_pullup(9), pch_udc_pcd_vbus_session(9), pch_udc_pcd_vbus_draw(9), pch_vbus_gpio_get_value(9), pch_vbus_gpio_work_fall(9), pch_vbus_gpio_work_rise(9), pch_vbus_gpio_irq(9), pch_vbus_gpio_init(9), pch_vbus_gpio_free(9), complete_req(9), empty_req_queue(9), pch_udc_free_dma_chain(9), pch_udc_create_dma_chain(9), prepare_dma(9), process_zlp(9), pch_udc_start_rxrequest(9), pch_udc_pcd_ep_enable(9), pch_udc_pcd_ep_disable(9), pch_udc_alloc_request(9), pch_udc_free_request(9), pch_udc_pcd_queue(9), pch_udc_pcd_dequeue(9), pch_udc_pcd_set_halt(9), pch_udc_pcd_set_wedge(9), pch_udc_pcd_fifo_flush(9), pch_udc_init_setup_buff(9), pch_udc_start_next_txrequest(9), pch_udc_complete_transfer(9), pch_udc_complete_receiver(9), pch_udc_svc_data_in(9), pch_udc_svc_data_out(9), pch_udc_svc_control_in(9), pch_udc_svc_control_out(9), pch_udc_postsvc_epinters(9), pch_udc_read_all_epstatus(9), pch_udc_activate_control_ep(9), pch_udc_svc_ur_interrupt(9), pch_udc_svc_enum_interrupt(9), pch_udc_svc_intf_interrupt(9), pch_udc_svc_cfg_interrupt(9), pch_udc_dev_isr(9), pch_udc_isr(9), pch_udc_setup_ep0(9), pch_udc_pcd_reinit(9), pch_udc_pcd_init(9), init_dma_pools(9)

that's the whole friend group right there. go say hi. πŸ’–


ngl the entire cast of this page lives in ./drivers/usb/gadget/udc β€” that's the directory, bestie, don't @ me.

and that's a wrap! πŸŽ€ this slay of a page comes to you from ./drivers/usb/gadget/udc, dated October 2026, and it's filed under struct pch_udc_dev(9). mwah πŸ’‹ πŸ¦‹

πŸ“¦ where this page comes from