USB: ssu100: fix overrun-error reporting
Fix reporting of overrun errors, which should only be reported once
using the inserted null character.
Fixes: 6b8f1ca558
("USB: ssu100: set tty_flags in ssu100_process_packet")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
855515a6d3
commit
75bcbf29c2
1 changed files with 3 additions and 8 deletions
|
@ -492,8 +492,7 @@ static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr,
|
||||||
}
|
}
|
||||||
if (lsr & UART_LSR_OE) {
|
if (lsr & UART_LSR_OE) {
|
||||||
port->icount.overrun++;
|
port->icount.overrun++;
|
||||||
if (*tty_flag == TTY_NORMAL)
|
tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
|
||||||
*tty_flag = TTY_OVERRUN;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,12 +510,8 @@ static void ssu100_process_read_urb(struct urb *urb)
|
||||||
if ((len >= 4) &&
|
if ((len >= 4) &&
|
||||||
(packet[0] == 0x1b) && (packet[1] == 0x1b) &&
|
(packet[0] == 0x1b) && (packet[1] == 0x1b) &&
|
||||||
((packet[2] == 0x00) || (packet[2] == 0x01))) {
|
((packet[2] == 0x00) || (packet[2] == 0x01))) {
|
||||||
if (packet[2] == 0x00) {
|
if (packet[2] == 0x00)
|
||||||
ssu100_update_lsr(port, packet[3], &flag);
|
ssu100_update_lsr(port, packet[3], &flag);
|
||||||
if (flag == TTY_OVERRUN)
|
|
||||||
tty_insert_flip_char(&port->port, 0,
|
|
||||||
TTY_OVERRUN);
|
|
||||||
}
|
|
||||||
if (packet[2] == 0x01)
|
if (packet[2] == 0x01)
|
||||||
ssu100_update_msr(port, packet[3]);
|
ssu100_update_msr(port, packet[3]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue