summaryrefslogtreecommitdiffstats
path: root/stack/l2cap/l2c_link.c
diff options
context:
space:
mode:
authorpramod kotreshappa <pramodk@codeaurora.org>2014-05-06 21:58:57 -0700
committerBalraj Selvaraj <bselva@codeaurora.org>2015-10-27 09:31:47 +0530
commitae184c7c3d136e931692a64fd625e971fcd3c325 (patch)
tree632bf1203cf9deb7d01b2e0bdb5a7758d49115b5 /stack/l2cap/l2c_link.c
parent372bc8d755d4fd727c6a85355532551bdd415bf5 (diff)
downloadandroid_system_bt-ae184c7c3d136e931692a64fd625e971fcd3c325.tar.gz
android_system_bt-ae184c7c3d136e931692a64fd625e971fcd3c325.tar.bz2
android_system_bt-ae184c7c3d136e931692a64fd625e971fcd3c325.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
Diffstat (limited to 'stack/l2cap/l2c_link.c')
-rw-r--r--stack/l2cap/l2c_link.c9
1 files changed, 9 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;