diff options
author | Johan Hovold | 2021-01-18 12:13:28 +0100 |
---|---|---|
committer | Johan Hovold | 2021-01-18 14:24:52 +0100 |
commit | 03f32d7cb51b62f6cc7fd884d6978fe1a6ad3f8d (patch) | |
tree | bf7fa06222beaf1f1028e84fb69800d3108d1ed4 /drivers/usb | |
parent | f61309d9c96a308465bec9d2e5206da265b075a0 (diff) |
USB: serial: cp210x: update control-characters on every change
Update the XON/XOFF control characters also when no other flow-control
flag has changed and software flow control is enabled.
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/cp210x.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index ee0139eb6636..4f90573c0d2b 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -1113,11 +1113,13 @@ static int cp210x_set_chars(struct usb_serial_port *port, static bool cp210x_termios_change(const struct ktermios *a, const struct ktermios *b) { - bool iflag_change; + bool iflag_change, cc_change; iflag_change = ((a->c_iflag ^ b->c_iflag) & (INPCK | IXON | IXOFF)); + cc_change = a->c_cc[VSTART] != b->c_cc[VSTART] || + a->c_cc[VSTOP] != b->c_cc[VSTOP]; - return tty_termios_hw_change(a, b) || iflag_change; + return tty_termios_hw_change(a, b) || iflag_change || cc_change; } static void cp210x_set_flow_control(struct tty_struct *tty, @@ -1132,7 +1134,9 @@ static void cp210x_set_flow_control(struct tty_struct *tty, if (old_termios && C_CRTSCTS(tty) == (old_termios->c_cflag & CRTSCTS) && I_IXON(tty) == (old_termios->c_iflag & IXON) && - I_IXOFF(tty) == (old_termios->c_iflag & IXOFF)) { + I_IXOFF(tty) == (old_termios->c_iflag & IXOFF) && + START_CHAR(tty) == old_termios->c_cc[VSTART] && + STOP_CHAR(tty) == old_termios->c_cc[VSTOP]) { return; } |