1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
|
/************************************************************************
*
* USBVEND.H Vendor-specific USB definitions
*
* NOTE: This must be kept in sync with the Edgeport firmware and
* must be kept backward-compatible with older firmware.
*
************************************************************************
*
* Copyright (C) 1998 Inside Out Networks, Inc.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
************************************************************************/
#if !defined(_USBVEND_H)
#define _USBVEND_H
/************************************************************************
*
* D e f i n e s / T y p e d e f s
*
************************************************************************/
//
// Definitions of USB product IDs
//
#define USB_VENDOR_ID_ION 0x1608 // Our VID
#define USB_VENDOR_ID_TI 0x0451 // TI VID
#define USB_VENDOR_ID_AXIOHM 0x05D9 /* Axiohm VID */
//
// Definitions of USB product IDs (PID)
// We break the USB-defined PID into an OEM Id field (upper 6 bits)
// and a Device Id (bottom 10 bits). The Device Id defines what
// device this actually is regardless of what the OEM wants to
// call it.
//
// ION-device OEM IDs
#define ION_OEM_ID_ION 0 // 00h Inside Out Networks
#define ION_OEM_ID_NLYNX 1 // 01h NLynx Systems
#define ION_OEM_ID_GENERIC 2 // 02h Generic OEM
#define ION_OEM_ID_MAC 3 // 03h Mac Version
#define ION_OEM_ID_MEGAWOLF 4 // 04h Lupusb OEM Mac version (MegaWolf)
#define ION_OEM_ID_MULTITECH 5 // 05h Multitech Rapidports
#define ION_OEM_ID_AGILENT 6 // 06h AGILENT board
// ION-device Device IDs
// Product IDs - assigned to match middle digit of serial number (No longer true)
#define ION_DEVICE_ID_80251_NETCHIP 0x020 // This bit is set in the PID if this edgeport hardware$
// is based on the 80251+Netchip.
#define ION_DEVICE_ID_GENERATION_1 0x00 // Value for 930 based edgeports
#define ION_DEVICE_ID_GENERATION_2 0x01 // Value for 80251+Netchip.
#define ION_DEVICE_ID_GENERATION_3 0x02 // Value for Texas Instruments TUSB5052 chip
#define ION_DEVICE_ID_GENERATION_4 0x03 // Watchport Family of products
#define ION_GENERATION_MASK 0x03
#define ION_DEVICE_ID_HUB_MASK 0x0080 // This bit in the PID designates a HUB device
// for example 8C would be a 421 4 port hub
// and 8D would be a 2 port embedded hub
#define EDGEPORT_DEVICE_ID_MASK 0x0ff // Not including OEM or GENERATION fields
#define ION_DEVICE_ID_UNCONFIGURED_EDGE_DEVICE 0x000 // In manufacturing only
#define ION_DEVICE_ID_EDGEPORT_4 0x001 // Edgeport/4 RS232
#define ION_DEVICE_ID_EDGEPORT_8R 0x002 // Edgeport with RJ45 no Ring
#define ION_DEVICE_ID_RAPIDPORT_4 0x003 // Rapidport/4
#define ION_DEVICE_ID_EDGEPORT_4T 0x004 // Edgeport/4 RS232 for Telxon (aka "Fleetport")
#define ION_DEVICE_ID_EDGEPORT_2 0x005 // Edgeport/2 RS232
#define ION_DEVICE_ID_EDGEPORT_4I 0x006 // Edgeport/4 RS422
#define ION_DEVICE_ID_EDGEPORT_2I 0x007 // Edgeport/2 RS422/RS485
#define ION_DEVICE_ID_EDGEPORT_8RR 0x008 // Edgeport with RJ45 with Data and RTS/CTS only
// ION_DEVICE_ID_EDGEPORT_8_HANDBUILT 0x009 // Hand-built Edgeport/8 (Placeholder, used in middle digit of serial number only!)
// ION_DEVICE_ID_MULTIMODEM_4X56 0x00A // MultiTech version of RP/4 (Placeholder, used in middle digit of serial number only!)
#define ION_DEVICE_ID_EDGEPORT_PARALLEL_PORT 0x00B // Edgeport/(4)21 Parallel port (USS720)
#define ION_DEVICE_ID_EDGEPORT_421 0x00C // Edgeport/421 Hub+RS232+Parallel
#define ION_DEVICE_ID_EDGEPORT_21 0x00D // Edgeport/21 RS232+Parallel
#define ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU 0x00E // Half of an Edgeport/8 (the kind with 2 EP/4s on 1 PCB)
#define ION_DEVICE_ID_EDGEPORT_8 0x00F // Edgeport/8 (single-CPU)
#define ION_DEVICE_ID_EDGEPORT_2_DIN 0x010 // Edgeport/2 RS232 with Apple DIN connector
#define ION_DEVICE_ID_EDGEPORT_4_DIN 0x011 // Edgeport/4 RS232 with Apple DIN connector
#define ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU 0x012 // Half of an Edgeport/16 (the kind with 2 EP/8s)
#define ION_DEVICE_ID_EDGEPORT_COMPATIBLE 0x013 // Edgeport Compatible, for NCR, Axiohm etc. testing
#define ION_DEVICE_ID_EDGEPORT_8I 0x014 // Edgeport/8 RS422 (single-CPU)
#define ION_DEVICE_ID_EDGEPORT_1 0x015 // Edgeport/1 RS232
#define ION_DEVICE_ID_EPOS44 0x016 // Half of an EPOS/44 (TIUMP BASED)
#define ION_DEVICE_ID_EDGEPORT_42 0x017 // Edgeport/42
#define ION_DEVICE_ID_EDGEPORT_412_8 0x018 // Edgeport/412 8 port part
#define ION_DEVICE_ID_EDGEPORT_412_4 0x019 // Edgeport/412 4 port part
#define ION_DEVICE_ID_EDGEPORT_22I 0x01A // Edgeport/22I is an Edgeport/4 with ports 1&2 RS422 and ports 3&4 RS232
// Compact Form factor TI based devices 2c, 21c, 22c, 221c
#define ION_DEVICE_ID_EDGEPORT_2C 0x01B // Edgeport/2c is a TI based Edgeport/2 - Small I2c
#define ION_DEVICE_ID_EDGEPORT_221C 0x01C // Edgeport/221c is a TI based Edgeport/2 with lucent chip and
// 2 external hub ports - Large I2C
#define ION_DEVICE_ID_EDGEPORT_22C 0x01D // Edgeport/22c is a TI based Edgeport/2 with
// 2 external hub ports - Large I2C
#define ION_DEVICE_ID_EDGEPORT_21C 0x01E // Edgeport/21c is a TI based Edgeport/2 with lucent chip
// Small I2C
/*
* DANGER DANGER The 0x20 bit was used to indicate a 8251/netchip GEN 2 device.
* Since the MAC, Linux, and Optimal drivers still used the old code
* I suggest that you skip the 0x20 bit when creating new PIDs
*/
// Generation 3 devices -- 3410 based edgport/1 (256 byte I2C)
#define ION_DEVICE_ID_TI3410_EDGEPORT_1 0x040 // Edgeport/1 RS232
#define ION_DEVICE_ID_TI3410_EDGEPORT_1I 0x041 // Edgeport/1i- RS422 model
// Ti based software switchable RS232/RS422/RS485 devices
#define ION_DEVICE_ID_EDGEPORT_4S 0x042 // Edgeport/4s - software switchable model
#define ION_DEVICE_ID_EDGEPORT_8S 0x043 // Edgeport/8s - software switchable model
// Usb to Ethernet dongle
#define ION_DEVICE_ID_EDGEPORT_E 0x0E0 // Edgeport/E Usb to Ethernet
// Edgeport TI based devices
#define ION_DEVICE_ID_TI_EDGEPORT_4 0x0201 // Edgeport/4 RS232
#define ION_DEVICE_ID_TI_EDGEPORT_2 0x0205 // Edgeport/2 RS232
#define ION_DEVICE_ID_TI_EDGEPORT_4I 0x0206 // Edgeport/4i RS422
#define ION_DEVICE_ID_TI_EDGEPORT_2I 0x0207 // Edgeport/2i RS422/RS485
#define ION_DEVICE_ID_TI_EDGEPORT_421 0x020C // Edgeport/421 4 hub 2 RS232 + Parallel (lucent on a different hub port)
#define ION_DEVICE_ID_TI_EDGEPORT_21 0x020D // Edgeport/21 2 RS232 + Parallel (lucent on a different hub port)
#define ION_DEVICE_ID_TI_EDGEPORT_416 0x0212 // Edgeport/416
#define ION_DEVICE_ID_TI_EDGEPORT_1 0x0215 // Edgeport/1 RS232
#define ION_DEVICE_ID_TI_EDGEPORT_42 0x0217 // Edgeport/42 4 hub 2 RS232
#define ION_DEVICE_ID_TI_EDGEPORT_22I 0x021A // Edgeport/22I is an Edgeport/4 with ports 1&2 RS422 and ports 3&4 RS232
#define ION_DEVICE_ID_TI_EDGEPORT_2C 0x021B // Edgeport/2c RS232
#define ION_DEVICE_ID_TI_EDGEPORT_221C 0x021C // Edgeport/221c is a TI based Edgeport/2 with lucent chip and
// 2 external hub ports - Large I2C
#define ION_DEVICE_ID_TI_EDGEPORT_22C 0x021D // Edgeport/22c is a TI based Edgeport/2 with
// 2 external hub ports - Large I2C
#define ION_DEVICE_ID_TI_EDGEPORT_21C 0x021E // Edgeport/21c is a TI based Edgeport/2 with lucent chip
// Generation 3 devices -- 3410 based edgport/1 (256 byte I2C)
#define ION_DEVICE_ID_TI_TI3410_EDGEPORT_1 0x0240 // Edgeport/1 RS232
#define ION_DEVICE_ID_TI_TI3410_EDGEPORT_1I 0x0241 // Edgeport/1i- RS422 model
// Ti based software switchable RS232/RS422/RS485 devices
#define ION_DEVICE_ID_TI_EDGEPORT_4S 0x0242 // Edgeport/4s - software switchable model
#define ION_DEVICE_ID_TI_EDGEPORT_8S 0x0243 // Edgeport/8s - software switchable model
#define ION_DEVICE_ID_TI_EDGEPORT_8 0x0244 // Edgeport/8 (single-CPU)
#define ION_DEVICE_ID_TI_EDGEPORT_416B 0x0247 // Edgeport/416
/************************************************************************
*
* Generation 4 devices
*
************************************************************************/
// Watchport based on 3410 both 1-wire and binary products (16K I2C)
#define ION_DEVICE_ID_WP_UNSERIALIZED 0x300 // Watchport based on 3410 both 1-wire and binary products
#define ION_DEVICE_ID_WP_PROXIMITY 0x301 // Watchport/P Discontinued
#define ION_DEVICE_ID_WP_MOTION 0x302 // Watchport/M
#define ION_DEVICE_ID_WP_MOISTURE 0x303 // Watchport/W
#define ION_DEVICE_ID_WP_TEMPERATURE 0x304 // Watchport/T
#define ION_DEVICE_ID_WP_HUMIDITY 0x305 // Watchport/H
#define ION_DEVICE_ID_WP_POWER 0x306 // Watchport
#define ION_DEVICE_ID_WP_LIGHT 0x307 // Watchport
#define ION_DEVICE_ID_WP_RADIATION 0x308 // Watchport
#define ION_DEVICE_ID_WP_ACCELERATION 0x309 // Watchport/A
#define ION_DEVICE_ID_WP_DISTANCE 0x30A // Watchport/D Discontinued
#define ION_DEVICE_ID_WP_PROX_DIST 0x30B // Watchport/D uses distance sensor
// Default to /P function
#define ION_DEVICE_ID_PLUS_PWR_HP4CD 0x30C // 5052 Plus Power HubPort/4CD+ (for Dell)
#define ION_DEVICE_ID_PLUS_PWR_HP4C 0x30D // 5052 Plus Power HubPort/4C+
#define ION_DEVICE_ID_PLUS_PWR_PCI 0x30E // 3410 Plus Power PCI Host Controller 4 port
//
// Definitions for AXIOHM USB product IDs
//
#define USB_VENDOR_ID_AXIOHM 0x05D9 // Axiohm VID
#define AXIOHM_DEVICE_ID_MASK 0xffff
#define AXIOHM_DEVICE_ID_EPIC_A758 0xA758
#define AXIOHM_DEVICE_ID_EPIC_A794 0xA794
#define AXIOHM_DEVICE_ID_EPIC_A225 0xA225
//
// Definitions for NCR USB product IDs
//
#define USB_VENDOR_ID_NCR 0x0404 // NCR VID
#define NCR_DEVICE_ID_MASK 0xffff
#define NCR_DEVICE_ID_EPIC_0202 0x0202
#define NCR_DEVICE_ID_EPIC_0203 0x0203
#define NCR_DEVICE_ID_EPIC_0310 0x0310
#define NCR_DEVICE_ID_EPIC_0311 0x0311
#define NCR_DEVICE_ID_EPIC_0312 0x0312
//
// Definitions for SYMBOL USB product IDs
//
#define USB_VENDOR_ID_SYMBOL 0x05E0 // Symbol VID
#define SYMBOL_DEVICE_ID_MASK 0xffff
#define SYMBOL_DEVICE_ID_KEYFOB 0x0700
//
// Definitions for other product IDs
#define ION_DEVICE_ID_MT4X56USB 0x1403 // OEM device
#define GENERATION_ID_FROM_USB_PRODUCT_ID(ProductId) \
((__u16) ((ProductId >> 8) & (ION_GENERATION_MASK)))
#define MAKE_USB_PRODUCT_ID(OemId, DeviceId) \
((__u16) (((OemId) << 10) || (DeviceId)))
#define DEVICE_ID_FROM_USB_PRODUCT_ID(ProductId) \
((__u16) ((ProductId) & (EDGEPORT_DEVICE_ID_MASK)))
#define OEM_ID_FROM_USB_PRODUCT_ID(ProductId) \
((__u16) (((ProductId) >> 10) & 0x3F))
//
// Definitions of parameters for download code. Note that these are
// specific to a given version of download code and must change if the
// corresponding download code changes.
//
// TxCredits value below which driver won't bother sending (to prevent too many small writes).
// Send only if above 25%
#define EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(InitialCredit, MaxPacketSize) (max(((InitialCredit) / 4), (MaxPacketSize)))
#define EDGE_FW_BULK_MAX_PACKET_SIZE 64 // Max Packet Size for Bulk In Endpoint (EP1)
#define EDGE_FW_BULK_READ_BUFFER_SIZE 1024 // Size to use for Bulk reads
#define EDGE_FW_INT_MAX_PACKET_SIZE 32 // Max Packet Size for Interrupt In Endpoint
// Note that many units were shipped with MPS=16, we
// force an upgrade to this value).
#define EDGE_FW_INT_INTERVAL 2 // 2ms polling on IntPipe
//
// Definitions of I/O Networks vendor-specific requests
// for default endpoint
//
// bmRequestType = 01000000 Set vendor-specific, to device
// bmRequestType = 11000000 Get vendor-specific, to device
//
// These are the definitions for the bRequest field for the
// above bmRequestTypes.
//
// For the read/write Edgeport memory commands, the parameters
// are as follows:
// wValue = 16-bit address
// wIndex = unused (though we could put segment 00: or FF: here)
// wLength = # bytes to read/write (max 64)
//
#define USB_REQUEST_ION_RESET_DEVICE 0 // Warm reboot Edgeport, retaining USB address
#define USB_REQUEST_ION_GET_EPIC_DESC 1 // Get Edgeport Compatibility Descriptor
// unused 2 // Unused, available
#define USB_REQUEST_ION_READ_RAM 3 // Read EdgePort RAM at specified addr
#define USB_REQUEST_ION_WRITE_RAM 4 // Write EdgePort RAM at specified addr
#define USB_REQUEST_ION_READ_ROM 5 // Read EdgePort ROM at specified addr
#define USB_REQUEST_ION_WRITE_ROM 6 // Write EdgePort ROM at specified addr
#define USB_REQUEST_ION_EXEC_DL_CODE 7 // Begin execution of RAM-based download
// code by jumping to address in wIndex:wValue
// 8 // Unused, available
#define USB_REQUEST_ION_ENABLE_SUSPEND 9 // Enable/Disable suspend feature
// (wValue != 0: Enable; wValue = 0: Disable)
#define USB_REQUEST_ION_SEND_IOSP 10 // Send an IOSP command to the edgeport over the control pipe
#define USB_REQUEST_ION_RECV_IOSP 11 // Receive an IOSP command from the edgeport over the control pipe
#define USB_REQUEST_ION_DIS_INT_TIMER 0x80 // Sent to Axiohm to enable/ disable
// interrupt token timer
// wValue = 1, enable (default)
// wValue = 0, disable
//
// Define parameter values for our vendor-specific commands
//
//
// Edgeport Compatibility Descriptor
//
// This descriptor is only returned by Edgeport-compatible devices
// supporting the EPiC spec. True ION devices do not return this
// descriptor, but instead return STALL on receipt of the
// GET_EPIC_DESC command. The driver interprets a STALL to mean that
// this is a "real" Edgeport.
//
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
|