33 #ifndef __LINUX_USB_SERIAL_KEYSPAN_H
34 #define __LINUX_USB_SERIAL_KEYSPAN_H
38 static int keyspan_open (
struct tty_struct *tty,
47 static int keyspan_write_room (
struct tty_struct *tty);
49 static int keyspan_write (
struct tty_struct *tty,
51 const unsigned char *
buf,
58 static void keyspan_set_termios (
struct tty_struct *tty,
61 static void keyspan_break_ctl (
struct tty_struct *tty,
63 static int keyspan_tiocmget (
struct tty_struct *tty);
64 static int keyspan_tiocmset (
struct tty_struct *tty,
70 u32 baud_rate,
u32 baudclk,
71 u8 *rate_hi,
u8 *rate_low,
72 u8 *prescaler,
int portnum);
75 u32 baud_rate,
u32 baudclk,
76 u8 *rate_hi,
u8 *rate_low,
77 u8 *prescaler,
int portnum);
80 u32 baud_rate,
u32 baudclk,
81 u8 *rate_hi,
u8 *rate_low,
82 u8 *prescaler,
int portnum);
85 u32 baud_rate,
u32 baudclk,
86 u8 *rate_hi,
u8 *rate_low,
87 u8 *prescaler,
int portnum);
108 #define KEYSPAN_INVALID_BAUD_RATE (-1)
109 #define KEYSPAN_BAUD_RATE_OK (0)
110 #define KEYSPAN_USA18X_BAUDCLK (12000000L)
111 #define KEYSPAN_USA19_BAUDCLK (12000000L)
112 #define KEYSPAN_USA19W_BAUDCLK (24000000L)
113 #define KEYSPAN_USA19HS_BAUDCLK (14769231L)
114 #define KEYSPAN_USA28_BAUDCLK (1843200L)
115 #define KEYSPAN_USA28X_BAUDCLK (12000000L)
116 #define KEYSPAN_USA49W_BAUDCLK (48000000L)
119 #define KEYSPAN_MAX_NUM_PORTS (4)
120 #define KEYSPAN_MAX_FLIPS (2)
124 #define KEYSPAN_VENDOR_ID (0x06cd)
127 #define keyspan_usa18x_pre_product_id 0x0105
128 #define keyspan_usa19_pre_product_id 0x0103
129 #define keyspan_usa19qi_pre_product_id 0x010b
130 #define keyspan_mpr_pre_product_id 0x011b
131 #define keyspan_usa19qw_pre_product_id 0x0118
132 #define keyspan_usa19w_pre_product_id 0x0106
133 #define keyspan_usa28_pre_product_id 0x0101
134 #define keyspan_usa28x_pre_product_id 0x0102
135 #define keyspan_usa28xa_pre_product_id 0x0114
136 #define keyspan_usa28xb_pre_product_id 0x0113
137 #define keyspan_usa49w_pre_product_id 0x0109
138 #define keyspan_usa49wlc_pre_product_id 0x011a
144 #define keyspan_usa18x_product_id 0x0112
145 #define keyspan_usa19_product_id 0x0107
146 #define keyspan_usa19qi_product_id 0x010c
147 #define keyspan_usa19hs_product_id 0x0121
148 #define keyspan_mpr_product_id 0x011c
149 #define keyspan_usa19qw_product_id 0x0119
150 #define keyspan_usa19w_product_id 0x0108
151 #define keyspan_usa28_product_id 0x010f
152 #define keyspan_usa28x_product_id 0x0110
153 #define keyspan_usa28xa_product_id 0x0115
154 #define keyspan_usa28xb_product_id 0x0110
155 #define keyspan_usa28xg_product_id 0x0135
156 #define keyspan_usa49w_product_id 0x010a
157 #define keyspan_usa49wlc_product_id 0x012a
158 #define keyspan_usa49wg_product_id 0x0131
199 u8 *rate_hi,
u8 *rate_low,
u8 *prescaler,
int portnum);
211 .indat_endp_flip = 0,
212 .outdat_endp_flip = 1,
213 .indat_endpoints = {0x81},
214 .outdat_endpoints = {0x01},
215 .inack_endpoints = {0x85},
216 .outcont_endpoints = {0x05},
217 .instat_endpoint = 0x87,
218 .indat_endpoint = -1,
219 .glocont_endpoint = 0x07,
220 .calculate_baud_rate = keyspan_usa19w_calc_baud,
228 .indat_endp_flip = 1,
229 .outdat_endp_flip = 1,
230 .indat_endpoints = {0x81},
231 .outdat_endpoints = {0x01},
232 .inack_endpoints = {0x83},
233 .outcont_endpoints = {0x03},
234 .instat_endpoint = 0x84,
235 .indat_endpoint = -1,
236 .glocont_endpoint = -1,
237 .calculate_baud_rate = keyspan_usa19_calc_baud,
245 .indat_endp_flip = 1,
246 .outdat_endp_flip = 1,
247 .indat_endpoints = {0x81},
248 .outdat_endpoints = {0x01},
249 .inack_endpoints = {0x83},
250 .outcont_endpoints = {0x03},
251 .instat_endpoint = 0x84,
252 .indat_endpoint = -1,
253 .glocont_endpoint = -1,
254 .calculate_baud_rate = keyspan_usa28_calc_baud,
262 .indat_endp_flip = 1,
263 .outdat_endp_flip = 1,
264 .indat_endpoints = {0x81},
265 .outdat_endpoints = {0x01},
266 .inack_endpoints = {0x83},
267 .outcont_endpoints = {0x03},
268 .instat_endpoint = 0x84,
269 .indat_endpoint = -1,
270 .glocont_endpoint = -1,
271 .calculate_baud_rate = keyspan_usa28_calc_baud,
279 .indat_endp_flip = 0,
280 .outdat_endp_flip = 1,
281 .indat_endpoints = {0x81},
282 .outdat_endpoints = {0x01},
283 .inack_endpoints = {0x85},
284 .outcont_endpoints = {0x05},
285 .instat_endpoint = 0x87,
286 .indat_endpoint = -1,
287 .glocont_endpoint = 0x07,
288 .calculate_baud_rate = keyspan_usa19w_calc_baud,
296 .indat_endp_flip = 0,
297 .outdat_endp_flip = 1,
298 .indat_endpoints = {0x81},
299 .outdat_endpoints = {0x01},
300 .inack_endpoints = {0x85},
301 .outcont_endpoints = {0x05},
302 .instat_endpoint = 0x87,
303 .indat_endpoint = -1,
304 .glocont_endpoint = 0x07,
305 .calculate_baud_rate = keyspan_usa19w_calc_baud,
313 .indat_endp_flip = 0,
314 .outdat_endp_flip = 0,
315 .indat_endpoints = {0x81},
316 .outdat_endpoints = {0x01},
317 .inack_endpoints = {-1},
318 .outcont_endpoints = {0x02},
319 .instat_endpoint = 0x82,
320 .indat_endpoint = -1,
321 .glocont_endpoint = -1,
322 .calculate_baud_rate = keyspan_usa19hs_calc_baud,
330 .indat_endp_flip = 1,
331 .outdat_endp_flip = 1,
332 .indat_endpoints = {0x81, 0x83},
333 .outdat_endpoints = {0x01, 0x03},
334 .inack_endpoints = {0x85, 0x86},
335 .outcont_endpoints = {0x05, 0x06},
336 .instat_endpoint = 0x87,
337 .indat_endpoint = -1,
338 .glocont_endpoint = 0x07,
339 .calculate_baud_rate = keyspan_usa28_calc_baud,
347 .indat_endp_flip = 0,
348 .outdat_endp_flip = 1,
349 .indat_endpoints = {0x81, 0x83},
350 .outdat_endpoints = {0x01, 0x03},
351 .inack_endpoints = {0x85, 0x86},
352 .outcont_endpoints = {0x05, 0x06},
353 .instat_endpoint = 0x87,
354 .indat_endpoint = -1,
355 .glocont_endpoint = 0x07,
356 .calculate_baud_rate = keyspan_usa19w_calc_baud,
364 .indat_endp_flip = 0,
365 .outdat_endp_flip = 1,
366 .indat_endpoints = {0x81, 0x83},
367 .outdat_endpoints = {0x01, 0x03},
368 .inack_endpoints = {0x85, 0x86},
369 .outcont_endpoints = {0x05, 0x06},
370 .instat_endpoint = 0x87,
371 .indat_endpoint = -1,
372 .glocont_endpoint = 0x07,
373 .calculate_baud_rate = keyspan_usa19w_calc_baud,
381 .indat_endp_flip = 0,
382 .outdat_endp_flip = 0,
383 .indat_endpoints = {0x84, 0x88},
384 .outdat_endpoints = {0x02, 0x06},
385 .inack_endpoints = {-1, -1},
386 .outcont_endpoints = {-1, -1},
387 .instat_endpoint = 0x81,
388 .indat_endpoint = -1,
389 .glocont_endpoint = 0x01,
390 .calculate_baud_rate = keyspan_usa19w_calc_baud,
399 .indat_endp_flip = 0,
400 .outdat_endp_flip = 0,
401 .indat_endpoints = {0x81, 0x82, 0x83, 0x84},
402 .outdat_endpoints = {0x01, 0x02, 0x03, 0x04},
403 .inack_endpoints = {-1, -1, -1, -1},
404 .outcont_endpoints = {-1, -1, -1, -1},
405 .instat_endpoint = 0x87,
406 .indat_endpoint = -1,
407 .glocont_endpoint = 0x07,
408 .calculate_baud_rate = keyspan_usa19w_calc_baud,
416 .indat_endp_flip = 0,
417 .outdat_endp_flip = 0,
418 .indat_endpoints = {0x81, 0x82, 0x83, 0x84},
419 .outdat_endpoints = {0x01, 0x02, 0x03, 0x04},
420 .inack_endpoints = {-1, -1, -1, -1},
421 .outcont_endpoints = {-1, -1, -1, -1},
422 .instat_endpoint = 0x87,
423 .indat_endpoint = -1,
424 .glocont_endpoint = 0x07,
425 .calculate_baud_rate = keyspan_usa19w_calc_baud,
433 .indat_endp_flip = 0,
434 .outdat_endp_flip = 0,
435 .indat_endpoints = {-1, -1, -1, -1},
436 .outdat_endpoints = {0x01, 0x02, 0x04, 0x06},
437 .inack_endpoints = {-1, -1, -1, -1},
438 .outcont_endpoints = {-1, -1, -1, -1},
439 .instat_endpoint = 0x81,
440 .indat_endpoint = 0x88,
441 .glocont_endpoint = 0x00,
442 .calculate_baud_rate = keyspan_usa19w_calc_baud,
447 &usa18x_device_details,
448 &usa19_device_details,
449 &usa19qi_device_details,
451 &usa19qw_device_details,
452 &usa19w_device_details,
453 &usa19hs_device_details,
454 &usa28_device_details,
455 &usa28x_device_details,
456 &usa28xa_device_details,
457 &usa28xg_device_details,
459 &usa49w_device_details,
460 &usa49wlc_device_details,
461 &usa49wg_device_details,
544 .name =
"keyspan_no_firm",
546 .description =
"Keyspan - (without firmware)",
547 .id_table = keyspan_pre_ids,
549 .attach = keyspan_fake_startup,
557 .description =
"Keyspan 1 port adapter",
558 .id_table = keyspan_1port_ids,
560 .open = keyspan_open,
561 .close = keyspan_close,
562 .dtr_rts = keyspan_dtr_rts,
563 .write = keyspan_write,
564 .write_room = keyspan_write_room,
565 .set_termios = keyspan_set_termios,
566 .break_ctl = keyspan_break_ctl,
567 .tiocmget = keyspan_tiocmget,
568 .tiocmset = keyspan_tiocmset,
569 .attach = keyspan_startup,
570 .disconnect = keyspan_disconnect,
571 .release = keyspan_release,
572 .port_probe = keyspan_port_probe,
573 .port_remove = keyspan_port_remove,
581 .description =
"Keyspan 2 port adapter",
582 .id_table = keyspan_2port_ids,
584 .open = keyspan_open,
585 .close = keyspan_close,
586 .dtr_rts = keyspan_dtr_rts,
587 .write = keyspan_write,
588 .write_room = keyspan_write_room,
589 .set_termios = keyspan_set_termios,
590 .break_ctl = keyspan_break_ctl,
591 .tiocmget = keyspan_tiocmget,
592 .tiocmset = keyspan_tiocmset,
593 .attach = keyspan_startup,
594 .disconnect = keyspan_disconnect,
595 .release = keyspan_release,
596 .port_probe = keyspan_port_probe,
597 .port_remove = keyspan_port_remove,
605 .description =
"Keyspan 4 port adapter",
606 .id_table = keyspan_4port_ids,
608 .open = keyspan_open,
609 .close = keyspan_close,
610 .dtr_rts = keyspan_dtr_rts,
611 .write = keyspan_write,
612 .write_room = keyspan_write_room,
613 .set_termios = keyspan_set_termios,
614 .break_ctl = keyspan_break_ctl,
615 .tiocmget = keyspan_tiocmget,
616 .tiocmset = keyspan_tiocmset,
617 .attach = keyspan_startup,
618 .disconnect = keyspan_disconnect,
619 .release = keyspan_release,
620 .port_probe = keyspan_port_probe,
621 .port_remove = keyspan_port_remove,
625 &keyspan_pre_device, &keyspan_1port_device,
626 &keyspan_2port_device, &keyspan_4port_device,
NULL