• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

external/bluetooth/bluedroid


Commit MetaInfo

Revisionc9053e64bd3383ea971582b4395fab9d5d614503 (tree)
Zeit2013-04-18 13:07:27
AutorGanesh Ganapathi Batta <ganeshg@broa...>
CommiterMatthew Xie

Log Message

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

Ändern Zusammenfassung

Diff

--- a/stack/l2cap/l2c_link.c
+++ b/stack/l2cap/l2c_link.c
@@ -1394,19 +1394,19 @@ void l2c_link_process_num_completed_pkts (UINT8 *p)
13941394 (*p_lcb->p_nocp_cb)(p_lcb->remote_bd_addr);
13951395 }
13961396
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-
14081397 if (p_lcb)
14091398 {
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+ }
14101410 /* If doing round-robin, adjust communal counts */
14111411 if (p_lcb->link_xmit_quota == 0)
14121412 {
--- a/stack/l2cap/l2c_utils.c
+++ b/stack/l2cap/l2c_utils.c
@@ -183,6 +183,15 @@ void l2cu_release_lcb (tL2C_LCB *p_lcb)
183183 if (l2cb.num_links_active >= 1)
184184 l2cb.num_links_active--;
185185
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+
186195 l2c_link_adjust_allocation();
187196
188197 /* Check for ping outstanding */