Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 0/2] Bluetooth: MSFT: Only enable the advertisement filter with monitors
@ 2026-11-20  1:13 Thomas de Gruijter via B4 Relay
  2026-11-20  1:13 ` [PATCH 1/2] Bluetooth: MSFT: Record the filter state on Command Disallowed Thomas de Gruijter via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thomas de Gruijter via B4 Relay @ 2026-11-20  1:13 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Brian Gix, Yun-Hao Chung,
	Miao-chen Chou, Archie Pusaka
  Cc: Luiz Augusto von Dentz, linux-bluetooth, linux-kernel,
	Thomas de Gruijter

On MediaTek MT7922 (USB 0e8d:0616, BT firmware build 20260724) LE
discovery and passive scanning find nothing, because msft_do_open()
enables the MSFT advertisement filter on every power on even when no
advertisement monitor is registered, and this controller then drops
every advertisement.

Patch 2 only enables the filter while at least one monitor is offloaded.
It is the first user of msft->filter_enabled, which does not follow the
controller when it reports the filter as already being in the requested
state, so patch 1 fixes that first.

How the problem was found
-------------------------
- btmon showed LE Set Extended Scan Parameters/Enable completing with
  status 0x00, followed by zero LE Extended Advertising Report events
  while three BLE beacons and ~20 other devices were in range.
- With hci0 powered off in BlueZ, the controller was reset and driven
  directly through the HCI user channel. Legacy and extended scanning
  both delivered reports (~870-980 in 10 s from 23 devices). Adding the
  kernel's init steps one at a time showed that only LE Set
  Advertisement Filter Enable(0x01) stops all reports (0, versus
  ~520-540 with LE Set Address Resolution Enable or the CIS host
  feature bit added instead).
- Disabling the filter on the running hci0 through a raw HCI socket made
  BlueZ LE discovery see 22 devices instead of 0.

Testing
-------
- Patch 2 was tested on the MT7922 described
  above: LE discovery works right after boot (22 devices instead of 0)
  and BLE power control of Lighthouse base stations works again.

Not tested
----------
- Patch 1.
- Any setup with advertisement monitors registered (adding or removing
  monitors, suspend/resume with monitors), any controller other than
  the MT7922, and the Command Disallowed path of patch 1, which needs a
  controller that starts with the filter enabled.

Tool assistance
---------------
The investigation and the creation test scripts were done using Claude Code.
I have reviewed the changes and the analysis and can answer questions about them.

---
Thomas de Gruijter (2):
      Bluetooth: MSFT: Record the filter state on Command Disallowed
      Bluetooth: MSFT: Only enable the advertisement filter with monitors

 net/bluetooth/msft.c | 57 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 49 insertions(+), 8 deletions(-)
---
base-commit: 1d79f61152c315e30e758116e525871732181a98
change-id: 20261120-msft-filter-monitors-05e7b8fb6175

Best regards,
--  
Thomas de Gruijter <thomasdegruijter@pm.me>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-20 17:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20  1:13 [PATCH 0/2] Bluetooth: MSFT: Only enable the advertisement filter with monitors Thomas de Gruijter via B4 Relay
2026-11-20  1:13 ` [PATCH 1/2] Bluetooth: MSFT: Record the filter state on Command Disallowed Thomas de Gruijter via B4 Relay
2026-11-20  4:51   ` Bluetooth: MSFT: Only enable the advertisement filter with monitors bluez.test.bot
2026-11-20  1:13 ` [PATCH 2/2] " Thomas de Gruijter via B4 Relay
2026-11-20 17:20 ` [PATCH 0/2] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox