2 * USB Keyspan PDA / Xircom / Entregra Converter driver
4 * Copyright (C) 1999 - 2001 Greg Kroah-Hartman <greg@kroah.com>
5 * Copyright (C) 1999, 2000 Brian Warner <warner@lothar.com>
6 * Copyright (C) 2000 Al Borchers <borchers@steinerpoint.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * See Documentation/usb/usb-serial.txt for more information on using this driver
16 * cleaned up the Xircom support. Added ids for Entregra device which is
17 * the same as the Xircom device. Enabled the code to be compiled for
18 * either Xircom or Keyspan devices.
20 * (08/11/2001) Cristian M. Craciunescu
21 * support for Xircom PGSDB9
24 * switched from using spinlock to a semaphore, which fixes lots of problems.
27 * Identify version on module load.
29 * (11/01/2000) Adam J. Richter
30 * usb_device_id table support
33 * Fixed bug with urb->dev not being set properly, now that the usb
37 * Added locks for SMP safeness.
38 * Fixed MOD_INC and MOD_DEC logic and the ability to open a port more
41 * (07/20/2000) borchers
42 * - keyspan_pda_write no longer sleeps if it is called on interrupt time;
43 * PPP and the line discipline with stty echo on can call write on
44 * interrupt time and this would cause an oops if write slept
45 * - if keyspan_pda_write is in an interrupt, it will not call
46 * usb_control_msg (which sleeps) to query the room in the device
47 * buffer, it simply uses the current room value it has
48 * - if the urb is busy or if it is throttled keyspan_pda_write just
49 * returns 0, rather than sleeping to wait for this to change; the
50 * write_chan code in n_tty.c will sleep if needed before calling
51 * keyspan_pda_write again
52 * - if the device needs to be unthrottled, write now queues up the
53 * call to usb_control_msg (which sleeps) to unthrottle the device
54 * - the wakeups from keyspan_pda_write_bulk_callback are queued rather
55 * than done directly from the callback to avoid the race in write_chan
56 * - keyspan_pda_chars_in_buffer also indicates its buffer is full if the
57 * urb status is -EINPROGRESS, meaning it cannot write at the moment
60 * Added module_init and module_exit functions to handle the fact that this
61 * driver is a loadable module now.
64 * Split driver up into device specific pieces.
69 #include <linux/config.h>
70 #include <linux/kernel.h>
71 #include <linux/errno.h>
72 #include <linux/init.h>
73 #include <linux/slab.h>
74 #include <linux/tty.h>
75 #include <linux/tty_driver.h>
76 #include <linux/tty_flip.h>
77 #include <linux/module.h>
78 #include <linux/spinlock.h>
79 #include <linux/tqueue.h>
80 #include <asm/uaccess.h>
81 #include <linux/usb.h>
83 #ifdef CONFIG_USB_SERIAL_DEBUG
90 struct ezusb_hex_record {
96 /* make a simple define to handle if we are compiling keyspan_pda or xircom support */
97 #if defined(CONFIG_USB_SERIAL_KEYSPAN_PDA) || defined(CONFIG_USB_SERIAL_KEYSPAN_PDA_MODULE)
102 #if defined(CONFIG_USB_SERIAL_XIRCOM) || defined(CONFIG_USB_SERIAL_XIRCOM_MODULE)
109 #include "keyspan_pda_fw.h"
113 #include "xircom_pgs_fw.h"
116 #include "usb-serial.h"
119 * Version Information
121 #define DRIVER_VERSION "v1.1"
122 #define DRIVER_AUTHOR "Brian Warner <warner@lothar.com>"
123 #define DRIVER_DESC "USB Keyspan PDA Converter driver"
125 struct keyspan_pda_private {
128 struct tq_struct wakeup_task;
129 struct tq_struct unthrottle_task;
133 #define KEYSPAN_VENDOR_ID 0x06cd
134 #define KEYSPAN_PDA_FAKE_ID 0x0103
135 #define KEYSPAN_PDA_ID 0x0104 /* no clue */
137 /* For Xircom PGSDB9 and older Entregra version of the same device */
138 #define XIRCOM_VENDOR_ID 0x085a
139 #define XIRCOM_FAKE_ID 0x8027
140 #define ENTREGRA_VENDOR_ID 0x1645
141 #define ENTREGRA_FAKE_ID 0x8093
143 static __devinitdata struct usb_device_id id_table_combined [] = {
145 { USB_DEVICE(KEYSPAN_VENDOR_ID, KEYSPAN_PDA_FAKE_ID) },
148 { USB_DEVICE(XIRCOM_VENDOR_ID, XIRCOM_FAKE_ID) },
149 { USB_DEVICE(ENTREGRA_VENDOR_ID, ENTREGRA_FAKE_ID) },
151 { USB_DEVICE(KEYSPAN_VENDOR_ID, KEYSPAN_PDA_ID) },
152 { } /* Terminating entry */
155 MODULE_DEVICE_TABLE (usb, id_table_combined);
157 static struct usb_device_id id_table_std [] = {
158 { USB_DEVICE(KEYSPAN_VENDOR_ID, KEYSPAN_PDA_ID) },
159 { } /* Terminating entry */
163 static struct usb_device_id id_table_fake [] = {
164 { USB_DEVICE(KEYSPAN_VENDOR_ID, KEYSPAN_PDA_FAKE_ID) },
165 { } /* Terminating entry */
170 static struct usb_device_id id_table_fake_xircom [] = {
171 { USB_DEVICE(XIRCOM_VENDOR_ID, XIRCOM_FAKE_ID) },
172 { USB_DEVICE(ENTREGRA_VENDOR_ID, ENTREGRA_FAKE_ID) },
177 static void keyspan_pda_wakeup_write( struct usb_serial_port *port )
180 struct tty_struct *tty = port->tty;
182 /* wake up port processes */
183 wake_up_interruptible( &port->write_wait );
185 /* wake up line discipline */
189 static void keyspan_pda_request_unthrottle( struct usb_serial *serial )
193 dbg(" request_unthrottle");
194 /* ask the device to tell us when the tx buffer becomes
195 sufficiently empty */
196 result = usb_control_msg(serial->dev,
197 usb_sndctrlpipe(serial->dev, 0),
198 7, /* request_unthrottle */
199 USB_TYPE_VENDOR | USB_RECIP_INTERFACE
201 16, /* value: threshold */
207 dbg("%s - error %d from usb_control_msg",
208 __FUNCTION__, result);
212 static void keyspan_pda_rx_interrupt (struct urb *urb)
214 struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
215 struct usb_serial *serial;
216 struct tty_struct *tty;
217 unsigned char *data = urb->transfer_buffer;
219 struct keyspan_pda_private *priv;
220 priv = (struct keyspan_pda_private *)(port->private);
222 /* the urb might have been killed. */
226 if (port_paranoia_check (port, "keyspan_pda_rx_interrupt")) {
230 serial = port->serial;
231 if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) {
235 /* see if the message is data or a status interrupt */
238 /* rest of message is rx data */
239 if (urb->actual_length) {
240 tty = serial->port[0].tty;
241 for (i = 1; i < urb->actual_length ; ++i) {
242 tty_insert_flip_char(tty, data[i], 0);
244 tty_flip_buffer_push(tty);
248 /* status interrupt */
249 dbg(" rx int, d1=%d, d2=%d", data[1], data[2]);
251 case 1: /* modemline change */
253 case 2: /* tx unthrottle interrupt */
254 tty = serial->port[0].tty;
255 priv->tx_throttled = 0;
256 /* queue up a wakeup at scheduler time */
257 schedule_task(&priv->wakeup_task);
267 /* INT urbs are automatically re-submitted */
271 static void keyspan_pda_rx_throttle (struct usb_serial_port *port)
273 /* stop receiving characters. We just turn off the URB request, and
274 let chars pile up in the device. If we're doing hardware
275 flowcontrol, the device will signal the other end when its buffer
276 fills up. If we're doing XON/XOFF, this would be a good time to
277 send an XOFF, although it might make sense to foist that off
278 upon the device too. */
280 dbg("keyspan_pda_rx_throttle port %d", port->number);
281 usb_unlink_urb(port->interrupt_in_urb);
285 static void keyspan_pda_rx_unthrottle (struct usb_serial_port *port)
287 /* just restart the receive interrupt URB */
288 dbg("keyspan_pda_rx_unthrottle port %d", port->number);
289 port->interrupt_in_urb->dev = port->serial->dev;
290 if (usb_submit_urb(port->interrupt_in_urb))
291 dbg(" usb_submit_urb(read urb) failed");
296 static int keyspan_pda_setbaud (struct usb_serial *serial, int baud)
302 case 110: bindex = 0; break;
303 case 300: bindex = 1; break;
304 case 1200: bindex = 2; break;
305 case 2400: bindex = 3; break;
306 case 4800: bindex = 4; break;
307 case 9600: bindex = 5; break;
308 case 19200: bindex = 6; break;
309 case 38400: bindex = 7; break;
310 case 57600: bindex = 8; break;
311 case 115200: bindex = 9; break;
312 default: return -EINVAL;
315 /* rather than figure out how to sleep while waiting for this
316 to complete, I just use the "legacy" API. */
317 rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
320 | USB_RECIP_INTERFACE
321 | USB_DIR_OUT, /* type */
331 static void keyspan_pda_break_ctl (struct usb_serial_port *port, int break_state)
333 struct usb_serial *serial = port->serial;
337 if (break_state == -1)
338 value = 1; /* start break */
340 value = 0; /* clear break */
341 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
343 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT,
344 value, 0, NULL, 0, 2*HZ);
346 dbg("%s - error %d from usb_control_msg",
347 __FUNCTION__, result);
348 /* there is something funky about this.. the TCSBRK that 'cu' performs
349 ought to translate into a break_ctl(-1),break_ctl(0) pair HZ/4
350 seconds apart, but it feels like the break sent isn't as long as it
355 static void keyspan_pda_set_termios (struct usb_serial_port *port,
356 struct termios *old_termios)
358 struct usb_serial *serial = port->serial;
359 unsigned int cflag = port->tty->termios->c_cflag;
361 /* cflag specifies lots of stuff: number of stop bits, parity, number
362 of data bits, baud. What can the device actually handle?:
363 CSTOPB (1 stop bit or 2)
366 There is minimal hw support for parity (a PSW bit seems to hold the
367 parity of whatever is in the accumulator). The UART either deals
368 with 10 bits (start, 8 data, stop) or 11 bits (start, 8 data,
369 1 special, stop). So, with firmware changes, we could do:
371 8N2: 11 bit, extra bit always (mark?)
372 8[EOMS]1: 11 bit, extra bit is parity
373 7[EOMS]1: 10 bit, b0/b7 is parity
374 7[EOMS]2: 11 bit, b0/b7 is parity, extra bit always (mark?)
376 HW flow control is dictated by the tty->termios->c_cflags & CRTSCTS
379 For now, just do baud. */
381 switch (cflag & CBAUD) {
382 /* we could support more values here, just need to calculate
383 the necessary divisors in the firmware. <asm/termbits.h>
384 has the Bnnn constants. */
385 case B110: keyspan_pda_setbaud(serial, 110); break;
386 case B300: keyspan_pda_setbaud(serial, 300); break;
387 case B1200: keyspan_pda_setbaud(serial, 1200); break;
388 case B2400: keyspan_pda_setbaud(serial, 2400); break;
389 case B4800: keyspan_pda_setbaud(serial, 4800); break;
390 case B9600: keyspan_pda_setbaud(serial, 9600); break;
391 case B19200: keyspan_pda_setbaud(serial, 19200); break;
392 case B38400: keyspan_pda_setbaud(serial, 38400); break;
393 case B57600: keyspan_pda_setbaud(serial, 57600); break;
394 case B115200: keyspan_pda_setbaud(serial, 115200); break;
395 default: dbg("can't handle requested baud rate"); break;
400 /* modem control pins: DTR and RTS are outputs and can be controlled.
401 DCD, RI, DSR, CTS are inputs and can be read. All outputs can also be
402 read. The byte passed is: DTR(b7) DCD RI DSR CTS RTS(b2) unused unused */
404 static int keyspan_pda_get_modem_info(struct usb_serial *serial,
405 unsigned char *value)
409 rc = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
411 USB_TYPE_VENDOR|USB_RECIP_INTERFACE|USB_DIR_IN,
412 0, 0, &data, 1, 2*HZ);
419 static int keyspan_pda_set_modem_info(struct usb_serial *serial,
423 rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
425 USB_TYPE_VENDOR|USB_RECIP_INTERFACE|USB_DIR_OUT,
426 value, 0, NULL, 0, 2*HZ);
431 static int keyspan_pda_ioctl(struct usb_serial_port *port, struct file *file,
432 unsigned int cmd, unsigned long arg)
434 struct usb_serial *serial = port->serial;
437 unsigned char status, mask;
440 case TIOCMGET: /* get modem pins state */
441 rc = keyspan_pda_get_modem_info(serial, &status);
445 ((status & (1<<7)) ? TIOCM_DTR : 0) |
446 ((status & (1<<6)) ? TIOCM_CAR : 0) |
447 ((status & (1<<5)) ? TIOCM_RNG : 0) |
448 ((status & (1<<4)) ? TIOCM_DSR : 0) |
449 ((status & (1<<3)) ? TIOCM_CTS : 0) |
450 ((status & (1<<2)) ? TIOCM_RTS : 0);
451 if (copy_to_user((unsigned int *)arg, &value, sizeof(int)))
454 case TIOCMSET: /* set a state as returned by MGET */
455 if (copy_from_user(&value, (unsigned int *)arg, sizeof(int)))
458 ((value & TIOCM_DTR) ? (1<<7) : 0) |
459 ((value & TIOCM_CAR) ? (1<<6) : 0) |
460 ((value & TIOCM_RNG) ? (1<<5) : 0) |
461 ((value & TIOCM_DSR) ? (1<<4) : 0) |
462 ((value & TIOCM_CTS) ? (1<<3) : 0) |
463 ((value & TIOCM_RTS) ? (1<<2) : 0);
464 rc = keyspan_pda_set_modem_info(serial, status);
468 case TIOCMBIS: /* set bits in bitmask <arg> */
469 case TIOCMBIC: /* clear bits from bitmask <arg> */
470 if (copy_from_user(&value, (unsigned int *)arg, sizeof(int)))
472 rc = keyspan_pda_get_modem_info(serial, &status);
476 ((value & TIOCM_RTS) ? (1<<2) : 0) |
477 ((value & TIOCM_DTR) ? (1<<7) : 0);
482 rc = keyspan_pda_set_modem_info(serial, status);
487 /* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/
490 /* return count of modemline transitions */
497 static int keyspan_pda_write(struct usb_serial_port *port, int from_user,
498 const unsigned char *buf, int count)
500 struct usb_serial *serial = port->serial;
501 int request_unthrottle = 0;
503 struct keyspan_pda_private *priv;
505 priv = (struct keyspan_pda_private *)(port->private);
506 /* guess how much room is left in the device's ring buffer, and if we
507 want to send more than that, check first, updating our notion of
508 what is left. If our write will result in no room left, ask the
509 device to give us an interrupt when the room available rises above
510 a threshold, and hold off all writers (eventually, those using
511 select() or poll() too) until we receive that unthrottle interrupt.
512 Block if we can't write anything at all, otherwise write as much as
514 dbg("keyspan_pda_write(%d)",count);
516 dbg(" write request of 0 bytes");
520 /* we might block because of:
521 the TX urb is in-flight (wait until it completes)
522 the device is full (wait until it says there is room)
524 if (port->write_urb->status == -EINPROGRESS || priv->tx_throttled ) {
528 /* At this point the URB is in our control, nobody else can submit it
529 again (the only sudden transition was the one from EINPROGRESS to
530 finished). Also, the tx process is not throttled. So we are
533 count = (count > port->bulk_out_size) ? port->bulk_out_size : count;
535 /* Check if we might overrun the Tx buffer. If so, ask the
536 device how much room it really has. This is done only on
537 scheduler time, since usb_control_msg() sleeps. */
538 if (count > priv->tx_room && !in_interrupt()) {
540 rc = usb_control_msg(serial->dev,
541 usb_rcvctrlpipe(serial->dev, 0),
543 USB_TYPE_VENDOR | USB_RECIP_INTERFACE
545 0, /* value: 0 means "remaining room" */
551 dbg(" roomquery failed");
555 dbg(" roomquery returned 0 bytes");
556 rc = -EIO; /* device didn't return any data */
559 dbg(" roomquery says %d", room);
560 priv->tx_room = room;
562 if (count > priv->tx_room) {
563 /* we're about to completely fill the Tx buffer, so
564 we'll be throttled afterwards. */
565 count = priv->tx_room;
566 request_unthrottle = 1;
570 /* now transfer data */
572 if( copy_from_user(port->write_urb->transfer_buffer,
579 memcpy (port->write_urb->transfer_buffer, buf, count);
581 /* send the data out the bulk port */
582 port->write_urb->transfer_buffer_length = count;
584 priv->tx_room -= count;
586 port->write_urb->dev = port->serial->dev;
587 rc = usb_submit_urb(port->write_urb);
589 dbg(" usb_submit_urb(write bulk) failed");
594 /* There wasn't any room left, so we are throttled until
595 the buffer empties a bit */
596 request_unthrottle = 1;
599 if (request_unthrottle) {
600 priv->tx_throttled = 1; /* block writers */
601 schedule_task(&priv->unthrottle_task);
610 static void keyspan_pda_write_bulk_callback (struct urb *urb)
612 struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
613 struct usb_serial *serial;
614 struct keyspan_pda_private *priv;
616 priv = (struct keyspan_pda_private *)(port->private);
618 if (port_paranoia_check (port, "keyspan_pda_rx_interrupt")) {
622 serial = port->serial;
623 if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) {
627 /* queue up a wakeup at scheduler time */
628 schedule_task(&priv->wakeup_task);
632 static int keyspan_pda_write_room (struct usb_serial_port *port)
634 struct keyspan_pda_private *priv;
635 priv = (struct keyspan_pda_private *)(port->private);
637 /* used by n_tty.c for processing of tabs and such. Giving it our
638 conservative guess is probably good enough, but needs testing by
639 running a console through the device. */
641 return (priv->tx_room);
645 static int keyspan_pda_chars_in_buffer (struct usb_serial_port *port)
647 struct keyspan_pda_private *priv;
648 priv = (struct keyspan_pda_private *)(port->private);
650 /* when throttled, return at least WAKEUP_CHARS to tell select() (via
651 n_tty.c:normal_poll() ) that we're not writeable. */
652 if( port->write_urb->status == -EINPROGRESS || priv->tx_throttled )
658 static int keyspan_pda_open (struct usb_serial_port *port, struct file *filp)
660 struct usb_serial *serial = port->serial;
663 struct keyspan_pda_private *priv;
665 /* find out how much room is in the Tx ring */
666 rc = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
668 USB_TYPE_VENDOR | USB_RECIP_INTERFACE
676 dbg("%s - roomquery failed", __FUNCTION__);
680 dbg("%s - roomquery returned 0 bytes", __FUNCTION__);
684 priv = (struct keyspan_pda_private *)(port->private);
685 priv->tx_room = room;
686 priv->tx_throttled = room ? 0 : 1;
688 /* the normal serial device seems to always turn on DTR and RTS here,
690 if (port->tty->termios->c_cflag & CBAUD)
691 keyspan_pda_set_modem_info(serial, (1<<7) | (1<<2) );
693 keyspan_pda_set_modem_info(serial, 0);
695 /*Start reading from the device*/
696 port->interrupt_in_urb->dev = serial->dev;
697 rc = usb_submit_urb(port->interrupt_in_urb);
699 dbg("%s - usb_submit_urb(read int) failed", __FUNCTION__);
708 static void keyspan_pda_close(struct usb_serial_port *port, struct file *filp)
710 struct usb_serial *serial = port->serial;
713 /* the normal serial device seems to always shut off DTR and RTS now */
714 if (port->tty->termios->c_cflag & HUPCL)
715 keyspan_pda_set_modem_info(serial, 0);
717 /* shutdown our bulk reads and writes */
718 usb_unlink_urb (port->write_urb);
719 usb_unlink_urb (port->interrupt_in_urb);
724 /* download the firmware to a "fake" device (pre-renumeration) */
725 static int keyspan_pda_fake_startup (struct usb_serial *serial)
728 const struct ezusb_hex_record *record = NULL;
730 /* download the firmware here ... */
731 response = ezusb_set_reset(serial, 1);
734 if (serial->dev->descriptor.idVendor == KEYSPAN_VENDOR_ID)
735 record = &keyspan_pda_firmware[0];
738 if ((serial->dev->descriptor.idVendor == XIRCOM_VENDOR_ID) ||
739 (serial->dev->descriptor.idVendor == ENTREGRA_VENDOR_ID))
740 record = &xircom_pgs_firmware[0];
742 if (record == NULL) {
743 err("%s: unknown vendor, aborting.", __FUNCTION__);
747 while(record->address != 0xffff) {
748 response = ezusb_writememory(serial, record->address,
749 (unsigned char *)record->data,
750 record->data_size, 0xa0);
752 err("ezusb_writememory failed for Keyspan PDA "
753 "firmware (%d %04X %p %d)",
755 record->address, record->data, record->data_size);
760 /* bring device out of reset. Renumeration will occur in a moment
761 and the new device will bind to the real driver */
762 response = ezusb_set_reset(serial, 0);
764 /* we want this device to fail to have a driver assigned to it. */
768 static int keyspan_pda_startup (struct usb_serial *serial)
771 struct keyspan_pda_private *priv;
773 /* allocate the private data structures for all ports. Well, for all
776 priv = serial->port[0].private
777 = kmalloc(sizeof(struct keyspan_pda_private), GFP_KERNEL);
779 return (1); /* error */
780 init_waitqueue_head(&serial->port[0].write_wait);
781 INIT_LIST_HEAD(&priv->wakeup_task.list);
782 priv->wakeup_task.sync = 0;
783 priv->wakeup_task.routine = (void *)keyspan_pda_wakeup_write;
784 priv->wakeup_task.data = (void *)(&serial->port[0]);
785 INIT_LIST_HEAD(&priv->unthrottle_task.list);
786 priv->unthrottle_task.sync = 0;
787 priv->unthrottle_task.routine = (void *)keyspan_pda_request_unthrottle;
788 priv->unthrottle_task.data = (void *)(serial);
792 static void keyspan_pda_shutdown (struct usb_serial *serial)
794 dbg("%s", __FUNCTION__);
796 kfree(serial->port[0].private);
800 static struct usb_serial_device_type keyspan_pda_fake_device = {
801 .owner = THIS_MODULE,
802 .name = "Keyspan PDA - (prerenumeration)",
803 .id_table = id_table_fake,
804 .num_interrupt_in = NUM_DONT_CARE,
805 .num_bulk_in = NUM_DONT_CARE,
806 .num_bulk_out = NUM_DONT_CARE,
808 .startup = keyspan_pda_fake_startup,
813 static struct usb_serial_device_type xircom_pgs_fake_device = {
814 .owner = THIS_MODULE,
815 .name = "Xircom / Entregra PGS - (prerenumeration)",
816 .id_table = id_table_fake_xircom,
817 .num_interrupt_in = NUM_DONT_CARE,
818 .num_bulk_in = NUM_DONT_CARE,
819 .num_bulk_out = NUM_DONT_CARE,
821 .startup = keyspan_pda_fake_startup,
825 static struct usb_serial_device_type keyspan_pda_device = {
826 .owner = THIS_MODULE,
827 .name = "Keyspan PDA",
828 .id_table = id_table_std,
829 .num_interrupt_in = 1,
833 .open = keyspan_pda_open,
834 .close = keyspan_pda_close,
835 .write = keyspan_pda_write,
836 .write_room = keyspan_pda_write_room,
837 .write_bulk_callback = keyspan_pda_write_bulk_callback,
838 .read_int_callback = keyspan_pda_rx_interrupt,
839 .chars_in_buffer = keyspan_pda_chars_in_buffer,
840 .throttle = keyspan_pda_rx_throttle,
841 .unthrottle = keyspan_pda_rx_unthrottle,
842 .ioctl = keyspan_pda_ioctl,
843 .set_termios = keyspan_pda_set_termios,
844 .break_ctl = keyspan_pda_break_ctl,
845 .startup = keyspan_pda_startup,
846 .shutdown = keyspan_pda_shutdown,
850 static int __init keyspan_pda_init (void)
852 usb_serial_register (&keyspan_pda_device);
854 usb_serial_register (&keyspan_pda_fake_device);
857 usb_serial_register (&xircom_pgs_fake_device);
859 info(DRIVER_DESC " " DRIVER_VERSION);
864 static void __exit keyspan_pda_exit (void)
866 usb_serial_deregister (&keyspan_pda_device);
868 usb_serial_deregister (&keyspan_pda_fake_device);
871 usb_serial_deregister (&xircom_pgs_fake_device);
876 module_init(keyspan_pda_init);
877 module_exit(keyspan_pda_exit);
879 MODULE_AUTHOR( DRIVER_AUTHOR );
880 MODULE_DESCRIPTION( DRIVER_DESC );
881 MODULE_LICENSE("GPL");
883 MODULE_PARM(debug, "i");
884 MODULE_PARM_DESC(debug, "Debug enabled or not");