summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Leung <daniel.leung@intel.com>2016-03-16 13:05:56 -0700
committerGerrit Code Review <gerrit@zephyrproject.org>2016-03-19 00:23:11 +0000
commitfa868a78460a3629a2131af543ece6ff65f2d8e8 (patch)
tree4b4d48c37fa91ee8f90aa5e7bb5fa7bebf4f1626
parent0b04465a8ce0d7f1c41bffb6a3237deb47e55388 (diff)
drivers: bluetooth: nble: restructures Bluetooth Kconfig options
This moves both the Bluetooth HCI and NBLE drivers under "Bluetooth Drivers" category. This also adds a selection for choosing Bluetooth stacks as the bulk of both HCI and NBLE stacks cannot be compiled together. Note that this does not move the source files. That should be done in a separate change. Change-Id: I32fa7097ada0fdc52bcc745adb78c7273f4023c6 Signed-off-by: Daniel Leung <daniel.leung@intel.com>
-rw-r--r--drivers/Kconfig2
-rw-r--r--drivers/bluetooth/Kconfig21
-rw-r--r--drivers/nble/Kconfig5
-rw-r--r--net/bluetooth/Kconfig26
-rw-r--r--net/bluetooth/Makefile3
-rw-r--r--samples/bluetooth/beacon/prj_nble.conf2
-rw-r--r--samples/bluetooth/peripheral/prj_nble.conf2
-rw-r--r--samples/bluetooth/peripheral_esp/prj_nble.conf2
-rw-r--r--samples/bluetooth/peripheral_hr/prj_nble.conf2
-rw-r--r--tests/bluetooth/shell/prj_nble.conf2
-rw-r--r--tests/bluetooth/tester/prj_nble.conf2
11 files changed, 59 insertions, 10 deletions
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 23fd73bae..457accb8c 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -65,8 +65,6 @@ source "drivers/aio/Kconfig"
source "drivers/qmsi/Kconfig"
-source "drivers/nble/Kconfig"
-
source "drivers/flash/Kconfig"
source "drivers/sensor/Kconfig"
diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 879dd47bd..b6b7930d4 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -19,8 +19,14 @@
#
# Bluetooth options
#
-menu "Bluetooth HCI Driver Options"
-depends on BLUETOOTH
+
+if BLUETOOTH
+
+menu "Bluetooth Drivers"
+
+if BLUETOOTH_STACK_HCI
+
+comment "Bluetooth HCI Driver Options"
config BLUETOOTH_UART
bool
@@ -28,11 +34,11 @@ config BLUETOOTH_UART
choice
prompt "Bluetooth HCI driver"
- depends on BLUETOOTH
default BLUETOOTH_H4
config BLUETOOTH_H4
bool "H:4 UART"
+ select SERIAL
select UART_INTERRUPT_DRIVEN
select BLUETOOTH_UART
help
@@ -41,6 +47,7 @@ config BLUETOOTH_H4
config BLUETOOTH_H5
bool "H:5 UART [EXPERIMENTAL]"
+ select SERIAL
select UART_INTERRUPT_DRIVEN
select BLUETOOTH_UART
help
@@ -77,7 +84,6 @@ config BLUETOOTH_UART_ON_DEV_NAME
# Needed headroom for outgoing buffers (to controller)
config BLUETOOTH_HCI_SEND_RESERVE
int
- depends on BLUETOOTH
default 0 if BLUETOOTH_H4
default 1 if BLUETOOTH_H5
# Even if no driver is selected the following default is still
@@ -87,11 +93,16 @@ config BLUETOOTH_HCI_SEND_RESERVE
# Needed headroom for incoming buffers (from controller)
config BLUETOOTH_HCI_RECV_RESERVE
int
- depends on BLUETOOTH
default 0 if BLUETOOTH_H4
default 0 if BLUETOOTH_H5
# Even if no driver is selected the following default is still
# needed e.g. for unit tests.
default 0
+endif # BLUETOOTH_STACK_HCI
+
+source "drivers/nble/Kconfig"
+
endmenu
+
+endif # BLUETOOTH
diff --git a/drivers/nble/Kconfig b/drivers/nble/Kconfig
index e52e3edee..d3f63ee26 100644
--- a/drivers/nble/Kconfig
+++ b/drivers/nble/Kconfig
@@ -18,14 +18,17 @@
config NBLE
bool "Support for custom Nordic Semiconductor BLE protocol"
+ default y if BLUETOOTH_STACK_NBLE
default n
select BLUETOOTH_PERIPHERAL
select BLUETOOTH_CENTRAL
select BLUETOOTH_GATT_CLIENT
select BLUETOOTH_SMP
+ select SERIAL
select UART_INTERRUPT_DRIVEN
select NANO_TIMEOUTS
select NET_BUF
+ depends on BLUETOOTH_STACK_NBLE
help
Enables support for using Nordic Semiconductor nRF51 Bluetooth
LE chips with a custom firmware. The API for this is a subset of
@@ -37,7 +40,7 @@ config NBLE
& endianess) as the nRF51 chip. The driver cannot be used on
any architecture that doesn't fulfill this requirement.
-if !BLUETOOTH && NBLE
+if NBLE
config BLUETOOTH_PERIPHERAL
bool
default n
diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig
index 8b4db56d7..ae9c43c9d 100644
--- a/net/bluetooth/Kconfig
+++ b/net/bluetooth/Kconfig
@@ -21,11 +21,34 @@ menuconfig BLUETOOTH
default n
select NANO_TIMEOUTS
select NET_BUF
- select BLUETOOTH_LE
+ select BLUETOOTH_LE if !BLUETOOTH_STACK_NBLE
help
This option enables Bluetooth support.
+choice
+ prompt "Bluetooth Stack Selection"
+ depends on BLUETOOTH
+ default BLUETOOTH_STACK_HCI
+ help
+ Select the Bluetooth stack to compile.
+
+config BLUETOOTH_STACK_HCI
+ bool "HCI Stack"
+ help
+ Select the Bluetooth stack to use with HCI drivers.
+
+config BLUETOOTH_STACK_NBLE
+ bool "Nordic BLE Stack"
+ help
+ Select the Bluetooth stack to use with Nordic BLE drivers.
+
+endchoice
+
if BLUETOOTH
+
+comment "HCI Stack Configurations"
+ depends on BLUETOOTH_STACK_HCI
+
config BLUETOOTH_LE
bool "Bluetooth Low Energy (LE) support"
default n
@@ -35,6 +58,7 @@ config BLUETOOTH_LE
select TINYCRYPT_SHA256
select TINYCRYPT_SHA256_HMAC
select TINYCRYPT_SHA256_HMAC_PRNG
+ depends on BLUETOOTH_STACK_HCI
help
This option enables Bluetooth Low Energy (LE) support.
Currently it is mandatory whenever Bluetooth support
diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile
index dcad961a4..4fb1e21f1 100644
--- a/net/bluetooth/Makefile
+++ b/net/bluetooth/Makefile
@@ -1,4 +1,5 @@
-obj-y = hci_core.o \
+obj-$(CONFIG_BLUETOOTH_STACK_HCI) = \
+ hci_core.o \
uuid.o
ifeq ($(CONFIG_BLUETOOTH_CONN),y)
diff --git a/samples/bluetooth/beacon/prj_nble.conf b/samples/bluetooth/beacon/prj_nble.conf
index 4e25bdbdd..28cf7119a 100644
--- a/samples/bluetooth/beacon/prj_nble.conf
+++ b/samples/bluetooth/beacon/prj_nble.conf
@@ -1,3 +1,5 @@
+CONFIG_BLUETOOTH=y
+CONFIG_BLUETOOTH_STACK_NBLE=y
CONFIG_NBLE=y
CONFIG_ARC_INIT=n
CONFIG_BLUETOOTH_DEBUG=y
diff --git a/samples/bluetooth/peripheral/prj_nble.conf b/samples/bluetooth/peripheral/prj_nble.conf
index 4e25bdbdd..28cf7119a 100644
--- a/samples/bluetooth/peripheral/prj_nble.conf
+++ b/samples/bluetooth/peripheral/prj_nble.conf
@@ -1,3 +1,5 @@
+CONFIG_BLUETOOTH=y
+CONFIG_BLUETOOTH_STACK_NBLE=y
CONFIG_NBLE=y
CONFIG_ARC_INIT=n
CONFIG_BLUETOOTH_DEBUG=y
diff --git a/samples/bluetooth/peripheral_esp/prj_nble.conf b/samples/bluetooth/peripheral_esp/prj_nble.conf
index 4e25bdbdd..28cf7119a 100644
--- a/samples/bluetooth/peripheral_esp/prj_nble.conf
+++ b/samples/bluetooth/peripheral_esp/prj_nble.conf
@@ -1,3 +1,5 @@
+CONFIG_BLUETOOTH=y
+CONFIG_BLUETOOTH_STACK_NBLE=y
CONFIG_NBLE=y
CONFIG_ARC_INIT=n
CONFIG_BLUETOOTH_DEBUG=y
diff --git a/samples/bluetooth/peripheral_hr/prj_nble.conf b/samples/bluetooth/peripheral_hr/prj_nble.conf
index 4e25bdbdd..28cf7119a 100644
--- a/samples/bluetooth/peripheral_hr/prj_nble.conf
+++ b/samples/bluetooth/peripheral_hr/prj_nble.conf
@@ -1,3 +1,5 @@
+CONFIG_BLUETOOTH=y
+CONFIG_BLUETOOTH_STACK_NBLE=y
CONFIG_NBLE=y
CONFIG_ARC_INIT=n
CONFIG_BLUETOOTH_DEBUG=y
diff --git a/tests/bluetooth/shell/prj_nble.conf b/tests/bluetooth/shell/prj_nble.conf
index b3e4095d3..95e5d7449 100644
--- a/tests/bluetooth/shell/prj_nble.conf
+++ b/tests/bluetooth/shell/prj_nble.conf
@@ -1,5 +1,7 @@
CONFIG_MINIMAL_LIBC_EXTENDED=y
CONFIG_TEST_RANDOM_GENERATOR=y
+CONFIG_BLUETOOTH=y
+CONFIG_BLUETOOTH_STACK_NBLE=y
CONFIG_NBLE=y
CONFIG_ARC_INIT=n
CONFIG_CONSOLE_HANDLER=y
diff --git a/tests/bluetooth/tester/prj_nble.conf b/tests/bluetooth/tester/prj_nble.conf
index 03112f7a4..7c2a730b5 100644
--- a/tests/bluetooth/tester/prj_nble.conf
+++ b/tests/bluetooth/tester/prj_nble.conf
@@ -1,5 +1,7 @@
CONFIG_UART_PIPE=y
CONFIG_CONSOLE_HANDLER=y
+CONFIG_BLUETOOTH=y
+CONFIG_BLUETOOTH_STACK_NBLE=y
CONFIG_NBLE=y
CONFIG_ARC_INIT=n
CONFIG_UART_CONSOLE=n