Bluetooth: Avoid link entering sniff mode during pairing process.

Found incoming connection issue with IOT devices when link enters
sniff mode during pairing process. The current change avoids link
entering sniff mode when link key is not available for connection.

Change-Id: I26fbbccec8d7b3faa91cba8f976fb0e44d7f5344
CRs-Fixed: 331520
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
This commit is contained in:
Srinivas Krovvidi
2012-01-26 10:48:08 +05:30
parent 749ce60bb4
commit 32ba935d89
2 changed files with 6 additions and 2 deletions

View File

@@ -909,7 +909,9 @@ void hci_conn_enter_sniff_mode(struct hci_conn *conn)
if (!lmp_sniff_capable(hdev) || !lmp_sniff_capable(conn))
return;
if (conn->mode != HCI_CM_ACTIVE || !(conn->link_policy & HCI_LP_SNIFF))
if (conn->mode != HCI_CM_ACTIVE ||
!(conn->link_policy & HCI_LP_SNIFF) ||
(hci_find_link_key(hdev, &conn->dst) == NULL))
return;
if (lmp_sniffsubr_capable(hdev) && lmp_sniffsubr_capable(conn)) {

View File

@@ -1,6 +1,6 @@
/*
BlueZ - Bluetooth protocol stack for Linux
Copyright (c) 2000-2001, 2010-2011, Code Aurora Forum. All rights reserved.
Copyright (c) 2000-2001, 2010-2012, Code Aurora Forum. All rights reserved.
Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
@@ -2492,6 +2492,7 @@ static inline void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff
hci_conn_hold(conn);
conn->disc_timeout = HCI_PAIRING_TIMEOUT;
hci_conn_put(conn);
hci_conn_enter_active_mode(conn, 0);
}
if (!test_bit(HCI_PAIRABLE, &hdev->flags))
@@ -2587,6 +2588,7 @@ static inline void hci_link_key_notify_evt(struct hci_dev *hdev, struct sk_buff
pin_len = conn->pin_length;
hci_conn_put(conn);
hci_conn_enter_active_mode(conn, 0);
}
if (test_bit(HCI_LINK_KEYS, &hdev->flags))