Skip to content

Commit 40a4410

Browse files
committed
Bluetooth: Add missing depends on for stack size Kconfig
Add missing depends on for stack size Kconfig values. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 6e34acc commit 40a4410

File tree

15 files changed

+32
-14
lines changed

15 files changed

+32
-14
lines changed

drivers/bluetooth/hci/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ config BT_UART
1313
config BT_H4
1414
bool "H:4 UART"
1515
select BT_UART
16+
select BT_DRV_RX_SUPPORT
1617
default y
1718
depends on DT_HAS_ZEPHYR_BT_HCI_UART_ENABLED
1819
help
@@ -22,6 +23,7 @@ config BT_H4
2223
config BT_H5
2324
bool "H:5 UART [EXPERIMENTAL]"
2425
select BT_UART
26+
select BT_DRV_RX_SUPPORT
2527
select EXPERIMENTAL
2628
default y
2729
depends on DT_HAS_ZEPHYR_BT_HCI_3WIRE_UART_ENABLED
@@ -69,6 +71,7 @@ config BT_HCI_IPC_ENDPOINT_BOUND_TIMEOUT_MS
6971
config BT_SPI
7072
bool
7173
select SPI
74+
select BT_DRV_RX_SUPPORT
7275
help
7376
Supports Bluetooth ICs using SPI as the communication protocol.
7477
HCI packets are sent and received as single Byte transfers,
@@ -121,6 +124,7 @@ config BT_STM32_IPM
121124
bool
122125
default y
123126
depends on DT_HAS_ST_STM32WB_RF_ENABLED
127+
select BT_DRV_RX_SUPPORT
124128
select USE_STM32_HAL_CORTEX
125129
select HAS_STM32LIB
126130
select BT_HCI_SETUP
@@ -266,6 +270,7 @@ config BT_AMBIQ_HCI
266270
default y
267271
depends on DT_HAS_AMBIQ_BT_HCI_SPI_ENABLED
268272
select SPI
273+
select BT_DRV_RX_SUPPORT
269274
select GPIO if SOC_SERIES_APOLLO4X
270275
select CLOCK_CONTROL if SOC_SERIES_APOLLO4X
271276
select BT_HCI_SETUP
@@ -345,12 +350,20 @@ config BT_HCI_SETUP
345350

346351
config BT_DRV_TX_STACK_SIZE
347352
int
353+
depends on BT_H5
348354
default 256
349355
help
350356
Stack size for the HCI driver's TX thread.
351357

358+
config BT_DRV_RX_SUPPORT
359+
bool
360+
361+
config BT_DRV_RX_HIGH_PRIO_SUPPORT
362+
bool
363+
352364
config BT_DRV_RX_STACK_SIZE
353365
int
366+
depends on BT_DRV_RX_SUPPORT
354367
default 640 if (BT_SPI || BT_AMBIQ_HCI)
355368
default BT_RX_STACK_SIZE if (BT_H4 || BT_HCI_RAW_H4)
356369
default BT_STM32_IPM_RX_STACK_SIZE if BT_STM32_IPM

drivers/bluetooth/hci/Kconfig.nxp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ config HCI_NXP_SET_CAL_DATA_ANNEX100
2525

2626
config HCI_NXP_RX_THREAD
2727
bool "Process RX buffers in a dedicated thread"
28+
select BT_DRV_RX_SUPPORT
2829
help
2930
Some platforms receive the HCI RX buffers in ISR context.
3031
If enabled, the HCI RX message is queued by the ISR, and the message is processed

drivers/bluetooth/hci/hci_ambiq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static int bt_apollo_open(const struct device *dev, bt_hci_recv_t recv)
372372
/* Start RX thread */
373373
k_thread_create(&spi_rx_thread_data, spi_rx_stack, K_KERNEL_STACK_SIZEOF(spi_rx_stack),
374374
(k_thread_entry_t)bt_spi_rx_thread, (void *)dev, NULL, NULL,
375-
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, K_NO_WAIT);
375+
K_PRIO_COOP(CONFIG_BT_RX_HIGH_PRIO), 0, K_NO_WAIT);
376376

