diff options
author | Johan Hovold <johan@kernel.org> | 2014-11-05 12:41:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-05 14:25:25 -0500 |
commit | 4473d054ceb572557954f9536731d39b20937b0c (patch) | |
tree | 0c49f80d520843b6371afb7bcce04db90f3e3f34 /drivers/usb/class | |
parent | ac0225f94f2af14d5db5a3ca2e9b151bb5488a52 (diff) |
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: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 6771f884cb82..9d6495424b06 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -985,11 +985,12 @@ static void acm_tty_set_termios(struct tty_struct *tty, | |||
985 | /* FIXME: Needs to clear unsupported bits in the termios */ | 985 | /* FIXME: Needs to clear unsupported bits in the termios */ |
986 | acm->clocal = ((termios->c_cflag & CLOCAL) != 0); | 986 | acm->clocal = ((termios->c_cflag & CLOCAL) != 0); |
987 | 987 | ||
988 | if (!newline.dwDTERate) { | 988 | if (C_BAUD(tty) == B0) { |
989 | newline.dwDTERate = acm->line.dwDTERate; | 989 | newline.dwDTERate = acm->line.dwDTERate; |
990 | newctrl &= ~ACM_CTRL_DTR; | 990 | newctrl &= ~ACM_CTRL_DTR; |
991 | } else | 991 | } else if (termios_old && (termios_old->c_cflag & CBAUD) == B0) { |
992 | newctrl |= ACM_CTRL_DTR; | 992 | newctrl |= ACM_CTRL_DTR; |
993 | } | ||
993 | 994 | ||
994 | if (newctrl != acm->ctrlout) | 995 | if (newctrl != acm->ctrlout) |
995 | acm_set_control(acm, acm->ctrlout = newctrl); | 996 | acm_set_control(acm, acm->ctrlout = newctrl); |