Skip to content

Commit 0aac4a6

Browse files
PavelVPVcvinayak
authored andcommitted
Revert "Bluetooth: host: extract sending of host num complete"
This reverts commit 32212bf. Signed-off-by: Pavel Vasilyev <[email protected]> (cherry picked from commit 971c2c9) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent ad1e79c commit 0aac4a6

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

subsys/bluetooth/host/hci_core.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ void bt_send_one_host_num_completed_packets(uint16_t handle)
228228
#if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL)
229229
void bt_hci_host_num_completed_packets(struct net_buf *buf)
230230
{
231+
struct bt_hci_cp_host_num_completed_packets *cp;
231232
uint16_t handle = acl(buf)->handle;
233+
struct bt_hci_handle_count *hc;
232234
struct bt_conn *conn;
233235
uint8_t index = acl(buf)->index;
234236

@@ -254,7 +256,23 @@ void bt_hci_host_num_completed_packets(struct net_buf *buf)
254256

255257
bt_conn_unref(conn);
256258

257-
bt_send_one_host_num_completed_packets(handle);
259+
LOG_DBG("Reporting completed packet for handle %u", handle);
260+
261+
buf = bt_hci_cmd_create(BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS,
262+
sizeof(*cp) + sizeof(*hc));
263+
if (!buf) {
264+
LOG_ERR("Unable to allocate new HCI command");
265+
return;
266+
}
267+
268+
cp = net_buf_add(buf, sizeof(*cp));
269+
cp->num_handles = sys_cpu_to_le16(1);
270+
271+
hc = net_buf_add(buf, sizeof(*hc));
272+
hc->handle = sys_cpu_to_le16(handle);
273+
hc->count = sys_cpu_to_le16(1);
274+
275+
bt_hci_cmd_send(BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS, buf);
258276
}
259277
#endif /* defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL) */
260278

0 commit comments

Comments
 (0)