Skip to content

Commit e9df3c5

Browse files
PavelVPVrlubos
authored andcommitted
[nrf fromtree] 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)
1 parent 8256f3d commit e9df3c5

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
@@ -273,7 +273,9 @@ __weak void bt_testing_trace_event_acl_pool_destroy(struct net_buf *buf)
273273
#if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL)
274274
void bt_hci_host_num_completed_packets(struct net_buf *buf)
275275
{
276+
struct bt_hci_cp_host_num_completed_packets *cp;
276277
uint16_t handle = acl(buf)->handle;
278+
struct bt_hci_handle_count *hc;
277279
struct bt_conn *conn;
278280
uint8_t index = acl(buf)->index;
279281

@@ -303,7 +305,23 @@ void bt_hci_host_num_completed_packets(struct net_buf *buf)
303305

304306
bt_conn_unref(conn);
305307

306-
bt_send_one_host_num_completed_packets(handle);
308+
LOG_DBG("Reporting completed packet for handle %u", handle);
309+
310+
buf = bt_hci_cmd_create(BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS,
311+
sizeof(*cp) + sizeof(*hc));
312+
if (!buf) {
313+
LOG_ERR("Unable to allocate new HCI command");
314+
return;
315+
}
316+
317+
cp = net_buf_add(buf, sizeof(*cp));
318+
cp->num_handles = sys_cpu_to_le16(1);
319+
320+
hc = net_buf_add(buf, sizeof(*hc));
321+
hc->handle = sys_cpu_to_le16(handle);
322+
hc->count = sys_cpu_to_le16(1);
323+
324+
bt_hci_cmd_send(BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS, buf);
307325
}
308326
#endif /* defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL) */
309327

0 commit comments

Comments
 (0)