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

Commit 8e2cec14 authored by Ganesh Ganapathi Batta's avatar Ganesh Ganapathi Batta Committed by Matthew Xie
Browse files

Proper management of controller ACL buffers.

Reclaim all the unacknowledged controller ACL buffers associated
with a L2CAP link when L2CAP control block is released.
Bug:8589069

Change-Id: Icef1646041e73280a13dedc7a45564d032c59712
parent 056da7da
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -1394,19 +1394,19 @@ void l2c_link_process_num_completed_pkts (UINT8 *p)
            (*p_lcb->p_nocp_cb)(p_lcb->remote_bd_addr);
        }

        if (p_lcb)
        {
#if (BLE_INCLUDED == TRUE)
        if (p_lcb && p_lcb->is_ble_link)
            if (p_lcb->is_ble_link)
            {
                l2cb.controller_le_xmit_window += num_sent;
            }
            else
#endif
            {

                /* Maintain the total window to the controller */
                l2cb.controller_xmit_window += num_sent;
            }

        if (p_lcb)
        {
            /* If doing round-robin, adjust communal counts */
            if (p_lcb->link_xmit_quota == 0)
            {
+9 −0
Original line number Diff line number Diff line
@@ -183,6 +183,15 @@ 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 */