aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-12-14 16:23:10 -0500
committerDavid S. Miller <davem@davemloft.net>2015-12-14 16:23:10 -0500
commit5148371a752234181ac73ea388863faeaf4dd66c (patch)
tree3cab25602dd57ce88c073a4321706717b3f0dd3d /net/bluetooth/hci_conn.c
parentwan: wanxl: add pci_disable_device in case of error (diff)
parentieee802154/adf7242: Driver for ADF7242 MAC IEEE802154 (diff)
downloadlinux-dev-5148371a752234181ac73ea388863faeaf4dd66c.tar.xz
linux-dev-5148371a752234181ac73ea388863faeaf4dd66c.zip
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Johan Hedberg says: ==================== pull request: bluetooth-next 2015-12-11 Here's another set of Bluetooth & 802.15.4 patches for the 4.5 kernel: - 6LoWPAN debugfs support - New 802.15.4 driver for ADF7242 MAC IEEE802154 - Initial code for 6LoWPAN Generic Header Compression (GHC) support - Refactor Bluetooth LE scan & advertising behind dedicated workqueue - Cleanups to Bluetooth H:5 HCI driver - Support for Toshiba Broadcom based Bluetooth controllers - Use continuous scanning when establishing Bluetooth LE connections Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 2d334e07fd77..32575b49f4a0 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -668,8 +668,16 @@ void hci_le_conn_failed(struct hci_conn *conn, u8 status)
conn->state = BT_CLOSED;
- mgmt_connect_failed(hdev, &conn->dst, conn->type, conn->dst_type,
- status);
+ /* If the status indicates successful cancellation of
+ * the attempt (i.e. Unkown Connection Id) there's no point of
+ * notifying failure since we'll go back to keep trying to
+ * connect. The only exception is explicit connect requests
+ * where a timeout + cancel does indicate an actual failure.
+ */
+ if (status != HCI_ERROR_UNKNOWN_CONN_ID ||
+ (params && params->explicit_connect))
+ mgmt_connect_failed(hdev, &conn->dst, conn->type,
+ conn->dst_type, status);
hci_connect_cfm(conn, status);
@@ -683,7 +691,7 @@ void hci_le_conn_failed(struct hci_conn *conn, u8 status)
/* Re-enable advertising in case this was a failed connection
* attempt as a peripheral.
*/
- mgmt_reenable_advertising(hdev);
+ hci_req_reenable_advertising(hdev);
}
static void create_le_conn_complete(struct hci_dev *hdev, u8 status, u16 opcode)
@@ -726,8 +734,12 @@ static void hci_req_add_le_create_conn(struct hci_request *req,
if (hci_update_random_address(req, false, &own_addr_type))
return;
+ /* Set window to be the same value as the interval to enable
+ * continuous scanning.
+ */
cp.scan_interval = cpu_to_le16(hdev->le_scan_interval);
- cp.scan_window = cpu_to_le16(hdev->le_scan_window);
+ cp.scan_window = cp.scan_interval;
+
bacpy(&cp.peer_addr, &conn->dst);
cp.peer_addr_type = conn->dst_type;
cp.own_address_type = own_addr_type;