Skip to content

Commit cd13a8d

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 e94b91d commit cd13a8d

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
@@ -229,7 +229,9 @@ void bt_send_one_host_num_completed_packets(uint16_t handle)
229229
#if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL)
230230
void bt_hci_host_num_completed_packets(struct net_buf *buf)
231231
{
232+
struct bt_hci_cp_host_num_completed_packets *cp;
232233
uint16_t handle = acl(buf)->handle;
234+
struct bt_hci_handle_count *hc;
233235
struct bt_conn *conn;
234236
uint8_t index = acl(buf)->index;
235237

@@ -255,7 +257,23 @@ void bt_hci_host_num_completed_packets(struct net_buf *buf)
255257

256258
bt_conn_unref(conn);
257259

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

0 commit comments

Comments
 (0)