aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/keyspan.h
diff options
context:
space:
mode:
authorLucy McCoy <lucy@keyspan.com>2007-05-18 15:10:41 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 19:29:45 -0400
commit0ca1268e109acf6d71507398cb95cab2e670b654 (patch)
treee73f21cb8313651b9e3616c601868ef09fbc6382 /drivers/usb/serial/keyspan.h
parent87e71b473ee199cf4b7b7a0ce890cd01f45e3a0e (diff)
USB Serial Keyspan: add support for USA-49WG & USA-28XG
Add support for Keyspan adapters: USA-49WG and USA-28XG Signed-off-by: Lucy P. McCoy <lucy@keyspan.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/keyspan.h')
-rw-r--r--drivers/usb/serial/keyspan.h74
1 files changed, 66 insertions, 8 deletions
diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h
index c6830cbdc6df..8a0d17401529 100644
--- a/drivers/usb/serial/keyspan.h
+++ b/drivers/usb/serial/keyspan.h
@@ -99,6 +99,10 @@ static int keyspan_usa90_send_setup (struct usb_serial *serial,
99 struct usb_serial_port *port, 99 struct usb_serial_port *port,
100 int reset_port); 100 int reset_port);
101 101
102static int keyspan_usa67_send_setup (struct usb_serial *serial,
103 struct usb_serial_port *port,
104 int reset_port);
105
102/* Struct used for firmware - increased size of data section 106/* Struct used for firmware - increased size of data section
103 to allow Keyspan's 'C' firmware struct to be used unmodified */ 107 to allow Keyspan's 'C' firmware struct to be used unmodified */
104struct ezusb_hex_record { 108struct ezusb_hex_record {
@@ -229,15 +233,17 @@ struct ezusb_hex_record {
229#define keyspan_usa28_product_id 0x010f 233#define keyspan_usa28_product_id 0x010f
230#define keyspan_usa28x_product_id 0x0110 234#define keyspan_usa28x_product_id 0x0110
231#define keyspan_usa28xa_product_id 0x0115 235#define keyspan_usa28xa_product_id 0x0115
236#define keyspan_usa28xb_product_id 0x0110
237#define keyspan_usa28xg_product_id 0x0135
232#define keyspan_usa49w_product_id 0x010a 238#define keyspan_usa49w_product_id 0x010a
233#define keyspan_usa49wlc_product_id 0x012a 239#define keyspan_usa49wlc_product_id 0x012a
234 240#define keyspan_usa49wg_product_id 0x0131
235 241
236struct keyspan_device_details { 242struct keyspan_device_details {
237 /* product ID value */ 243 /* product ID value */
238 int product_id; 244 int product_id;
239 245
240 enum {msg_usa26, msg_usa28, msg_usa49, msg_usa90} msg_format; 246 enum {msg_usa26, msg_usa28, msg_usa49, msg_usa90, msg_usa67} msg_format;
241 247
242 /* Number of physical ports */ 248 /* Number of physical ports */
243 int num_ports; 249 int num_ports;
@@ -264,6 +270,9 @@ struct keyspan_device_details {
264 /* Endpoint used for input status */ 270 /* Endpoint used for input status */
265 int instat_endpoint; 271 int instat_endpoint;
266 272
273 /* Endpoint used for input data 49WG only */
274 int indat_endpoint;
275
267 /* Endpoint used for global control functions */ 276 /* Endpoint used for global control functions */
268 int glocont_endpoint; 277 int glocont_endpoint;
269 278
@@ -287,6 +296,7 @@ static const struct keyspan_device_details usa18x_device_details = {
287 .inack_endpoints = {0x85}, 296 .inack_endpoints = {0x85},
288 .outcont_endpoints = {0x05}, 297 .outcont_endpoints = {0x05},
289 .instat_endpoint = 0x87, 298 .instat_endpoint = 0x87,
299 .indat_endpoint = -1,
290 .glocont_endpoint = 0x07, 300 .glocont_endpoint = 0x07,
291 .calculate_baud_rate = keyspan_usa19w_calc_baud, 301 .calculate_baud_rate = keyspan_usa19w_calc_baud,
292 .baudclk = KEYSPAN_USA18X_BAUDCLK, 302 .baudclk = KEYSPAN_USA18X_BAUDCLK,
@@ -303,6 +313,7 @@ static const struct keyspan_device_details usa19_device_details = {
303 .inack_endpoints = {0x83}, 313 .inack_endpoints = {0x83},
304 .outcont_endpoints = {0x03}, 314 .outcont_endpoints = {0x03},
305 .instat_endpoint = 0x84, 315 .instat_endpoint = 0x84,
316 .indat_endpoint = -1,
306 .glocont_endpoint = -1, 317 .glocont_endpoint = -1,
307 .calculate_baud_rate = keyspan_usa19_calc_baud, 318 .calculate_baud_rate = keyspan_usa19_calc_baud,
308 .baudclk = KEYSPAN_USA19_BAUDCLK, 319 .baudclk = KEYSPAN_USA19_BAUDCLK,
@@ -319,6 +330,7 @@ static const struct keyspan_device_details usa19qi_device_details = {
319 .inack_endpoints = {0x83}, 330 .inack_endpoints = {0x83},
320 .outcont_endpoints = {0x03}, 331 .outcont_endpoints = {0x03},
321 .instat_endpoint = 0x84, 332 .instat_endpoint = 0x84,
333 .indat_endpoint = -1,
322 .glocont_endpoint = -1, 334 .glocont_endpoint = -1,
323 .calculate_baud_rate = keyspan_usa28_calc_baud, 335 .calculate_baud_rate = keyspan_usa28_calc_baud,
324 .baudclk = KEYSPAN_USA19_BAUDCLK, 336 .baudclk = KEYSPAN_USA19_BAUDCLK,
@@ -335,6 +347,7 @@ static const struct keyspan_device_details mpr_device_details = {
335 .inack_endpoints = {0x83}, 347 .inack_endpoints = {0x83},
336 .outcont_endpoints = {0x03}, 348 .outcont_endpoints = {0x03},
337 .instat_endpoint = 0x84, 349 .instat_endpoint = 0x84,
350 .indat_endpoint = -1,
338 .glocont_endpoint = -1, 351 .glocont_endpoint = -1,
339 .calculate_baud_rate = keyspan_usa28_calc_baud, 352 .calculate_baud_rate = keyspan_usa28_calc_baud,
340 .baudclk = KEYSPAN_USA19_BAUDCLK, 353 .baudclk = KEYSPAN_USA19_BAUDCLK,
@@ -351,6 +364,7 @@ static const struct keyspan_device_details usa19qw_device_details = {
351 .inack_endpoints = {0x85}, 364 .inack_endpoints = {0x85},
352 .outcont_endpoints = {0x05}, 365 .outcont_endpoints = {0x05},
353 .instat_endpoint = 0x87, 366 .instat_endpoint = 0x87,
367 .indat_endpoint = -1,
354 .glocont_endpoint = 0x07, 368 .glocont_endpoint = 0x07,
355 .calculate_baud_rate = keyspan_usa19w_calc_baud, 369 .calculate_baud_rate = keyspan_usa19w_calc_baud,
356 .baudclk = KEYSPAN_USA19W_BAUDCLK, 370 .baudclk = KEYSPAN_USA19W_BAUDCLK,
@@ -367,6 +381,7 @@ static const struct keyspan_device_details usa19w_device_details = {
367 .inack_endpoints = {0x85}, 381 .inack_endpoints = {0x85},
368 .outcont_endpoints = {0x05}, 382 .outcont_endpoints = {0x05},
369 .instat_endpoint = 0x87, 383 .instat_endpoint = 0x87,
384 .indat_endpoint = -1,
370 .glocont_endpoint = 0x07, 385 .glocont_endpoint = 0x07,
371 .calculate_baud_rate = keyspan_usa19w_calc_baud, 386 .calculate_baud_rate = keyspan_usa19w_calc_baud,
372 .baudclk = KEYSPAN_USA19W_BAUDCLK, 387 .baudclk = KEYSPAN_USA19W_BAUDCLK,
@@ -383,6 +398,7 @@ static const struct keyspan_device_details usa19hs_device_details = {
383 .inack_endpoints = {-1}, 398 .inack_endpoints = {-1},
384 .outcont_endpoints = {0x02}, 399 .outcont_endpoints = {0x02},
385 .instat_endpoint = 0x82, 400 .instat_endpoint = 0x82,
401 .indat_endpoint = -1,
386 .glocont_endpoint = -1, 402 .glocont_endpoint = -1,
387 .calculate_baud_rate = keyspan_usa19hs_calc_baud, 403 .calculate_baud_rate = keyspan_usa19hs_calc_baud,
388 .baudclk = KEYSPAN_USA19HS_BAUDCLK, 404 .baudclk = KEYSPAN_USA19HS_BAUDCLK,
@@ -399,6 +415,7 @@ static const struct keyspan_device_details usa28_device_details = {
399 .inack_endpoints = {0x85, 0x86}, 415 .inack_endpoints = {0x85, 0x86},
400 .outcont_endpoints = {0x05, 0x06}, 416 .outcont_endpoints = {0x05, 0x06},
401 .instat_endpoint = 0x87, 417 .instat_endpoint = 0x87,
418 .indat_endpoint = -1,
402 .glocont_endpoint = 0x07, 419 .glocont_endpoint = 0x07,
403 .calculate_baud_rate = keyspan_usa28_calc_baud, 420 .calculate_baud_rate = keyspan_usa28_calc_baud,
404 .baudclk = KEYSPAN_USA28_BAUDCLK, 421 .baudclk = KEYSPAN_USA28_BAUDCLK,
@@ -415,6 +432,7 @@ static const struct keyspan_device_details usa28x_device_details = {
415 .inack_endpoints = {0x85, 0x86}, 432 .inack_endpoints = {0x85, 0x86},
416 .outcont_endpoints = {0x05, 0x06}, 433 .outcont_endpoints = {0x05, 0x06},
417 .instat_endpoint = 0x87, 434 .instat_endpoint = 0x87,
435 .indat_endpoint = -1,
418 .glocont_endpoint = 0x07, 436 .glocont_endpoint = 0x07,
419 .calculate_baud_rate = keyspan_usa19w_calc_baud, 437 .calculate_baud_rate = keyspan_usa19w_calc_baud,
420 .baudclk = KEYSPAN_USA28X_BAUDCLK, 438 .baudclk = KEYSPAN_USA28X_BAUDCLK,
@@ -431,11 +449,28 @@ static const struct keyspan_device_details usa28xa_device_details = {
431 .inack_endpoints = {0x85, 0x86}, 449 .inack_endpoints = {0x85, 0x86},
432 .outcont_endpoints = {0x05, 0x06}, 450 .outcont_endpoints = {0x05, 0x06},
433 .instat_endpoint = 0x87, 451 .instat_endpoint = 0x87,
452 .indat_endpoint = -1,
434 .glocont_endpoint = 0x07, 453 .glocont_endpoint = 0x07,
435 .calculate_baud_rate = keyspan_usa19w_calc_baud, 454 .calculate_baud_rate = keyspan_usa19w_calc_baud,
436 .baudclk = KEYSPAN_USA28X_BAUDCLK, 455 .baudclk = KEYSPAN_USA28X_BAUDCLK,
437}; 456};
438 457
458static const struct keyspan_device_details usa28xg_device_details = {
459 .product_id = keyspan_usa28xg_product_id,
460 .msg_format = msg_usa67,
461 .num_ports = 2,
462 .indat_endp_flip = 0,
463 .outdat_endp_flip = 0,
464 .indat_endpoints = {0x84, 0x88},
465 .outdat_endpoints = {0x02, 0x06},
466 .inack_endpoints = {-1, -1},
467 .outcont_endpoints = {-1, -1},
468 .instat_endpoint = 0x81,
469 .indat_endpoint = -1,
470 .glocont_endpoint = 0x01,
471 .calculate_baud_rate = keyspan_usa19w_calc_baud,
472 .baudclk = KEYSPAN_USA28X_BAUDCLK,
473};
439/* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */ 474/* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */
440 475
441static const struct keyspan_device_details usa49w_device_details = { 476static const struct keyspan_device_details usa49w_device_details = {
@@ -449,6 +484,7 @@ static const struct keyspan_device_details usa49w_device_details = {
449 .inack_endpoints = {-1, -1, -1, -1}, 484 .inack_endpoints = {-1, -1, -1, -1},
450 .outcont_endpoints = {-1, -1, -1, -1}, 485 .outcont_endpoints = {-1, -1, -1, -1},
451 .instat_endpoint = 0x87, 486 .instat_endpoint = 0x87,
487 .indat_endpoint = -1,
452 .glocont_endpoint = 0x07, 488 .glocont_endpoint = 0x07,
453 .calculate_baud_rate = keyspan_usa19w_calc_baud, 489 .calculate_baud_rate = keyspan_usa19w_calc_baud,
454 .baudclk = KEYSPAN_USA49W_BAUDCLK, 490 .baudclk = KEYSPAN_USA49W_BAUDCLK,
@@ -465,11 +501,29 @@ static const struct keyspan_device_details usa49wlc_device_details = {
465 .inack_endpoints = {-1, -1, -1, -1}, 501 .inack_endpoints = {-1, -1, -1, -1},
466 .outcont_endpoints = {-1, -1, -1, -1}, 502 .outcont_endpoints = {-1, -1, -1, -1},
467 .instat_endpoint = 0x87, 503 .instat_endpoint = 0x87,
504 .indat_endpoint = -1,
468 .glocont_endpoint = 0x07, 505 .glocont_endpoint = 0x07,
469 .calculate_baud_rate = keyspan_usa19w_calc_baud, 506 .calculate_baud_rate = keyspan_usa19w_calc_baud,
470 .baudclk = KEYSPAN_USA19W_BAUDCLK, 507 .baudclk = KEYSPAN_USA19W_BAUDCLK,
471}; 508};
472 509
510static const struct keyspan_device_details usa49wg_device_details = {
511 .product_id = keyspan_usa49wg_product_id,
512 .msg_format = msg_usa49,
513 .num_ports = 4,
514 .indat_endp_flip = 0,
515 .outdat_endp_flip = 0,
516 .indat_endpoints = {-1, -1, -1, -1}, /* single 'global' data in EP */
517 .outdat_endpoints = {0x01, 0x02, 0x04, 0x06},
518 .inack_endpoints = {-1, -1, -1, -1},
519 .outcont_endpoints = {-1, -1, -1, -1},
520 .instat_endpoint = 0x81,
521 .indat_endpoint = 0x88,
522 .glocont_endpoint = 0x00, /* uses control EP */
523 .calculate_baud_rate = keyspan_usa19w_calc_baud,
524 .baudclk = KEYSPAN_USA19W_BAUDCLK,
525};
526
473static const struct keyspan_device_details *keyspan_devices[] = { 527static const struct keyspan_device_details *keyspan_devices[] = {
474 &usa18x_device_details, 528 &usa18x_device_details,
475 &usa19_device_details, 529 &usa19_device_details,
@@ -481,9 +535,11 @@ static const struct keyspan_device_details *keyspan_devices[] = {
481 &usa28_device_details, 535 &usa28_device_details,
482 &usa28x_device_details, 536 &usa28x_device_details,
483 &usa28xa_device_details, 537 &usa28xa_device_details,
538 &usa28xg_device_details,
484 /* 28xb not required as it renumerates as a 28x */ 539 /* 28xb not required as it renumerates as a 28x */
485 &usa49w_device_details, 540 &usa49w_device_details,
486 &usa49wlc_device_details, 541 &usa49wlc_device_details,
542 &usa49wg_device_details,
487 NULL, 543 NULL,
488}; 544};
489 545
@@ -510,8 +566,11 @@ static struct usb_device_id keyspan_ids_combined[] = {
510 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, 566 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) },
511 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, 567 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) },
512 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) }, 568 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) },
569 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_product_id) },
570 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xg_product_id) },
513 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id)}, 571 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id)},
514 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)}, 572 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)},
573 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wg_product_id)},
515 { } /* Terminating entry */ 574 { } /* Terminating entry */
516}; 575};
517 576
@@ -557,12 +616,15 @@ static struct usb_device_id keyspan_2port_ids[] = {
557 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, 616 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) },
558 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, 617 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) },
559 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) }, 618 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) },
619 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_product_id) },
620 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xg_product_id) },
560 { } /* Terminating entry */ 621 { } /* Terminating entry */
561}; 622};
562 623
563static struct usb_device_id keyspan_4port_ids[] = { 624static struct usb_device_id keyspan_4port_ids[] = {
564 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id) }, 625 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id) },
565 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)}, 626 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)},
627 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wg_product_id)},
566 { } /* Terminating entry */ 628 { } /* Terminating entry */
567}; 629};
568 630
@@ -573,7 +635,6 @@ static struct usb_serial_driver keyspan_pre_device = {
573 .name = "keyspan_no_firm", 635 .name = "keyspan_no_firm",
574 }, 636 },
575 .description = "Keyspan - (without firmware)", 637 .description = "Keyspan - (without firmware)",
576 .usb_driver = &keyspan_driver,
577 .id_table = keyspan_pre_ids, 638 .id_table = keyspan_pre_ids,
578 .num_interrupt_in = NUM_DONT_CARE, 639 .num_interrupt_in = NUM_DONT_CARE,
579 .num_bulk_in = NUM_DONT_CARE, 640 .num_bulk_in = NUM_DONT_CARE,
@@ -588,7 +649,6 @@ static struct usb_serial_driver keyspan_1port_device = {
588 .name = "keyspan_1", 649 .name = "keyspan_1",
589 }, 650 },
590 .description = "Keyspan 1 port adapter", 651 .description = "Keyspan 1 port adapter",
591 .usb_driver = &keyspan_driver,
592 .id_table = keyspan_1port_ids, 652 .id_table = keyspan_1port_ids,
593 .num_interrupt_in = NUM_DONT_CARE, 653 .num_interrupt_in = NUM_DONT_CARE,
594 .num_bulk_in = NUM_DONT_CARE, 654 .num_bulk_in = NUM_DONT_CARE,
@@ -616,7 +676,6 @@ static struct usb_serial_driver keyspan_2port_device = {
616 .name = "keyspan_2", 676 .name = "keyspan_2",
617 }, 677 },
618 .description = "Keyspan 2 port adapter", 678 .description = "Keyspan 2 port adapter",
619 .usb_driver = &keyspan_driver,
620 .id_table = keyspan_2port_ids, 679 .id_table = keyspan_2port_ids,
621 .num_interrupt_in = NUM_DONT_CARE, 680 .num_interrupt_in = NUM_DONT_CARE,
622 .num_bulk_in = NUM_DONT_CARE, 681 .num_bulk_in = NUM_DONT_CARE,
@@ -644,11 +703,10 @@ static struct usb_serial_driver keyspan_4port_device = {
644 .name = "keyspan_4", 703 .name = "keyspan_4",
645 }, 704 },
646 .description = "Keyspan 4 port adapter", 705 .description = "Keyspan 4 port adapter",
647 .usb_driver = &keyspan_driver,
648 .id_table = keyspan_4port_ids, 706 .id_table = keyspan_4port_ids,
649 .num_interrupt_in = NUM_DONT_CARE, 707 .num_interrupt_in = NUM_DONT_CARE,
650 .num_bulk_in = 5, 708 .num_bulk_in = NUM_DONT_CARE,
651 .num_bulk_out = 5, 709 .num_bulk_out = NUM_DONT_CARE,
652 .num_ports = 4, 710 .num_ports = 4,
653 .open = keyspan_open, 711 .open = keyspan_open,
654 .close = keyspan_close, 712 .close = keyspan_close,