Commit d1187302 authored by Szymon Janc's avatar Szymon Janc Committed by Johan Hedberg
Browse files

Bluetooth: Make bt_send stack requirements a Kconfig option



This allows to fine tune TX stacks size depending on selected HCI
driver. If needed it can be used to tune for monitor too or other
logging mechanism used.

Change-Id: Ib501921da0b786e151083760d85ec58fe3c08b60
Signed-off-by: default avatarSzymon Janc <ext.szymon.janc@tieto.com>
parent 151e37b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@
#include <bluetooth/hci_raw.h>

static struct device *hci_uart_dev;
static BT_STACK_NOINIT(tx_thread_stack, 1024);
static BT_STACK_NOINIT(tx_thread_stack, CONFIG_BLUETOOTH_HCI_SEND_STACK);

/* HCI command buffers */
#define CMD_BUF_SIZE (CONFIG_BLUETOOTH_HCI_SEND_RESERVE + \
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,16 @@

comment "Host Stack Configuration"

# Stack size needed for executing bt_send with specified driver
config BLUETOOTH_HCI_SEND_STACK
	int
	# Even if no driver is selected the following default is still
	# needed e.g. for unit tests.
	default 256
	default 256 if BLUETOOTH_H4
	default 256 if BLUETOOTH_H5
	default 512 if BLUETOOTH_CONTROLLER

config BLUETOOTH_HCI_RAW
	bool "RAW HCI access"
	help
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ struct bt_conn {
	 * Since these threads don't overlap, one stack can be used by
	 * both of them.
	 */
	BT_STACK(stack, 256);
	BT_STACK(stack, CONFIG_BLUETOOTH_HCI_SEND_STACK);
};

/* Process incoming data for a connection */
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@

/* Stacks for the threads */
static BT_STACK_NOINIT(rx_thread_stack, CONFIG_BLUETOOTH_RX_STACK_SIZE);
static BT_STACK_NOINIT(cmd_tx_thread_stack, 256);
static BT_STACK_NOINIT(cmd_tx_thread_stack, CONFIG_BLUETOOTH_HCI_SEND_STACK);

struct bt_dev bt_dev;