Bluetooth: Use ext adv handle from requests in CCs
authorDaniel Winkler <danielwinkler@google.com>
Mon, 5 Apr 2021 23:33:04 +0000 (16:33 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 6 Apr 2021 08:43:25 +0000 (10:43 +0200)
commit25e70886c20005ac7facbd997ff4c3526dcd0de3
tree0e9ad60438754062d80916c068a7e2a68712688e
parent93917fd224fdaebd0864143468e358300d1ffe36
Bluetooth: Use ext adv handle from requests in CCs

Some extended advertising hci command complete events are still using
hdev->cur_adv_instance to map the request to the correct advertisement
handle. However, with extended advertising, "current instance" doesn't
make sense as we can have multiple concurrent advertisements. This
change switches these command complete handlers to use the advertising
handle from the request/event, to ensure we will always use the correct
advertising handle regardless of the state of hdev->cur_adv_instance.

This change is tested on hatch and kefka chromebooks and run through
single- and multi-advertising automated tests to confirm callbacks
report tx power to the correct advertising handle, etc.

Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Daniel Winkler <danielwinkler@google.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_event.c