Skip to content

Commit 5638d9e

Browse files
committed
Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect
When disconnecting an ISO link the controller may not generate HCI_EV_NUM_COMP_PKTS for unacked packets which needs to be restored in hci_conn_del otherwise the host would assume they are still in use and would not be able to use all the buffers available. Fixes: 26afbd8 ("Bluetooth: Add initial implementation of CIS connections") Signed-off-by: Luiz Augusto von Dentz <[email protected]> Tested-by: Frédéric Danis <[email protected]>
1 parent 7c9524d commit 5638d9e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

net/bluetooth/hci_conn.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,10 +1067,21 @@ int hci_conn_del(struct hci_conn *conn)
10671067
hdev->acl_cnt += conn->sent;
10681068
} else {
10691069
struct hci_conn *acl = conn->link;
1070+
10701071
if (acl) {
10711072
acl->link = NULL;
10721073
hci_conn_drop(acl);
10731074
}
1075+
1076+
/* Unacked ISO frames */
1077+
if (conn->type == ISO_LINK) {
1078+
if (hdev->iso_pkts)
1079+
hdev->iso_cnt += conn->sent;
1080+
else if (hdev->le_pkts)
1081+
hdev->le_cnt += conn->sent;
1082+
else
1083+
hdev->acl_cnt += conn->sent;
1084+
}
10741085
}
10751086

10761087
if (conn->amp_mgr)

0 commit comments

Comments
 (0)