diff options
Diffstat (limited to 'drivers/usb/serial/kl5kusb105.c')
-rw-r--r-- | drivers/usb/serial/kl5kusb105.c | 124 |
1 files changed, 65 insertions, 59 deletions
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index 55736df7d2f4..b395ac759888 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c | |||
@@ -126,9 +126,6 @@ static struct usb_serial_driver kl5kusb105d_device = { | |||
126 | .description = "KL5KUSB105D / PalmConnect", | 126 | .description = "KL5KUSB105D / PalmConnect", |
127 | .usb_driver = &kl5kusb105d_driver, | 127 | .usb_driver = &kl5kusb105d_driver, |
128 | .id_table = id_table, | 128 | .id_table = id_table, |
129 | .num_interrupt_in = 1, | ||
130 | .num_bulk_in = 1, | ||
131 | .num_bulk_out = 1, | ||
132 | .num_ports = 1, | 129 | .num_ports = 1, |
133 | .open = klsi_105_open, | 130 | .open = klsi_105_open, |
134 | .close = klsi_105_close, | 131 | .close = klsi_105_close, |
@@ -194,7 +191,7 @@ static int klsi_105_chg_port_settings(struct usb_serial_port *port, | |||
194 | if (rc < 0) | 191 | if (rc < 0) |
195 | err("Change port settings failed (error = %d)", rc); | 192 | err("Change port settings failed (error = %d)", rc); |
196 | info("%s - %d byte block, baudrate %x, databits %d, u1 %d, u2 %d", | 193 | info("%s - %d byte block, baudrate %x, databits %d, u1 %d, u2 %d", |
197 | __FUNCTION__, | 194 | __func__, |
198 | settings->pktlen, | 195 | settings->pktlen, |
199 | settings->baudrate, settings->databits, | 196 | settings->baudrate, settings->databits, |
200 | settings->unknown1, settings->unknown2); | 197 | settings->unknown1, settings->unknown2); |
@@ -225,7 +222,7 @@ static int klsi_105_get_line_state(struct usb_serial_port *port, | |||
225 | __u8 status_buf[KLSI_STATUSBUF_LEN] = { -1,-1}; | 222 | __u8 status_buf[KLSI_STATUSBUF_LEN] = { -1,-1}; |
226 | __u16 status; | 223 | __u16 status; |
227 | 224 | ||
228 | info("%s - sending SIO Poll request", __FUNCTION__); | 225 | info("%s - sending SIO Poll request", __func__); |
229 | rc = usb_control_msg(port->serial->dev, | 226 | rc = usb_control_msg(port->serial->dev, |
230 | usb_rcvctrlpipe(port->serial->dev, 0), | 227 | usb_rcvctrlpipe(port->serial->dev, 0), |
231 | KL5KUSB105A_SIO_POLL, | 228 | KL5KUSB105A_SIO_POLL, |
@@ -240,7 +237,7 @@ static int klsi_105_get_line_state(struct usb_serial_port *port, | |||
240 | else { | 237 | else { |
241 | status = le16_to_cpu(*(u16 *)status_buf); | 238 | status = le16_to_cpu(*(u16 *)status_buf); |
242 | 239 | ||
243 | info("%s - read status %x %x", __FUNCTION__, | 240 | info("%s - read status %x %x", __func__, |
244 | status_buf[0], status_buf[1]); | 241 | status_buf[0], status_buf[1]); |
245 | 242 | ||
246 | *line_state_p = klsi_105_status2linestate(status); | 243 | *line_state_p = klsi_105_status2linestate(status); |
@@ -268,7 +265,7 @@ static int klsi_105_startup (struct usb_serial *serial) | |||
268 | priv = kmalloc(sizeof(struct klsi_105_private), | 265 | priv = kmalloc(sizeof(struct klsi_105_private), |
269 | GFP_KERNEL); | 266 | GFP_KERNEL); |
270 | if (!priv) { | 267 | if (!priv) { |
271 | dbg("%skmalloc for klsi_105_private failed.", __FUNCTION__); | 268 | dbg("%skmalloc for klsi_105_private failed.", __func__); |
272 | i--; | 269 | i--; |
273 | goto err_cleanup; | 270 | goto err_cleanup; |
274 | } | 271 | } |
@@ -298,7 +295,7 @@ static int klsi_105_startup (struct usb_serial *serial) | |||
298 | urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, | 295 | urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, |
299 | GFP_KERNEL); | 296 | GFP_KERNEL); |
300 | if (!urb->transfer_buffer) { | 297 | if (!urb->transfer_buffer) { |
301 | err("%s - out of memory for urb buffers.", __FUNCTION__); | 298 | err("%s - out of memory for urb buffers.", __func__); |
302 | goto err_cleanup; | 299 | goto err_cleanup; |
303 | } | 300 | } |
304 | } | 301 | } |
@@ -328,7 +325,7 @@ static void klsi_105_shutdown (struct usb_serial *serial) | |||
328 | { | 325 | { |
329 | int i; | 326 | int i; |
330 | 327 | ||
331 | dbg("%s", __FUNCTION__); | 328 | dbg("%s", __func__); |
332 | 329 | ||
333 | /* stop reads and writes on all ports */ | 330 | /* stop reads and writes on all ports */ |
334 | for (i=0; i < serial->num_ports; ++i) { | 331 | for (i=0; i < serial->num_ports; ++i) { |
@@ -373,7 +370,7 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp) | |||
373 | struct klsi_105_port_settings cfg; | 370 | struct klsi_105_port_settings cfg; |
374 | unsigned long flags; | 371 | unsigned long flags; |
375 | 372 | ||
376 | dbg("%s port %d", __FUNCTION__, port->number); | 373 | dbg("%s port %d", __func__, port->number); |
377 | 374 | ||
378 | /* force low_latency on so that our tty_push actually forces | 375 | /* force low_latency on so that our tty_push actually forces |
379 | * the data through | 376 | * the data through |
@@ -419,7 +416,7 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp) | |||
419 | 416 | ||
420 | rc = usb_submit_urb(port->read_urb, GFP_KERNEL); | 417 | rc = usb_submit_urb(port->read_urb, GFP_KERNEL); |
421 | if (rc) { | 418 | if (rc) { |
422 | err("%s - failed submitting read urb, error %d", __FUNCTION__, rc); | 419 | err("%s - failed submitting read urb, error %d", __func__, rc); |
423 | retval = rc; | 420 | retval = rc; |
424 | goto exit; | 421 | goto exit; |
425 | } | 422 | } |
@@ -437,14 +434,14 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp) | |||
437 | err("Enabling read failed (error = %d)", rc); | 434 | err("Enabling read failed (error = %d)", rc); |
438 | retval = rc; | 435 | retval = rc; |
439 | } else | 436 | } else |
440 | dbg("%s - enabled reading", __FUNCTION__); | 437 | dbg("%s - enabled reading", __func__); |
441 | 438 | ||
442 | rc = klsi_105_get_line_state(port, &line_state); | 439 | rc = klsi_105_get_line_state(port, &line_state); |
443 | if (rc >= 0) { | 440 | if (rc >= 0) { |
444 | spin_lock_irqsave (&priv->lock, flags); | 441 | spin_lock_irqsave (&priv->lock, flags); |
445 | priv->line_state = line_state; | 442 | priv->line_state = line_state; |
446 | spin_unlock_irqrestore (&priv->lock, flags); | 443 | spin_unlock_irqrestore (&priv->lock, flags); |
447 | dbg("%s - read line state 0x%lx", __FUNCTION__, line_state); | 444 | dbg("%s - read line state 0x%lx", __func__, line_state); |
448 | retval = 0; | 445 | retval = 0; |
449 | } else | 446 | } else |
450 | retval = rc; | 447 | retval = rc; |
@@ -459,7 +456,7 @@ static void klsi_105_close (struct usb_serial_port *port, struct file *filp) | |||
459 | struct klsi_105_private *priv = usb_get_serial_port_data(port); | 456 | struct klsi_105_private *priv = usb_get_serial_port_data(port); |
460 | int rc; | 457 | int rc; |
461 | 458 | ||
462 | dbg("%s port %d", __FUNCTION__, port->number); | 459 | dbg("%s port %d", __func__, port->number); |
463 | 460 | ||
464 | mutex_lock(&port->serial->disc_mutex); | 461 | mutex_lock(&port->serial->disc_mutex); |
465 | if (!port->serial->disconnected) { | 462 | if (!port->serial->disconnected) { |
@@ -502,7 +499,7 @@ static int klsi_105_write (struct usb_serial_port *port, | |||
502 | int result, size; | 499 | int result, size; |
503 | int bytes_sent=0; | 500 | int bytes_sent=0; |
504 | 501 | ||
505 | dbg("%s - port %d", __FUNCTION__, port->number); | 502 | dbg("%s - port %d", __func__, port->number); |
506 | 503 | ||
507 | while (count > 0) { | 504 | while (count > 0) { |
508 | /* try to find a free urb (write 0 bytes if none) */ | 505 | /* try to find a free urb (write 0 bytes if none) */ |
@@ -514,21 +511,21 @@ static int klsi_105_write (struct usb_serial_port *port, | |||
514 | for (i=0; i<NUM_URBS; i++) { | 511 | for (i=0; i<NUM_URBS; i++) { |
515 | if (priv->write_urb_pool[i]->status != -EINPROGRESS) { | 512 | if (priv->write_urb_pool[i]->status != -EINPROGRESS) { |
516 | urb = priv->write_urb_pool[i]; | 513 | urb = priv->write_urb_pool[i]; |
517 | dbg("%s - using pool URB %d", __FUNCTION__, i); | 514 | dbg("%s - using pool URB %d", __func__, i); |
518 | break; | 515 | break; |
519 | } | 516 | } |
520 | } | 517 | } |
521 | spin_unlock_irqrestore (&priv->lock, flags); | 518 | spin_unlock_irqrestore (&priv->lock, flags); |
522 | 519 | ||
523 | if (urb==NULL) { | 520 | if (urb==NULL) { |
524 | dbg("%s - no more free urbs", __FUNCTION__); | 521 | dbg("%s - no more free urbs", __func__); |
525 | goto exit; | 522 | goto exit; |
526 | } | 523 | } |
527 | 524 | ||
528 | if (urb->transfer_buffer == NULL) { | 525 | if (urb->transfer_buffer == NULL) { |
529 | urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC); | 526 | urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC); |
530 | if (urb->transfer_buffer == NULL) { | 527 | if (urb->transfer_buffer == NULL) { |
531 | err("%s - no more kernel memory...", __FUNCTION__); | 528 | err("%s - no more kernel memory...", __func__); |
532 | goto exit; | 529 | goto exit; |
533 | } | 530 | } |
534 | } | 531 | } |
@@ -554,7 +551,7 @@ static int klsi_105_write (struct usb_serial_port *port, | |||
554 | /* send the data out the bulk port */ | 551 | /* send the data out the bulk port */ |
555 | result = usb_submit_urb(urb, GFP_ATOMIC); | 552 | result = usb_submit_urb(urb, GFP_ATOMIC); |
556 | if (result) { | 553 | if (result) { |
557 | err("%s - failed submitting write urb, error %d", __FUNCTION__, result); | 554 | err("%s - failed submitting write urb, error %d", __func__, result); |
558 | goto exit; | 555 | goto exit; |
559 | } | 556 | } |
560 | buf += size; | 557 | buf += size; |
@@ -570,13 +567,13 @@ exit: | |||
570 | 567 | ||
571 | static void klsi_105_write_bulk_callback ( struct urb *urb) | 568 | static void klsi_105_write_bulk_callback ( struct urb *urb) |
572 | { | 569 | { |
573 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 570 | struct usb_serial_port *port = urb->context; |
574 | int status = urb->status; | 571 | int status = urb->status; |
575 | 572 | ||
576 | dbg("%s - port %d", __FUNCTION__, port->number); | 573 | dbg("%s - port %d", __func__, port->number); |
577 | 574 | ||
578 | if (status) { | 575 | if (status) { |
579 | dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, | 576 | dbg("%s - nonzero write bulk status received: %d", __func__, |
580 | status); | 577 | status); |
581 | return; | 578 | return; |
582 | } | 579 | } |
@@ -603,7 +600,7 @@ static int klsi_105_chars_in_buffer (struct usb_serial_port *port) | |||
603 | 600 | ||
604 | spin_unlock_irqrestore (&priv->lock, flags); | 601 | spin_unlock_irqrestore (&priv->lock, flags); |
605 | 602 | ||
606 | dbg("%s - returns %d", __FUNCTION__, chars); | 603 | dbg("%s - returns %d", __func__, chars); |
607 | return (chars); | 604 | return (chars); |
608 | } | 605 | } |
609 | 606 | ||
@@ -623,7 +620,7 @@ static int klsi_105_write_room (struct usb_serial_port *port) | |||
623 | 620 | ||
624 | spin_unlock_irqrestore (&priv->lock, flags); | 621 | spin_unlock_irqrestore (&priv->lock, flags); |
625 | 622 | ||
626 | dbg("%s - returns %d", __FUNCTION__, room); | 623 | dbg("%s - returns %d", __func__, room); |
627 | return (room); | 624 | return (room); |
628 | } | 625 | } |
629 | 626 | ||
@@ -631,18 +628,18 @@ static int klsi_105_write_room (struct usb_serial_port *port) | |||
631 | 628 | ||
632 | static void klsi_105_read_bulk_callback (struct urb *urb) | 629 | static void klsi_105_read_bulk_callback (struct urb *urb) |
633 | { | 630 | { |
634 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 631 | struct usb_serial_port *port = urb->context; |
635 | struct klsi_105_private *priv = usb_get_serial_port_data(port); | 632 | struct klsi_105_private *priv = usb_get_serial_port_data(port); |
636 | struct tty_struct *tty; | 633 | struct tty_struct *tty; |
637 | unsigned char *data = urb->transfer_buffer; | 634 | unsigned char *data = urb->transfer_buffer; |
638 | int rc; | 635 | int rc; |
639 | int status = urb->status; | 636 | int status = urb->status; |
640 | 637 | ||
641 | dbg("%s - port %d", __FUNCTION__, port->number); | 638 | dbg("%s - port %d", __func__, port->number); |
642 | 639 | ||
643 | /* The urb might have been killed. */ | 640 | /* The urb might have been killed. */ |
644 | if (status) { | 641 | if (status) { |
645 | dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, | 642 | dbg("%s - nonzero read bulk status received: %d", __func__, |
646 | status); | 643 | status); |
647 | return; | 644 | return; |
648 | } | 645 | } |
@@ -652,12 +649,12 @@ static void klsi_105_read_bulk_callback (struct urb *urb) | |||
652 | */ | 649 | */ |
653 | if (urb->actual_length == 0) { | 650 | if (urb->actual_length == 0) { |
654 | /* empty urbs seem to happen, we ignore them */ | 651 | /* empty urbs seem to happen, we ignore them */ |
655 | /* dbg("%s - emtpy URB", __FUNCTION__); */ | 652 | /* dbg("%s - emtpy URB", __func__); */ |
656 | ; | 653 | ; |
657 | } else if (urb->actual_length <= 2) { | 654 | } else if (urb->actual_length <= 2) { |
658 | dbg("%s - size %d URB not understood", __FUNCTION__, | 655 | dbg("%s - size %d URB not understood", __func__, |
659 | urb->actual_length); | 656 | urb->actual_length); |
660 | usb_serial_debug_data(debug, &port->dev, __FUNCTION__, | 657 | usb_serial_debug_data(debug, &port->dev, __func__, |
661 | urb->actual_length, data); | 658 | urb->actual_length, data); |
662 | } else { | 659 | } else { |
663 | int bytes_sent = ((__u8 *) data)[0] + | 660 | int bytes_sent = ((__u8 *) data)[0] + |
@@ -669,12 +666,12 @@ static void klsi_105_read_bulk_callback (struct urb *urb) | |||
669 | * intermixed tty_flip_buffer_push()s | 666 | * intermixed tty_flip_buffer_push()s |
670 | * FIXME | 667 | * FIXME |
671 | */ | 668 | */ |
672 | usb_serial_debug_data(debug, &port->dev, __FUNCTION__, | 669 | usb_serial_debug_data(debug, &port->dev, __func__, |
673 | urb->actual_length, data); | 670 | urb->actual_length, data); |
674 | 671 | ||
675 | if (bytes_sent + 2 > urb->actual_length) { | 672 | if (bytes_sent + 2 > urb->actual_length) { |
676 | dbg("%s - trying to read more data than available" | 673 | dbg("%s - trying to read more data than available" |
677 | " (%d vs. %d)", __FUNCTION__, | 674 | " (%d vs. %d)", __func__, |
678 | bytes_sent+2, urb->actual_length); | 675 | bytes_sent+2, urb->actual_length); |
679 | /* cap at implied limit */ | 676 | /* cap at implied limit */ |
680 | bytes_sent = urb->actual_length - 2; | 677 | bytes_sent = urb->actual_length - 2; |
@@ -697,7 +694,7 @@ static void klsi_105_read_bulk_callback (struct urb *urb) | |||
697 | port); | 694 | port); |
698 | rc = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 695 | rc = usb_submit_urb(port->read_urb, GFP_ATOMIC); |
699 | if (rc) | 696 | if (rc) |
700 | err("%s - failed resubmitting read urb, error %d", __FUNCTION__, rc); | 697 | err("%s - failed resubmitting read urb, error %d", __func__, rc); |
701 | } /* klsi_105_read_bulk_callback */ | 698 | } /* klsi_105_read_bulk_callback */ |
702 | 699 | ||
703 | 700 | ||
@@ -705,12 +702,14 @@ static void klsi_105_set_termios (struct usb_serial_port *port, | |||
705 | struct ktermios *old_termios) | 702 | struct ktermios *old_termios) |
706 | { | 703 | { |
707 | struct klsi_105_private *priv = usb_get_serial_port_data(port); | 704 | struct klsi_105_private *priv = usb_get_serial_port_data(port); |
708 | unsigned int iflag = port->tty->termios->c_iflag; | 705 | struct tty_struct *tty = port->tty; |
706 | unsigned int iflag = tty->termios->c_iflag; | ||
709 | unsigned int old_iflag = old_termios->c_iflag; | 707 | unsigned int old_iflag = old_termios->c_iflag; |
710 | unsigned int cflag = port->tty->termios->c_cflag; | 708 | unsigned int cflag = tty->termios->c_cflag; |
711 | unsigned int old_cflag = old_termios->c_cflag; | 709 | unsigned int old_cflag = old_termios->c_cflag; |
712 | struct klsi_105_port_settings cfg; | 710 | struct klsi_105_port_settings cfg; |
713 | unsigned long flags; | 711 | unsigned long flags; |
712 | speed_t baud; | ||
714 | 713 | ||
715 | /* lock while we are modifying the settings */ | 714 | /* lock while we are modifying the settings */ |
716 | spin_lock_irqsave (&priv->lock, flags); | 715 | spin_lock_irqsave (&priv->lock, flags); |
@@ -718,10 +717,12 @@ static void klsi_105_set_termios (struct usb_serial_port *port, | |||
718 | /* | 717 | /* |
719 | * Update baud rate | 718 | * Update baud rate |
720 | */ | 719 | */ |
720 | baud = tty_get_baud_rate(tty); | ||
721 | |||
721 | if( (cflag & CBAUD) != (old_cflag & CBAUD) ) { | 722 | if( (cflag & CBAUD) != (old_cflag & CBAUD) ) { |
722 | /* reassert DTR and (maybe) RTS on transition from B0 */ | 723 | /* reassert DTR and (maybe) RTS on transition from B0 */ |
723 | if( (old_cflag & CBAUD) == B0 ) { | 724 | if( (old_cflag & CBAUD) == B0 ) { |
724 | dbg("%s: baud was B0", __FUNCTION__); | 725 | dbg("%s: baud was B0", __func__); |
725 | #if 0 | 726 | #if 0 |
726 | priv->control_state |= TIOCM_DTR; | 727 | priv->control_state |= TIOCM_DTR; |
727 | /* don't set RTS if using hardware flow control */ | 728 | /* don't set RTS if using hardware flow control */ |
@@ -731,8 +732,8 @@ static void klsi_105_set_termios (struct usb_serial_port *port, | |||
731 | mct_u232_set_modem_ctrl(serial, priv->control_state); | 732 | mct_u232_set_modem_ctrl(serial, priv->control_state); |
732 | #endif | 733 | #endif |
733 | } | 734 | } |
734 | 735 | } | |
735 | switch(tty_get_baud_rate(port->tty)) { | 736 | switch(baud) { |
736 | case 0: /* handled below */ | 737 | case 0: /* handled below */ |
737 | break; | 738 | break; |
738 | case 1200: | 739 | case 1200: |
@@ -760,35 +761,36 @@ static void klsi_105_set_termios (struct usb_serial_port *port, | |||
760 | priv->cfg.baudrate = kl5kusb105a_sio_b115200; | 761 | priv->cfg.baudrate = kl5kusb105a_sio_b115200; |
761 | break; | 762 | break; |
762 | default: | 763 | default: |
763 | err("KLSI USB->Serial converter:" | 764 | dbg("KLSI USB->Serial converter:" |
764 | " unsupported baudrate request, using default" | 765 | " unsupported baudrate request, using default" |
765 | " of 9600"); | 766 | " of 9600"); |
766 | priv->cfg.baudrate = kl5kusb105a_sio_b9600; | 767 | priv->cfg.baudrate = kl5kusb105a_sio_b9600; |
768 | baud = 9600; | ||
767 | break; | 769 | break; |
768 | } | 770 | } |
769 | if ((cflag & CBAUD) == B0 ) { | 771 | if ((cflag & CBAUD) == B0 ) { |
770 | dbg("%s: baud is B0", __FUNCTION__); | 772 | dbg("%s: baud is B0", __func__); |
771 | /* Drop RTS and DTR */ | 773 | /* Drop RTS and DTR */ |
772 | /* maybe this should be simulated by sending read | 774 | /* maybe this should be simulated by sending read |
773 | * disable and read enable messages? | 775 | * disable and read enable messages? |
774 | */ | 776 | */ |
775 | ; | 777 | ; |
776 | #if 0 | 778 | #if 0 |
777 | priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS); | 779 | priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS); |
778 | mct_u232_set_modem_ctrl(serial, priv->control_state); | 780 | mct_u232_set_modem_ctrl(serial, priv->control_state); |
779 | #endif | 781 | #endif |
780 | } | ||
781 | } | 782 | } |
783 | tty_encode_baud_rate(tty, baud, baud); | ||
782 | 784 | ||
783 | if ((cflag & CSIZE) != (old_cflag & CSIZE)) { | 785 | if ((cflag & CSIZE) != (old_cflag & CSIZE)) { |
784 | /* set the number of data bits */ | 786 | /* set the number of data bits */ |
785 | switch (cflag & CSIZE) { | 787 | switch (cflag & CSIZE) { |
786 | case CS5: | 788 | case CS5: |
787 | dbg("%s - 5 bits/byte not supported", __FUNCTION__); | 789 | dbg("%s - 5 bits/byte not supported", __func__); |
788 | spin_unlock_irqrestore (&priv->lock, flags); | 790 | spin_unlock_irqrestore (&priv->lock, flags); |
789 | return ; | 791 | return ; |
790 | case CS6: | 792 | case CS6: |
791 | dbg("%s - 6 bits/byte not supported", __FUNCTION__); | 793 | dbg("%s - 6 bits/byte not supported", __func__); |
792 | spin_unlock_irqrestore (&priv->lock, flags); | 794 | spin_unlock_irqrestore (&priv->lock, flags); |
793 | return ; | 795 | return ; |
794 | case CS7: | 796 | case CS7: |
@@ -810,6 +812,8 @@ static void klsi_105_set_termios (struct usb_serial_port *port, | |||
810 | if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD)) | 812 | if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD)) |
811 | || (cflag & CSTOPB) != (old_cflag & CSTOPB) ) { | 813 | || (cflag & CSTOPB) != (old_cflag & CSTOPB) ) { |
812 | 814 | ||
815 | /* Not currently supported */ | ||
816 | tty->termios->c_cflag &= ~(PARENB|PARODD|CSTOPB); | ||
813 | #if 0 | 817 | #if 0 |
814 | priv->last_lcr = 0; | 818 | priv->last_lcr = 0; |
815 | 819 | ||
@@ -837,6 +841,8 @@ static void klsi_105_set_termios (struct usb_serial_port *port, | |||
837 | || (iflag & IXON) != (old_iflag & IXON) | 841 | || (iflag & IXON) != (old_iflag & IXON) |
838 | || (cflag & CRTSCTS) != (old_cflag & CRTSCTS) ) { | 842 | || (cflag & CRTSCTS) != (old_cflag & CRTSCTS) ) { |
839 | 843 | ||
844 | /* Not currently supported */ | ||
845 | tty->termios->c_cflag &= ~CRTSCTS; | ||
840 | /* Drop DTR/RTS if no flow control otherwise assert */ | 846 | /* Drop DTR/RTS if no flow control otherwise assert */ |
841 | #if 0 | 847 | #if 0 |
842 | if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS) ) | 848 | if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS) ) |
@@ -862,7 +868,7 @@ static void mct_u232_break_ctl( struct usb_serial_port *port, int break_state ) | |||
862 | struct mct_u232_private *priv = (struct mct_u232_private *)port->private; | 868 | struct mct_u232_private *priv = (struct mct_u232_private *)port->private; |
863 | unsigned char lcr = priv->last_lcr; | 869 | unsigned char lcr = priv->last_lcr; |
864 | 870 | ||
865 | dbg("%sstate=%d", __FUNCTION__, break_state); | 871 | dbg("%sstate=%d", __func__, break_state); |
866 | 872 | ||
867 | if (break_state) | 873 | if (break_state) |
868 | lcr |= MCT_U232_SET_BREAK; | 874 | lcr |= MCT_U232_SET_BREAK; |
@@ -877,7 +883,7 @@ static int klsi_105_tiocmget (struct usb_serial_port *port, struct file *file) | |||
877 | unsigned long flags; | 883 | unsigned long flags; |
878 | int rc; | 884 | int rc; |
879 | unsigned long line_state; | 885 | unsigned long line_state; |
880 | dbg("%s - request, just guessing", __FUNCTION__); | 886 | dbg("%s - request, just guessing", __func__); |
881 | 887 | ||
882 | rc = klsi_105_get_line_state(port, &line_state); | 888 | rc = klsi_105_get_line_state(port, &line_state); |
883 | if (rc < 0) { | 889 | if (rc < 0) { |
@@ -889,7 +895,7 @@ static int klsi_105_tiocmget (struct usb_serial_port *port, struct file *file) | |||
889 | spin_lock_irqsave (&priv->lock, flags); | 895 | spin_lock_irqsave (&priv->lock, flags); |
890 | priv->line_state = line_state; | 896 | priv->line_state = line_state; |
891 | spin_unlock_irqrestore (&priv->lock, flags); | 897 | spin_unlock_irqrestore (&priv->lock, flags); |
892 | dbg("%s - read line state 0x%lx", __FUNCTION__, line_state); | 898 | dbg("%s - read line state 0x%lx", __func__, line_state); |
893 | return (int)line_state; | 899 | return (int)line_state; |
894 | } | 900 | } |
895 | 901 | ||
@@ -898,7 +904,7 @@ static int klsi_105_tiocmset (struct usb_serial_port *port, struct file *file, | |||
898 | { | 904 | { |
899 | int retval = -EINVAL; | 905 | int retval = -EINVAL; |
900 | 906 | ||
901 | dbg("%s", __FUNCTION__); | 907 | dbg("%s", __func__); |
902 | 908 | ||
903 | /* if this ever gets implemented, it should be done something like this: | 909 | /* if this ever gets implemented, it should be done something like this: |
904 | struct usb_serial *serial = port->serial; | 910 | struct usb_serial *serial = port->serial; |
@@ -924,7 +930,7 @@ static int klsi_105_tiocmset (struct usb_serial_port *port, struct file *file, | |||
924 | 930 | ||
925 | static void klsi_105_throttle (struct usb_serial_port *port) | 931 | static void klsi_105_throttle (struct usb_serial_port *port) |
926 | { | 932 | { |
927 | dbg("%s - port %d", __FUNCTION__, port->number); | 933 | dbg("%s - port %d", __func__, port->number); |
928 | usb_kill_urb(port->read_urb); | 934 | usb_kill_urb(port->read_urb); |
929 | } | 935 | } |
930 | 936 | ||
@@ -932,12 +938,12 @@ static void klsi_105_unthrottle (struct usb_serial_port *port) | |||
932 | { | 938 | { |
933 | int result; | 939 | int result; |
934 | 940 | ||
935 | dbg("%s - port %d", __FUNCTION__, port->number); | 941 | dbg("%s - port %d", __func__, port->number); |
936 | 942 | ||
937 | port->read_urb->dev = port->serial->dev; | 943 | port->read_urb->dev = port->serial->dev; |
938 | result = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 944 | result = usb_submit_urb(port->read_urb, GFP_ATOMIC); |
939 | if (result) | 945 | if (result) |
940 | err("%s - failed submitting read urb, error %d", __FUNCTION__, | 946 | err("%s - failed submitting read urb, error %d", __func__, |
941 | result); | 947 | result); |
942 | } | 948 | } |
943 | 949 | ||