Skip to content

Commit 179f3c6

Browse files
PavelVPVkartben
authored andcommitted
bluetooth: hci: ipc: assert when building HCI IPC driver w/o ACL FC
The HCI IPC driver is not reliable and can lead to lost ACL data if built without Controller-to-Host ACL flow control. This commit prevents building HCI IPC driver and hci_ipc sample without CONFIG_BT_HCI_ACL_FLOW_CONTROL. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
1 parent 8ce291d commit 179f3c6

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

drivers/bluetooth/hci/ipc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#include <zephyr/logging/log.h>
2020
LOG_MODULE_REGISTER(bt_hci_driver);
2121

22+
BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_CONN) || IS_ENABLED(CONFIG_BT_HCI_ACL_FLOW_CONTROL),
23+
"HCI IPC driver can drop ACL data without Controller-to-Host ACL flow control");
24+
2225
#define DT_DRV_COMPAT zephyr_bt_hci_ipc
2326

2427
#define IPC_BOUND_TIMEOUT_IN_MS K_MSEC(1000)

samples/bluetooth/hci_ipc/src/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929

3030
LOG_MODULE_REGISTER(hci_ipc, CONFIG_BT_LOG_LEVEL);
3131

32+
BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_CONN) || IS_ENABLED(CONFIG_BT_HCI_ACL_FLOW_CONTROL),
33+
"HCI IPC driver can drop ACL data without Controller-to-Host ACL flow control");
34+
3235
static struct ipc_ept hci_ept;
3336

3437
static K_THREAD_STACK_DEFINE(tx_thread_stack, CONFIG_BT_HCI_TX_STACK_SIZE);

samples/bluetooth/pbp_public_broadcast_sink/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ CONFIG_UTF8=y
1010
CONFIG_BT_SMP=y
1111
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
1212
CONFIG_BT_L2CAP_TX_BUF_COUNT=20
13-
CONFIG_BT_HCI_ACL_FLOW_CONTROL=n
1413
CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE=196
1514

1615
# CAP

samples/bluetooth/pbp_public_broadcast_source/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ CONFIG_BT_ISO_MAX_CHAN=2
1010
CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT=2
1111
CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT=2
1212
CONFIG_BT_ISO_TX_BUF_COUNT=4
13-
CONFIG_BT_HCI_ACL_FLOW_CONTROL=n
1413

1514
# PBP support
1615
CONFIG_BT_PBP=y

0 commit comments

Comments
 (0)