377377
ret = bt_apollo_controller_init(spi_send_packet);
378378
if (ret == 0) {

drivers/bluetooth/hci/hci_nxp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ static void bt_rx_thread(void *p1, void *p2, void *p3)
368368
}
369369

370370
K_THREAD_DEFINE(nxp_hci_rx_thread, CONFIG_BT_DRV_RX_STACK_SIZE, bt_rx_thread, NULL, NULL, NULL,
371-
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, 0);
371+
K_PRIO_COOP(CONFIG_BT_RX_HIGH_PRIO), 0, 0);
372372

373373
static void hci_rx_cb(uint8_t packetType, uint8_t *data, uint16_t len)
374374
{

drivers/bluetooth/hci/hci_silabs_efr32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static int slz_bt_open(const struct device *dev, bt_hci_recv_t recv)
272272

273273
k_thread_create(&slz_rx_thread, slz_rx_stack, K_KERNEL_STACK_SIZEOF(slz_rx_stack),
274274
slz_rx_thread_func, (void *)dev, NULL, NULL,
275-
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, K_NO_WAIT);
275+
K_PRIO_COOP(CONFIG_BT_RX_HIGH_PRIO), 0, K_NO_WAIT);
276276
k_thread_name_set(&slz_rx_thread, "EFR32 HCI RX");
277277

278278
rail_isr_installer();

drivers/bluetooth/hci/hci_spi_st.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv)
663663
k_thread_create(&spi_rx_thread_data, spi_rx_stack,
664664
K_KERNEL_STACK_SIZEOF(spi_rx_stack),
665665
bt_spi_rx_thread, (void *)dev, NULL, NULL,
666-
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO),
666+
K_PRIO_COOP(CONFIG_BT_RX_HIGH_PRIO),
667667
0, K_NO_WAIT);
668668

669669
/* Device will let us know when it's ready */

drivers/bluetooth/hci/ipm_stm32wb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv)
559559
k_thread_create(&ipm_rx_thread_data, ipm_rx_stack,
560560
K_KERNEL_STACK_SIZEOF(ipm_rx_stack),
561561
bt_ipm_rx_thread, (void *)dev, NULL, NULL,
562-
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO),
562+
K_PRIO_COOP(CONFIG_BT_RX_HIGH_PRIO),
563563
0, K_NO_WAIT);
564564

565565
hci->recv = recv;

drivers/bluetooth/hci/spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv)
398398
k_thread_create(&spi_rx_thread_data, spi_rx_stack,
399399
K_KERNEL_STACK_SIZEOF(spi_rx_stack),
400400
bt_spi_rx_thread, (void *)dev, NULL, NULL,
401-
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO),
401+
K_PRIO_COOP(CONFIG_BT_RX_HIGH_PRIO),
402402
0, K_NO_WAIT);
403403
k_thread_name_set(&spi_rx_thread_data, "bt_spi_rx_thread");
404404

drivers/bluetooth/hci/userchan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static int uc_open(const struct device *dev, bt_hci_recv_t recv)
308308
k_thread_create(&rx_thread_data, rx_thread_stack,
309309
K_KERNEL_STACK_SIZEOF(rx_thread_stack),
310310
rx_thread, (void *)dev, NULL, NULL,
311-
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO),
311+
K_PRIO_COOP(CONFIG_BT_RX_HIGH_PRIO),
312312
0, K_NO_WAIT);
313313

314314
LOG_DBG("returning");

subsys/bluetooth/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ config BT_HCI_RAW
5050

5151
config BT_HCI_RAW_H4
5252
bool "RAW HCI H:4 transport"
53+
select BT_DRV_RX_SUPPORT
5354
help
5455
This option enables HCI RAW access to work over an H:4
5556
transport, note that it still need to be selected at runtime.

subsys/bluetooth/common/dummy.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ BUILD_ASSERT(alignof(bt_addr_t) == 1);
3131
BUILD_ASSERT(sizeof(bt_addr_le_t) == BT_ADDR_LE_SIZE);
3232
BUILD_ASSERT(alignof(bt_addr_le_t) == 1);
3333

