Linux bluetooth development
 help / color / mirror / Atom feed
From: Hemant Gupta <hemant.gupta@stericsson.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Hemant Gupta <hemant.gupta@stericsson.com>
Subject: [PATCH] Bluetooth: Update L2CAP Channel State for LE Link during Pairing
Date: Wed, 18 Apr 2012 10:24:34 +0530	[thread overview]
Message-ID: <1334724874-3086-1-git-send-email-hemant.gupta@stericsson.com> (raw)

This patch updates the L2CAP Channel state to Connected when LE Link
is established, so that data transmission can start on CID 4.
Without this fix if remote side sends data on CID 4 immidiately after
LE Link was established, data was being discarded in l2cap_att_channel()
API because channel state was still BT_CONNECT when SMP pairing is in
progress. This was resulting in disconnection from remote side after 30 seconds
since ATT request was not answered by user space as data was discarded.

Signed-off-by: Hemant Gupta <hemant.gupta@stericsson.com>
---
 net/bluetooth/l2cap_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 15478b3..20dbebb 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1189,6 +1189,7 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
 		l2cap_chan_lock(chan);
 
 		if (conn->hcon->type == LE_LINK) {
+			__l2cap_state_change(chan, BT_CONNECTED);
 			if (smp_conn_security(conn, chan->sec_level))
 				l2cap_chan_ready(chan);
 
-- 
1.7.0.4


             reply	other threads:[~2012-04-18  4:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18  4:54 Hemant Gupta [this message]
2012-04-19 14:03 ` [PATCH] Bluetooth: Update L2CAP Channel State for LE Link during Pairing Gustavo Padovan
2012-04-19 15:41   ` Hemant Gupta

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=1334724874-3086-1-git-send-email-hemant.gupta@stericsson.com \
    --to=hemant.gupta@stericsson.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox