drivers/usb/host/xhci-dbgcap.h

Source file repositories/reference/linux-study-clean/drivers/usb/host/xhci-dbgcap.h

File Facts

System
Linux kernel
Corpus path
drivers/usb/host/xhci-dbgcap.h
Extension
.h
Size
7074 bytes
Lines
273
Domain
Driver Families
Bucket
drivers/usb
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct dbc_regs {
	__le32	capability;
	__le32	doorbell;
	__le32	ersts;		/* Event Ring Segment Table Size*/
	__le32	__reserved_0;	/* 0c~0f reserved bits */
	__le64	erstba;		/* Event Ring Segment Table Base Address */
	__le64	erdp;		/* Event Ring Dequeue Pointer */
	__le32	control;
	__le32	status;
	__le32	portsc;		/* Port status and control */
	__le32	__reserved_1;	/* 2b~28 reserved bits */
	__le64	dccp;		/* Debug Capability Context Pointer */
	__le32	devinfo1;	/* Device Descriptor Info Register 1 */
	__le32	devinfo2;	/* Device Descriptor Info Register 2 */
};

struct dbc_info_context {
	__le64	string0;
	__le64	manufacturer;
	__le64	product;
	__le64	serial;
	__le32	length;
	__le32	__reserved_0[7];
};

#define DBC_CTRL_DBC_RUN		BIT(0)
#define DBC_CTRL_PORT_ENABLE		BIT(1)
#define DBC_CTRL_HALT_OUT_TR		BIT(2)
#define DBC_CTRL_HALT_IN_TR		BIT(3)
#define DBC_CTRL_DBC_RUN_CHANGE		BIT(4)
#define DBC_CTRL_DBC_ENABLE		BIT(31)
#define DBC_CTRL_MAXBURST(p)		(((p) >> 16) & 0xff)
#define DBC_DOOR_BELL_TARGET(p)		(((p) & 0xff) << 8)

#define DBC_MAX_PACKET			1024
#define	DBC_CONTEXT_SIZE		64

/*
 * Port status:
 */
#define DBC_PORTSC_CONN_STATUS		BIT(0)
#define DBC_PORTSC_PORT_ENABLED		BIT(1)
#define DBC_PORTSC_CONN_CHANGE		BIT(17)
#define DBC_PORTSC_RESET_CHANGE		BIT(21)
#define DBC_PORTSC_LINK_CHANGE		BIT(22)
#define DBC_PORTSC_CONFIG_CHANGE	BIT(23)

/*
 * The maximum length of a string descriptor is 255, because the bLength
 * field in the usb_string_descriptor struct is __u8.  In practice the
 * maximum length is 254, because a string descriptor consists of a 2 byte
 * header followed by UTF-16 characters (2 bytes each). This allows for
 * only 126 characters (code points) in the string, which is where
 * USB_MAX_STRING_LEN comes from.
 */
#define USB_MAX_STRING_DESC_LEN		254

struct dbc_str_descs {
	char	string0[USB_MAX_STRING_DESC_LEN];
	char	manufacturer[USB_MAX_STRING_DESC_LEN];
	char	product[USB_MAX_STRING_DESC_LEN];
	char	serial[USB_MAX_STRING_DESC_LEN];
};

/*
 * NULL terminated UTF-8 strings used to create UTF-16 strings
 * (with maxiumum USB_MAX_STRING_LEN 2 byte characters).
 */
struct dbc_str {
	char	manufacturer[USB_MAX_STRING_LEN+1];
	char	product[USB_MAX_STRING_LEN+1];
	char	serial[USB_MAX_STRING_LEN+1];
};

#define DBC_PROTOCOL			1	/* GNU Remote Debug Command */
#define DBC_VENDOR_ID			0x1d6b	/* Linux Foundation 0x1d6b */
#define DBC_PRODUCT_ID			0x0010	/* device 0010 */
#define DBC_DEVICE_REV			0x0010	/* 0.10 */

enum dbc_state {
	DS_DISABLED = 0,
	DS_INITIALIZED,
	DS_ENABLED,
	DS_CONNECTED,
	DS_CONFIGURED,
	DS_MAX
};

struct dbc_ep {
	struct xhci_dbc			*dbc;

Annotation

Implementation Notes