aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/mct_u232.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/mct_u232.c')
-rw-r--r--drivers/usb/serial/mct_u232.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index fc1cea4aba13..5fc2cef30e39 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -143,9 +143,6 @@ static struct usb_serial_driver mct_u232_device = {
143 .description = "MCT U232", 143 .description = "MCT U232",
144 .usb_driver = &mct_u232_driver, 144 .usb_driver = &mct_u232_driver,
145 .id_table = id_table_combined, 145 .id_table = id_table_combined,
146 .num_interrupt_in = 2,
147 .num_bulk_in = 0,
148 .num_bulk_out = 1,
149 .num_ports = 1, 146 .num_ports = 1,
150 .open = mct_u232_open, 147 .open = mct_u232_open,
151 .close = mct_u232_close, 148 .close = mct_u232_close,
@@ -402,7 +399,7 @@ static void mct_u232_shutdown (struct usb_serial *serial)
402 struct mct_u232_private *priv; 399 struct mct_u232_private *priv;
403 int i; 400 int i;
404 401
405 dbg("%s", __FUNCTION__); 402 dbg("%s", __func__);
406 403
407 for (i=0; i < serial->num_ports; ++i) { 404 for (i=0; i < serial->num_ports; ++i) {
408 /* My special items, the standard routines free my urbs */ 405 /* My special items, the standard routines free my urbs */
@@ -424,7 +421,7 @@ static int mct_u232_open (struct usb_serial_port *port, struct file *filp)
424 unsigned char last_lcr; 421 unsigned char last_lcr;
425 unsigned char last_msr; 422 unsigned char last_msr;
426 423
427 dbg("%s port %d", __FUNCTION__, port->number); 424 dbg("%s port %d", __func__, port->number);
428 425
429 /* Compensate for a hardware bug: although the Sitecom U232-P25 426 /* Compensate for a hardware bug: although the Sitecom U232-P25
430 * device reports a maximum output packet size of 32 bytes, 427 * device reports a maximum output packet size of 32 bytes,
@@ -489,7 +486,7 @@ static void mct_u232_close (struct usb_serial_port *port, struct file *filp)
489 unsigned int c_cflag; 486 unsigned int c_cflag;
490 unsigned int control_state; 487 unsigned int control_state;
491 struct mct_u232_private *priv = usb_get_serial_port_data(port); 488 struct mct_u232_private *priv = usb_get_serial_port_data(port);
492 dbg("%s port %d", __FUNCTION__, port->number); 489 dbg("%s port %d", __func__, port->number);
493 490
494 if (port->tty) { 491 if (port->tty) {
495 c_cflag = port->tty->termios->c_cflag; 492 c_cflag = port->tty->termios->c_cflag;
@@ -517,7 +514,7 @@ static void mct_u232_close (struct usb_serial_port *port, struct file *filp)
517 514
518static void mct_u232_read_int_callback (struct urb *urb) 515static void mct_u232_read_int_callback (struct urb *urb)
519{ 516{
520 struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 517 struct usb_serial_port *port = urb->context;
521 struct mct_u232_private *priv = usb_get_serial_port_data(port); 518 struct mct_u232_private *priv = usb_get_serial_port_data(port);
522 struct usb_serial *serial = port->serial; 519 struct usb_serial *serial = port->serial;
523 struct tty_struct *tty; 520 struct tty_struct *tty;
@@ -535,21 +532,21 @@ static void mct_u232_read_int_callback (struct urb *urb)
535 case -ESHUTDOWN: 532 case -ESHUTDOWN:
536 /* this urb is terminated, clean up */ 533 /* this urb is terminated, clean up */
537 dbg("%s - urb shutting down with status: %d", 534 dbg("%s - urb shutting down with status: %d",
538 __FUNCTION__, status); 535 __func__, status);
539 return; 536 return;
540 default: 537 default:
541 dbg("%s - nonzero urb status received: %d", 538 dbg("%s - nonzero urb status received: %d",
542 __FUNCTION__, status); 539 __func__, status);
543 goto exit; 540 goto exit;
544 } 541 }
545 542
546 if (!serial) { 543 if (!serial) {
547 dbg("%s - bad serial pointer, exiting", __FUNCTION__); 544 dbg("%s - bad serial pointer, exiting", __func__);
548 return; 545 return;
549 } 546 }
550 547
551 dbg("%s - port %d", __FUNCTION__, port->number); 548 dbg("%s - port %d", __func__, port->number);
552 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data); 549 usb_serial_debug_data(debug, &port->dev, __func__, urb->actual_length, data);
553 550
554 /* 551 /*
555 * Work-a-round: handle the 'usual' bulk-in pipe here 552 * Work-a-round: handle the 'usual' bulk-in pipe here
@@ -606,7 +603,7 @@ exit:
606 retval = usb_submit_urb (urb, GFP_ATOMIC); 603 retval = usb_submit_urb (urb, GFP_ATOMIC);
607 if (retval) 604 if (retval)
608 err ("%s - usb_submit_urb failed with result %d", 605 err ("%s - usb_submit_urb failed with result %d",
609 __FUNCTION__, retval); 606 __func__, retval);
610} /* mct_u232_read_int_callback */ 607} /* mct_u232_read_int_callback */
611 608
612static void mct_u232_set_termios (struct usb_serial_port *port, 609static void mct_u232_set_termios (struct usb_serial_port *port,
@@ -636,7 +633,7 @@ static void mct_u232_set_termios (struct usb_serial_port *port,
636 633
637 /* reassert DTR and RTS on transition from B0 */ 634 /* reassert DTR and RTS on transition from B0 */
638 if ((old_cflag & CBAUD) == B0) { 635 if ((old_cflag & CBAUD) == B0) {
639 dbg("%s: baud was B0", __FUNCTION__); 636 dbg("%s: baud was B0", __func__);
640 control_state |= TIOCM_DTR | TIOCM_RTS; 637 control_state |= TIOCM_DTR | TIOCM_RTS;
641 mct_u232_set_modem_ctrl(serial, control_state); 638 mct_u232_set_modem_ctrl(serial, control_state);
642 } 639 }
@@ -644,7 +641,7 @@ static void mct_u232_set_termios (struct usb_serial_port *port,
644 mct_u232_set_baud_rate(serial, port, tty_get_baud_rate(port->tty)); 641 mct_u232_set_baud_rate(serial, port, tty_get_baud_rate(port->tty));
645 642
646 if ((cflag & CBAUD) == B0 ) { 643 if ((cflag & CBAUD) == B0 ) {
647 dbg("%s: baud is B0", __FUNCTION__); 644 dbg("%s: baud is B0", __func__);
648 /* Drop RTS and DTR */ 645 /* Drop RTS and DTR */
649 control_state &= ~(TIOCM_DTR | TIOCM_RTS); 646 control_state &= ~(TIOCM_DTR | TIOCM_RTS);
650 mct_u232_set_modem_ctrl(serial, control_state); 647 mct_u232_set_modem_ctrl(serial, control_state);
@@ -699,7 +696,7 @@ static void mct_u232_break_ctl( struct usb_serial_port *port, int break_state )
699 unsigned char lcr; 696 unsigned char lcr;
700 unsigned long flags; 697 unsigned long flags;
701 698
702 dbg("%sstate=%d", __FUNCTION__, break_state); 699 dbg("%sstate=%d", __func__, break_state);
703 700
704 spin_lock_irqsave(&priv->lock, flags); 701 spin_lock_irqsave(&priv->lock, flags);
705 lcr = priv->last_lcr; 702 lcr = priv->last_lcr;
@@ -718,7 +715,7 @@ static int mct_u232_tiocmget (struct usb_serial_port *port, struct file *file)
718 unsigned int control_state; 715 unsigned int control_state;
719 unsigned long flags; 716 unsigned long flags;
720 717
721 dbg("%s", __FUNCTION__); 718 dbg("%s", __func__);
722 719
723 spin_lock_irqsave(&priv->lock, flags); 720 spin_lock_irqsave(&priv->lock, flags);
724 control_state = priv->control_state; 721 control_state = priv->control_state;
@@ -735,7 +732,7 @@ static int mct_u232_tiocmset (struct usb_serial_port *port, struct file *file,
735 unsigned int control_state; 732 unsigned int control_state;
736 unsigned long flags; 733 unsigned long flags;
737 734
738 dbg("%s", __FUNCTION__); 735 dbg("%s", __func__);
739 736
740 spin_lock_irqsave(&priv->lock, flags); 737 spin_lock_irqsave(&priv->lock, flags);
741 control_state = priv->control_state; 738 control_state = priv->control_state;
@@ -757,7 +754,7 @@ static int mct_u232_tiocmset (struct usb_serial_port *port, struct file *file,
757static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file, 754static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file,
758 unsigned int cmd, unsigned long arg) 755 unsigned int cmd, unsigned long arg)
759{ 756{
760 dbg("%scmd=0x%x", __FUNCTION__, cmd); 757 dbg("%scmd=0x%x", __func__, cmd);
761 758
762 /* Based on code from acm.c and others */ 759 /* Based on code from acm.c and others */
763 switch (cmd) { 760 switch (cmd) {
@@ -772,7 +769,7 @@ static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file,
772 return 0; 769 return 0;
773 770
774 default: 771 default:
775 dbg("%s: arg not supported - 0x%04x", __FUNCTION__,cmd); 772 dbg("%s: arg not supported - 0x%04x", __func__,cmd);
776 return(-ENOIOCTLCMD); 773 return(-ENOIOCTLCMD);
777 break; 774 break;
778 } 775 }
@@ -787,7 +784,7 @@ static void mct_u232_throttle (struct usb_serial_port *port)
787 struct tty_struct *tty; 784 struct tty_struct *tty;
788 785
789 tty = port->tty; 786 tty = port->tty;
790 dbg("%s - port %d", __FUNCTION__, port->number); 787 dbg("%s - port %d", __func__, port->number);
791 788
792 spin_lock_irqsave(&priv->lock, flags); 789 spin_lock_irqsave(&priv->lock, flags);
793 priv->rx_flags |= THROTTLED; 790 priv->rx_flags |= THROTTLED;
@@ -809,7 +806,7 @@ static void mct_u232_unthrottle (struct usb_serial_port *port)
809 unsigned int control_state; 806 unsigned int control_state;
810 struct tty_struct *tty; 807 struct tty_struct *tty;
811 808
812 dbg("%s - port %d", __FUNCTION__, port->number); 809 dbg("%s - port %d", __func__, port->number);
813 810
814 tty = port->tty; 811 tty = port->tty;
815 spin_lock_irqsave(&priv->lock, flags); 812 spin_lock_irqsave(&priv->lock, flags);