Skip to content

Commit

Permalink
bluetooth: hci: ipc: assert when building HCI IPC driver w/o ACL FC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
PavelVPV committed Mar 3, 2025
1 parent e885c8c commit b92b51a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions drivers/bluetooth/hci/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(bt_hci_driver);

BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_CONN) || IS_ENABLED(CONFIG_BT_HCI_ACL_FLOW_CONTROL),
"IPC transport is not reliable without Controller-to-Host ACL flow control");

#define DT_DRV_COMPAT zephyr_bt_hci_ipc

#define IPC_BOUND_TIMEOUT_IN_MS K_MSEC(1000)
Expand Down
3 changes: 3 additions & 0 deletions samples/bluetooth/hci_ipc/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

LOG_MODULE_REGISTER(hci_ipc, CONFIG_BT_LOG_LEVEL);

BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_CONN) || IS_ENABLED(CONFIG_BT_HCI_ACL_FLOW_CONTROL),
"IPC transport is not reliable without Controller-to-Host ACL flow control");

static struct ipc_ept hci_ept;

static K_THREAD_STACK_DEFINE(tx_thread_stack, CONFIG_BT_HCI_TX_STACK_SIZE);
Expand Down
1 change: 0 additions & 1 deletion samples/bluetooth/pbp_public_broadcast_sink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ CONFIG_UTF8=y
CONFIG_BT_SMP=y
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
CONFIG_BT_L2CAP_TX_BUF_COUNT=20
CONFIG_BT_HCI_ACL_FLOW_CONTROL=n
CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE=196

# CAP
Expand Down
1 change: 0 additions & 1 deletion samples/bluetooth/pbp_public_broadcast_source/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ CONFIG_BT_ISO_MAX_CHAN=2
CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT=2
CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT=2
CONFIG_BT_ISO_TX_BUF_COUNT=4
CONFIG_BT_HCI_ACL_FLOW_CONTROL=n

# PBP support
CONFIG_BT_PBP=y
Expand Down

0 comments on commit b92b51a

Please sign in to comment.