diff --git a/nimble/host/src/ble_hs_hci_evt.c b/nimble/host/src/ble_hs_hci_evt.c index ec412f2a1..bd0fd00cf 100644 --- a/nimble/host/src/ble_hs_hci_evt.c +++ b/nimble/host/src/ble_hs_hci_evt.c @@ -226,7 +226,6 @@ ble_hs_hci_evt_num_completed_pkts(uint8_t event_code, uint8_t *data, int len) uint16_t num_pkts; uint16_t handle; uint8_t num_handles; - int tx_outstanding; int off; int i; @@ -242,13 +241,6 @@ ble_hs_hci_evt_num_completed_pkts(uint8_t event_code, uint8_t *data, int len) } off++; - /* If we were previously blocked due to controller buffer exhaustion, and - * this event indicates that some buffers have been freed, then the host - * needs to resume transmitting. `tx_outstanding` keeps track of whether - * this is the case. - */ - tx_outstanding = 0; - for (i = 0; i < num_handles; i++) { handle = get_le16(data + off); num_pkts = get_le16(data + off + 2); @@ -264,19 +256,14 @@ ble_hs_hci_evt_num_completed_pkts(uint8_t event_code, uint8_t *data, int len) conn->bhc_outstanding_pkts -= num_pkts; } - if (ble_hs_hci_avail_pkts == 0) { - tx_outstanding = 1; - } - ble_hs_hci_add_avail_pkts(num_pkts); } ble_hs_unlock(); } } - if (tx_outstanding) { - ble_hs_wakeup_tx(); - } + /* If any transmissions have stalled, wake them up now. */ + ble_hs_wakeup_tx(); return 0; }