external/bluetooth/bluedroid
Revision | c9053e64bd3383ea971582b4395fab9d5d614503 (tree) |
---|---|
Zeit | 2013-04-18 13:07:27 |
Autor | Ganesh Ganapathi Batta <ganeshg@broa...> |
Commiter | Matthew Xie |
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
@@ -1394,19 +1394,19 @@ void l2c_link_process_num_completed_pkts (UINT8 *p) | ||
1394 | 1394 | (*p_lcb->p_nocp_cb)(p_lcb->remote_bd_addr); |
1395 | 1395 | } |
1396 | 1396 | |
1397 | -#if (BLE_INCLUDED == TRUE) | |
1398 | - if (p_lcb && p_lcb->is_ble_link) | |
1399 | - l2cb.controller_le_xmit_window += num_sent; | |
1400 | - else | |
1401 | -#endif | |
1402 | - { | |
1403 | - | |
1404 | - /* Maintain the total window to the controller */ | |
1405 | - l2cb.controller_xmit_window += num_sent; | |
1406 | - } | |
1407 | - | |
1408 | 1397 | if (p_lcb) |
1409 | 1398 | { |
1399 | +#if (BLE_INCLUDED == TRUE) | |
1400 | + if (p_lcb->is_ble_link) | |
1401 | + { | |
1402 | + l2cb.controller_le_xmit_window += num_sent; | |
1403 | + } | |
1404 | + else | |
1405 | +#endif | |
1406 | + { | |
1407 | + /* Maintain the total window to the controller */ | |
1408 | + l2cb.controller_xmit_window += num_sent; | |
1409 | + } | |
1410 | 1410 | /* If doing round-robin, adjust communal counts */ |
1411 | 1411 | if (p_lcb->link_xmit_quota == 0) |
1412 | 1412 | { |
@@ -183,6 +183,15 @@ void l2cu_release_lcb (tL2C_LCB *p_lcb) | ||
183 | 183 | if (l2cb.num_links_active >= 1) |
184 | 184 | l2cb.num_links_active--; |
185 | 185 | |
186 | + if (p_lcb->sent_not_acked > 0) | |
187 | + { | |
188 | + l2cb.controller_xmit_window += p_lcb->sent_not_acked; | |
189 | + if (l2cb.controller_xmit_window > l2cb.num_lm_acl_bufs) | |
190 | + { | |
191 | + l2cb.controller_xmit_window = l2cb.num_lm_acl_bufs; | |
192 | + } | |
193 | + } | |
194 | + | |
186 | 195 | l2c_link_adjust_allocation(); |
187 | 196 | |
188 | 197 | /* Check for ping outstanding */ |