hci: reserve packet buffer for custom init

This commit is contained in:
Matthias Ringwald 2024-02-05 11:15:37 +01:00
parent ca6804fd63
commit ee418d0f5b

View File

@ -1972,6 +1972,7 @@ static void hci_initializing_run(void){
case HCI_INIT_CUSTOM_PRE_INIT: case HCI_INIT_CUSTOM_PRE_INIT:
// Custom initialization // Custom initialization
if (hci_stack->chipset && hci_stack->chipset->next_command){ 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); hci_stack->chipset_result = (*hci_stack->chipset->next_command)(hci_stack->hci_packet_buffer);
bool send_cmd = false; bool send_cmd = false;
switch (hci_stack->chipset_result){ switch (hci_stack->chipset_result){
@ -2012,10 +2013,11 @@ static void hci_initializing_run(void){
} }
if (send_cmd){ if (send_cmd){
hci_reserve_packet_buffer();
hci_stack->last_cmd_opcode = little_endian_read_16(hci_stack->hci_packet_buffer, 0); hci_stack->last_cmd_opcode = little_endian_read_16(hci_stack->hci_packet_buffer, 0);
hci_send_prepared_cmd_packet(); hci_send_prepared_cmd_packet();
break; break;
} else {
hci_release_packet_buffer();
} }
log_info("Init script done"); log_info("Init script done");