aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/io_usbvend.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/io_usbvend.h')
-rw-r--r--drivers/usb/serial/io_usbvend.h87
1 files changed, 38 insertions, 49 deletions
diff --git a/drivers/usb/serial/io_usbvend.h b/drivers/usb/serial/io_usbvend.h
index 8e1a491e52a9..51f83fbb73bb 100644
--- a/drivers/usb/serial/io_usbvend.h
+++ b/drivers/usb/serial/io_usbvend.h
@@ -26,7 +26,7 @@
26 26
27// 27//
28// Definitions of USB product IDs 28// Definitions of USB product IDs
29// 29//
30 30
31#define USB_VENDOR_ID_ION 0x1608 // Our VID 31#define USB_VENDOR_ID_ION 0x1608 // Our VID
32#define USB_VENDOR_ID_TI 0x0451 // TI VID 32#define USB_VENDOR_ID_TI 0x0451 // TI VID
@@ -54,7 +54,7 @@
54// Product IDs - assigned to match middle digit of serial number (No longer true) 54// Product IDs - assigned to match middle digit of serial number (No longer true)
55 55
56#define ION_DEVICE_ID_80251_NETCHIP 0x020 // This bit is set in the PID if this edgeport hardware$ 56#define ION_DEVICE_ID_80251_NETCHIP 0x020 // This bit is set in the PID if this edgeport hardware$
57 // is based on the 80251+Netchip. 57 // is based on the 80251+Netchip.
58 58
59#define ION_DEVICE_ID_GENERATION_1 0x00 // Value for 930 based edgeports 59#define ION_DEVICE_ID_GENERATION_1 0x00 // Value for 930 based edgeports
60#define ION_DEVICE_ID_GENERATION_2 0x01 // Value for 80251+Netchip. 60#define ION_DEVICE_ID_GENERATION_2 0x01 // Value for 80251+Netchip.
@@ -134,7 +134,7 @@
134#define ION_DEVICE_ID_TI_EDGEPORT_416 0x0212 // Edgeport/416 134#define ION_DEVICE_ID_TI_EDGEPORT_416 0x0212 // Edgeport/416
135#define ION_DEVICE_ID_TI_EDGEPORT_1 0x0215 // Edgeport/1 RS232 135#define ION_DEVICE_ID_TI_EDGEPORT_1 0x0215 // Edgeport/1 RS232
136#define ION_DEVICE_ID_TI_EDGEPORT_42 0x0217 // Edgeport/42 4 hub 2 RS232 136#define ION_DEVICE_ID_TI_EDGEPORT_42 0x0217 // Edgeport/42 4 hub 2 RS232
137#define ION_DEVICE_ID_TI_EDGEPORT_22I 0x021A // Edgeport/22I is an Edgeport/4 with ports 1&2 RS422 and ports 3&4 RS232 137#define ION_DEVICE_ID_TI_EDGEPORT_22I 0x021A // Edgeport/22I is an Edgeport/4 with ports 1&2 RS422 and ports 3&4 RS232
138#define ION_DEVICE_ID_TI_EDGEPORT_2C 0x021B // Edgeport/2c RS232 138#define ION_DEVICE_ID_TI_EDGEPORT_2C 0x021B // Edgeport/2c RS232
139#define ION_DEVICE_ID_TI_EDGEPORT_221C 0x021C // Edgeport/221c is a TI based Edgeport/2 with lucent chip and 139#define ION_DEVICE_ID_TI_EDGEPORT_221C 0x021C // Edgeport/221c is a TI based Edgeport/2 with lucent chip and
140 // 2 external hub ports - Large I2C 140 // 2 external hub ports - Large I2C
@@ -142,7 +142,7 @@
142 // 2 external hub ports - Large I2C 142 // 2 external hub ports - Large I2C
143#define ION_DEVICE_ID_TI_EDGEPORT_21C 0x021E // Edgeport/21c is a TI based Edgeport/2 with lucent chip 143#define ION_DEVICE_ID_TI_EDGEPORT_21C 0x021E // Edgeport/21c is a TI based Edgeport/2 with lucent chip
144 144
145// Generation 3 devices -- 3410 based edgport/1 (256 byte I2C) 145// Generation 3 devices -- 3410 based edgport/1 (256 byte I2C)
146#define ION_DEVICE_ID_TI_TI3410_EDGEPORT_1 0x0240 // Edgeport/1 RS232 146#define ION_DEVICE_ID_TI_TI3410_EDGEPORT_1 0x0240 // Edgeport/1 RS232
147#define ION_DEVICE_ID_TI_TI3410_EDGEPORT_1I 0x0241 // Edgeport/1i- RS422 model 147#define ION_DEVICE_ID_TI_TI3410_EDGEPORT_1I 0x0241 // Edgeport/1i- RS422 model
148 148
@@ -176,7 +176,7 @@
176 // Default to /P function 176 // Default to /P function
177 177
178#define ION_DEVICE_ID_PLUS_PWR_HP4CD 0x30C // 5052 Plus Power HubPort/4CD+ (for Dell) 178#define ION_DEVICE_ID_PLUS_PWR_HP4CD 0x30C // 5052 Plus Power HubPort/4CD+ (for Dell)
179#define ION_DEVICE_ID_PLUS_PWR_HP4C 0x30D // 5052 Plus Power HubPort/4C+ 179#define ION_DEVICE_ID_PLUS_PWR_HP4C 0x30D // 5052 Plus Power HubPort/4C+
180#define ION_DEVICE_ID_PLUS_PWR_PCI 0x30E // 3410 Plus Power PCI Host Controller 4 port 180#define ION_DEVICE_ID_PLUS_PWR_PCI 0x30E // 3410 Plus Power PCI Host Controller 4 port
181 181
182 182
@@ -217,17 +217,17 @@
217#define ION_DEVICE_ID_MT4X56USB 0x1403 // OEM device 217#define ION_DEVICE_ID_MT4X56USB 0x1403 // OEM device
218 218
219 219
220#define GENERATION_ID_FROM_USB_PRODUCT_ID( ProductId ) \ 220#define GENERATION_ID_FROM_USB_PRODUCT_ID(ProductId) \
221 ( (__u16) ((ProductId >> 8) & (ION_GENERATION_MASK)) ) 221 ((__u16) ((ProductId >> 8) & (ION_GENERATION_MASK)))
222 222
223#define MAKE_USB_PRODUCT_ID( OemId, DeviceId ) \ 223#define MAKE_USB_PRODUCT_ID(OemId, DeviceId) \
224 ( (__u16) (((OemId) << 10) || (DeviceId)) ) 224 ((__u16) (((OemId) << 10) || (DeviceId)))
225 225
226#define DEVICE_ID_FROM_USB_PRODUCT_ID( ProductId ) \ 226#define DEVICE_ID_FROM_USB_PRODUCT_ID(ProductId) \
227 ( (__u16) ((ProductId) & (EDGEPORT_DEVICE_ID_MASK)) ) 227 ((__u16) ((ProductId) & (EDGEPORT_DEVICE_ID_MASK)))
228 228
229#define OEM_ID_FROM_USB_PRODUCT_ID( ProductId ) \ 229#define OEM_ID_FROM_USB_PRODUCT_ID(ProductId) \
230 ( (__u16) (((ProductId) >> 10) & 0x3F) ) 230 ((__u16) (((ProductId) >> 10) & 0x3F))
231 231
232// 232//
233// Definitions of parameters for download code. Note that these are 233// Definitions of parameters for download code. Note that these are
@@ -237,7 +237,7 @@
237 237
238// TxCredits value below which driver won't bother sending (to prevent too many small writes). 238// TxCredits value below which driver won't bother sending (to prevent too many small writes).
239// Send only if above 25% 239// Send only if above 25%
240#define EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(InitialCredit, MaxPacketSize) (max( ((InitialCredit) / 4), (MaxPacketSize) )) 240#define EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(InitialCredit, MaxPacketSize) (max(((InitialCredit) / 4), (MaxPacketSize)))
241 241
242#define EDGE_FW_BULK_MAX_PACKET_SIZE 64 // Max Packet Size for Bulk In Endpoint (EP1) 242#define EDGE_FW_BULK_MAX_PACKET_SIZE 64 // Max Packet Size for Bulk In Endpoint (EP1)
243#define EDGE_FW_BULK_READ_BUFFER_SIZE 1024 // Size to use for Bulk reads 243#define EDGE_FW_BULK_READ_BUFFER_SIZE 1024 // Size to use for Bulk reads
@@ -263,7 +263,7 @@
263// wValue = 16-bit address 263// wValue = 16-bit address
264// wIndex = unused (though we could put segment 00: or FF: here) 264// wIndex = unused (though we could put segment 00: or FF: here)
265// wLength = # bytes to read/write (max 64) 265// wLength = # bytes to read/write (max 64)
266// 266//
267 267
268#define USB_REQUEST_ION_RESET_DEVICE 0 // Warm reboot Edgeport, retaining USB address 268#define USB_REQUEST_ION_RESET_DEVICE 0 // Warm reboot Edgeport, retaining USB address
269#define USB_REQUEST_ION_GET_EPIC_DESC 1 // Get Edgeport Compatibility Descriptor 269#define USB_REQUEST_ION_GET_EPIC_DESC 1 // Get Edgeport Compatibility Descriptor
@@ -278,7 +278,7 @@
278#define USB_REQUEST_ION_ENABLE_SUSPEND 9 // Enable/Disable suspend feature 278#define USB_REQUEST_ION_ENABLE_SUSPEND 9 // Enable/Disable suspend feature
279 // (wValue != 0: Enable; wValue = 0: Disable) 279 // (wValue != 0: Enable; wValue = 0: Disable)
280 280
281#define USB_REQUEST_ION_SEND_IOSP 10 // Send an IOSP command to the edgeport over the control pipe 281#define USB_REQUEST_ION_SEND_IOSP 10 // Send an IOSP command to the edgeport over the control pipe
282#define USB_REQUEST_ION_RECV_IOSP 11 // Receive an IOSP command from the edgeport over the control pipe 282#define USB_REQUEST_ION_RECV_IOSP 11 // Receive an IOSP command from the edgeport over the control pipe
283 283
284 284
@@ -301,8 +301,7 @@
301// this is a "real" Edgeport. 301// this is a "real" Edgeport.
302// 302//
303 303
304struct edge_compatibility_bits 304struct edge_compatibility_bits {
305{
306 // This __u32 defines which Vendor-specific commands/functionality 305 // This __u32 defines which Vendor-specific commands/functionality
307 // the device supports on the default EP0 pipe. 306 // the device supports on the default EP0 pipe.
308 307
@@ -334,24 +333,22 @@ struct edge_compatibility_bits
334 __u32 TrueEdgeport : 1; // 0001 Set if device is a 'real' Edgeport 333 __u32 TrueEdgeport : 1; // 0001 Set if device is a 'real' Edgeport
335 // (Used only by driver, NEVER set by an EPiC device) 334 // (Used only by driver, NEVER set by an EPiC device)
336 __u32 GenUnused : 31; // Available for future expansion, must be 0 335 __u32 GenUnused : 31; // Available for future expansion, must be 0
337
338}; 336};
339 337
340#define EDGE_COMPATIBILITY_MASK0 0x0001 338#define EDGE_COMPATIBILITY_MASK0 0x0001
341#define EDGE_COMPATIBILITY_MASK1 0x3FFF 339#define EDGE_COMPATIBILITY_MASK1 0x3FFF
342#define EDGE_COMPATIBILITY_MASK2 0x0001 340#define EDGE_COMPATIBILITY_MASK2 0x0001
343 341
344struct edge_compatibility_descriptor 342struct edge_compatibility_descriptor {
345{
346 __u8 Length; // Descriptor Length (per USB spec) 343 __u8 Length; // Descriptor Length (per USB spec)
347 __u8 DescType; // Descriptor Type (per USB spec, =DEVICE type) 344 __u8 DescType; // Descriptor Type (per USB spec, =DEVICE type)
348 __u8 EpicVer; // Version of EPiC spec supported 345 __u8 EpicVer; // Version of EPiC spec supported
349 // (Currently must be 1) 346 // (Currently must be 1)
350 __u8 NumPorts; // Number of serial ports supported 347 __u8 NumPorts; // Number of serial ports supported
351 __u8 iDownloadFile; // Index of string containing download code filename 348 __u8 iDownloadFile; // Index of string containing download code filename
352 // 0=no download, FF=download compiled into driver. 349 // 0=no download, FF=download compiled into driver.
353 __u8 Unused[ 3 ]; // Available for future expansion, must be 0 350 __u8 Unused[3]; // Available for future expansion, must be 0
354 // (Currently must be 0). 351 // (Currently must be 0).
355 __u8 MajorVersion; // Firmware version: xx. 352 __u8 MajorVersion; // Firmware version: xx.
356 __u8 MinorVersion; // yy. 353 __u8 MinorVersion; // yy.
357 __le16 BuildNumber; // zzzz (LE format) 354 __le16 BuildNumber; // zzzz (LE format)
@@ -359,9 +356,7 @@ struct edge_compatibility_descriptor
359 // The following structure contains __u32s, with each bit 356 // The following structure contains __u32s, with each bit
360 // specifying whether the EPiC device supports the given 357 // specifying whether the EPiC device supports the given
361 // command or functionality. 358 // command or functionality.
362
363 struct edge_compatibility_bits Supports; 359 struct edge_compatibility_bits Supports;
364
365}; 360};
366 361
367// Values for iDownloadFile 362// Values for iDownloadFile
@@ -391,8 +386,8 @@ struct edge_compatibility_descriptor
391 386
392// Define the max block size that may be read or written 387// Define the max block size that may be read or written
393// in a read/write RAM/ROM command. 388// in a read/write RAM/ROM command.
394#define MAX_SIZE_REQ_ION_READ_MEM ( (__u16) 64 ) 389#define MAX_SIZE_REQ_ION_READ_MEM ((__u16)64)
395#define MAX_SIZE_REQ_ION_WRITE_MEM ( (__u16) 64 ) 390#define MAX_SIZE_REQ_ION_WRITE_MEM ((__u16)64)
396 391
397 392
398// 393//
@@ -545,7 +540,7 @@ struct edge_boot_descriptor {
545 __u8 MajorVersion; // C6 Firmware version: xx. 540 __u8 MajorVersion; // C6 Firmware version: xx.
546 __u8 MinorVersion; // C7 yy. 541 __u8 MinorVersion; // C7 yy.
547 __le16 BuildNumber; // C8 zzzz (LE format) 542 __le16 BuildNumber; // C8 zzzz (LE format)
548 543
549 __u16 EnumRootDescTable; // CA Root of ROM-based descriptor table 544 __u16 EnumRootDescTable; // CA Root of ROM-based descriptor table
550 __u8 NumDescTypes; // CC Number of supported descriptor types 545 __u8 NumDescTypes; // CC Number of supported descriptor types
551 546
@@ -597,41 +592,36 @@ struct edge_boot_descriptor {
597#define I2C_DESC_TYPE_ION 0 // Not defined by TI 592#define I2C_DESC_TYPE_ION 0 // Not defined by TI
598 593
599 594
600struct ti_i2c_desc 595struct ti_i2c_desc {
601{
602 __u8 Type; // Type of descriptor 596 __u8 Type; // Type of descriptor
603 __u16 Size; // Size of data only not including header 597 __u16 Size; // Size of data only not including header
604 __u8 CheckSum; // Checksum (8 bit sum of data only) 598 __u8 CheckSum; // Checksum (8 bit sum of data only)
605 __u8 Data[0]; // Data starts here 599 __u8 Data[0]; // Data starts here
606}__attribute__((packed)); 600} __attribute__((packed));
607 601
608// for 5152 devices only (type 2 record) 602// for 5152 devices only (type 2 record)
609// for 3410 the version is stored in the WATCHPORT_FIRMWARE_VERSION descriptor 603// for 3410 the version is stored in the WATCHPORT_FIRMWARE_VERSION descriptor
610struct ti_i2c_firmware_rec 604struct ti_i2c_firmware_rec {
611{
612 __u8 Ver_Major; // Firmware Major version number 605 __u8 Ver_Major; // Firmware Major version number
613 __u8 Ver_Minor; // Firmware Minor version number 606 __u8 Ver_Minor; // Firmware Minor version number
614 __u8 Data[0]; // Download starts here 607 __u8 Data[0]; // Download starts here
615}__attribute__((packed)); 608} __attribute__((packed));
616 609
617 610
618struct watchport_firmware_version 611struct watchport_firmware_version {
619{
620// Added 2 bytes for version number 612// Added 2 bytes for version number
621 __u8 Version_Major; // Download Version (for Watchport) 613 __u8 Version_Major; // Download Version (for Watchport)
622 __u8 Version_Minor; 614 __u8 Version_Minor;
623}__attribute__((packed)); 615} __attribute__((packed));
624 616
625 617
626// Structure of header of download image in fw_down.h 618// Structure of header of download image in fw_down.h
627struct ti_i2c_image_header 619struct ti_i2c_image_header {
628{
629 __le16 Length; 620 __le16 Length;
630 __u8 CheckSum; 621 __u8 CheckSum;
631}__attribute__((packed)); 622} __attribute__((packed));
632 623
633struct ti_basic_descriptor 624struct ti_basic_descriptor {
634{
635 __u8 Power; // Self powered 625 __u8 Power; // Self powered
636 // bit 7: 1 - power switching supported 626 // bit 7: 1 - power switching supported
637 // 0 - power switching not supported 627 // 0 - power switching not supported
@@ -663,9 +653,9 @@ struct ti_basic_descriptor
663#define TI_I2C_SIZE_MASK 0x1f // 5 bits 653#define TI_I2C_SIZE_MASK 0x1f // 5 bits
664#define TI_GET_I2C_SIZE(x) ((((x) & TI_I2C_SIZE_MASK)+1)*256) 654#define TI_GET_I2C_SIZE(x) ((((x) & TI_I2C_SIZE_MASK)+1)*256)
665 655
666#define TI_MAX_I2C_SIZE ( 16 * 1024 ) 656#define TI_MAX_I2C_SIZE (16 * 1024)
667 657
668#define TI_MANUF_VERSION_0 0 658#define TI_MANUF_VERSION_0 0
669 659
670// IonConig2 flags 660// IonConig2 flags
671#define TI_CONFIG2_RS232 0x01 661#define TI_CONFIG2_RS232 0x01
@@ -676,8 +666,7 @@ struct ti_basic_descriptor
676#define TI_CONFIG2_WATCHPORT 0x10 666#define TI_CONFIG2_WATCHPORT 0x10
677 667
678 668
679struct edge_ti_manuf_descriptor 669struct edge_ti_manuf_descriptor {
680{
681 __u8 IonConfig; // Config byte for ION manufacturing use 670 __u8 IonConfig; // Config byte for ION manufacturing use
682 __u8 IonConfig2; // Expansion 671 __u8 IonConfig2; // Expansion
683 __u8 Version; // Version 672 __u8 Version; // Version
@@ -688,7 +677,7 @@ struct edge_ti_manuf_descriptor
688 __u8 HubConfig2; // Used to configure the Hub 677 __u8 HubConfig2; // Used to configure the Hub
689 __u8 TotalPorts; // Total Number of Com Ports for the entire device (All UMPs) 678 __u8 TotalPorts; // Total Number of Com Ports for the entire device (All UMPs)
690 __u8 Reserved; // Reserved 679 __u8 Reserved; // Reserved
691}__attribute__((packed)); 680} __attribute__((packed));
692 681
693 682
694#endif // if !defined(_USBVEND_H) 683#endif // if !defined(_USBVEND_H)