Skip to content

Commit

Permalink
USB: serial: ftdi_sio: fix IXON/IXOFF mixup
Browse files Browse the repository at this point in the history
Since forever this driver has had IXON and IXOFF mixed up, and has used
the latter rather than the former to enable hardware-assisted software
flow control on output.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
  • Loading branch information
Johan Hovold committed May 21, 2018
1 parent 79ef518 commit 5ada984
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2342,12 +2342,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
} else {
/*
* Xon/Xoff code
*
* Check the IXOFF status in the iflag component of the
* termios structure. If IXOFF is not set, the pre-xon/xoff
* code is executed.
*/
if (iflag & IXOFF) {
if (iflag & IXON) {
dev_dbg(ddev, "%s request to enable xonxoff iflag=%04x\n",
__func__, iflag);
/* Try to enable the XON/XOFF on the ftdi_sio
Expand All @@ -2372,7 +2368,7 @@ static void ftdi_set_termios(struct tty_struct *tty,
}
} else {
/* else clause to only run if cflag ! CRTSCTS and iflag
* ! XOFF. CHECKME Assuming XON/XOFF handled by tty
* ! XON. CHECKME Assuming XON/XOFF handled by tty
* stack - not by device */
dev_dbg(ddev, "%s Turning off hardware flow control\n", __func__);
if (usb_control_msg(dev,
Expand Down

0 comments on commit 5ada984

Please sign in to comment.