diff options
author | pramod kotreshappa <pramodk@codeaurora.org> | 2014-05-06 21:58:57 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-26 21:07:38 -0700 |
commit | 2772d76990d8424ef3c629dba164fc7111b37db3 (patch) | |
tree | 7a42d9fd8d25580c376588fb164d24dc8c4f1fdf | |
parent | 871c1edaf17bbbd1b10f6b332e06ab13119bd956 (diff) | |
download | android_system_bt-2772d76990d8424ef3c629dba164fc7111b37db3.tar.gz android_system_bt-2772d76990d8424ef3c629dba164fc7111b37db3.tar.bz2 android_system_bt-2772d76990d8424ef3c629dba164fc7111b37db3.zip |
Bluetooth: Dynamic ACL buffer allocation based on ACL Priority
1. A2dp acl link priority is set to high once streaming starts
2. Allocation min 2 ACL bufferswq to high priority link
CRs-fixed: 647447
Change-Id: I8f7742ae193998643ff2a12bf87f9874844ee0f7
-rw-r--r-- | stack/l2cap/l2c_link.c | 9 | ||||
-rw-r--r-- | stack/l2cap/l2c_utils.c | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/stack/l2cap/l2c_link.c b/stack/l2cap/l2c_link.c index 438ae0583..1432b1ae6 100644 --- a/stack/l2cap/l2c_link.c +++ b/stack/l2cap/l2c_link.c @@ -85,6 +85,7 @@ BOOLEAN hci_blacklistted_for_role_switch (BD_ADDR addr) return FALSE; } +#define HI_PRI_LINK_QUOTA 2 //Mininum ACL buffer quota for high priority link /******************************************************************************* ** ** Function l2c_link_hci_conn_req @@ -898,6 +899,14 @@ void l2c_link_adjust_allocation (void) while ( (num_hipri_links * high_pri_link_quota + low_quota) > controller_xmit_quota ) high_pri_link_quota--; + /*Adjust high pri link with min 3 buffers*/ + if(num_hipri_links > 0) + { + if(high_pri_link_quota < HI_PRI_LINK_QUOTA) + { + high_pri_link_quota = HI_PRI_LINK_QUOTA; + } + } /* Work out the xmit quota and buffer quota high and low priorities */ hi_quota = num_hipri_links * high_pri_link_quota; low_quota = (hi_quota < controller_xmit_quota) ? controller_xmit_quota - hi_quota : 1; diff --git a/stack/l2cap/l2c_utils.c b/stack/l2cap/l2c_utils.c index dafe34498..5bf11556d 100644 --- a/stack/l2cap/l2c_utils.c +++ b/stack/l2cap/l2c_utils.c @@ -2613,6 +2613,12 @@ BOOLEAN l2cu_set_acl_priority (BD_ADDR bd_addr, UINT8 priority, BOOLEAN reset_af return (FALSE); } + if (p_lcb->acl_priority != priority) + { + p_lcb->acl_priority = priority; + l2c_link_adjust_allocation(); + } + if (BTM_IS_BRCM_CONTROLLER()) { /* Called from above L2CAP through API; send VSC if changed */ |