From 65e07099a7d364ae97129cc057cd188991100a45 Mon Sep 17 00:00:00 2001 From: Vinayak Chettimada Date: Wed, 26 Apr 2017 10:38:15 +0200 Subject: [PATCH] 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 --- subsys/bluetooth/host/Kconfig | 9 --------- subsys/bluetooth/host/l2cap.c | 7 ++----- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index d853a7ae670..2a821876db8 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 06c9121ffd0..125030c89b0 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,