]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
Bluetooth: hci_sync: avoid dup filtering when passive scanning with adv monitor
authorAnton Khirnov <anton@khirnov.net>
Mon, 29 Jul 2024 19:58:10 +0000 (21:58 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 7 Aug 2024 20:36:01 +0000 (16:36 -0400)
This restores behaviour (including the comment) from now-removed
hci_request.c, and also matches existing code for active scanning.

Without this, the duplicates filter is always active when passive
scanning, which makes it impossible to work with devices that send
nontrivial dynamic data in their advertisement reports.

Fixes: abfeea476c68 ("Bluetooth: hci_sync: Convert MGMT_OP_START_DISCOVERY")
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_sync.c

index a31d39a821f4400fb94576402afc2404d6258339..e79cd40bd079df3848ebc04efa777b8b4d48373a 100644 (file)
@@ -3019,6 +3019,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;