Skip to contentSkip to conversation

Bluetooth: msft: Extended monitor tracking by address filter

PATCH Applied [email protected] 3 participants 3 messages Jun 21, 2023 – Jun 26, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 Bluetooth: msft: Extended monitor tracking by address filter

From: Hilda Wu <[email protected]>

Since limited tracking device per condition, this feature is to support tracking multiple devices concurrently.
When a pattern monitor detects the device, this feature issues an address monitor for tracking that device. Let pattern monitor can keep monitor new devices.
This feature adds an address filter when receiving a LE monitor device event which monitor handle is for a pattern, and the controller started monitoring the device. And this feature also has cancelled the monitor advertisement from address filters when receiving a LE monitor device event when the controller stopped monitoring the device specified by an address and monitor handle.

Below is an example to know the feature adds the address filter.

//Add MSFT pattern monitor
< HCI Command: Vendor (0x3f|0x00f0) plen 14 #142 [hci0] 55.552420

        03 b8 a4 03 ff 01 01 06 09 05 5f 52 45 46        .........._REF
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 6 #143 [hci0] 55.653960

      Vendor (0x3f|0x00f0) ncmd 2
        Status: Success (0x00)
        03 00

//Got event from the pattern monitor

Quoted 1 line

HCI Event: Vendor (0xff) plen 18 #148 [hci0] 58.384953

23 79 54 33 77 88 97 68 02 00 fb c1 29 eb 27 b8 #yT3w..h....).'.
00 01 ..

//Add MSFT address monitor (Sample address: B8:27:EB:29:C1:FB)
< HCI Command: Vendor (0x3f|0x00f0) plen 13 #149 [hci0] 58.385067

        03 b8 a4 03 ff 04 00 fb c1 29 eb 27 b8           .........).'.

//Report to userspace about found device (ADV Monitor Device Found)
@ MGMT Event: Unknown (0x002f) plen 38 {0x0003} [hci0] 58.680042

        01 00 fb c1 29 eb 27 b8 01 ce 00 00 00 00 16 00  ....).'.........
        0a 09 4b 45 59 42 44 5f 52 45 46 02 01 06 03 19  ..KEYBD_REF.....
        c1 03 03 03 12 18                                ......

//Got event from address monitor

Quoted 1 line

HCI Event: Vendor (0xff) plen 18 #152 [hci0] 58.672956

        23 79 54 33 77 88 97 68 02 00 fb c1 29 eb 27 b8  #yT3w..h....).'.
        01 01

---
Changes in v5:
- Change quirk name and description.
- Add btmon sample

Changes in v4:
- Follow suggested, modification include allocate an address_filter cb and pass to hci_cmd_sync_queue, etc.

Changes in v3:
- Added flag for the feature.
- Modified debug message level.
- Follow suggested, using reverse xmas tree in new code.

Changes in v2:
- Fixed build bot warning, removed un-used parameter.
- Follow suggested, adjust for readability and idiomatic, modified error case, etc.
---

---
 drivers/bluetooth/btrtl.c   |   4 +
 include/net/bluetooth/hci.h |  10 +
 net/bluetooth/msft.c        | 412 ++++++++++++++++++++++++++++++++++--
 3 files changed, 411 insertions(+), 15 deletions(-)
drivers/bluetooth/btrtl.c +4 -0
index 04399b3c39a0..ddae6524106d 100644
@@ -1269,6 +1269,10 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
 		if (btrtl_dev->project_id == CHIP_ID_8852C)
 			btrealtek_set_flag(hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP);
 
+		if (btrtl_dev->project_id == CHIP_ID_8852A ||
+		    btrtl_dev->project_id == CHIP_ID_8852C)
+			set_bit(HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER, &hdev->quirks);
+
 		hci_set_aosp_capable(hdev);
 		break;
 	default:
include/net/bluetooth/hci.h +10 -0
index ab2f8f1817cf..5723405b833e 100644
@@ -309,6 +309,16 @@ enum {
 	 * to support it.
 	 */
 	HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT,
+
+	/* When this quirk is set, MSFT extension monitor tracking by
+	 * address filter is supported. Since tracking quantity of each
+	 * pattern is limited, this feature supports tracking multiple
+	 * devices concurrently if controller supports multiple
+	 * address filters.
+	 *
+	 * This quirk must be set before hci_register_dev is called.
+	 */
+	HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER,
 };
 
 /* HCI device flags */
net/bluetooth/msft.c +397 -15

545 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=759053

---Test result---

Test Summary:

CheckPatch                    PASS      1.45 seconds
GitLint                       PASS      0.35 seconds
SubjectPrefix                 PASS      0.13 seconds
BuildKernel                   PASS      32.28 seconds
CheckAllWarning               PASS      35.44 seconds
CheckSparse                   PASS      40.65 seconds
CheckSmatch                   PASS      112.92 seconds
BuildKernel32                 PASS      31.27 seconds
TestRunnerSetup               PASS      445.76 seconds
TestRunner_l2cap-tester       PASS      16.59 seconds
TestRunner_iso-tester         PASS      23.14 seconds
TestRunner_bnep-tester        PASS      5.36 seconds
TestRunner_mgmt-tester        PASS      128.25 seconds
TestRunner_rfcomm-tester      PASS      8.66 seconds
TestRunner_sco-tester         PASS      8.00 seconds
TestRunner_ioctl-tester       PASS      9.20 seconds
TestRunner_mesh-tester        PASS      6.84 seconds
TestRunner_smp-tester         PASS      7.94 seconds
TestRunner_userchan-tester    PASS      5.67 seconds
IncrementalBuild              PASS      29.96 seconds

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to [email protected]
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 14 lines · On Wed, 21 Jun 2023 18:00:31 +0800 you wrote:

From: Hilda Wu <[email protected]>

Since limited tracking device per condition, this feature is to support tracking multiple devices concurrently.
When a pattern monitor detects the device, this feature issues an address monitor for tracking that device. Let pattern monitor can keep monitor new devices.
This feature adds an address filter when receiving a LE monitor device event which monitor handle is for a pattern, and the controller started monitoring the device. And this feature also has cancelled the monitor advertisement from address filters when receiving a LE monitor device event when the controller stopped monitoring the device specified by an address and monitor handle.

Quoted 1 line

[...]

Here is the summary with links:
- [v5] Bluetooth: msft: Extended monitor tracking by address filter

    https://git.kernel.org/bluetooth/bluetooth-next/c/53c7c193d66a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html