Single advertising set in the emulator and mgmt-tester
Status from this message: This series was applied to bluetooth/bluez.git (master)
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | emulator: Set the number of advertising setsemulator/ emulator/ emulator/ +1 more | +34 | 1 reply | |
| 2/2 | mgmt-tester: Add single advertising set teststools/ | +87 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH BlueZ 0/2] Single advertising set in the emulator and mgmt-tester
A controller may report a single advertising set (LE Read Number of Supported Advertising Sets returns 0x01 to 0xF0). The kernel then gives advertising instance 1 handle 0x00, the handle Global Advertising uses too, and several places took the instance number for the handle. Those were fixed in bluetooth-next by commits daf949c968d4, e7e877bf658a, 8b1eff978e66 and 4dce35adafb5, but the emulator always reports three sets, so mgmt-tester couldn't see them.
Patch 1 lets a test set the emulated controller's number of sets (btdev_set_adv_sets(), hciemu_set_central_le_adv_sets()), kept across HCI_Reset; the default stays at three. Patch 2 adds three mgmt-tester cases on one set: the random address, the controller ending a timed instance, and the removal, each on handle 0x00.
How it was tested: on a Raspberry Pi 5 running 7.4-rc2 with net/bluetooth from bluetooth-next.
- With the four kernel commits: the three new cases pass.
- Without them (bluetooth-next at def8a484b): all three fail. The first shows the bug, LE Set Advertising Set Random Address for handle 0x01; the other two fail when adding the instance, for the same reason.
- The whole of mgmt-tester with and without these patches on the same
kernel: the same tests fail on that machine either way (Read Ext Controller Info and some LL Privacy cases, and a few that pass or fail from run to run), so nothing changed for the existing ones.
The bugs were first found on real hardware: a WCH CH582 running an open controller firmware of ours that reports one advertising set, driven from btmgmt and checked with btmon. These cases let anyone repeat them without it.
Weihong Guan (2):
emulator: Set the number of advertising sets
mgmt-tester: Add single advertising set tests
emulator/btdev.c | 18 ++++++++-- emulator/btdev.h | 2 ++ emulator/hciemu.c | 14 ++++++++ emulator/hciemu.h | 2 ++ tools/mgmt-tester.c | 87 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 121 insertions(+), 2 deletions(-)
Signature · 1 line
2.47.3