reset tx state before daemon event hci packet sent - avoids stalls

This commit is contained in:
matthias.ringwald@gmail.com 2014-11-19 22:14:29 +00:00
parent 1fd51e4555
commit 5ffcfcf3c5

View File

@ -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);