• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

system/bt


Commit MetaInfo

Revisionc3934ddad6520040152eaeedd4ad667bd467a153 (tree)
Time2019-08-20 17:52:48
Authorweichinweng <weichinweng@goog...>
Commiterweichinweng

Log Message

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

Change Summary

Incremental Difference

--- a/stack/l2cap/l2c_link.cc
+++ b/stack/l2cap/l2c_link.cc
@@ -675,6 +675,8 @@ void l2c_link_adjust_allocation(void) {
675675 uint16_t num_hipri_links = 0;
676676 uint16_t controller_xmit_quota = l2cb.num_lm_acl_bufs;
677677 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;
678680
679681 /* If no links active, reset buffer quotas and controller buffers */
680682 if (l2cb.num_links_active == 0) {
@@ -685,7 +687,8 @@ void l2c_link_adjust_allocation(void) {
685687
686688 /* First, count the links */
687689 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)) {
689692 if (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH)
690693 num_hipri_links++;
691694 else
@@ -732,7 +735,8 @@ void l2c_link_adjust_allocation(void) {
732735
733736 /* Now, assign the quotas to each link */
734737 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)) {
736740 if (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH) {
737741 p_lcb->link_xmit_quota = high_pri_link_quota;
738742 } else {