summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Xie <mattx@google.com>2013-04-29 23:06:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-29 23:06:33 +0000
commitb05c0190b55369618c968b27ea406f9660bfa4ed (patch)
tree5a0d33ababfa2c5ea86556abf352972fb1a08a7e
parent2d41fe1c5dbac701a074eec272545439168930a7 (diff)
parent12c3f496c3612472a22cbb0afd89812b154b4186 (diff)
downloadbluedroid-b05c0190b55369618c968b27ea406f9660bfa4ed.tar.gz
Merge "LE: Fix shared ACL buffer allocation" into jb-mr2-dev
-rw-r--r--include/bt_target.h6
-rw-r--r--stack/l2cap/l2c_ble.c6
2 files changed, 11 insertions, 1 deletions
diff --git a/include/bt_target.h b/include/bt_target.h
index dd1b19e..0ce6971 100644
--- a/include/bt_target.h
+++ b/include/bt_target.h
@@ -550,6 +550,12 @@
#define L2CAP_FCR_RX_POOL_ID HCI_ACL_POOL_ID
#endif
+/* Number of ACL buffers to assign to LE
+ if the HCI buffer pool is shared with BR/EDR */
+#ifndef L2C_DEF_NUM_BLE_BUF_SHARED
+#define L2C_DEF_NUM_BLE_BUF_SHARED 1
+#endif
+
/* Used by BTM when it sends HCI commands to the controller. */
#ifndef BTM_CMD_POOL_ID
#define BTM_CMD_POOL_ID GKI_POOL_ID_2
diff --git a/stack/l2cap/l2c_ble.c b/stack/l2cap/l2c_ble.c
index e323587..75053bd 100644
--- a/stack/l2cap/l2c_ble.c
+++ b/stack/l2cap/l2c_ble.c
@@ -623,7 +623,11 @@ BOOLEAN l2cble_create_conn (tL2C_LCB *p_lcb)
void l2c_link_processs_ble_num_bufs (UINT16 num_lm_ble_bufs)
{
if (num_lm_ble_bufs == 0)
- num_lm_ble_bufs = l2cb.num_lm_acl_bufs;
+ {
+ num_lm_ble_bufs = L2C_DEF_NUM_BLE_BUF_SHARED;
+ l2cb.num_lm_acl_bufs -= L2C_DEF_NUM_BLE_BUF_SHARED;
+ }
+
l2cb.num_lm_ble_bufs = l2cb.controller_le_xmit_window = num_lm_ble_bufs;
}