summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel.starke@siemens.com <daniel.starke@siemens.com>2022-02-18 10:31:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-02 13:51:21 +0300
commit67e22f721d04cd3fd5f8e2e49f8bee419725a36f (patch)
tree04f85323855d97c33fa97beae7da72e0bfae3573
parentbcb96350dc2c645cae3da11047f803eb7ca678c4 (diff)
downloadlinux-67e22f721d04cd3fd5f8e2e49f8bee419725a36f.tar.xz
tty: n_gsm: fix wrong tty control line for flow control
commit c19d93542a6081577e6da9bf5e887979c72e80c1 upstream. tty flow control is handled via gsmtty_throttle() and gsmtty_unthrottle(). Both functions propagate the outgoing hardware flow control state to the remote side via MSC (modem status command) frames. The local state is taken from the RTS (ready to send) flag of the tty. However, RTS gets mapped to DTR (data terminal ready), which is wrong. This patch corrects this by mapping RTS to RTS. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke <daniel.starke@siemens.com> Link: https://lore.kernel.org/r/20220218073123.2121-5-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/n_gsm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index b270659393e3..26b1bf745233 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -3246,9 +3246,9 @@ static void gsmtty_throttle(struct tty_struct *tty)
if (dlci->state == DLCI_CLOSED)
return;
if (C_CRTSCTS(tty))
- dlci->modem_tx &= ~TIOCM_DTR;
+ dlci->modem_tx &= ~TIOCM_RTS;
dlci->throttled = true;
- /* Send an MSC with DTR cleared */
+ /* Send an MSC with RTS cleared */
gsmtty_modem_update(dlci, 0);
}
@@ -3258,9 +3258,9 @@ static void gsmtty_unthrottle(struct tty_struct *tty)
if (dlci->state == DLCI_CLOSED)
return;
if (C_CRTSCTS(tty))
- dlci->modem_tx |= TIOCM_DTR;
+ dlci->modem_tx |= TIOCM_RTS;
dlci->throttled = false;
- /* Send an MSC with DTR set */
+ /* Send an MSC with RTS set */
gsmtty_modem_update(dlci, 0);
}