All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Timo Teräs" <ext-timo.teras@nokia.com>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] [PATCH] RFCOMM does not call tty_hangup() when DCD is de-asserted
Date: Wed, 20 Apr 2005 14:22:40 +0300	[thread overview]
Message-ID: <42663B80.6070309@nokia.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

Hi all,

It seems that RFCOMM does not handle properly the de-assertation of CD 
signal. It should call tty_hangup() to work properly.

One side effect is that data calls that are hanged up from remote side 
are not detected as being hanged up.

I've made a very quick patch for this. In my case this patch enabled the 
detection carried detect signal de-assertation. But since I'm not an 
expert on RFCOMM stuff there might be some cases where tty_hangup() 
should not be called. In serial side the DCD change is handled by 
uart_handle_dcd_change() defined in include/linux/serial_core.h and it 
has some extra checks there as well.

So could some one wiser there check what actually has to be done for the 
hangup mechanism to work properly. Or if my patch looks good enough feel 
free to commit it.

Thanks,
   Timo

[-- Attachment #2: bluez-dcd-fix.diff --]
[-- Type: text/plain, Size: 586 bytes --]

===== net/bluetooth/rfcomm/tty.c 1.36 vs edited =====
--- 1.36/net/bluetooth/rfcomm/tty.c	2005-04-13 15:55:20 +03:00
+++ edited/net/bluetooth/rfcomm/tty.c	2005-04-20 14:13:45 +03:00
@@ -531,6 +531,12 @@ static void rfcomm_dev_modem_status(stru
 	
 	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)
+			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) |

             reply	other threads:[~2005-04-20 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-20 11:22 Timo Teräs [this message]
2005-04-20 12:39 ` [Bluez-devel] [PATCH] RFCOMM does not call tty_hangup() when DCD is de-asserted Marcel Holtmann
2005-04-20 13:26   ` Timo Teräs
2005-04-21 21:09   ` [Bluez-devel] [PATCH] RFCOMM does not call tty_hangup() whenDCD " Victor Shcherbatyuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42663B80.6070309@nokia.com \
    --to=ext-timo.teras@nokia.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.