Bluetooth: hci_sync: Reset device counters in hci_dev_close_sync()
Before resetting or closing the device, protocol counters should also be
zeroed.
Fixes: d0b137062b ("Bluetooth: hci_sync: Rework init stages")
Signed-off-by: Heitor Alves de Siqueira <halves@igalia.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
master
parent
525daaea45
commit
cdf88b35e0
|
|
@ -5393,6 +5393,10 @@ int hci_dev_close_sync(struct hci_dev *hdev)
|
||||||
/* Reset device */
|
/* Reset device */
|
||||||
skb_queue_purge(&hdev->cmd_q);
|
skb_queue_purge(&hdev->cmd_q);
|
||||||
atomic_set(&hdev->cmd_cnt, 1);
|
atomic_set(&hdev->cmd_cnt, 1);
|
||||||
|
hdev->acl_cnt = 0;
|
||||||
|
hdev->sco_cnt = 0;
|
||||||
|
hdev->le_cnt = 0;
|
||||||
|
hdev->iso_cnt = 0;
|
||||||
if (hci_test_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE) &&
|
if (hci_test_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE) &&
|
||||||
!auto_off && !hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) {
|
!auto_off && !hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) {
|
||||||
set_bit(HCI_INIT, &hdev->flags);
|
set_bit(HCI_INIT, &hdev->flags);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue