system/bt
Revision | c3934ddad6520040152eaeedd4ad667bd467a153 (tree) |
---|---|
Time | 2019-08-20 17:52:48 |
Author | weichinweng <weichinweng@goog...> |
Commiter | weichinweng |
Distribute ACL buffer only for not BLE device
If LE ACL buffer is not zero from controller, will distribute ACL buffer
only for not BLE device to avoid assigning wrong quota to each device.
For BLE device, will be distribute BLE ACL buffer via l2cap ble layer.
If LE ACL buffe is zero from controller, will keep existing logic.
Bug: 136799551
Test: 1. Pair BLE and BREDR device, check whether Quota is correct.
Change-Id: Idd7079e8da3390fa9f4e42b07774df8928f2bf20
Merged-In: Idd7079e8da3390fa9f4e42b07774df8928f2bf20
@@ -675,6 +675,8 @@ void l2c_link_adjust_allocation(void) { | ||
675 | 675 | uint16_t num_hipri_links = 0; |
676 | 676 | uint16_t controller_xmit_quota = l2cb.num_lm_acl_bufs; |
677 | 677 | uint16_t high_pri_link_quota = L2CAP_HIGH_PRI_MIN_XMIT_QUOTA_A; |
678 | + bool is_share_buffer = | |
679 | + (l2cb.num_lm_ble_bufs == L2C_DEF_NUM_BLE_BUF_SHARED) ? true : false; | |
678 | 680 | |
679 | 681 | /* If no links active, reset buffer quotas and controller buffers */ |
680 | 682 | if (l2cb.num_links_active == 0) { |
@@ -685,7 +687,8 @@ void l2c_link_adjust_allocation(void) { | ||
685 | 687 | |
686 | 688 | /* First, count the links */ |
687 | 689 | for (yy = 0, p_lcb = &l2cb.lcb_pool[0]; yy < MAX_L2CAP_LINKS; yy++, p_lcb++) { |
688 | - if (p_lcb->in_use) { | |
690 | + if (p_lcb->in_use && | |
691 | + (is_share_buffer || p_lcb->transport != BT_TRANSPORT_LE)) { | |
689 | 692 | if (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH) |
690 | 693 | num_hipri_links++; |
691 | 694 | else |
@@ -732,7 +735,8 @@ void l2c_link_adjust_allocation(void) { | ||
732 | 735 | |
733 | 736 | /* Now, assign the quotas to each link */ |
734 | 737 | for (yy = 0, p_lcb = &l2cb.lcb_pool[0]; yy < MAX_L2CAP_LINKS; yy++, p_lcb++) { |
735 | - if (p_lcb->in_use) { | |
738 | + if (p_lcb->in_use && | |
739 | + (is_share_buffer || p_lcb->transport != BT_TRANSPORT_LE)) { | |
736 | 740 | if (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH) { |
737 | 741 | p_lcb->link_xmit_quota = high_pri_link_quota; |
738 | 742 | } else { |