STRUCT CDNS3_DEVICE(9)
π NAME
okay bestie, welcome to the Kernel API Manual page for struct cdns3_device(9) β and the NAME is literally: struct cdns3_device β represent USB device. Thatβs the whole vibe: this struct is how the driver represents a USB device. π¦
β¨ SYNOPSIS
Hereβs the struct in all its glory, copied exactly so you can trust it:
struct cdns3_device {
struct device *dev;
struct device *sysdev;
struct usb_gadget gadget;
struct usb_gadget_driver *gadget_driver;
#define CDNS_REVISION_V0 0x00024501;
#define CDNS_REVISION_V1 0x00024509;
u32 dev_ver;
spinlock_t lock;
struct cdns3_usb_regs __iomem *regs;
struct dma_pool *eps_dma_pool;
struct usb_ctrlrequest *setup_buf;
dma_addr_t setup_dma;
void *zlp_buf;
u8 ep0_stage;
int ep0_data_dir;
struct cdns3_endpoint *eps[CDNS3_ENDPOINTS_MAX_COUNT];
struct list_head aligned_buf_list;
struct work_struct aligned_buf_wq;
u32 selected_ep;
u16 isoch_delay;
unsigned wait_for_setup:1;
unsigned u1_allowed:1;
unsigned u2_allowed:1;
unsigned is_selfpowered:1;
unsigned setup_pending:1;
unsigned hw_configured_flag:1;
unsigned wake_up_flag:1;
unsigned status_completion_no_call:1;
unsigned using_streams:1;
int out_mem_is_allocated;
struct work_struct pending_status_wq;
struct usb_request *pending_status_request;
u16 onchip_buffers;
u16 onchip_used_size;
u16 ep_buf_size;
u16 ep_iso_burst;
};
Also peep the two revision defines living inside the struct: CDNS_REVISION_V0 is 0x00024501, and CDNS_REVISION_V1 is 0x00024509. Slay. π
π Members
devβ pointer to thedevicestructure associated with this controller.sysdevβ pointer to the DMA capable device.gadgetβ device side representation of the peripheral controller.gadget_driverβ pointer to the gadget driver.dev_verβ device controller version. πlockβ for synchronizing.regsβ base address for device side registers.setup_bufβ used while processing USB control requests.setup_dmaβ DMA address forsetup_buf.zlp_bufβ zlp buffer.ep0_stageβ ep0 stage during the enumeration process.ep0_data_dirβ direction for control transfer.epsβ array of pointers to all endpoints, with ep0 excluded. The array iseps[CDNS3_ENDPOINTS_MAX_COUNT]. β¨aligned_buf_listβ list of aligned buffers internally allocated by driver.aligned_buf_wqβ workqueue freeing no longer used aligned buf.selected_epβ actually selected endpoint. Itβs used only to improve performance.isoch_delayβ value from Set Isoch Delay request. Only valid on SS/SSP.u1_allowed:1β allow device transition to u1 state.u2_allowed:1β allow device transition to u2 state.is_selfpowered:1β device is self powered.setup_pending:1β setup packet is processing by gadget driver.hw_configured_flag:1β hardware endpoint configuration was set.wake_up_flag:1β allow device to remote up the host.status_completion_no_call:1β indicate that driver is waiting for status s stage completion. Itβs used in deferred SET_CONFIGURATION request.pending_status_wqβ workqueue handling status stage for deferred requests.pending_status_requestβ request for which status stage was deferred.onchip_buffersβ number of available on-chip buffers.onchip_used_sizeβ actual size of on-chip memory assigned to endpoints.
πΈ Struct-only cameos (no separate member blurb in the original)
eps_dma_poolβ itβs in the struct asstruct dma_pool *eps_dma_pool;; the Members list doesnβt give it its own description here.wait_for_setup:1β bitfield in the struct, no separate member blurb in the original.using_streams:1β bitfield in the struct, no separate member blurb in the original.out_mem_is_allocatedβintin the struct, no separate member blurb in the original.ep_buf_sizeβu16in the struct, no separate member blurb in the original.ep_iso_burstβu16in the struct, no separate member blurb in the original.
π SEE ALSO
Kernel file ./drivers/usb/cdns3/cdns3-gadget.h:
struct cdns3_usb_regs(9)struct cdns3_trb(9)struct cdns3_endpoint(9)struct cdns3_aligned_buf(9)struct cdns3_request(9)
xoxo, this page lives under source/version ./drivers/usb/cdns3 and is dated October 2026 β go be iconic with your USB gadget struct, bestie! π
β¨
π¦ 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