⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 io_usbvend.h

📁 usb driver for 2.6.17
💻 H
📖 第 1 页 / 共 2 页
字号:
											// 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 )//// Notes for the following two ION vendor-specific param descriptors:////	1.	These have a standard USB descriptor header so they look like a//		normal descriptor.//	2.	Any strings in the structures are in USB-defined string//		descriptor format, so that they may be separately retrieved,//		if necessary, with a minimum of work on the 930. This also//		requires them to be in UNICODE format, which, for English at//		least, simply means extending each __u8 into a __u16.//	3.	For all fields, 00 means 'uninitialized'.//	4.	All unused areas should be set to 00 for future expansion.//// This structure is ver 2 format. It contains ALL USB descriptors as// well as the configuration parameters that were in the original V1// structure. It is NOT modified when new boot code is downloaded; rather,// these values are set or modified by manufacturing. It is located at// xC00-xFBF (length 3C0h) in the ROM.// This structure is a superset of the v1 structure and is arranged so// that all of the v1 fields remain at the same address. We are just// adding more room to the front of the structure to hold the descriptors.//// The actual contents of this structure are defined in a 930 assembly// file, converted to a binary image, and then written by the serialization// program. The C definition of this structure just defines a dummy// area for general USB descriptors and the descriptor tables (the root// descriptor starts at xC00). At the bottom of the structure are the// fields inherited from the v1 structure.#define MAX_SERIALNUMBER_LEN	12#define MAX_ASSEMBLYNUMBER_LEN	14struct edge_manuf_descriptor {	__u16	RootDescTable[0x10];			// C00 Root of descriptor tables (just a placeholder)	__u8	DescriptorArea[0x2E0];			// C20 Descriptors go here, up to 2E0h (just a placeholder)							//     Start of v1-compatible section	__u8	Length;					// F00 Desc length for what follows, per USB (= C0h )	__u8	DescType;				// F01 Desc type, per USB (=DEVICE type)	__u8	DescVer;				// F02 Desc version/format (currently 2)	__u8	NumRootDescEntries;			// F03 # entries in RootDescTable	__u8	RomSize;				// F04 Size of ROM/E2PROM in K	__u8	RamSize;				// F05 Size of external RAM in K	__u8	CpuRev;					// F06 CPU revision level (chg only if s/w visible)	__u8	BoardRev;				// F07 PCB revision level (chg only if s/w visible)	__u8	NumPorts;				// F08 Number of ports	__u8	DescDate[3];				// F09 MM/DD/YY when descriptor template was compiler,							//     so host can track changes to USB-only descriptors.	__u8	SerNumLength;				// F0C USB string descriptor len	__u8	SerNumDescType;				// F0D USB descriptor type (=STRING type)	__le16	SerialNumber[MAX_SERIALNUMBER_LEN];	// F0E "01-01-000100" Unicode Serial Number	__u8	AssemblyNumLength;			// F26 USB string descriptor len	__u8	AssemblyNumDescType;			// F27 USB descriptor type (=STRING type)	__le16	AssemblyNumber[MAX_ASSEMBLYNUMBER_LEN];	// F28 "350-1000-01-A " assembly number	__u8	OemAssyNumLength;			// F44 USB string descriptor len	__u8	OemAssyNumDescType;			// F45 USB descriptor type (=STRING type)	__le16	OemAssyNumber[MAX_ASSEMBLYNUMBER_LEN];	// F46 "xxxxxxxxxxxxxx" OEM assembly number	__u8	ManufDateLength;			// F62 USB string descriptor len	__u8	ManufDateDescType;			// F63 USB descriptor type (=STRING type)	__le16	ManufDate[6];				// F64 "MMDDYY" manufacturing date	__u8	Reserved3[0x4D];			// F70 -- unused, set to 0 --	__u8	UartType;				// FBD Uart Type	__u8	IonPid;					// FBE Product ID, == LSB of USB DevDesc.PID							//      (Note: Edgeport/4s before 11/98 will have							//       00 here instead of 01)	__u8	IonConfig;				// FBF Config byte for ION manufacturing use							// FBF end of structure, total len = 3C0h};#define MANUF_DESC_VER_1	1	// Original definition of MANUF_DESC#define MANUF_DESC_VER_2	2	// Ver 2, starts at xC00h len 3C0h// Uart Types// Note: Since this field was added only recently, all Edgeport/4 units// shipped before 11/98 will have 00 in this field. Therefore,// both 00 and 01 values mean '654.#define MANUF_UART_EXAR_654_EARLY	0	// Exar 16C654 in Edgeport/4s before 11/98#define MANUF_UART_EXAR_654		1	// Exar 16C654#define MANUF_UART_EXAR_2852		2	// Exar 16C2852//// Note: The CpuRev and BoardRev values do not conform to manufacturing// revisions; they are to be incremented only when the CPU or hardware// changes in a software-visible way, such that the 930 software or// the host driver needs to handle the hardware differently.//// Values of bottom 5 bits of CpuRev & BoardRev for// Implementation 0 (ie, 930-based)#define	MANUF_CPU_REV_AD4		1	// 930 AD4, with EP1 Rx bug (needs RXSPM)#define	MANUF_CPU_REV_AD5		2	// 930 AD5, with above bug (supposedly) fixed#define	MANUF_CPU_80251			0x20	// Intel 80251#define MANUF_BOARD_REV_A		1	// Original version, == Manuf Rev A#define MANUF_BOARD_REV_B		2	// Manuf Rev B, wakeup interrupt works#define MANUF_BOARD_REV_C		3	// Manuf Rev C, 2/4 ports, rs232/rs422#define MANUF_BOARD_REV_GENERATION_2	0x20	// Second generaiton edgeport// Values of bottom 5 bits of CpuRev & BoardRev for// Implementation 1 (ie, 251+Netchip-based)#define	MANUF_CPU_REV_1			1	// C251TB Rev 1 (Need actual Intel rev here)#define MANUF_BOARD_REV_A		1	// First rev of 251+Netchip design#define	MANUF_SERNUM_LENGTH		sizeof(((struct edge_manuf_descriptor *)0)->SerialNumber)#define	MANUF_ASSYNUM_LENGTH		sizeof(((struct edge_manuf_descriptor *)0)->AssemblyNumber)#define	MANUF_OEMASSYNUM_LENGTH		sizeof(((struct edge_manuf_descriptor *)0)->OemAssyNumber)#define	MANUF_MANUFDATE_LENGTH		sizeof(((struct edge_manuf_descriptor *)0)->ManufDate)#define	MANUF_ION_CONFIG_DIAG_NO_LOOP	0x20	// As below but no ext loopback test#define	MANUF_ION_CONFIG_DIAG		0x40	// 930 based device: 1=Run h/w diags, 0=norm						// TIUMP Device    : 1=IONSERIAL needs to run Final Test#define	MANUF_ION_CONFIG_MASTER		0x80	// 930 based device:  1=Master mode, 0=Normal						// TIUMP Device    :  1=First device on a multi TIUMP Device//// This structure describes parameters for the boot code, and// is programmed along with new boot code. These are values// which are specific to a given build of the boot code. It// is exactly 64 bytes long and is fixed at address FF:xFC0// - FF:xFFF. Note that the 930-mandated UCONFIG bytes are// included in this structure.//struct edge_boot_descriptor {	__u8		Length;			// C0 Desc length, per USB (= 40h)	__u8		DescType;		// C1 Desc type, per USB (= DEVICE type)	__u8		DescVer;		// C2 Desc version/format	__u8		Reserved1;		// C3 -- unused, set to 0 --	__le16		BootCodeLength;		// C4 Boot code goes from FF:0000 to FF:(len-1)						//	  (LE format)	__u8		MajorVersion;		// C6 Firmware version: xx.	__u8		MinorVersion;		// C7			yy.	__le16		BuildNumber;		// C8			zzzz (LE format)		__u16		EnumRootDescTable;	// CA Root of ROM-based descriptor table	__u8		NumDescTypes;		// CC Number of supported descriptor types	__u8		Reserved4;		// CD Fix Compiler Packing	__le16		Capabilities;		// CE-CF Capabilities flags (LE format)	__u8		Reserved2[0x28];	// D0 -- unused, set to 0 --	__u8		UConfig0;		// F8 930-defined CPU configuration byte 0	__u8		UConfig1;		// F9 930-defined CPU configuration byte 1	__u8		Reserved3[6];		// FA -- unused, set to 0 --						// FF end of structure, total len = 80};#define BOOT_DESC_VER_1		1	// Original definition of BOOT_PARAMS#define BOOT_DESC_VER_2		2	// 2nd definition, descriptors not included in boot	// Capabilities flags#define	BOOT_CAP_RESET_CMD	0x0001	// If set, boot correctly supports ION_RESET_DEVICE/************************************************************************                 T I   U M P   D E F I N I T I O N S ***********************************************************************/// Chip definitions in I2C#define UMP5152			0x52#define UMP3410			0x10//************************************************************************//	TI I2C Format Definitions//************************************************************************#define I2C_DESC_TYPE_INFO_BASIC	0x01#define I2C_DESC_TYPE_FIRMWARE_BASIC	0x02#define I2C_DESC_TYPE_DEVICE		0x03#define I2C_DESC_TYPE_CONFIG		0x04#define I2C_DESC_TYPE_STRING		0x05#define I2C_DESC_TYPE_FIRMWARE_AUTO	0x07	// for 3410 download#define I2C_DESC_TYPE_CONFIG_KLUDGE	0x14	// for 3410#define I2C_DESC_TYPE_WATCHPORT_VERSION	0x15	// firmware version number for watchport#define I2C_DESC_TYPE_WATCHPORT_CALIBRATION_DATA 0x16	// Watchport Calibration Data#define I2C_DESC_TYPE_FIRMWARE_BLANK	0xf2// Special section defined by ION#define I2C_DESC_TYPE_ION		0	// Not defined by TIstruct ti_i2c_desc{	__u8	Type;			// Type of descriptor	__u16	Size;			// Size of data only not including header	__u8	CheckSum;		// Checksum (8 bit sum of data only)	__u8	Data[0];		// Data starts here}__attribute__((packed));// for 5152 devices only (type 2 record)// for 3410 the version is stored in the WATCHPORT_FIRMWARE_VERSION descriptorstruct ti_i2c_firmware_rec{	__u8	Ver_Major;		// Firmware Major version number	__u8	Ver_Minor;		// Firmware Minor version number	__u8	Data[0];		// Download starts here}__attribute__((packed));struct watchport_firmware_version{// Added 2 bytes for version number	__u8	Version_Major;		//  Download Version (for Watchport)	__u8	Version_Minor;}__attribute__((packed));// Structure of header of download image in fw_down.hstruct ti_i2c_image_header{	__le16	Length;	__u8	CheckSum;}__attribute__((packed));struct ti_basic_descriptor{	__u8	Power;		// Self powered				// bit 7: 1 - power switching supported				//        0 - power switching not supported				//				// bit 0: 1 - self powered				//        0 - bus powered				//				//	__u16	HubVid;		// VID HUB	__u16	HubPid;		// PID HUB	__u16	DevPid;		// PID Edgeport	__u8	HubTime;	// Time for power on to power good	__u8	HubCurrent;	// HUB Current = 100ma} __attribute__((packed));// CPU / Board Rev Definitions#define TI_CPU_REV_5052			2	// 5052 based edgeports#define TI_CPU_REV_3410			3	// 3410 based edgeports#define TI_BOARD_REV_TI_EP		0	// Basic ti based edgeport#define TI_BOARD_REV_COMPACT		1	// Compact board#define TI_BOARD_REV_WATCHPORT		2	// Watchport#define TI_GET_CPU_REVISION(x)		(__u8)((((x)>>4)&0x0f))#define TI_GET_BOARD_REVISION(x)	(__u8)(((x)&0x0f))#define TI_I2C_SIZE_MASK		0x1f  // 5 bits#define TI_GET_I2C_SIZE(x)		((((x) & TI_I2C_SIZE_MASK)+1)*256)#define TI_MAX_I2C_SIZE			( 16 * 1024 )#define TI_MANUF_VERSION_0		0	// IonConig2 flags#define TI_CONFIG2_RS232		0x01#define TI_CONFIG2_RS422		0x02#define TI_CONFIG2_RS485		0x04#define TI_CONFIG2_SWITCHABLE		0x08#define TI_CONFIG2_WATCHPORT		0x10struct edge_ti_manuf_descriptor{	__u8 IonConfig;		//  Config byte for ION manufacturing use	__u8 IonConfig2;	//  Expansion	__u8 Version;		//  Version	__u8 CpuRev_BoardRev;	//  CPU revision level (0xF0) and Board Rev Level (0x0F)	__u8 NumPorts;		//  Number of ports	for this UMP	__u8 NumVirtualPorts;	//  Number of Virtual ports	__u8 HubConfig1;	//  Used to configure the Hub	__u8 HubConfig2;	//  Used to configure the Hub	__u8 TotalPorts;	//  Total Number of Com Ports for the entire device (All UMPs)	__u8 Reserved;		//  Reserved}__attribute__((packed));#endif		// if !defined(_USBVEND_H)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -