linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Fix legacy pairing with some devices
@ 2012-05-28  9:47 Szymon Janc
  2012-05-28  9:47 ` [PATCH 2/2] Bluetooth: Remove unused HCI timeouts definitions Szymon Janc
  2012-05-29 17:37 ` [PATCH 1/2] Bluetooth: Fix legacy pairing with some devices Gustavo Padovan
  0 siblings, 2 replies; 11+ messages in thread
From: Szymon Janc @ 2012-05-28  9:47 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Some devices e.g. SonyEricsson Xperia ray and arc S don't do SDP search
before pairing. No L2CAP is connected so default HCI_DISCONN_TIMEOUT
(2 seconds) timeout value is being used. This results in problems with
legacy pairing as remote user has only few seconds to enter PIN before
ACL is disconnected.

Increase disconnect timeout to HCI_PAIRING_TIMEOUT if SSP is disabled
and no linkey exists.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
---
 net/bluetooth/hci_event.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ac86b65..98e8020 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1762,7 +1762,12 @@ static void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 		if (conn->type == ACL_LINK) {
 			conn->state = BT_CONFIG;
 			hci_conn_hold(conn);
-			conn->disc_timeout = HCI_DISCONN_TIMEOUT;
+
+			if (!hci_conn_ssp_enabled(conn) &&
+			    !hci_find_link_key(hdev, &ev->bdaddr))
+				conn->disc_timeout = HCI_PAIRING_TIMEOUT;
+			else
+				conn->disc_timeout = HCI_DISCONN_TIMEOUT;
 		} else
 			conn->state = BT_CONNECTED;
 
-- 
on behalf of ST-Ericsson


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-07-19 10:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28  9:47 [PATCH 1/2] Bluetooth: Fix legacy pairing with some devices Szymon Janc
2012-05-28  9:47 ` [PATCH 2/2] Bluetooth: Remove unused HCI timeouts definitions Szymon Janc
2012-05-29 17:39   ` Gustavo Padovan
2012-05-29 17:37 ` [PATCH 1/2] Bluetooth: Fix legacy pairing with some devices Gustavo Padovan
2012-05-30  7:41   ` Szymon Janc
2012-06-29 10:56     ` Johan Hedberg
2012-07-04  7:56       ` Gustavo Padovan
2012-07-19  9:13         ` Szymon Janc
2012-07-19  9:34           ` Johan Hedberg
2012-07-19 10:17             ` Szymon Janc
2012-07-19 10:25               ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).