2 Keyspan USB to Serial Converter driver
4 (C) Copyright (C) 2000-2001
5 Hugh Blemings <hugh@blemings.org>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 See http://misc.nu/hugh/keyspan.html for more information.
14 Code in this driver inspired by and in a number of places taken
15 from Brian Warner's original Keyspan-PDA driver.
17 This driver has been put together with the support of Innosys, Inc.
18 and Keyspan, Inc the manufacturers of the Keyspan USB-serial products.
21 Thanks to Paulus for miscellaneous tidy ups, some largish chunks
22 of much nicer and/or completely new code and (perhaps most uniquely)
23 having the patience to sit down and explain why and where he'd changed
26 Tip 'o the hat to IBM (and previously Linuxcare :) for supporting
27 staff in their work on open source projects.
29 See keyspan.c for update history.
33 #ifndef __LINUX_USB_SERIAL_KEYSPAN_H
34 #define __LINUX_USB_SERIAL_KEYSPAN_H
37 /* Function prototypes for Keyspan serial converter */
38 static int keyspan_open (struct usb_serial_port *port,
40 static void keyspan_close (struct usb_serial_port *port,
42 static int keyspan_startup (struct usb_serial *serial);
43 static void keyspan_shutdown (struct usb_serial *serial);
44 static void keyspan_rx_throttle (struct usb_serial_port *port);
45 static void keyspan_rx_unthrottle (struct usb_serial_port *port);
46 static int keyspan_write_room (struct usb_serial_port *port);
48 static int keyspan_write (struct usb_serial_port *port,
49 const unsigned char *buf,
52 static void keyspan_send_setup (struct usb_serial_port *port,
56 static int keyspan_chars_in_buffer (struct usb_serial_port *port);
57 static int keyspan_ioctl (struct usb_serial_port *port,
61 static void keyspan_set_termios (struct usb_serial_port *port,
62 struct ktermios *old);
63 static void keyspan_break_ctl (struct usb_serial_port *port,
65 static int keyspan_tiocmget (struct usb_serial_port *port,
67 static int keyspan_tiocmset (struct usb_serial_port *port,
68 struct file *file, unsigned int set,
70 static int keyspan_fake_startup (struct usb_serial *serial);
72 static int keyspan_usa19_calc_baud (u32 baud_rate, u32 baudclk,
73 u8 *rate_hi, u8 *rate_low,
74 u8 *prescaler, int portnum);
76 static int keyspan_usa19w_calc_baud (u32 baud_rate, u32 baudclk,
77 u8 *rate_hi, u8 *rate_low,
78 u8 *prescaler, int portnum);
80 static int keyspan_usa28_calc_baud (u32 baud_rate, u32 baudclk,
81 u8 *rate_hi, u8 *rate_low,
82 u8 *prescaler, int portnum);
84 static int keyspan_usa19hs_calc_baud (u32 baud_rate, u32 baudclk,
85 u8 *rate_hi, u8 *rate_low,
86 u8 *prescaler, int portnum);
88 static int keyspan_usa28_send_setup (struct usb_serial *serial,
89 struct usb_serial_port *port,
91 static int keyspan_usa26_send_setup (struct usb_serial *serial,
92 struct usb_serial_port *port,
94 static int keyspan_usa49_send_setup (struct usb_serial *serial,
95 struct usb_serial_port *port,
98 static int keyspan_usa90_send_setup (struct usb_serial *serial,
99 struct usb_serial_port *port,
102 /* Struct used for firmware - increased size of data section
103 to allow Keyspan's 'C' firmware struct to be used unmodified */
104 struct ezusb_hex_record {
110 /* Conditionally include firmware images, if they aren't
111 included create a null pointer instead. Current
112 firmware images aren't optimised to remove duplicate
113 addresses in the image itself. */
114 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28
115 #include "keyspan_usa28_fw.h"
117 static const struct ezusb_hex_record *keyspan_usa28_firmware = NULL;
120 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28X
121 #include "keyspan_usa28x_fw.h"
123 static const struct ezusb_hex_record *keyspan_usa28x_firmware = NULL;
126 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28XA
127 #include "keyspan_usa28xa_fw.h"
129 static const struct ezusb_hex_record *keyspan_usa28xa_firmware = NULL;
132 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28XB
133 #include "keyspan_usa28xb_fw.h"
135 static const struct ezusb_hex_record *keyspan_usa28xb_firmware = NULL;
138 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19
139 #include "keyspan_usa19_fw.h"
141 static const struct ezusb_hex_record *keyspan_usa19_firmware = NULL;
144 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19QI
145 #include "keyspan_usa19qi_fw.h"
147 static const struct ezusb_hex_record *keyspan_usa19qi_firmware = NULL;
150 #ifdef CONFIG_USB_SERIAL_KEYSPAN_MPR
151 #include "keyspan_mpr_fw.h"
153 static const struct ezusb_hex_record *keyspan_mpr_firmware = NULL;
156 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19QW
157 #include "keyspan_usa19qw_fw.h"
159 static const struct ezusb_hex_record *keyspan_usa19qw_firmware = NULL;
162 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA18X
163 #include "keyspan_usa18x_fw.h"
165 static const struct ezusb_hex_record *keyspan_usa18x_firmware = NULL;
168 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19W
169 #include "keyspan_usa19w_fw.h"
171 static const struct ezusb_hex_record *keyspan_usa19w_firmware = NULL;
174 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA49W
175 #include "keyspan_usa49w_fw.h"
177 static const struct ezusb_hex_record *keyspan_usa49w_firmware = NULL;
180 #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA49WLC
181 #include "keyspan_usa49wlc_fw.h"
183 static const struct ezusb_hex_record *keyspan_usa49wlc_firmware = NULL;
186 /* Values used for baud rate calculation - device specific */
187 #define KEYSPAN_INVALID_BAUD_RATE (-1)
188 #define KEYSPAN_BAUD_RATE_OK (0)
189 #define KEYSPAN_USA18X_BAUDCLK (12000000L) /* a guess */
190 #define KEYSPAN_USA19_BAUDCLK (12000000L)
191 #define KEYSPAN_USA19W_BAUDCLK (24000000L)
192 #define KEYSPAN_USA19HS_BAUDCLK (14769231L)
193 #define KEYSPAN_USA28_BAUDCLK (1843200L)
194 #define KEYSPAN_USA28X_BAUDCLK (12000000L)
195 #define KEYSPAN_USA49W_BAUDCLK (48000000L)
197 /* Some constants used to characterise each device. */
198 #define KEYSPAN_MAX_NUM_PORTS (4)
199 #define KEYSPAN_MAX_FLIPS (2)
201 /* Device info for the Keyspan serial converter, used
202 by the overall usb-serial probe function */
203 #define KEYSPAN_VENDOR_ID (0x06cd)
205 /* Product IDs for the products supported, pre-renumeration */
206 #define keyspan_usa18x_pre_product_id 0x0105
207 #define keyspan_usa19_pre_product_id 0x0103
208 #define keyspan_usa19qi_pre_product_id 0x010b
209 #define keyspan_mpr_pre_product_id 0x011b
210 #define keyspan_usa19qw_pre_product_id 0x0118
211 #define keyspan_usa19w_pre_product_id 0x0106
212 #define keyspan_usa28_pre_product_id 0x0101
213 #define keyspan_usa28x_pre_product_id 0x0102
214 #define keyspan_usa28xa_pre_product_id 0x0114
215 #define keyspan_usa28xb_pre_product_id 0x0113
216 #define keyspan_usa49w_pre_product_id 0x0109
217 #define keyspan_usa49wlc_pre_product_id 0x011a
219 /* Product IDs post-renumeration. Note that the 28x and 28xb
220 have the same id's post-renumeration but behave identically
221 so it's not an issue. */
222 #define keyspan_usa18x_product_id 0x0112
223 #define keyspan_usa19_product_id 0x0107
224 #define keyspan_usa19qi_product_id 0x010c
225 #define keyspan_usa19hs_product_id 0x0121
226 #define keyspan_mpr_product_id 0x011c
227 #define keyspan_usa19qw_product_id 0x0119
228 #define keyspan_usa19w_product_id 0x0108
229 #define keyspan_usa28_product_id 0x010f
230 #define keyspan_usa28x_product_id 0x0110
231 #define keyspan_usa28xa_product_id 0x0115
232 #define keyspan_usa49w_product_id 0x010a
233 #define keyspan_usa49wlc_product_id 0x012a
236 struct keyspan_device_details {
237 /* product ID value */
240 enum {msg_usa26, msg_usa28, msg_usa49, msg_usa90} msg_format;
242 /* Number of physical ports */
245 /* 1 if endpoint flipping used on input, 0 if not */
248 /* 1 if endpoint flipping used on output, 0 if not */
249 int outdat_endp_flip;
251 /* Table mapping input data endpoint IDs to physical
252 port number and flip if used */
253 int indat_endpoints[KEYSPAN_MAX_NUM_PORTS];
255 /* Same for output endpoints */
256 int outdat_endpoints[KEYSPAN_MAX_NUM_PORTS];
258 /* Input acknowledge endpoints */
259 int inack_endpoints[KEYSPAN_MAX_NUM_PORTS];
261 /* Output control endpoints */
262 int outcont_endpoints[KEYSPAN_MAX_NUM_PORTS];
264 /* Endpoint used for input status */
267 /* Endpoint used for global control functions */
268 int glocont_endpoint;
270 int (*calculate_baud_rate) (u32 baud_rate, u32 baudclk,
271 u8 *rate_hi, u8 *rate_low, u8 *prescaler, int portnum);
275 /* Now for each device type we setup the device detail
276 structure with the appropriate information (provided
277 in Keyspan's documentation) */
279 static const struct keyspan_device_details usa18x_device_details = {
280 .product_id = keyspan_usa18x_product_id,
281 .msg_format = msg_usa26,
283 .indat_endp_flip = 0,
284 .outdat_endp_flip = 1,
285 .indat_endpoints = {0x81},
286 .outdat_endpoints = {0x01},
287 .inack_endpoints = {0x85},
288 .outcont_endpoints = {0x05},
289 .instat_endpoint = 0x87,
290 .glocont_endpoint = 0x07,
291 .calculate_baud_rate = keyspan_usa19w_calc_baud,
292 .baudclk = KEYSPAN_USA18X_BAUDCLK,
295 static const struct keyspan_device_details usa19_device_details = {
296 .product_id = keyspan_usa19_product_id,
297 .msg_format = msg_usa28,
299 .indat_endp_flip = 1,
300 .outdat_endp_flip = 1,
301 .indat_endpoints = {0x81},
302 .outdat_endpoints = {0x01},
303 .inack_endpoints = {0x83},
304 .outcont_endpoints = {0x03},
305 .instat_endpoint = 0x84,
306 .glocont_endpoint = -1,
307 .calculate_baud_rate = keyspan_usa19_calc_baud,
308 .baudclk = KEYSPAN_USA19_BAUDCLK,
311 static const struct keyspan_device_details usa19qi_device_details = {
312 .product_id = keyspan_usa19qi_product_id,
313 .msg_format = msg_usa28,
315 .indat_endp_flip = 1,
316 .outdat_endp_flip = 1,
317 .indat_endpoints = {0x81},
318 .outdat_endpoints = {0x01},
319 .inack_endpoints = {0x83},
320 .outcont_endpoints = {0x03},
321 .instat_endpoint = 0x84,
322 .glocont_endpoint = -1,
323 .calculate_baud_rate = keyspan_usa28_calc_baud,
324 .baudclk = KEYSPAN_USA19_BAUDCLK,
327 static const struct keyspan_device_details mpr_device_details = {
328 .product_id = keyspan_mpr_product_id,
329 .msg_format = msg_usa28,
331 .indat_endp_flip = 1,
332 .outdat_endp_flip = 1,
333 .indat_endpoints = {0x81},
334 .outdat_endpoints = {0x01},
335 .inack_endpoints = {0x83},
336 .outcont_endpoints = {0x03},
337 .instat_endpoint = 0x84,
338 .glocont_endpoint = -1,
339 .calculate_baud_rate = keyspan_usa28_calc_baud,
340 .baudclk = KEYSPAN_USA19_BAUDCLK,
343 static const struct keyspan_device_details usa19qw_device_details = {
344 .product_id = keyspan_usa19qw_product_id,
345 .msg_format = msg_usa26,
347 .indat_endp_flip = 0,
348 .outdat_endp_flip = 1,
349 .indat_endpoints = {0x81},
350 .outdat_endpoints = {0x01},
351 .inack_endpoints = {0x85},
352 .outcont_endpoints = {0x05},
353 .instat_endpoint = 0x87,
354 .glocont_endpoint = 0x07,
355 .calculate_baud_rate = keyspan_usa19w_calc_baud,
356 .baudclk = KEYSPAN_USA19W_BAUDCLK,
359 static const struct keyspan_device_details usa19w_device_details = {
360 .product_id = keyspan_usa19w_product_id,
361 .msg_format = msg_usa26,
363 .indat_endp_flip = 0,
364 .outdat_endp_flip = 1,
365 .indat_endpoints = {0x81},
366 .outdat_endpoints = {0x01},
367 .inack_endpoints = {0x85},
368 .outcont_endpoints = {0x05},
369 .instat_endpoint = 0x87,
370 .glocont_endpoint = 0x07,
371 .calculate_baud_rate = keyspan_usa19w_calc_baud,
372 .baudclk = KEYSPAN_USA19W_BAUDCLK,
375 static const struct keyspan_device_details usa19hs_device_details = {
376 .product_id = keyspan_usa19hs_product_id,
377 .msg_format = msg_usa90,
379 .indat_endp_flip = 0,
380 .outdat_endp_flip = 0,
381 .indat_endpoints = {0x81},
382 .outdat_endpoints = {0x01},
383 .inack_endpoints = {-1},
384 .outcont_endpoints = {0x02},
385 .instat_endpoint = 0x82,
386 .glocont_endpoint = -1,
387 .calculate_baud_rate = keyspan_usa19hs_calc_baud,
388 .baudclk = KEYSPAN_USA19HS_BAUDCLK,
391 static const struct keyspan_device_details usa28_device_details = {
392 .product_id = keyspan_usa28_product_id,
393 .msg_format = msg_usa28,
395 .indat_endp_flip = 1,
396 .outdat_endp_flip = 1,
397 .indat_endpoints = {0x81, 0x83},
398 .outdat_endpoints = {0x01, 0x03},
399 .inack_endpoints = {0x85, 0x86},
400 .outcont_endpoints = {0x05, 0x06},
401 .instat_endpoint = 0x87,
402 .glocont_endpoint = 0x07,
403 .calculate_baud_rate = keyspan_usa28_calc_baud,
404 .baudclk = KEYSPAN_USA28_BAUDCLK,
407 static const struct keyspan_device_details usa28x_device_details = {
408 .product_id = keyspan_usa28x_product_id,
409 .msg_format = msg_usa26,
411 .indat_endp_flip = 0,
412 .outdat_endp_flip = 1,
413 .indat_endpoints = {0x81, 0x83},
414 .outdat_endpoints = {0x01, 0x03},
415 .inack_endpoints = {0x85, 0x86},
416 .outcont_endpoints = {0x05, 0x06},
417 .instat_endpoint = 0x87,
418 .glocont_endpoint = 0x07,
419 .calculate_baud_rate = keyspan_usa19w_calc_baud,
420 .baudclk = KEYSPAN_USA28X_BAUDCLK,
423 static const struct keyspan_device_details usa28xa_device_details = {
424 .product_id = keyspan_usa28xa_product_id,
425 .msg_format = msg_usa26,
427 .indat_endp_flip = 0,
428 .outdat_endp_flip = 1,
429 .indat_endpoints = {0x81, 0x83},
430 .outdat_endpoints = {0x01, 0x03},
431 .inack_endpoints = {0x85, 0x86},
432 .outcont_endpoints = {0x05, 0x06},
433 .instat_endpoint = 0x87,
434 .glocont_endpoint = 0x07,
435 .calculate_baud_rate = keyspan_usa19w_calc_baud,
436 .baudclk = KEYSPAN_USA28X_BAUDCLK,
439 /* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */
441 static const struct keyspan_device_details usa49w_device_details = {
442 .product_id = keyspan_usa49w_product_id,
443 .msg_format = msg_usa49,
445 .indat_endp_flip = 0,
446 .outdat_endp_flip = 0,
447 .indat_endpoints = {0x81, 0x82, 0x83, 0x84},
448 .outdat_endpoints = {0x01, 0x02, 0x03, 0x04},
449 .inack_endpoints = {-1, -1, -1, -1},
450 .outcont_endpoints = {-1, -1, -1, -1},
451 .instat_endpoint = 0x87,
452 .glocont_endpoint = 0x07,
453 .calculate_baud_rate = keyspan_usa19w_calc_baud,
454 .baudclk = KEYSPAN_USA49W_BAUDCLK,
457 static const struct keyspan_device_details usa49wlc_device_details = {
458 .product_id = keyspan_usa49wlc_product_id,
459 .msg_format = msg_usa49,
461 .indat_endp_flip = 0,
462 .outdat_endp_flip = 0,
463 .indat_endpoints = {0x81, 0x82, 0x83, 0x84},
464 .outdat_endpoints = {0x01, 0x02, 0x03, 0x04},
465 .inack_endpoints = {-1, -1, -1, -1},
466 .outcont_endpoints = {-1, -1, -1, -1},
467 .instat_endpoint = 0x87,
468 .glocont_endpoint = 0x07,
469 .calculate_baud_rate = keyspan_usa19w_calc_baud,
470 .baudclk = KEYSPAN_USA19W_BAUDCLK,
473 static const struct keyspan_device_details *keyspan_devices[] = {
474 &usa18x_device_details,
475 &usa19_device_details,
476 &usa19qi_device_details,
478 &usa19qw_device_details,
479 &usa19w_device_details,
480 &usa19hs_device_details,
481 &usa28_device_details,
482 &usa28x_device_details,
483 &usa28xa_device_details,
484 /* 28xb not required as it renumerates as a 28x */
485 &usa49w_device_details,
486 &usa49wlc_device_details,
490 static struct usb_device_id keyspan_ids_combined[] = {
491 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) },
492 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) },
493 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) },
494 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) },
495 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) },
496 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_pre_product_id) },
497 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) },
498 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) },
499 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) },
500 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_pre_product_id) },
501 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_pre_product_id) },
502 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_pre_product_id) },
503 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) },
504 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) },
505 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) },
506 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) },
507 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) },
508 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19hs_product_id) },
509 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) },
510 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) },
511 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) },
512 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) },
513 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id)},
514 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)},
515 { } /* Terminating entry */
518 MODULE_DEVICE_TABLE(usb, keyspan_ids_combined);
520 static struct usb_driver keyspan_driver = {
522 .probe = usb_serial_probe,
523 .disconnect = usb_serial_disconnect,
524 .id_table = keyspan_ids_combined,
528 /* usb_device_id table for the pre-firmware download keyspan devices */
529 static struct usb_device_id keyspan_pre_ids[] = {
530 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) },
531 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) },
532 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) },
533 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) },
534 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) },
535 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_pre_product_id) },
536 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) },
537 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) },
538 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) },
539 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_pre_product_id) },
540 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_pre_product_id) },
541 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_pre_product_id) },
542 { } /* Terminating entry */
545 static struct usb_device_id keyspan_1port_ids[] = {
546 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) },
547 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) },
548 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) },
549 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) },
550 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) },
551 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19hs_product_id) },
552 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) },
553 { } /* Terminating entry */
556 static struct usb_device_id keyspan_2port_ids[] = {
557 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) },
558 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) },
559 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) },
560 { } /* Terminating entry */
563 static struct usb_device_id keyspan_4port_ids[] = {
564 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id) },
565 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)},
566 { } /* Terminating entry */
569 /* Structs for the devices, pre and post renumeration. */
570 static struct usb_serial_driver keyspan_pre_device = {
572 .owner = THIS_MODULE,
573 .name = "keyspan_no_firm",
575 .description = "Keyspan - (without firmware)",
576 .usb_driver = &keyspan_driver,
577 .id_table = keyspan_pre_ids,
578 .num_interrupt_in = NUM_DONT_CARE,
579 .num_bulk_in = NUM_DONT_CARE,
580 .num_bulk_out = NUM_DONT_CARE,
582 .attach = keyspan_fake_startup,
585 static struct usb_serial_driver keyspan_1port_device = {
587 .owner = THIS_MODULE,
590 .description = "Keyspan 1 port adapter",
591 .usb_driver = &keyspan_driver,
592 .id_table = keyspan_1port_ids,
593 .num_interrupt_in = NUM_DONT_CARE,
594 .num_bulk_in = NUM_DONT_CARE,
595 .num_bulk_out = NUM_DONT_CARE,
597 .open = keyspan_open,
598 .close = keyspan_close,
599 .write = keyspan_write,
600 .write_room = keyspan_write_room,
601 .chars_in_buffer = keyspan_chars_in_buffer,
602 .throttle = keyspan_rx_throttle,
603 .unthrottle = keyspan_rx_unthrottle,
604 .ioctl = keyspan_ioctl,
605 .set_termios = keyspan_set_termios,
606 .break_ctl = keyspan_break_ctl,
607 .tiocmget = keyspan_tiocmget,
608 .tiocmset = keyspan_tiocmset,
609 .attach = keyspan_startup,
610 .shutdown = keyspan_shutdown,
613 static struct usb_serial_driver keyspan_2port_device = {
615 .owner = THIS_MODULE,
618 .description = "Keyspan 2 port adapter",
619 .usb_driver = &keyspan_driver,
620 .id_table = keyspan_2port_ids,
621 .num_interrupt_in = NUM_DONT_CARE,
622 .num_bulk_in = NUM_DONT_CARE,
623 .num_bulk_out = NUM_DONT_CARE,
625 .open = keyspan_open,
626 .close = keyspan_close,
627 .write = keyspan_write,
628 .write_room = keyspan_write_room,
629 .chars_in_buffer = keyspan_chars_in_buffer,
630 .throttle = keyspan_rx_throttle,
631 .unthrottle = keyspan_rx_unthrottle,
632 .ioctl = keyspan_ioctl,
633 .set_termios = keyspan_set_termios,
634 .break_ctl = keyspan_break_ctl,
635 .tiocmget = keyspan_tiocmget,
636 .tiocmset = keyspan_tiocmset,
637 .attach = keyspan_startup,
638 .shutdown = keyspan_shutdown,
641 static struct usb_serial_driver keyspan_4port_device = {
643 .owner = THIS_MODULE,
646 .description = "Keyspan 4 port adapter",
647 .usb_driver = &keyspan_driver,
648 .id_table = keyspan_4port_ids,
649 .num_interrupt_in = NUM_DONT_CARE,
653 .open = keyspan_open,
654 .close = keyspan_close,
655 .write = keyspan_write,
656 .write_room = keyspan_write_room,
657 .chars_in_buffer = keyspan_chars_in_buffer,
658 .throttle = keyspan_rx_throttle,
659 .unthrottle = keyspan_rx_unthrottle,
660 .ioctl = keyspan_ioctl,
661 .set_termios = keyspan_set_termios,
662 .break_ctl = keyspan_break_ctl,
663 .tiocmget = keyspan_tiocmget,
664 .tiocmset = keyspan_tiocmset,
665 .attach = keyspan_startup,
666 .shutdown = keyspan_shutdown,