Skip to contentSkip to conversation

USB: serial: ftdi_sio: fix IXON/IXOFF mixup

PATCH New Greg Kroah-Hartman 1 participant 1 message May 18, 2018 USB

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/4 USB: serial: ftdi_sio: fix IXON/IXOFF mixup

Quoted 28 lines · Johan Hovold

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.

---
 drivers/usb/serial/ftdi_sio.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/usb/serial/ftdi_sio.c +1 -5
index 7ea221d42dba..62c99871863c 100644
@@ -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

drivers/usb/serial/ftdi_sio.c static void ftdi_set_termios(struct tty_struct *tty, · line 2374

Quoted 8 lines
drivers/usb/serial/ftdi_sio.c +1 -1
@@ -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,

Ugh, that's a huge sign that no one actually uses IXON/IXOFF anymore :(

Anyway, thanks for fixing this up, should also probably be backported to the stable kernels.

---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html