drivers/usb/serial/io_usbvend.h

Source file repositories/reference/linux-study-clean/drivers/usb/serial/io_usbvend.h

File Facts

System
Linux kernel
Corpus path
drivers/usb/serial/io_usbvend.h
Extension
.h
Size
28758 bytes
Lines
683
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 edge_compatibility_bits {
	// This __u32 defines which Vendor-specific commands/functionality
	// the device supports on the default EP0 pipe.

	__u32	VendEnableSuspend	:  1;	// 0001 Set if device supports ION_ENABLE_SUSPEND
	__u32	VendUnused		: 31;	// Available for future expansion, must be 0

	// This __u32 defines which IOSP commands are supported over the
	// bulk pipe EP1.

											// xxxx Set if device supports:
	__u32	IOSPOpen		:  1;	// 0001	OPEN / OPEN_RSP (Currently must be 1)
	__u32	IOSPClose		:  1;	// 0002	CLOSE
	__u32	IOSPChase		:  1;	// 0004	CHASE / CHASE_RSP
	__u32	IOSPSetRxFlow		:  1;	// 0008	SET_RX_FLOW
	__u32	IOSPSetTxFlow		:  1;	// 0010	SET_TX_FLOW
	__u32	IOSPSetXChar		:  1;	// 0020	SET_XON_CHAR/SET_XOFF_CHAR
	__u32	IOSPRxCheck		:  1;	// 0040	RX_CHECK_REQ/RX_CHECK_RSP
	__u32	IOSPSetClrBreak		:  1;	// 0080	SET_BREAK/CLEAR_BREAK
	__u32	IOSPWriteMCR		:  1;	// 0100	MCR register writes (set/clr DTR/RTS)
	__u32	IOSPWriteLCR		:  1;	// 0200	LCR register writes (wordlen/stop/parity)
	__u32	IOSPSetBaudRate		:  1;	// 0400	setting Baud rate (writes to LCR.80h and DLL/DLM register)
	__u32	IOSPDisableIntPipe	:  1;	// 0800 Do not use the interrupt pipe for TxCredits or RxButesAvailable
	__u32	IOSPRxDataAvail		:  1;   // 1000 Return status of RX Fifo (Data available in Fifo)
	__u32	IOSPTxPurge		:  1;	// 2000 Purge TXBuffer and/or Fifo in Edgeport hardware
	__u32	IOSPUnused		: 18;	// Available for future expansion, must be 0

	// This __u32 defines which 'general' features are supported

	__u32	TrueEdgeport		:  1;	// 0001	Set if device is a 'real' Edgeport
											// (Used only by driver, NEVER set by an EPiC device)
	__u32	GenUnused		: 31;	// Available for future expansion, must be 0
};

#define EDGE_COMPATIBILITY_MASK0	0x0001
#define EDGE_COMPATIBILITY_MASK1	0x3FFF
#define EDGE_COMPATIBILITY_MASK2	0x0001

struct edge_compatibility_descriptor {
	__u8	Length;				// Descriptor Length (per USB spec)
	__u8	DescType;			// Descriptor Type (per USB spec, =DEVICE type)
	__u8	EpicVer;			// Version of EPiC spec supported
						// (Currently must be 1)
	__u8	NumPorts;			// Number of serial ports supported
	__u8	iDownloadFile;			// Index of string containing download code filename
						// 0=no download, FF=download compiled into driver.
	__u8	Unused[3];			// Available for future expansion, must be 0
						// (Currently must be 0).
	__u8	MajorVersion;			// Firmware version: xx.
	__u8	MinorVersion;			//  yy.
	__le16	BuildNumber;			//  zzzz (LE format)

	// The following structure contains __u32s, with each bit
	// specifying whether the EPiC device supports the given
	// command or functionality.
	struct edge_compatibility_bits	Supports;
};

// Values for iDownloadFile
#define	EDGE_DOWNLOAD_FILE_NONE		0	// No download requested
#define	EDGE_DOWNLOAD_FILE_INTERNAL	0xFF	// Download the file compiled into driver (930 version)
#define	EDGE_DOWNLOAD_FILE_I930		0xFF	// Download the file compiled into driver (930 version)
#define	EDGE_DOWNLOAD_FILE_80251	0xFE	// Download the file compiled into driver (80251 version)



/*
 *	Special addresses for READ/WRITE_RAM/ROM
 */

// Version 1 (original) format of DeviceParams
#define	EDGE_MANUF_DESC_ADDR_V1		0x00FF7F00
#define	EDGE_MANUF_DESC_LEN_V1		sizeof(EDGE_MANUF_DESCRIPTOR_V1)

// Version 2 format of DeviceParams. This format is longer (3C0h)
// and starts lower in memory, at the uppermost 1K in ROM.
#define	EDGE_MANUF_DESC_ADDR		0x00FF7C00
#define	EDGE_MANUF_DESC_LEN		sizeof(struct edge_manuf_descriptor)

// Boot params descriptor
#define	EDGE_BOOT_DESC_ADDR		0x00FF7FC0
#define	EDGE_BOOT_DESC_LEN		sizeof(struct edge_boot_descriptor)

// Define the max block size that may be read or written
// in a read/write RAM/ROM command.
#define	MAX_SIZE_REQ_ION_READ_MEM	((__u16)64)
#define	MAX_SIZE_REQ_ION_WRITE_MEM	((__u16)64)


//

Annotation

Implementation Notes