Bluetooth: Permit connectionless host-controller combined build

In a host plus controller combined build, if no connection
is required, deselect CONFIG_BLUETOOTH_MAX_CONN. This will
reduce RAM and ROM usage in the controller.

Also, make BLUETOOTH_PERIPHERAL, BLUETOOTH_CENTRAL and
BLUETOOTH_CONN switches accessible by the controller kconfig
to select the right roles to enable.

Change-id: I164cf696ab2a6f4859086d2cb18f6d3f2b1399d3
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
This commit is contained in:
Vinayak Chettimada 2017-03-27 16:04:42 +02:00 committed by Johan Hedberg
commit cced2aea30
2 changed files with 40 additions and 35 deletions

View file

@ -1,6 +1,7 @@
# Kconfig - Bluetooth LE stack configuration options
#
# Copyright (c) 2016-2017 Nordic Semiconductor ASA
# Copyright (c) 2015-2016 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
@ -23,13 +24,39 @@ config BLUETOOTH_UART_TO_HOST_DEV_NAME
to connect to an external Bluetooth Host when Zephyr is
acting as a Bluetooth Controller.
# Virtual/hidden option to make the conditions more intuitive
config BLUETOOTH_HCI_HOST
# Virtual/hidden option to make the conditions more intuitive
bool
default y
depends on !BLUETOOTH_HCI_RAW
select POLL
config BLUETOOTH_PERIPHERAL
bool "Peripheral Role support"
select BLUETOOTH_CONN
default y if BLUETOOTH_HCI_RAW
help
Select this for LE Peripheral role support.
config BLUETOOTH_CENTRAL
bool "Central Role support"
select BLUETOOTH_CONN
default y if BLUETOOTH_HCI_RAW
help
Select this for LE Central role support.
config BLUETOOTH_CONN
bool
config BLUETOOTH_MAX_CONN
int "Maximum number of simultaneous connections"
depends on BLUETOOTH_CONN
range 1 64
default 1
help
Maximum number of simultaneous Bluetooth connections
supported.
config BLUETOOTH_HCI_CMD_COUNT
int "Number of HCI command buffers"
default 2
@ -116,21 +143,6 @@ config BLUETOOTH_INTERNAL_STORAGE
persistent storage handlers through the bt_storage API, rather
an internal default handler is used for this.
config BLUETOOTH_PERIPHERAL
bool "Peripheral Role support"
select BLUETOOTH_CONN
help
Select this for LE Peripheral role support.
config BLUETOOTH_CENTRAL
bool "Central Role support"
select BLUETOOTH_CONN
help
Select this for LE Central role support.
config BLUETOOTH_CONN
bool
if BLUETOOTH_CONN
config BLUETOOTH_L2CAP_TX_BUF_COUNT
int "Number of L2CAP TX buffers"
@ -268,15 +280,6 @@ config BLUETOOTH_TINYCRYPT_ECC
option injects support for the 2 HCI commands required for LE Secure
Connections so that Hosts can make use of those.
config BLUETOOTH_MAX_CONN
int "Maximum number of simultaneous connections"
depends on BLUETOOTH_CONN || BLUETOOTH_CONTROLLER
default 1
range 1 64
help
Maximum number of simultaneous Bluetooth connections
supported. The minimum (and default) number is 1.
config BLUETOOTH_DEBUG
bool

View file

@ -1,7 +1,5 @@
ccflags-y +=-I$(srctree)/include/drivers
obj-$(CONFIG_BLUETOOTH_HCI_HOST) += uuid.o hci_core.o
obj-$(CONFIG_BLUETOOTH_HCI_RAW) += hci_raw.o
obj-$(CONFIG_BLUETOOTH_DEBUG) += log.o
@ -12,6 +10,9 @@ obj-$(CONFIG_BLUETOOTH_TINYCRYPT_ECC) += hci_ecc.o
obj-$(CONFIG_BLUETOOTH_INTERNAL_STORAGE) += storage.o
ifeq ($(CONFIG_BLUETOOTH_HCI_HOST),y)
obj-y += uuid.o hci_core.o
ifeq ($(CONFIG_BLUETOOTH_CONN),y)
obj-y += conn.o l2cap.o att.o gatt.o
@ -23,6 +24,7 @@ ifeq ($(CONFIG_BLUETOOTH_CONN),y)
endif
obj-$(CONFIG_BLUETOOTH_HOST_CRYPTO) += crypto.o
endif
obj-$(CONFIG_BLUETOOTH_BREDR) += keys_br.o l2cap_br.o sdp.o