diff --git a/src/hci_transport_h4_ehcill_dma.c b/src/hci_transport_h4_ehcill_dma.c index 0674e2a9a..0a23ebe78 100644 --- a/src/hci_transport_h4_ehcill_dma.c +++ b/src/hci_transport_h4_ehcill_dma.c @@ -360,6 +360,12 @@ static void h4_block_sent(void){ static int h4_process(struct data_source *ds) { + // reset tx state before emitting packet sent event + // to allow for positive can_send_now + if (tx_state == TX_DONE){ + tx_state = TX_IDLE; + } + // notify about packet sent if (tx_send_packet_sent){ tx_send_packet_sent = 0; @@ -367,11 +373,6 @@ static int h4_process(struct data_source *ds) { packet_handler(HCI_EVENT_PACKET, &event[0], sizeof(event)); } - // reset tx state - if (tx_state == TX_DONE){ - tx_state = TX_IDLE; - } - if (h4_state != H4_PACKET_RECEIVED) return 0; packet_handler(hci_packet[0], &hci_packet[1], read_pos-1);