From fddd786dfe9ab83f8c439bdc3142a0c1239b1fe9 Mon Sep 17 00:00:00 2001 From: Morten Priess Date: Tue, 20 Aug 2019 08:53:01 +0200 Subject: [PATCH] bluetooth: host: Configurable HCI stack sizes Made BT_HCI_TX_STACK_SIZE configurable and added BT_HCI_ECC_STACK_SIZE. These changes are necessary to allow vendors to adjust for other achitectures. Signed-off-by: Morten Priess --- subsys/bluetooth/host/Kconfig | 19 +++++++++++++++---- subsys/bluetooth/host/hci_ecc.c | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 15b32b44f77..dbfb9a4706c 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -63,9 +63,9 @@ config BT_DISCARDABLE_BUF_COUNT block and may even eliminate deadlocks in some cases. config BT_HCI_TX_STACK_SIZE - # NOTE: This value is derived from other symbols and should not be - # user-configurable. Do not give it a prompt. - int + # NOTE: This value is derived from other symbols and should only be + # changed if required by architecture + int "HCI Tx thread stack size" default 512 if BT_H4 default 512 if BT_H5 default 416 if BT_SPI @@ -79,7 +79,18 @@ config BT_HCI_TX_STACK_SIZE # the worst-case stack size if an out-of-tree controller is used. default 1024 help - Stack size needed for executing bt_send with specified driver + Stack size needed for executing bt_send with specified driver. + NOTE: This is an advanced setting and should not be changed unless + absolutely necessary + +config BT_HCI_ECC_STACK_SIZE + # NOTE: This value is derived from other symbols and should only be + # changed if required by architecture + int "HCI ECC thread stack size" + default 1100 + help + NOTE: This is an advanced setting and should not be changed unless + absolutely necessary config BT_HCI_TX_PRIO # Hidden option for Co-Operative Tx thread priority diff --git a/subsys/bluetooth/host/hci_ecc.c b/subsys/bluetooth/host/hci_ecc.c index 2587f1ae240..a5a32e460fc 100644 --- a/subsys/bluetooth/host/hci_ecc.c +++ b/subsys/bluetooth/host/hci_ecc.c @@ -36,7 +36,7 @@ #endif static struct k_thread ecc_thread_data; -static K_THREAD_STACK_DEFINE(ecc_thread_stack, 1100); +static K_THREAD_STACK_DEFINE(ecc_thread_stack, CONFIG_BT_HCI_ECC_STACK_SIZE); /* based on Core Specification 4.2 Vol 3. Part H 2.3.5.6.1 */ static const u32_t debug_private_key[8] = {