Bluetooth: Remove ACL details from BT_BUF_RX_SIZE

BT_BUF_RX_SIZE is used for the RX buffer pool which is used for both
ACL data and HCI events. It should therefore not contain any
ACL-specific details. This patch removes the ACL header size from the
macro and instead makes taking it into account the responsibility to
the Kconfig option. Since buffer sizes are anyway rounded up to the
nearest multiple of 4 the default goes up from 70 to 76.

Change-Id: I41274d9131e7529d41c16bd66de95637fb150a29
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-01-16 18:48:31 +02:00
commit 6f114e0a62
2 changed files with 10 additions and 5 deletions

View file

@ -49,7 +49,6 @@ enum bt_buf_type {
/** Data size neeed for HCI RX buffers */ /** Data size neeed for HCI RX buffers */
#define BT_BUF_RX_SIZE (CONFIG_BLUETOOTH_HCI_RECV_RESERVE + \ #define BT_BUF_RX_SIZE (CONFIG_BLUETOOTH_HCI_RECV_RESERVE + \
sizeof(struct bt_hci_acl_hdr) + \
CONFIG_BLUETOOTH_RX_BUF_LEN) CONFIG_BLUETOOTH_RX_BUF_LEN)
/** Allocate a buffer for incoming data /** Allocate a buffer for incoming data

View file

@ -79,11 +79,17 @@ config BLUETOOTH_RX_BUF_COUNT
config BLUETOOTH_RX_BUF_LEN config BLUETOOTH_RX_BUF_LEN
int "Maximum supported HCI RX buffer length" int "Maximum supported HCI RX buffer length"
default 70 default 76
default 253 if BLUETOOTH_BREDR default 264 if BLUETOOTH_BREDR
range 70 2000 range 73 2000
help help
Maximum data size for each HCI RX buffer. Maximum data size for each HCI RX buffer. This size includes
everything starting with the ACL or HCI event headers. Note that
buffer sizes are always rounded up to the nearest multiple of 4,
so if this Kconfig value is something else then there will be some
wasted space. The minimum of 73 has been taken for LE SC which has
an L2CAP MTU of 65 bytes. On top of this there's the L2CAP header
(4 bytes) and the ACL header (also 4 bytes) which yields 73 bytes.
config BLUETOOTH_UART_TO_HOST_DEV_NAME config BLUETOOTH_UART_TO_HOST_DEV_NAME
string "Device Name of UART Device to an external Bluetooth Host" string "Device Name of UART Device to an external Bluetooth Host"