34-
#if defined(CONFIG_BT_HCI_HOST)
3534
/* The Bluetooth subsystem requires that higher priority events shall be given
3635
* in a priority higher than the Bluetooth Host's Tx and the Controller's
3736
* receive thread priority.
3837
* This is required in order to dispatch Number of Completed Packets event
3938
* before any new data arrives on a connection to the Host threads.
4039
*/
41-
BUILD_ASSERT(CONFIG_BT_DRIVER_RX_HIGH_PRIO < CONFIG_BT_HCI_TX_PRIO);
42-
#endif /* defined(CONFIG_BT_HCI_HOST) */
40+
BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_HCI_HOST) || !IS_ENABLED(CONFIG_BT_RX_HIGH_PRIO_SUPPORT) ||
41+
(CONFIG_BT_RX_HIGH_PRIO < CONFIG_BT_HCI_TX_PRIO));
4342

4443
#if (defined(CONFIG_LOG_BACKEND_RTT) && \
4544
(defined(CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL) || \

subsys/bluetooth/controller/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ config BT_LL_SW_SPLIT
147147
default y
148148
depends on DT_HAS_ZEPHYR_BT_HCI_LL_SW_SPLIT_ENABLED
149149
select HAS_BT_CTLR
150+
select BT_DRV_RX_HIGH_PRIO_SUPPORT if !BT_HCI_RAW
150151
help
151152
Use Zephyr software Bluetooth LE Link Layer ULL LLL split implementation.
152153

subsys/bluetooth/controller/Kconfig.ll_sw_split

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ config BT_CTLR_RX_POLL
126126
config BT_CTLR_RX_PRIO_STACK_SIZE
127127
# Hidden
128128
int
129-
depends on !BT_HCI_RAW
129+
depends on BT_DRV_RX_HIGH_PRIO_SUPPORT
130130
default 448
131131
help
132132
Controller's Co-Operative high priority Rx thread stack size.

subsys/bluetooth/controller/hci/hci_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ static int hci_driver_open(const struct device *dev, bt_hci_recv_t recv)
10241024
k_thread_create(&prio_recv_thread_data, prio_recv_thread_stack,
10251025
K_KERNEL_STACK_SIZEOF(prio_recv_thread_stack),
10261026
prio_recv_thread, (void *)dev, NULL, NULL,
1027-
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, K_NO_WAIT);
1027+
K_PRIO_COOP(CONFIG_BT_RX_HIGH_PRIO), 0, K_NO_WAIT);
10281028
k_thread_name_set(&prio_recv_thread_data, "BT CTLR RX pri");
10291029
#endif /* CONFIG_BT_CTLR_RX_PRIO_STACK_SIZE */
10301030

subsys/bluetooth/host/Kconfig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ endchoice
110110

111111
config BT_RX_STACK_SIZE
112112
int "Size of the receiving thread stack"
113+
depends on BT_DRV_RX_SUPPORT || BT_RECV_WORKQ_BT
113114
default 768 if BT_HCI_RAW
114115
default 3092 if BT_MESH_GATT_CLIENT
115116
default 2600 if BT_MESH
@@ -126,11 +127,13 @@ config BT_RX_STACK_SIZE
126127
config BT_RX_PRIO
127128
# Hidden option for Co-Operative Rx thread priority
128129
int
130+
depends on BT_DRV_RX_SUPPORT
129131
default 8
130132

131-
config BT_DRIVER_RX_HIGH_PRIO
132-
# Hidden option for Co-Operative HCI driver RX thread priority
133+
config BT_RX_HIGH_PRIO
134+
# Hidden option for Co-Operative HCI driver High Priority Rx thread priority
133135
int
136+
depends on BT_DRV_RX_HIGH_PRIO_SUPPORT
134137
default 6
135138

136139
config BT_CONN_TX_NOTIFY_WQ

0 commit comments

Comments
 (0)