STRUCT CDNSP_DEVICE(9)
๐ซ NAME ๐ซ
okay so this is the struct cdnsp_device(9) page from the Kernel API Manual, bestie โ and itโs literally the whole USB device vibe in one struct.
struct cdnsp_device โ represent USB device. periodt ๐
๐ธ SYNOPSIS ๐ธ
struct cdnsp_device {
struct device *dev;
struct usb_gadget gadget;
struct usb_gadget_driver *gadget_driver;
unsigned int irq;
void __iomem *regs;
struct cdnsp_cap_regs __iomem *cap_regs;
struct cdnsp_op_regs __iomem *op_regs;
struct cdnsp_run_regs __iomem *run_regs;
struct cdnsp_doorbell_array __iomem *dba;
struct cdnsp_intr_reg __iomem *ir_set;
struct cdnsp_20port_cap __iomem *port20_regs;
struct cdnsp_3xport_cap __iomem *port3x_regs;
struct cdnsp_rev_cap __iomem *rev_cap;
__u32 hcs_params1;
__u32 hcs_params3;
__u32 hcc_params;
#define RTL_REVISION_NEW_LPM 0x2700;
__u32 rtl_revision;
spinlock_t lock;
struct usb_ctrlrequest setup;
struct cdnsp_request ep0_preq;
enum cdnsp_ep0_stage ep0_stage;
u8 three_stage_setup;
u8 ep0_expect_in;
u8 setup_id;
u8 setup_speed;
void *setup_buf;
u8 device_address;
int may_wakeup;
u16 hci_version;
struct cdnsp_device_context_array *dcbaa;
struct cdnsp_ring *cmd_ring;
struct cdnsp_command cmd;
struct cdnsp_ring *event_ring;
struct cdnsp_erst erst;
int slot_id;
struct cdnsp_container_ctx out_ctx;
struct cdnsp_container_ctx in_ctx;
struct cdnsp_ep eps[CDNSP_ENDPOINTS_NUM];
u8 usb2_hw_lpm_capable:1;
u8 u1_allowed:1;
u8 u2_allowed:1;
struct dma_pool *device_pool;
struct dma_pool *segment_pool;
#define CDNSP_STATE_HALTED BIT(1);
#define CDNSP_STATE_DYING BIT(2);
#define CDNSP_STATE_DISCONNECT_PENDING BIT(3);
#define CDNSP_WAKEUP_PENDING BIT(4);
unsigned int cdnsp_state;
unsigned int link_state;
struct cdnsp_port usb2_port;
struct cdnsp_port eusb_port;
struct cdnsp_port usb3_port;
struct cdnsp_port *active_port;
u16 test_mode;
};
no cap, this is a big struct โ but every field is a little puzzle piece and weโre gonna go through all of them ๐
โจ Members โจ
devโ pointer to the device structure associated with this controller.gadgetโ device side representation of the peripheral controller.gadget_driverโ pointer to the gadget driver.irqโ IRQ line number used by device side.regsโ IO device memory.cap_regsโ capability registers.op_regsโ operational registers.run_regsโ runtime registers.dbaโ device base address register.ir_setโ current interrupter register set.port20_regsโ Port 2.0 Peripheral Configuration Registers.port3x_regsโ USB3.x Port Peripheral Configuration Registers.rev_capโ Controller Capabilities Registers.hcs_params1โ cached register copies of read-onlyHCSPARAMS1.hcc_paramsโ cached register copies of read-onlyHCCPARAMS1.rtl_revisionโ cached controller rtl revision.lockโ lock used in interrupt thread context.setupโ temporary buffer for setup packet.ep0_preqโ internal allocated request used during enumeration.ep0_stageโ ep0 stage during enumeration process.three_stage_setupโ three state or two state setup.ep0_expect_inโ data IN expected for control transfer.setup_idโ setup identifier.setup_speedโ speed detected for current SETUP packet.setup_bufโ buffer for SETUP packet.device_addressโ current device address.may_wakeupโ remote wakeup enabled/disabled.hci_versionโ device controller version.dcbaaโ Device context base address array.cmd_ringโ Command ring.cmdโ represent all what is needed to issue command on Command Ring.event_ringโ Event ring.erstโ Event Ring Segment table.slot_idโ current Slot ID. Should be0or1.out_ctxโ output context.in_ctxโ input context.epsโ array of endpoints object associated with device.usb2_hw_lpm_capableโ hardware lpm is enabled; ๐u1_allowedโ allow device transition to U1 state.u2_allowedโ allow device transition to U2 state.device_poolโ DMA pool for allocating input and output context.segment_poolโ DMA pool for allocating new segments.cdnsp_stateโ current state of controller.link_stateโ current link state.usb2_portโ Port USB 2.0.usb3_portโ Port USB 3.0.active_portโ current selected Port.test_modeโ selected Test Mode.
๐ฎ SEE ALSO ๐ฎ
Kernel file ./drivers/usb/cdns3/cdnsp-gadget.h has the whole squad, bestie:
struct cdnsp_cap_regs(9)struct cdnsp_op_regs(9)struct cdnsp_port_regs(9)struct cdnsp_intr_reg(9)struct cdnsp_run_regs(9)struct cdnsp_rev_cap(9)struct cdnsp_doorbell_array(9)struct cdnsp_container_ctx(9)struct cdnsp_slot_ctx(9)struct cdnsp_ep_ctx(9)struct cdnsp_stream_info(9)struct cdnsp_ep(9)struct cdnsp_device_context_array(9)struct cdnsp_transfer_event(9)struct cdnsp_link_trb(9)struct cdnsp_event_cmd(9)struct cdnsp_segment(9)struct cdnsp_td(9)struct cdnsp_dequeue_state(9)struct cdnsp_ring(9)struct cdnsp_erst_entry(9)struct cdnsp_erst(9)struct cdnsp_request(9)struct cdnsp_port(9)next_request(9)
and thatโs the whole page, bestie ๐ซถ source vibe is ./drivers/usb/cdns3, dated October 2026 โ mwah ๐โจ
๐ฆ 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