Skip to content

Commit c19d935

Browse files
dstarke-siemensgregkh
authored andcommitted
tty: n_gsm: fix wrong tty control line for flow control
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: e1eaea4 ("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>
1 parent 96b169f commit c19d935

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/tty/n_gsm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3243,9 +3243,9 @@ static void gsmtty_throttle(struct tty_struct *tty)
32433243
if (dlci->state == DLCI_CLOSED)
32443244
return;
32453245
if (C_CRTSCTS(tty))
3246-
dlci->modem_tx &= ~TIOCM_DTR;
3246+
dlci->modem_tx &= ~TIOCM_RTS;
32473247
dlci->throttled = true;
3248-
/* Send an MSC with DTR cleared */
3248+
/* Send an MSC with RTS cleared */
32493249
gsmtty_modem_update(dlci, 0);
32503250
}
32513251

@@ -3255,9 +3255,9 @@ static void gsmtty_unthrottle(struct tty_struct *tty)
32553255
if (dlci->state == DLCI_CLOSED)
32563256
return;
32573257
if (C_CRTSCTS(tty))
3258-
dlci->modem_tx |= TIOCM_DTR;
3258+
dlci->modem_tx |= TIOCM_RTS;
32593259
dlci->throttled = false;
3260-
/* Send an MSC with DTR set */
3260+
/* Send an MSC with RTS set */
32613261
gsmtty_modem_update(dlci, 0);
32623262
}
32633263

0 commit comments

Comments
 (0)