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>
This commit is contained in:
Vinayak Chettimada 2017-04-26 10:38:15 +02:00 committed by Anas Nashif
commit 65e07099a7
2 changed files with 2 additions and 14 deletions

View file

@ -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

View file

@ -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,