aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-12-05 10:20:14 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2014-12-05 11:17:19 -0500
commit4efbb2ce8b6f693ce9607c28082f542a70eb5934 (patch)
tree0374c7bbb38927f3779a8003878da3cf2fe388e2
parent2f010b55884efad9c2be572070cb7377a5388fcd (diff)
Bluetooth: Add support for enabling Extended Scanner Filter Policies
The new Extended Scanner Filter Policies feature has to be enabled by selecting the correct filter policy for the scan parameters. This patch does that when the controller has been enabled to use LE Privacy. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/hci_core.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index da8969e08b0c..c1d5726cb8c9 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -5625,6 +5625,19 @@ void hci_req_add_le_passive_scan(struct hci_request *req)
5625 */ 5625 */
5626 filter_policy = update_white_list(req); 5626 filter_policy = update_white_list(req);
5627 5627
5628 /* When the controller is using random resolvable addresses and
5629 * with that having LE privacy enabled, then controllers with
5630 * Extended Scanner Filter Policies support can now enable support
5631 * for handling directed advertising.
5632 *
5633 * So instead of using filter polices 0x00 (no whitelist)
5634 * and 0x01 (whitelist enabled) use the new filter policies
5635 * 0x02 (no whitelist) and 0x03 (whitelist enabled).
5636 */
5637 if (test_bit(HCI_PRIVACY, &hdev->dev_flags) &&
5638 (hdev->le_features[0] & HCI_LE_EXT_SCAN_POLICY))
5639 filter_policy |= 0x02;
5640
5628 memset(&param_cp, 0, sizeof(param_cp)); 5641 memset(&param_cp, 0, sizeof(param_cp));
5629 param_cp.type = LE_SCAN_PASSIVE; 5642 param_cp.type = LE_SCAN_PASSIVE;
5630 param_cp.interval = cpu_to_le16(hdev->le_scan_interval); 5643 param_cp.interval = cpu_to_le16(hdev->le_scan_interval);