diff --git a/include/bluetooth/hci_raw.h b/include/bluetooth/hci_raw.h index 030fb0ca3c4f8e..d7f2fa2cca41fd 100644 --- a/include/bluetooth/hci_raw.h +++ b/include/bluetooth/hci_raw.h @@ -21,14 +21,12 @@ extern "C" { #endif -#if defined(CONFIG_BT_CTLR_TX_BUFFER_SIZE) -#define BT_L2CAP_MTU (CONFIG_BT_CTLR_TX_BUFFER_SIZE - BT_L2CAP_HDR_SIZE) -#else -#define BT_L2CAP_MTU 65 /* 64-byte public key + opcode */ -#endif /* CONFIG_BT_CTLR */ +#define _BT_ACL_BUF_SIZE(len) (BT_BUF_RESERVE + \ + BT_HCI_ACL_HDR_SIZE + \ + (len)) /** Data size needed for ACL buffers */ -#define BT_BUF_ACL_SIZE BT_L2CAP_BUF_SIZE(BT_L2CAP_MTU) +#define BT_BUF_ACL_SIZE _BT_ACL_BUF_SIZE(CONFIG_BT_HCI_ACL_DATA_SIZE) #if defined(CONFIG_BT_CTLR_TX_BUFFERS) #define BT_HCI_ACL_COUNT CONFIG_BT_CTLR_TX_BUFFERS @@ -36,8 +34,6 @@ extern "C" { #define BT_HCI_ACL_COUNT 6 #endif -#define BT_BUF_TX_SIZE MAX(BT_BUF_RX_SIZE, BT_BUF_ACL_SIZE) - /** @brief Send packet to the Bluetooth controller * * Send packet to the Bluetooth controller. Caller needs to diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 326d7d1f347358..5e71a87261fa46 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -126,6 +126,16 @@ config BT_HCI_RESERVE Headroom that the driver needs for sending and receiving buffers. Add a new 'default' entry for each new driver. +config BT_HCI_ACL_DATA_SIZE + int + prompt "ACL data buffer size" if !BT_CTLR + depends on BT_HCI_RAW + range 27 251 + default BT_CTLR_DATA_LENGTH_MAX if BT_CTLR + default 27 + help + Maximum ACL data payload in HCI packets, excluding HCI header. + config BT_RECV_IS_RX_THREAD # Hidden option set by the HCI driver to indicate that there's # no need for the host to have its own RX thread.