ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / usb / serial / ipaq.c
1 /*
2  * USB Compaq iPAQ driver
3  *
4  *      Copyright (C) 2001 - 2002
5  *          Ganesh Varadarajan <ganesh@veritas.com>
6  *
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.
11  *
12  * (12/12/2002) ganesh
13  *      Added support for practically all devices supported by ActiveSync
14  *      on Windows. Thanks to Wes Cilldhaire <billybobjoehenrybob@hotmail.com>.
15  *
16  * (26/11/2002) ganesh
17  *      Added insmod options to specify product and vendor id.
18  *      Use modprobe ipaq vendor=0xfoo product=0xbar
19  *
20  * (26/7/2002) ganesh
21  *      Fixed up broken error handling in ipaq_open. Retry the "kickstart"
22  *      packet much harder - this drastically reduces connection failures.
23  *
24  * (30/4/2002) ganesh
25  *      Added support for the Casio EM500. Completely untested. Thanks
26  *      to info from Nathan <wfilardo@fuse.net>
27  *
28  * (19/3/2002) ganesh
29  *      Don't submit urbs while holding spinlocks. Not strictly necessary
30  *      in 2.5.x.
31  *
32  * (8/3/2002) ganesh
33  *      The ipaq sometimes emits a '\0' before the CLIENT string. At this
34  *      point of time, the ppp ldisc is not yet attached to the tty, so
35  *      n_tty echoes "^ " to the ipaq, which messes up the chat. In 2.5.6-pre2
36  *      this causes a panic because echo_char() tries to sleep in interrupt
37  *      context.
38  *      The fix is to tell the upper layers that this is a raw device so that
39  *      echoing is suppressed. Thanks to Lyle Lindholm for a detailed bug
40  *      report.
41  *
42  * (25/2/2002) ganesh
43  *      Added support for the HP Jornada 548 and 568. Completely untested.
44  *      Thanks to info from Heath Robinson and Arieh Davidoff.
45  */
46
47 #include <linux/config.h>
48 #include <linux/kernel.h>
49 #include <linux/errno.h>
50 #include <linux/init.h>
51 #include <linux/slab.h>
52 #include <linux/tty.h>
53 #include <linux/tty_driver.h>
54 #include <linux/tty_flip.h>
55 #include <linux/module.h>
56 #include <linux/spinlock.h>
57 #include <asm/uaccess.h>
58 #include <linux/usb.h>
59
60 #ifdef CONFIG_USB_SERIAL_DEBUG
61         static int debug = 1;
62 #else
63         static int debug = 0;
64 #endif
65
66 #include "usb-serial.h"
67 #include "ipaq.h"
68
69 #define KP_RETRIES      100
70
71 /*
72  * Version Information
73  */
74
75 #define DRIVER_VERSION "v0.5"
76 #define DRIVER_AUTHOR "Ganesh Varadarajan <ganesh@veritas.com>"
77 #define DRIVER_DESC "USB PocketPC PDA driver"
78
79 static int      product, vendor;
80
81 /* Function prototypes for an ipaq */
82 static int  ipaq_open (struct usb_serial_port *port, struct file *filp);
83 static void ipaq_close (struct usb_serial_port *port, struct file *filp);
84 static int  ipaq_startup (struct usb_serial *serial);
85 static void ipaq_shutdown (struct usb_serial *serial);
86 static int ipaq_write(struct usb_serial_port *port, int from_user, const unsigned char *buf,
87                        int count);
88 static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const unsigned char *buf,
89                            int count);
90 static void ipaq_write_gather(struct usb_serial_port *port);
91 static void ipaq_read_bulk_callback (struct urb *urb, struct pt_regs *regs);
92 static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs);
93 static int ipaq_write_room(struct usb_serial_port *port);
94 static int ipaq_chars_in_buffer(struct usb_serial_port *port);
95 static void ipaq_destroy_lists(struct usb_serial_port *port);
96
97
98 static struct usb_device_id ipaq_id_table [] = {
99         /* The first entry is a placeholder for the insmod-specified device */
100         { USB_DEVICE(COMPAQ_VENDOR_ID, COMPAQ_IPAQ_ID) },
101         { USB_DEVICE(ASKEY_VENDOR_ID, ASKEY_PRODUCT_ID) },
102         { USB_DEVICE(BCOM_VENDOR_ID, BCOM_0065_ID) },
103         { USB_DEVICE(BCOM_VENDOR_ID, BCOM_0066_ID) },
104         { USB_DEVICE(BCOM_VENDOR_ID, BCOM_0067_ID) },
105         { USB_DEVICE(CASIO_VENDOR_ID, CASIO_2001_ID) },
106         { USB_DEVICE(CASIO_VENDOR_ID, CASIO_EM500_ID) },
107         { USB_DEVICE(COMPAQ_VENDOR_ID, COMPAQ_IPAQ_ID) },
108         { USB_DEVICE(COMPAQ_VENDOR_ID, COMPAQ_0032_ID) },
109         { USB_DEVICE(DELL_VENDOR_ID, DELL_AXIM_ID) },
110         { USB_DEVICE(FSC_VENDOR_ID, FSC_LOOX_ID) },
111         { USB_DEVICE(HP_VENDOR_ID, HP_JORNADA_548_ID) },
112         { USB_DEVICE(HP_VENDOR_ID, HP_JORNADA_568_ID) },
113         { USB_DEVICE(HP_VENDOR_ID, HP_2016_ID) },
114         { USB_DEVICE(HP_VENDOR_ID, HP_2116_ID) },
115         { USB_DEVICE(HP_VENDOR_ID, HP_2216_ID) },
116         { USB_DEVICE(HP_VENDOR_ID, HP_3016_ID) },
117         { USB_DEVICE(HP_VENDOR_ID, HP_3116_ID) },
118         { USB_DEVICE(HP_VENDOR_ID, HP_3216_ID) },
119         { USB_DEVICE(HP_VENDOR_ID, HP_4016_ID) },
120         { USB_DEVICE(HP_VENDOR_ID, HP_4116_ID) },
121         { USB_DEVICE(HP_VENDOR_ID, HP_4216_ID) },
122         { USB_DEVICE(HP_VENDOR_ID, HP_5016_ID) },
123         { USB_DEVICE(HP_VENDOR_ID, HP_5116_ID) },
124         { USB_DEVICE(HP_VENDOR_ID, HP_5216_ID) },
125         { USB_DEVICE(LINKUP_VENDOR_ID, LINKUP_PRODUCT_ID) },
126         { USB_DEVICE(MICROSOFT_VENDOR_ID, MICROSOFT_00CE_ID) },
127         { USB_DEVICE(PORTATEC_VENDOR_ID, PORTATEC_PRODUCT_ID) },
128         { USB_DEVICE(ROVER_VENDOR_ID, ROVER_P5_ID) },
129         { USB_DEVICE(SAGEM_VENDOR_ID, SAGEM_WIRELESS_ID) },
130         { USB_DEVICE(SOCKET_VENDOR_ID, SOCKET_PRODUCT_ID) },
131         { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_ID) },
132         { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_E310_ID) },
133         { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_E740_ID) },
134         { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_E335_ID) },
135         { USB_DEVICE(HTC_VENDOR_ID, HTC_PRODUCT_ID) },
136         { USB_DEVICE(NEC_VENDOR_ID, NEC_PRODUCT_ID) },
137         { USB_DEVICE(ASUS_VENDOR_ID, ASUS_A600_PRODUCT_ID) },
138         { }                                     /* Terminating entry */
139 };
140
141 MODULE_DEVICE_TABLE (usb, ipaq_id_table);
142
143 static struct usb_driver ipaq_driver = {
144         .owner =        THIS_MODULE,
145         .name =         "ipaq",
146         .probe =        usb_serial_probe,
147         .disconnect =   usb_serial_disconnect,
148         .id_table =     ipaq_id_table,
149 };
150
151
152 /* All of the device info needed for the Compaq iPAQ */
153 struct usb_serial_device_type ipaq_device = {
154         .owner =                THIS_MODULE,
155         .name =                 "PocketPC PDA",
156         .id_table =             ipaq_id_table,
157         .num_interrupt_in =     NUM_DONT_CARE,
158         .num_bulk_in =          1,
159         .num_bulk_out =         1,
160         .num_ports =            1,
161         .open =                 ipaq_open,
162         .close =                ipaq_close,
163         .attach =               ipaq_startup,
164         .shutdown =             ipaq_shutdown,
165         .write =                ipaq_write,
166         .write_room =           ipaq_write_room,
167         .chars_in_buffer =      ipaq_chars_in_buffer,
168         .read_bulk_callback =   ipaq_read_bulk_callback,
169         .write_bulk_callback =  ipaq_write_bulk_callback,
170 };
171
172 static spinlock_t       write_list_lock;
173 static int              bytes_in;
174 static int              bytes_out;
175
176 static int ipaq_open(struct usb_serial_port *port, struct file *filp)
177 {
178         struct usb_serial       *serial = port->serial;
179         struct ipaq_private     *priv;
180         struct ipaq_packet      *pkt;
181         int                     i, result = 0;
182         int                     retries = KP_RETRIES;
183
184         if (port_paranoia_check(port, __FUNCTION__)) {
185                 return -ENODEV;
186         }
187         
188         dbg("%s - port %d", __FUNCTION__, port->number);
189
190         bytes_in = 0;
191         bytes_out = 0;
192         priv = (struct ipaq_private *)kmalloc(sizeof(struct ipaq_private), GFP_KERNEL);
193         if (priv == NULL) {
194                 err("%s - Out of memory", __FUNCTION__);
195                 return -ENOMEM;
196         }
197         usb_set_serial_port_data(port, priv);
198         priv->active = 0;
199         priv->queue_len = 0;
200         INIT_LIST_HEAD(&priv->queue);
201         INIT_LIST_HEAD(&priv->freelist);
202
203         for (i = 0; i < URBDATA_QUEUE_MAX / PACKET_SIZE; i++) {
204                 pkt = kmalloc(sizeof(struct ipaq_packet), GFP_KERNEL);
205                 if (pkt == NULL) {
206                         goto enomem;
207                 }
208                 pkt->data = kmalloc(PACKET_SIZE, GFP_KERNEL);
209                 if (pkt->data == NULL) {
210                         kfree(pkt);
211                         goto enomem;
212                 }
213                 pkt->len = 0;
214                 pkt->written = 0;
215                 INIT_LIST_HEAD(&pkt->list);
216                 list_add(&pkt->list, &priv->freelist);
217                 priv->free_len += PACKET_SIZE;
218         }
219
220         /*
221          * Force low latency on. This will immediately push data to the line
222          * discipline instead of queueing.
223          */
224
225         port->tty->low_latency = 1;
226         port->tty->raw = 1;
227         port->tty->real_raw = 1;
228
229         /*
230          * Lose the small buffers usbserial provides. Make larger ones.
231          */
232
233         kfree(port->bulk_in_buffer);
234         kfree(port->bulk_out_buffer);
235         port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
236         if (port->bulk_in_buffer == NULL) {
237                 goto enomem;
238         }
239         port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
240         if (port->bulk_out_buffer == NULL) {
241                 kfree(port->bulk_in_buffer);
242                 goto enomem;
243         }
244         port->read_urb->transfer_buffer = port->bulk_in_buffer;
245         port->write_urb->transfer_buffer = port->bulk_out_buffer;
246         port->read_urb->transfer_buffer_length = URBDATA_SIZE;
247         port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE;
248         
249         /* Start reading from the device */
250         usb_fill_bulk_urb(port->read_urb, serial->dev, 
251                       usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
252                       port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
253                       ipaq_read_bulk_callback, port);
254         result = usb_submit_urb(port->read_urb, GFP_KERNEL);
255         if (result) {
256                 err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
257                 goto error;
258         }
259
260         /*
261          * Send out control message observed in win98 sniffs. Not sure what
262          * it does, but from empirical observations, it seems that the device
263          * will start the chat sequence once one of these messages gets
264          * through. Since this has a reasonably high failure rate, we retry
265          * several times.
266          */
267
268         while (retries--) {
269                 result = usb_control_msg(serial->dev,
270                                 usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21,
271                                 0x1, 0, NULL, 0, HZ / 10 + 1);
272                 if (result == 0) {
273                         return 0;
274                 }
275         }
276         err("%s - failed doing control urb, error %d", __FUNCTION__, result);
277         goto error;
278
279 enomem:
280         result = -ENOMEM;
281         err("%s - Out of memory", __FUNCTION__);
282 error:
283         ipaq_destroy_lists(port);
284         kfree(priv);
285         return result;
286 }
287
288
289 static void ipaq_close(struct usb_serial_port *port, struct file *filp)
290 {
291         struct usb_serial       *serial;
292         struct ipaq_private     *priv = usb_get_serial_port_data(port);
293
294         if (port_paranoia_check(port, __FUNCTION__)) {
295                 return; 
296         }
297         
298         dbg("%s - port %d", __FUNCTION__, port->number);
299                          
300         serial = get_usb_serial(port, __FUNCTION__);
301         if (!serial)
302                 return;
303
304         /*
305          * shut down bulk read and write
306          */
307
308         usb_unlink_urb(port->write_urb);
309         usb_unlink_urb(port->read_urb);
310         ipaq_destroy_lists(port);
311         kfree(priv);
312         usb_set_serial_port_data(port, NULL);
313
314         /* Uncomment the following line if you want to see some statistics in your syslog */
315         /* info ("Bytes In = %d  Bytes Out = %d", bytes_in, bytes_out); */
316 }
317
318 static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs)
319 {
320         struct usb_serial_port  *port = (struct usb_serial_port *)urb->context;
321         struct usb_serial       *serial = get_usb_serial (port, __FUNCTION__);
322         struct tty_struct       *tty;
323         unsigned char           *data = urb->transfer_buffer;
324         int                     i, result;
325
326         if (port_paranoia_check(port, __FUNCTION__))
327                 return;
328
329         dbg("%s - port %d", __FUNCTION__, port->number);
330
331         if (!serial) {
332                 dbg("%s - bad serial pointer, exiting", __FUNCTION__);
333                 return;
334         }
335
336         if (urb->status) {
337                 dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
338                 return;
339         }
340
341         usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
342
343         tty = port->tty;
344         if (tty && urb->actual_length) {
345                 for (i = 0; i < urb->actual_length ; ++i) {
346                         /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */
347                         if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
348                                 tty_flip_buffer_push(tty);
349                         }
350                         /* this doesn't actually push the data through unless tty->low_latency is set */
351                         tty_insert_flip_char(tty, data[i], 0);
352                 }
353                 tty_flip_buffer_push(tty);
354                 bytes_in += urb->actual_length;
355         }
356
357         /* Continue trying to always read  */
358         usb_fill_bulk_urb(port->read_urb, serial->dev, 
359                       usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
360                       port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
361                       ipaq_read_bulk_callback, port);
362         result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
363         if (result)
364                 err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
365         return;
366 }
367
368 static int ipaq_write(struct usb_serial_port *port, int from_user, const unsigned char *buf,
369                        int count)
370 {
371         const unsigned char     *current_position = buf;
372         int                     bytes_sent = 0;
373         int                     transfer_size;
374
375         dbg("%s - port %d", __FUNCTION__, port->number);
376
377         while (count > 0) {
378                 transfer_size = min(count, PACKET_SIZE);
379                 if (ipaq_write_bulk(port, from_user, current_position, transfer_size)) {
380                         break;
381                 }
382                 current_position += transfer_size;
383                 bytes_sent += transfer_size;
384                 count -= transfer_size;
385                 bytes_out += transfer_size;
386         }
387
388         return bytes_sent;
389
390
391 static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const unsigned char *buf,
392                            int count)
393 {
394         struct ipaq_private     *priv = usb_get_serial_port_data(port);
395         struct ipaq_packet      *pkt = NULL;
396         int                     result = 0;
397         unsigned long           flags;
398
399         if (priv->free_len <= 0) {
400                 dbg("%s - we're stuffed", __FUNCTION__);
401                 return -EAGAIN;
402         }
403
404         spin_lock_irqsave(&write_list_lock, flags);
405         if (!list_empty(&priv->freelist)) {
406                 pkt = list_entry(priv->freelist.next, struct ipaq_packet, list);
407                 list_del(&pkt->list);
408                 priv->free_len -= PACKET_SIZE;
409         }
410         spin_unlock_irqrestore(&write_list_lock, flags);
411         if (pkt == NULL) {
412                 dbg("%s - we're stuffed", __FUNCTION__);
413                 return -EAGAIN;
414         }
415
416         if (from_user) {
417                 if (copy_from_user(pkt->data, buf, count))
418                         return -EFAULT;
419         } else {
420                 memcpy(pkt->data, buf, count);
421         }
422         usb_serial_debug_data(__FILE__, __FUNCTION__, count, pkt->data);
423
424         pkt->len = count;
425         pkt->written = 0;
426         spin_lock_irqsave(&write_list_lock, flags);
427         list_add_tail(&pkt->list, &priv->queue);
428         priv->queue_len += count;
429         if (priv->active == 0) {
430                 priv->active = 1;
431                 ipaq_write_gather(port);
432                 spin_unlock_irqrestore(&write_list_lock, flags);
433                 result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
434                 if (result) {
435                         err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
436                 }
437         } else {
438                 spin_unlock_irqrestore(&write_list_lock, flags);
439         }
440         return result;
441 }
442
443 static void ipaq_write_gather(struct usb_serial_port *port)
444 {
445         struct ipaq_private     *priv = usb_get_serial_port_data(port);
446         struct usb_serial       *serial = port->serial;
447         int                     count, room;
448         struct ipaq_packet      *pkt;
449         struct urb              *urb = port->write_urb;
450         struct list_head        *tmp;
451
452         if (urb->status == -EINPROGRESS) {
453                 /* Should never happen */
454                 err("%s - flushing while urb is active !", __FUNCTION__);
455                 return;
456         }
457         room = URBDATA_SIZE;
458         for (tmp = priv->queue.next; tmp != &priv->queue;) {
459                 pkt = list_entry(tmp, struct ipaq_packet, list);
460                 tmp = tmp->next;
461                 count = min(room, (int)(pkt->len - pkt->written));
462                 memcpy(urb->transfer_buffer + (URBDATA_SIZE - room),
463                        pkt->data + pkt->written, count);
464                 room -= count;
465                 pkt->written += count;
466                 priv->queue_len -= count;
467                 if (pkt->written == pkt->len) {
468                         list_move(&pkt->list, &priv->freelist);
469                         priv->free_len += PACKET_SIZE;
470                 }
471                 if (room == 0) {
472                         break;
473                 }
474         }
475
476         count = URBDATA_SIZE - room;
477         usb_fill_bulk_urb(port->write_urb, serial->dev, 
478                       usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress),
479                       port->write_urb->transfer_buffer, count, ipaq_write_bulk_callback,
480                       port);
481         return;
482 }
483
484 static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs)
485 {
486         struct usb_serial_port  *port = (struct usb_serial_port *)urb->context;
487         struct ipaq_private     *priv = usb_get_serial_port_data(port);
488         unsigned long           flags;
489         int                     result;
490
491         if (port_paranoia_check (port, __FUNCTION__)) {
492                 return;
493         }
494         
495         dbg("%s - port %d", __FUNCTION__, port->number);
496         
497         if (urb->status) {
498                 dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
499         }
500
501         spin_lock_irqsave(&write_list_lock, flags);
502         if (!list_empty(&priv->queue)) {
503                 ipaq_write_gather(port);
504                 spin_unlock_irqrestore(&write_list_lock, flags);
505                 result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
506                 if (result) {
507                         err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
508                 }
509         } else {
510                 priv->active = 0;
511                 spin_unlock_irqrestore(&write_list_lock, flags);
512         }
513
514         schedule_work(&port->work);
515 }
516
517 static int ipaq_write_room(struct usb_serial_port *port)
518 {
519         struct ipaq_private     *priv = usb_get_serial_port_data(port);
520
521         dbg("%s - freelen %d", __FUNCTION__, priv->free_len);
522         return priv->free_len;
523 }
524
525 static int ipaq_chars_in_buffer(struct usb_serial_port *port)
526 {
527         struct ipaq_private     *priv = usb_get_serial_port_data(port);
528
529         dbg("%s - queuelen %d", __FUNCTION__, priv->queue_len);
530         return priv->queue_len;
531 }
532
533 static void ipaq_destroy_lists(struct usb_serial_port *port)
534 {
535         struct ipaq_private     *priv = usb_get_serial_port_data(port);
536         struct list_head        *tmp;
537         struct ipaq_packet      *pkt;
538
539         for (tmp = priv->queue.next; tmp != &priv->queue;) {
540                 pkt = list_entry(tmp, struct ipaq_packet, list);
541                 tmp = tmp->next;
542                 kfree(pkt->data);
543                 kfree(pkt);
544         }
545         for (tmp = priv->freelist.next; tmp != &priv->freelist;) {
546                 pkt = list_entry(tmp, struct ipaq_packet, list);
547                 tmp = tmp->next;
548                 kfree(pkt->data);
549                 kfree(pkt);
550         }
551         return;
552 }
553
554
555 static int ipaq_startup(struct usb_serial *serial)
556 {
557         dbg("%s", __FUNCTION__);
558         if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
559                 err("active config #%d != 1 ??",
560                         serial->dev->actconfig->desc.bConfigurationValue);
561                 return -ENODEV;
562         }
563         return usb_reset_configuration (serial->dev);
564 }
565
566 static void ipaq_shutdown(struct usb_serial *serial)
567 {
568         dbg("%s", __FUNCTION__);
569 }
570
571 static int __init ipaq_init(void)
572 {
573         int retval;
574         spin_lock_init(&write_list_lock);
575         retval = usb_serial_register(&ipaq_device);
576         if (retval) 
577                 goto failed_usb_serial_register;
578         info(DRIVER_DESC " " DRIVER_VERSION);
579         if (vendor) {
580                 ipaq_id_table[0].idVendor = vendor;
581                 ipaq_id_table[0].idProduct = product;
582         }
583         retval = usb_register(&ipaq_driver);
584         if (retval)
585                 goto failed_usb_register;
586                   
587         return 0;
588 failed_usb_register:
589         usb_serial_deregister(&ipaq_device);
590 failed_usb_serial_register:
591         return retval;
592 }
593
594
595 static void __exit ipaq_exit(void)
596 {
597         usb_deregister(&ipaq_driver);
598         usb_serial_deregister(&ipaq_device);
599 }
600
601
602 module_init(ipaq_init);
603 module_exit(ipaq_exit);
604
605 MODULE_AUTHOR( DRIVER_AUTHOR );
606 MODULE_DESCRIPTION( DRIVER_DESC );
607 MODULE_LICENSE("GPL");
608
609 MODULE_PARM(debug, "i");
610 MODULE_PARM_DESC(debug, "Debug enabled or not");
611
612 MODULE_PARM(vendor, "h");
613 MODULE_PARM_DESC(vendor, "User specified USB idVendor");
614
615 MODULE_PARM(product, "h");
616 MODULE_PARM_DESC(product, "User specified USB idProduct");