Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b479a8c8 authored by Andre Eisenbach's avatar Andre Eisenbach Committed by Android Git Automerger
Browse files

am 62e8fbf6: am 6fd88cd7: LE: Release transmit buffer credits

* commit '62e8fbf6':
  LE: Release transmit buffer credits
parents c8dbdcaf 62e8fbf6
Loading
Loading
Loading
Loading
+22 −9
Original line number Diff line number Diff line
@@ -136,6 +136,28 @@ void l2cu_release_lcb (tL2C_LCB *p_lcb)
    btm_remove_sco_links(p_lcb->remote_bd_addr);
#endif

    if (p_lcb->sent_not_acked > 0)
    {
#if (BLE_INCLUDED == TRUE)
        if (p_lcb->is_ble_link)
        {
            l2cb.controller_le_xmit_window += p_lcb->sent_not_acked;
            if (l2cb.controller_le_xmit_window > l2cb.num_lm_ble_bufs)
            {
                l2cb.controller_le_xmit_window = l2cb.num_lm_ble_bufs;
            }
        }
        else
#endif
        {
            l2cb.controller_xmit_window += p_lcb->sent_not_acked;
            if (l2cb.controller_xmit_window > l2cb.num_lm_acl_bufs)
            {
                l2cb.controller_xmit_window = l2cb.num_lm_acl_bufs;
            }
        }
    }

#if (BLE_INCLUDED == TRUE)
    p_lcb->is_ble_link = FALSE;
    l2cb.is_ble_connecting = FALSE;
@@ -183,15 +205,6 @@ void l2cu_release_lcb (tL2C_LCB *p_lcb)
    if (l2cb.num_links_active >= 1)
        l2cb.num_links_active--;

    if (p_lcb->sent_not_acked > 0)
    {
        l2cb.controller_xmit_window += p_lcb->sent_not_acked;
        if (l2cb.controller_xmit_window > l2cb.num_lm_acl_bufs)
        {
            l2cb.controller_xmit_window = l2cb.num_lm_acl_bufs;
        }
    }

    l2c_link_adjust_allocation();

    /* Check for ping outstanding */