blob: c2467b2409db904511475e4b3caa1b0a3dd11cfd [file] [log] [blame]
From ed9950ac7d2b9fd655ae31d441bfb86b7a62149f Mon Sep 17 00:00:00 2001
From: Manish Mandlik <mmandlik@google.com>
Date: Fri, 3 Jun 2022 14:38:26 -0700
Subject: [PATCH] CHROMIUM: Bluetooth: hci_sync: Disable filter dup when adv
monitoring
SW based filtering requires all advertisement reports to perform RSSI
based filtering. So, disable filter duplicates while scanning for
advertisement monitoring.
Fixes: 9ca7b6b1cc20 ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3")
Note: This will be upstream'd later. Submitting as a CHROMIUM patch to get this merged into M104 on time.
Signed-off-by: Manish Mandlik <mmandlik@google.com>
BUG=b:234869005
TEST=Run AdvMonitor tests on dedede with RTL
Signed-off-by: Zhengping Jiang <jiangzhp@google.com>
---
net/bluetooth/hci_sync.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index b180c0fff709f0ae2a68c85346dd8d5159fe3b7e..79cc35d0fc5fcc61bdb654f6d9e9a9e40151700d 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2664,6 +2664,20 @@ static int hci_passive_scan_sync(struct hci_dev *hdev)
} else if (hci_is_adv_monitoring(hdev)) {
window = hdev->le_scan_window_adv_monitor;
interval = hdev->le_scan_int_adv_monitor;
+
+ /* Disable duplicates filter when scanning for advertisement
+ * monitor for the following reasons.
+ *
+ * For HW pattern filtering (ex. MSFT), Realtek and Qualcomm
+ * controllers ignore RSSI_Sampling_Period when the duplicates
+ * filter is enabled.
+ *
+ * For SW pattern filtering, when we're not doing interleaved
+ * scanning, it is necessary to disable duplicates filter,
+ * otherwise hosts can only receive one advertisement and it's
+ * impossible to know if a peer is still in range.
+ */
+ filter_dups = LE_SCAN_FILTER_DUP_DISABLE;
} else {
window = hdev->le_scan_window;
interval = hdev->le_scan_interval;
--
2.38.1.584.g0f3c55d4c2-goog