drivers/usb/usbip/vudc.h

Source file repositories/reference/linux-study-clean/drivers/usb/usbip/vudc.h

File Facts

System
Linux kernel
Corpus path
drivers/usb/usbip/vudc.h
Extension
.h
Size
3651 bytes
Lines
179
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 vep {
	struct usb_ep ep;
	unsigned type:2; /* type, as USB_ENDPOINT_XFER_* */
	char name[8];	/* space for ep name */

	const struct usb_endpoint_descriptor *desc;
	struct usb_gadget *gadget;
	struct list_head req_queue; /* Request queue */
	unsigned halted:1;
	unsigned wedged:1;
	unsigned already_seen:1;
	unsigned setup_stage:1;
};

struct vrequest {
	struct usb_request req;
	struct vudc *udc;
	struct list_head req_entry; /* Request queue */
};

struct urbp {
	struct urb *urb;
	struct vep *ep;
	struct list_head urb_entry; /* urb queue */
	unsigned long seqnum;
	unsigned type:2; /* for tx, since ep type can change after */
	unsigned new:1;
};

struct v_unlink {
	unsigned long seqnum;
	__u32 status;
};

enum tx_type {
	TX_UNLINK,
	TX_SUBMIT,
};

struct tx_item {
	struct list_head tx_entry;
	enum tx_type type;
	union {
		struct urbp *s;
		struct v_unlink *u;
	};
};

enum tr_state {
	VUDC_TR_RUNNING,
	VUDC_TR_IDLE,
	VUDC_TR_STOPPED,
};

struct transfer_timer {
	struct timer_list timer;
	enum tr_state state;
	unsigned long frame_start;
	int frame_limit;
};

struct vudc {
	struct usb_gadget gadget;
	struct usb_gadget_driver *driver;
	struct platform_device *pdev;

	struct usb_device_descriptor dev_desc;

	struct usbip_device ud;
	struct transfer_timer tr_timer;
	struct timespec64 start_time;

	struct list_head urb_queue;

	spinlock_t lock_tx;
	struct list_head tx_queue;
	wait_queue_head_t tx_waitq;

	spinlock_t lock;
	struct vep *ep;
	int address;
	u16 devstatus;

	unsigned pullup:1;
	unsigned connected:1;
	unsigned desc_cached:1;
};

struct vudc_device {
	struct platform_device *pdev;

Annotation

Implementation Notes