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>
This commit is contained in:
Daniel Leung 2016-03-16 13:05:56 -07:00 committed by Gerrit Code Review
commit fa868a7846
11 changed files with 59 additions and 10 deletions

View file

@ -65,8 +65,6 @@ source "drivers/aio/Kconfig"
source "drivers/qmsi/Kconfig"
source "drivers/nble/Kconfig"
source "drivers/flash/Kconfig"
source "drivers/sensor/Kconfig"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,4 +1,5 @@
obj-y = hci_core.o \
obj-$(CONFIG_BLUETOOTH_STACK_HCI) = \
hci_core.o \
uuid.o
ifeq ($(CONFIG_BLUETOOTH_CONN),y)

View file

@ -1,3 +1,5 @@
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_STACK_NBLE=y
CONFIG_NBLE=y
CONFIG_ARC_INIT=n
CONFIG_BLUETOOTH_DEBUG=y

View file

@ -1,3 +1,5 @@
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_STACK_NBLE=y
CONFIG_NBLE=y
CONFIG_ARC_INIT=n
CONFIG_BLUETOOTH_DEBUG=y

View file

@ -1,3 +1,5 @@
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_STACK_NBLE=y
CONFIG_NBLE=y
CONFIG_ARC_INIT=n
CONFIG_BLUETOOTH_DEBUG=y

View file

@ -1,3 +1,5 @@
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_STACK_NBLE=y
CONFIG_NBLE=y
CONFIG_ARC_INIT=n
CONFIG_BLUETOOTH_DEBUG=y

View file

@ -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

View file

@ -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