]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: Handle Inquiry Cancel error after Inquiry Complete
authorSonny Sasaka <sonnysasaka@chromium.org>
Wed, 6 May 2020 19:55:03 +0000 (12:55 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 13 May 2020 07:35:17 +0000 (09:35 +0200)
commita4f20b5d059a92d0fef94c4e4c83d01f6917b6b3
tree7800aa1cbf5e1c35c9b3db635cbdaba5bcff7409
parent6acc83bcae949fe398f7efe7c67bb3d250257322
Bluetooth: Handle Inquiry Cancel error after Inquiry Complete

After sending Inquiry Cancel command to the controller, it is possible
that Inquiry Complete event comes before Inquiry Cancel command complete
event. In this case the Inquiry Cancel command will have status of
Command Disallowed since there is no Inquiry session to be cancelled.
This case should not be treated as error, otherwise we can reach an
inconsistent state.

Example of a btmon trace when this happened:

< HCI Command: Inquiry Cancel (0x01|0x0002) plen 0
> HCI Event: Inquiry Complete (0x01) plen 1
        Status: Success (0x00)
> HCI Event: Command Complete (0x0e) plen 4
      Inquiry Cancel (0x01|0x0002) ncmd 1
        Status: Command Disallowed (0x0c)

Signed-off-by: Sonny Sasaka <sonnysasaka@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_event.c