Commit 4473d054 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: cdc-acm: only raise DTR on transitions from B0

Make sure to only raise DTR on transitions from B0 in set_termios.

Also allow set_termios to be called from open with a termios_old of
NULL. Note that DTR will not be raised prematurely in this case.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ac0225f9
...@@ -985,11 +985,12 @@ static void acm_tty_set_termios(struct tty_struct *tty, ...@@ -985,11 +985,12 @@ static void acm_tty_set_termios(struct tty_struct *tty,
/* FIXME: Needs to clear unsupported bits in the termios */ /* FIXME: Needs to clear unsupported bits in the termios */
acm->clocal = ((termios->c_cflag & CLOCAL) != 0); acm->clocal = ((termios->c_cflag & CLOCAL) != 0);
if (!newline.dwDTERate) { if (C_BAUD(tty) == B0) {
newline.dwDTERate = acm->line.dwDTERate; newline.dwDTERate = acm->line.dwDTERate;
newctrl &= ~ACM_CTRL_DTR; newctrl &= ~ACM_CTRL_DTR;
} else } else if (termios_old && (termios_old->c_cflag & CBAUD) == B0) {
newctrl |= ACM_CTRL_DTR; newctrl |= ACM_CTRL_DTR;
}
if (newctrl != acm->ctrlout) if (newctrl != acm->ctrlout)
acm_set_control(acm, acm->ctrlout = newctrl); acm_set_control(acm, acm->ctrlout = newctrl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment