Bluetooth: Remove BT_HCI_RESERVE and BT_HCI_RAW_RESERVE

In most cases these were defined as 1. Saving one byte for the rest
doesn't really justify the added complexity that comes with these
options. Removing them also simplifies the interface between HCI
transports/drivers and the host stack, which in turn helps pave the way
for having HCI as a proper Zephyr driver API.

Fixes #71907

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
This commit is contained in:
Johan Hedberg 2024-04-25 09:50:10 +03:00 committed by Carles Cufí
parent 2332bf0311
commit d590bcb5e0
20 changed files with 5 additions and 51 deletions

View file

@ -476,6 +476,9 @@ Bluetooth
* `BT_ISO_TIMESTAMP_NONE` has been removed and the `ts` parameter of :c:func:`bt_iso_chan_send` has
as well. :c:func:`bt_iso_chan_send` now always sends without timestamp. To send with a timestamp,
:c:func:`bt_iso_chan_send_ts` can be used.
* The ``CONFIG_BT_HCI_RESERVE`` and ``CONFIG_BT_HCI_RAW_RESERVE`` Kconfig options were removed. All
buffers get by default one byte of headroom now, which HCI transport implementations can rely on
(whether they need it or not).
Bluetooth Mesh
==============

View file

@ -51,11 +51,8 @@ struct bt_buf_data {
uint8_t type;
};
#if defined(CONFIG_BT_HCI_RAW)
#define BT_BUF_RESERVE MAX(CONFIG_BT_HCI_RESERVE, CONFIG_BT_HCI_RAW_RESERVE)
#else
#define BT_BUF_RESERVE CONFIG_BT_HCI_RESERVE
#endif
/* Headroom reserved in buffers, primarily for HCI transport encoding purposes */
#define BT_BUF_RESERVE 1
/** Helper to include reserved HCI data in buffer calculations */
#define BT_BUF_SIZE(size) (BT_BUF_RESERVE + (size))

View file

@ -10,7 +10,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=2
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since

View file

@ -8,7 +8,6 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=16

View file

@ -10,7 +10,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=2
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since

View file

@ -10,7 +10,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=2
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since

View file

@ -11,7 +11,6 @@ CONFIG_CBPRINTF_REDUCED_INTEGRAL=y
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=2
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since

View file

@ -10,7 +10,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
# Host number of completed commands does not follow normal flow control.

View file

@ -10,7 +10,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
# Host number of completed commands does not follow normal flow control.

View file

@ -10,7 +10,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
# Host number of completed commands does not follow normal flow control.

View file

@ -10,7 +10,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
# Host number of completed commands does not follow normal flow control.

View file

@ -8,7 +8,6 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=16

View file

@ -6,7 +6,6 @@ CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_MAX_CONN=16
CONFIG_BT_TINYCRYPT_ECC=n
CONFIG_BT_HCI_RAW_RESERVE=1
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
# Host number of completed commands does not follow normal flow control.

View file

@ -61,15 +61,6 @@ config BT_HCI_RAW_H4_ENABLE
This option enables use of H:4 transport for HCI RAW access at
build time.
config BT_HCI_RAW_RESERVE
int "Buffer headroom needed for HCI transport"
depends on BT_HCI_RAW
default 1 if BT_HCI_RAW_H4
default 0
help
This option is used by the HCI raw transport implementation to
declare how much headroom it needs for any HCI transport headers.
config BT_HCI_RAW_CMD_EXT
bool "RAW HCI Command Extension"
help

View file

@ -72,27 +72,6 @@ config BT_HCI_TX_PRIO
int
default 7
config BT_HCI_RESERVE
int
default 0 if BT_H4
default 1 if BT_H5
default 1 if BT_HCI_IPC
default 1 if BT_SPI
default 1 if BT_STM32_IPM
default 1 if BT_STM32WBA
default 1 if BT_USERCHAN
default 1 if BT_ESP32
default 0 if BT_B91
default 1 if BT_AMBIQ_HCI
default 1 if BT_SILABS_HCI
# Even if no driver is selected the following default is still
# needed e.g. for unit tests.
default 0
help
Headroom that the driver needs for sending and receiving buffers. Add a
new 'default' entry for each new driver.
choice BT_RECV_CONTEXT
prompt "BT RX Thread Selection"
default BT_RECV_WORKQ_SYS if SOC_SERIES_NRF51X

View file

@ -3,7 +3,6 @@ CONFIG_ASSERT=y
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=1
CONFIG_BT_BUF_CMD_TX_COUNT=10

View file

@ -3,7 +3,6 @@ CONFIG_ASSERT=y
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=1
CONFIG_BT_BUF_CMD_TX_COUNT=10

View file

@ -3,7 +3,6 @@ CONFIG_ASSERT=y
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=16
CONFIG_BT_BUF_CMD_TX_COUNT=10

View file

@ -3,7 +3,6 @@ CONFIG_ASSERT=y
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=1
CONFIG_BT_BUF_CMD_TX_COUNT=10

View file

@ -11,7 +11,6 @@ CONFIG_CBPRINTF_REDUCED_INTEGRAL=y
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=4
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since