diff options
author | Bill Pemberton <wfp5p@virginia.edu> | 2010-08-13 09:59:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-23 23:50:16 -0400 |
commit | 6b8f1ca5581bf9783069cd6bde65ba7a3a470aab (patch) | |
tree | 0a626d008a02e857fafba936eba46225f592ee53 /drivers/usb/serial/ssu100.c | |
parent | 85dee135b84f1c7cad252fa4a619ea692077a7fc (diff) |
USB: ssu100: set tty_flags in ssu100_process_packet
flag was never set in ssu100_process_packet. Add logic to set it
before calling tty_insert_flip_*
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/ssu100.c')
-rw-r--r-- | drivers/usb/serial/ssu100.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index 55e9672d286a..660c31f14999 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c | |||
@@ -602,7 +602,8 @@ static void ssu100_update_msr(struct usb_serial_port *port, u8 msr) | |||
602 | } | 602 | } |
603 | } | 603 | } |
604 | 604 | ||
605 | static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr) | 605 | static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr, |
606 | char *tty_flag) | ||
606 | { | 607 | { |
607 | struct ssu100_port_private *priv = usb_get_serial_port_data(port); | 608 | struct ssu100_port_private *priv = usb_get_serial_port_data(port); |
608 | unsigned long flags; | 609 | unsigned long flags; |
@@ -611,16 +612,32 @@ static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr) | |||
611 | priv->shadowLSR = lsr; | 612 | priv->shadowLSR = lsr; |
612 | spin_unlock_irqrestore(&priv->status_lock, flags); | 613 | spin_unlock_irqrestore(&priv->status_lock, flags); |
613 | 614 | ||
615 | *tty_flag = TTY_NORMAL; | ||
614 | if (lsr & UART_LSR_BRK_ERROR_BITS) { | 616 | if (lsr & UART_LSR_BRK_ERROR_BITS) { |
615 | if (lsr & UART_LSR_BI) | 617 | /* we always want to update icount, but we only want to |
618 | * update tty_flag for one case */ | ||
619 | if (lsr & UART_LSR_BI) { | ||
616 | priv->icount.brk++; | 620 | priv->icount.brk++; |
617 | if (lsr & UART_LSR_FE) | 621 | *tty_flag = TTY_BREAK; |
618 | priv->icount.frame++; | 622 | usb_serial_handle_break(port); |
619 | if (lsr & UART_LSR_PE) | 623 | } |
624 | if (lsr & UART_LSR_PE) { | ||
620 | priv->icount.parity++; | 625 | priv->icount.parity++; |
621 | if (lsr & UART_LSR_OE) | 626 | if (*tty_flag == TTY_NORMAL) |
627 | *tty_flag = TTY_PARITY; | ||
628 | } | ||
629 | if (lsr & UART_LSR_FE) { | ||
630 | priv->icount.frame++; | ||
631 | if (*tty_flag == TTY_NORMAL) | ||
632 | *tty_flag = TTY_FRAME; | ||
633 | } | ||
634 | if (lsr & UART_LSR_OE){ | ||
622 | priv->icount.overrun++; | 635 | priv->icount.overrun++; |
636 | if (*tty_flag == TTY_NORMAL) | ||
637 | *tty_flag = TTY_OVERRUN; | ||
638 | } | ||
623 | } | 639 | } |
640 | |||
624 | } | 641 | } |
625 | 642 | ||
626 | static int ssu100_process_packet(struct tty_struct *tty, | 643 | static int ssu100_process_packet(struct tty_struct *tty, |
@@ -629,7 +646,7 @@ static int ssu100_process_packet(struct tty_struct *tty, | |||
629 | char *packet, int len) | 646 | char *packet, int len) |
630 | { | 647 | { |
631 | int i; | 648 | int i; |
632 | char flag; | 649 | char flag = TTY_NORMAL; |
633 | char *ch; | 650 | char *ch; |
634 | 651 | ||
635 | dbg("%s - port %d", __func__, port->number); | 652 | dbg("%s - port %d", __func__, port->number); |
@@ -637,8 +654,11 @@ static int ssu100_process_packet(struct tty_struct *tty, | |||
637 | if ((len >= 4) && | 654 | if ((len >= 4) && |
638 | (packet[0] == 0x1b) && (packet[1] == 0x1b) && | 655 | (packet[0] == 0x1b) && (packet[1] == 0x1b) && |
639 | ((packet[2] == 0x00) || (packet[2] == 0x01))) { | 656 | ((packet[2] == 0x00) || (packet[2] == 0x01))) { |
640 | if (packet[2] == 0x00) | 657 | if (packet[2] == 0x00) { |
641 | ssu100_update_lsr(port, packet[3]); | 658 | ssu100_update_lsr(port, packet[3], &flag); |
659 | if (flag == TTY_OVERRUN) | ||
660 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); | ||
661 | } | ||
642 | if (packet[2] == 0x01) | 662 | if (packet[2] == 0x01) |
643 | ssu100_update_msr(port, packet[3]); | 663 | ssu100_update_msr(port, packet[3]); |
644 | 664 | ||