Skip to content

Commit

Permalink
[Bluetooth]: Call tty_hangup() when DCD is de-asserted
Browse files Browse the repository at this point in the history
The RFCOMM layer does not handle properly the de-assertation
of CD signal. It should call tty_hangup() to work properly.

Signed-off-by: Timo Teräs <ext-timo.teras@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Timo Teräs authored and David S. Miller committed Aug 29, 2005
1 parent 85a1e93 commit 7b9eb9e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/bluetooth/rfcomm/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,14 @@ static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig)
struct rfcomm_dev *dev = dlc->owner;
if (!dev)
return;

BT_DBG("dlc %p dev %p v24_sig 0x%02x", dlc, dev, v24_sig);

if ((dev->modem_status & TIOCM_CD) && !(v24_sig & RFCOMM_V24_DV)) {
if (dev->tty && !C_CLOCAL(dev->tty))
tty_hangup(dev->tty);
}

dev->modem_status =
((v24_sig & RFCOMM_V24_RTC) ? (TIOCM_DSR | TIOCM_DTR) : 0) |
((v24_sig & RFCOMM_V24_RTR) ? (TIOCM_RTS | TIOCM_CTS) : 0) |
Expand Down

0 comments on commit 7b9eb9e

Please sign in to comment.