summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>2017-04-26 10:38:15 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2017-04-28 16:06:25 +0300
commit0c37239173a7e0418b221f518d6c80fdf97015d3 (patch)
tree969f22b6a5a3276ba23aebf03a0901e91ec642ae
parenta5be508aff58a748c17b6459d1bc6b16c240f34b (diff)
Bluetooth: l2cap: Use global conn tx pool for segmentation
L2CAP Dynamic Channel feature uses the global connection Tx pool for segmentation either when there is no free buffers in the original application pool or when the original data buffer has no headroom to add L2CAP headers. This eliminates the need for a dedicated fallback pool for Dynamic Channel segmentation. Change-id: Ia5452c814169d17ef261ecef425a8fcf2e7e1e84 Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
-rw-r--r--subsys/bluetooth/host/Kconfig9
-rw-r--r--subsys/bluetooth/host/l2cap.c7
2 files changed, 2 insertions, 14 deletions
diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig
index d853a7ae6..2a821876d 100644
--- a/subsys/bluetooth/host/Kconfig
+++ b/subsys/bluetooth/host/Kconfig
@@ -267,15 +267,6 @@ config BLUETOOTH_L2CAP_DYNAMIC_CHANNEL
This option enables support for LE Connection oriented Channels,
allowing the creation of dynamic L2CAP Channels.
-config BLUETOOTH_L2CAP_DYN_CHAN_BUF_SIZE
- int "L2CAP Dynamic channel segment buffer size"
- depends on BLUETOOTH_L2CAP_DYNAMIC_CHANNEL
- range 23 BLUETOOTH_L2CAP_TX_MTU
- default 23
- help
- Size of the buffer used for segmentation of SDU when application
- supplied buffer does not have sufficient headroom.
-
config BLUETOOTH_GATT_DYNAMIC_DB
bool "GATT dynamic database support"
help
diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c
index 06c9121ff..125030c89 100644
--- a/subsys/bluetooth/host/l2cap.c
+++ b/subsys/bluetooth/host/l2cap.c
@@ -56,10 +56,6 @@ static sys_slist_t le_channels;
static sys_slist_t servers;
-/* Pool for outgoing LE data packets, MTU is 23 */
-NET_BUF_POOL_DEFINE(le_l2cap_dyn_chan_pool, CONFIG_BLUETOOTH_MAX_CONN,
- BT_L2CAP_BUF_SIZE(CONFIG_BLUETOOTH_L2CAP_DYN_CHAN_BUF_SIZE),
- BT_BUF_USER_DATA_MIN, NULL);
#endif /* CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL */
/* L2CAP signalling channel specific context */
@@ -1013,7 +1009,8 @@ static inline struct net_buf *l2cap_alloc_seg(struct net_buf *buf)
}
}
- return bt_l2cap_create_pdu(&le_l2cap_dyn_chan_pool, 0);
+ /* Fallback to using global connection tx pool */
+ return bt_l2cap_create_pdu(NULL, 0);
}
static struct net_buf *l2cap_chan_create_seg(struct bt_l2cap_le_chan *ch,