summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-12-03 05:45:19 -0500
committerMarcel Holtmann <marcel@holtmann.org>2015-12-09 18:51:51 -0500
commit2f99536a5b34d5b0f54723067d68f6cef3f0fdc6 (patch)
treeed994a129f72fd33e0ade575a3e43b729ae6d4e9 /net/bluetooth
parent28dc4b92e20e0fd18be2d8356abf959d58c7346a (diff)
Bluetooth: Use continuous scanning when creating LE connections
All LE connections are now triggered through a preceding passive scan and waiting for a connectable advertising report. This means we've got the best possible guarantee that the device is within range and should be able to request the controller to perform continuous scanning. This way we minimize the risk that we miss out on any advertising packets. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Cc: stable@vger.kernel.org # 4.3+
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_conn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index e2600213cd50..48a7eac6ef71 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -726,8 +726,12 @@ static void hci_req_add_le_create_conn(struct hci_request *req,
726 if (hci_update_random_address(req, false, &own_addr_type)) 726 if (hci_update_random_address(req, false, &own_addr_type))
727 return; 727 return;
728 728
729 /* Set window to be the same value as the interval to enable
730 * continuous scanning.
731 */
729 cp.scan_interval = cpu_to_le16(hdev->le_scan_interval); 732 cp.scan_interval = cpu_to_le16(hdev->le_scan_interval);
730 cp.scan_window = cpu_to_le16(hdev->le_scan_window); 733 cp.scan_window = cp.scan_interval;
734
731 bacpy(&cp.peer_addr, &conn->dst); 735 bacpy(&cp.peer_addr, &conn->dst);
732 cp.peer_addr_type = conn->dst_type; 736 cp.peer_addr_type = conn->dst_type;
733 cp.own_address_type = own_addr_type; 737 cp.own_address_type = own_addr_type;