aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/kl5kusb105.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/kl5kusb105.c')
-rw-r--r--drivers/usb/serial/kl5kusb105.c79
1 files changed, 33 insertions, 46 deletions
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index cc0ba38d4748..ad168255cc04 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -107,7 +107,7 @@ static struct usb_driver kl5kusb105d_driver = {
107 .probe = usb_serial_probe, 107 .probe = usb_serial_probe,
108 .disconnect = usb_serial_disconnect, 108 .disconnect = usb_serial_disconnect,
109 .id_table = id_table, 109 .id_table = id_table,
110 .no_dynamic_id = 1, 110 .no_dynamic_id = 1,
111}; 111};
112 112
113static struct usb_serial_driver kl5kusb105d_device = { 113static struct usb_serial_driver kl5kusb105d_device = {
@@ -115,26 +115,26 @@ static struct usb_serial_driver kl5kusb105d_device = {
115 .owner = THIS_MODULE, 115 .owner = THIS_MODULE,
116 .name = "kl5kusb105d", 116 .name = "kl5kusb105d",
117 }, 117 },
118 .description = "KL5KUSB105D / PalmConnect", 118 .description = "KL5KUSB105D / PalmConnect",
119 .usb_driver = &kl5kusb105d_driver, 119 .usb_driver = &kl5kusb105d_driver,
120 .id_table = id_table, 120 .id_table = id_table,
121 .num_ports = 1, 121 .num_ports = 1,
122 .open = klsi_105_open, 122 .open = klsi_105_open,
123 .close = klsi_105_close, 123 .close = klsi_105_close,
124 .write = klsi_105_write, 124 .write = klsi_105_write,
125 .write_bulk_callback = klsi_105_write_bulk_callback, 125 .write_bulk_callback = klsi_105_write_bulk_callback,
126 .chars_in_buffer = klsi_105_chars_in_buffer, 126 .chars_in_buffer = klsi_105_chars_in_buffer,
127 .write_room = klsi_105_write_room, 127 .write_room = klsi_105_write_room,
128 .read_bulk_callback = klsi_105_read_bulk_callback, 128 .read_bulk_callback = klsi_105_read_bulk_callback,
129 .set_termios = klsi_105_set_termios, 129 .set_termios = klsi_105_set_termios,
130 /*.break_ctl = klsi_105_break_ctl,*/ 130 /*.break_ctl = klsi_105_break_ctl,*/
131 .tiocmget = klsi_105_tiocmget, 131 .tiocmget = klsi_105_tiocmget,
132 .tiocmset = klsi_105_tiocmset, 132 .tiocmset = klsi_105_tiocmset,
133 .attach = klsi_105_startup, 133 .attach = klsi_105_startup,
134 .disconnect = klsi_105_disconnect, 134 .disconnect = klsi_105_disconnect,
135 .release = klsi_105_release, 135 .release = klsi_105_release,
136 .throttle = klsi_105_throttle, 136 .throttle = klsi_105_throttle,
137 .unthrottle = klsi_105_unthrottle, 137 .unthrottle = klsi_105_unthrottle,
138}; 138};
139 139
140struct klsi_105_port_settings { 140struct klsi_105_port_settings {
@@ -189,7 +189,7 @@ static int klsi_105_chg_port_settings(struct usb_serial_port *port,
189 settings->pktlen, settings->baudrate, settings->databits, 189 settings->pktlen, settings->baudrate, settings->databits,
190 settings->unknown1, settings->unknown2); 190 settings->unknown1, settings->unknown2);
191 return rc; 191 return rc;
192} /* klsi_105_chg_port_settings */ 192}
193 193
194/* translate a 16-bit status value from the device to linux's TIO bits */ 194/* translate a 16-bit status value from the device to linux's TIO bits */
195static unsigned long klsi_105_status2linestate(const __u16 status) 195static unsigned long klsi_105_status2linestate(const __u16 status)
@@ -202,6 +202,7 @@ static unsigned long klsi_105_status2linestate(const __u16 status)
202 202
203 return res; 203 return res;
204} 204}
205
205/* 206/*
206 * Read line control via vendor command and return result through 207 * Read line control via vendor command and return result through
207 * *line_state_p 208 * *line_state_p
@@ -325,8 +326,7 @@ err_cleanup:
325 usb_set_serial_port_data(serial->port[i], NULL); 326 usb_set_serial_port_data(serial->port[i], NULL);
326 } 327 }
327 return -ENOMEM; 328 return -ENOMEM;
328} /* klsi_105_startup */ 329}
329
330 330
331static void klsi_105_disconnect(struct usb_serial *serial) 331static void klsi_105_disconnect(struct usb_serial *serial)
332{ 332{
@@ -352,8 +352,7 @@ static void klsi_105_disconnect(struct usb_serial *serial)
352 } 352 }
353 } 353 }
354 } 354 }
355} /* klsi_105_disconnect */ 355}
356
357 356
358static void klsi_105_release(struct usb_serial *serial) 357static void klsi_105_release(struct usb_serial *serial)
359{ 358{
@@ -367,7 +366,7 @@ static void klsi_105_release(struct usb_serial *serial)
367 366
368 kfree(priv); 367 kfree(priv);
369 } 368 }
370} /* klsi_105_release */ 369}
371 370
372static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port) 371static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)
373{ 372{
@@ -461,8 +460,7 @@ static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)
461exit: 460exit:
462 kfree(cfg); 461 kfree(cfg);
463 return retval; 462 return retval;
464} /* klsi_105_open */ 463}
465
466 464
467static void klsi_105_close(struct usb_serial_port *port) 465static void klsi_105_close(struct usb_serial_port *port)
468{ 466{
@@ -498,8 +496,7 @@ static void klsi_105_close(struct usb_serial_port *port)
498 dev_info(&port->serial->dev->dev, 496 dev_info(&port->serial->dev->dev,
499 "port stats: %ld bytes in, %ld bytes out\n", 497 "port stats: %ld bytes in, %ld bytes out\n",
500 priv->bytes_in, priv->bytes_out); 498 priv->bytes_in, priv->bytes_out);
501} /* klsi_105_close */ 499}
502
503 500
504/* We need to write a complete 64-byte data block and encode the 501/* We need to write a complete 64-byte data block and encode the
505 * number actually sent in the first double-byte, LSB-order. That 502 * number actually sent in the first double-byte, LSB-order. That
@@ -507,7 +504,6 @@ static void klsi_105_close(struct usb_serial_port *port)
507 */ 504 */
508#define KLSI_105_DATA_OFFSET 2 /* in the bulk urb data block */ 505#define KLSI_105_DATA_OFFSET 2 /* in the bulk urb data block */
509 506
510
511static int klsi_105_write(struct tty_struct *tty, 507static int klsi_105_write(struct tty_struct *tty,
512 struct usb_serial_port *port, const unsigned char *buf, int count) 508 struct usb_serial_port *port, const unsigned char *buf, int count)
513{ 509{
@@ -586,7 +582,7 @@ exit:
586 priv->bytes_out += bytes_sent; 582 priv->bytes_out += bytes_sent;
587 583
588 return bytes_sent; /* that's how much we wrote */ 584 return bytes_sent; /* that's how much we wrote */
589} /* klsi_105_write */ 585}
590 586
591static void klsi_105_write_bulk_callback(struct urb *urb) 587static void klsi_105_write_bulk_callback(struct urb *urb)
592{ 588{
@@ -602,8 +598,7 @@ static void klsi_105_write_bulk_callback(struct urb *urb)
602 } 598 }
603 599
604 usb_serial_port_softint(port); 600 usb_serial_port_softint(port);
605} /* klsi_105_write_bulk_completion_callback */ 601}
606
607 602
608/* return number of characters currently in the writing process */ 603/* return number of characters currently in the writing process */
609static int klsi_105_chars_in_buffer(struct tty_struct *tty) 604static int klsi_105_chars_in_buffer(struct tty_struct *tty)
@@ -647,8 +642,6 @@ static int klsi_105_write_room(struct tty_struct *tty)
647 return room; 642 return room;
648} 643}
649 644
650
651
652static void klsi_105_read_bulk_callback(struct urb *urb) 645static void klsi_105_read_bulk_callback(struct urb *urb)
653{ 646{
654 struct usb_serial_port *port = urb->context; 647 struct usb_serial_port *port = urb->context;
@@ -720,8 +713,7 @@ static void klsi_105_read_bulk_callback(struct urb *urb)
720 dev_err(&port->dev, 713 dev_err(&port->dev,
721 "%s - failed resubmitting read urb, error %d\n", 714 "%s - failed resubmitting read urb, error %d\n",
722 __func__, rc); 715 __func__, rc);
723} /* klsi_105_read_bulk_callback */ 716}
724
725 717
726static void klsi_105_set_termios(struct tty_struct *tty, 718static void klsi_105_set_termios(struct tty_struct *tty,
727 struct usb_serial_port *port, 719 struct usb_serial_port *port,
@@ -888,8 +880,7 @@ static void klsi_105_set_termios(struct tty_struct *tty,
888 klsi_105_chg_port_settings(port, cfg); 880 klsi_105_chg_port_settings(port, cfg);
889err: 881err:
890 kfree(cfg); 882 kfree(cfg);
891} /* klsi_105_set_termios */ 883}
892
893 884
894#if 0 885#if 0
895static void mct_u232_break_ctl(struct tty_struct *tty, int break_state) 886static void mct_u232_break_ctl(struct tty_struct *tty, int break_state)
@@ -907,7 +898,7 @@ static void mct_u232_break_ctl(struct tty_struct *tty, int break_state)
907 lcr |= MCT_U232_SET_BREAK; 898 lcr |= MCT_U232_SET_BREAK;
908 899
909 mct_u232_set_line_ctrl(serial, lcr); 900 mct_u232_set_line_ctrl(serial, lcr);
910} /* mct_u232_break_ctl */ 901}
911#endif 902#endif
912 903
913static int klsi_105_tiocmget(struct tty_struct *tty, struct file *file) 904static int klsi_105_tiocmget(struct tty_struct *tty, struct file *file)
@@ -986,7 +977,6 @@ static void klsi_105_unthrottle(struct tty_struct *tty)
986} 977}
987 978
988 979
989
990static int __init klsi_105_init(void) 980static int __init klsi_105_init(void)
991{ 981{
992 int retval; 982 int retval;
@@ -1006,7 +996,6 @@ failed_usb_serial_register:
1006 return retval; 996 return retval;
1007} 997}
1008 998
1009
1010static void __exit klsi_105_exit(void) 999static void __exit klsi_105_exit(void)
1011{ 1000{
1012 usb_deregister(&kl5kusb105d_driver); 1001 usb_deregister(&kl5kusb105d_driver);
@@ -1024,5 +1013,3 @@ MODULE_LICENSE("GPL");
1024 1013
1025module_param(debug, bool, S_IRUGO | S_IWUSR); 1014module_param(debug, bool, S_IRUGO | S_IWUSR);
1026MODULE_PARM_DESC(debug, "enable extensive debugging messages"); 1015MODULE_PARM_DESC(debug, "enable extensive debugging messages");
1027
1028/* vim: set sts=8 ts=8 sw=8: */