From ee418d0f5ba87e45ace5ba826d1c1bd4f28d5384 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 5 Feb 2024 11:15:37 +0100 Subject: [PATCH] hci: reserve packet buffer for custom init --- src/hci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index bb1c6fe5e..1c4e5d50b 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1972,6 +1972,7 @@ static void hci_initializing_run(void){ case HCI_INIT_CUSTOM_PRE_INIT: // Custom initialization if (hci_stack->chipset && hci_stack->chipset->next_command){ + hci_reserve_packet_buffer(); hci_stack->chipset_result = (*hci_stack->chipset->next_command)(hci_stack->hci_packet_buffer); bool send_cmd = false; switch (hci_stack->chipset_result){ @@ -2012,10 +2013,11 @@ static void hci_initializing_run(void){ } if (send_cmd){ - hci_reserve_packet_buffer(); hci_stack->last_cmd_opcode = little_endian_read_16(hci_stack->hci_packet_buffer, 0); hci_send_prepared_cmd_packet(); break; + } else { + hci_release_packet_buffer(); } log_info("Init script done");