From 6bc645962a22645fc2881f03316e984377781239 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 2 Nov 2016 11:06:56 +0200 Subject: [PATCH] Bluetooth: Move Bluetooth host stack to subsys Move the Bluetooth host stack from net/bluetooth to subsys/bluetooth/host. This is preparation for having both host and controller under the same root, i.e. subsys/bluetooth/. Change-Id: I3bc796f7e331fca0c485f3890d62b9c03e027b96 Signed-off-by: Johan Hedberg --- MAINTAINERS | 2 +- doc/subsystems/bluetooth/bluetooth.rst | 2 +- drivers/bluetooth/nble/Makefile | 2 +- net/Kconfig | 2 -- net/Makefile | 1 - subsys/Kconfig | 1 + subsys/Makefile | 1 + subsys/bluetooth/Kconfig | 18 ++++++++++++++++++ subsys/bluetooth/Makefile | 1 + .../bluetooth/host}/Kconfig | 0 .../bluetooth/host}/Makefile | 0 .../bluetooth => subsys/bluetooth/host}/a2dp.c | 0 .../bluetooth/host}/a2dp_internal.h | 0 {net/bluetooth => subsys/bluetooth/host}/at.c | 0 {net/bluetooth => subsys/bluetooth/host}/at.h | 0 {net/bluetooth => subsys/bluetooth/host}/att.c | 0 .../bluetooth/host}/att_internal.h | 0 .../bluetooth/host}/avdtp.c | 0 .../bluetooth/host}/avdtp_internal.h | 0 .../bluetooth => subsys/bluetooth/host}/conn.c | 0 .../bluetooth/host}/conn_internal.h | 0 {net/bluetooth => subsys/bluetooth/host}/ecc.h | 1 - .../bluetooth => subsys/bluetooth/host}/gatt.c | 0 .../bluetooth/host}/gatt_internal.h | 0 .../bluetooth/host}/hci_core.c | 0 .../bluetooth/host}/hci_core.h | 0 .../bluetooth/host}/hci_ecc.c | 0 .../bluetooth/host}/hci_ecc.h | 0 .../bluetooth/host}/hci_raw.c | 0 .../bluetooth/host}/hfp_hf.c | 0 .../bluetooth/host}/hfp_internal.h | 0 .../bluetooth => subsys/bluetooth/host}/keys.c | 1 - .../bluetooth => subsys/bluetooth/host}/keys.h | 0 .../bluetooth/host}/keys_br.c | 0 .../bluetooth/host}/l2cap.c | 0 .../bluetooth/host}/l2cap_br.c | 0 .../bluetooth/host}/l2cap_internal.h | 0 {net/bluetooth => subsys/bluetooth/host}/log.c | 0 .../bluetooth/host}/monitor.c | 0 .../bluetooth/host}/monitor.h | 0 .../bluetooth/host}/rfcomm.c | 0 .../bluetooth/host}/rfcomm_internal.h | 0 {net/bluetooth => subsys/bluetooth/host}/sdp.c | 0 .../bluetooth/host}/sdp_internal.h | 0 {net/bluetooth => subsys/bluetooth/host}/smp.c | 0 {net/bluetooth => subsys/bluetooth/host}/smp.h | 0 .../bluetooth/host}/smp_null.c | 0 .../bluetooth => subsys/bluetooth/host}/uuid.c | 0 48 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 subsys/bluetooth/Kconfig create mode 100644 subsys/bluetooth/Makefile rename {net/bluetooth => subsys/bluetooth/host}/Kconfig (100%) rename {net/bluetooth => subsys/bluetooth/host}/Makefile (100%) rename {net/bluetooth => subsys/bluetooth/host}/a2dp.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/a2dp_internal.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/at.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/at.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/att.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/att_internal.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/avdtp.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/avdtp_internal.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/conn.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/conn_internal.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/ecc.h (99%) rename {net/bluetooth => subsys/bluetooth/host}/gatt.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/gatt_internal.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/hci_core.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/hci_core.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/hci_ecc.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/hci_ecc.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/hci_raw.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/hfp_hf.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/hfp_internal.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/keys.c (99%) rename {net/bluetooth => subsys/bluetooth/host}/keys.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/keys_br.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/l2cap.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/l2cap_br.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/l2cap_internal.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/log.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/monitor.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/monitor.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/rfcomm.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/rfcomm_internal.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/sdp.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/sdp_internal.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/smp.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/smp.h (100%) rename {net/bluetooth => subsys/bluetooth/host}/smp_null.c (100%) rename {net/bluetooth => subsys/bluetooth/host}/uuid.c (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 6565c17cea..616c38aafd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -175,7 +175,7 @@ M: Luiz Augusto von Dentz M: Szymon Janc S: Supported W: https://www.zephyrproject.org/doc/subsystems/bluetooth/bluetooth.html -F: net/bluetooth/ +F: subsys/bluetooth/ F: include/bluetooth/ F: drivers/bluetooth/ F: samples/bluetooth/ diff --git a/doc/subsystems/bluetooth/bluetooth.rst b/doc/subsystems/bluetooth/bluetooth.rst index 8c0ed3c7c9..07f48ba2c4 100644 --- a/doc/subsystems/bluetooth/bluetooth.rst +++ b/doc/subsystems/bluetooth/bluetooth.rst @@ -38,7 +38,7 @@ Source tree layout The stack is split up as follows in the source tree: -``net/bluetooth/`` +``subsys/bluetooth/`` The core stack itself. This is where the HCI command & event handling as well as connection tracking happens. The implementation of the core protocols such as L2CAP, ATT & SMP is also here. diff --git a/drivers/bluetooth/nble/Makefile b/drivers/bluetooth/nble/Makefile index 6ad21658ec..16b6bbbe6c 100644 --- a/drivers/bluetooth/nble/Makefile +++ b/drivers/bluetooth/nble/Makefile @@ -2,4 +2,4 @@ subdir-ccflags-$(CONFIG_NBLE) +=-I$(srctree)/drivers/bluetooth obj-$(CONFIG_NBLE) += gap.o conn.o gatt.o uart.o rpc_serialize.o \ rpc_deserialize.o stubs.o smp.o \ - ../../../net/bluetooth/uuid.o + ../../../subsys/bluetooth/host/uuid.o diff --git a/net/Kconfig b/net/Kconfig index 4efedf7578..e88d8598ba 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -18,8 +18,6 @@ menu "Networking" -source "net/bluetooth/Kconfig" - source "net/ip/Kconfig" config NET_BUF diff --git a/net/Makefile b/net/Makefile index 06a4773f06..20b4b7edea 100644 --- a/net/Makefile +++ b/net/Makefile @@ -1,3 +1,2 @@ -obj-$(CONFIG_BLUETOOTH) += bluetooth/ obj-$(CONFIG_NET_BUF) += buf.o obj-$(CONFIG_NETWORKING) += ip/ diff --git a/subsys/Kconfig b/subsys/Kconfig index 0a5c8e0368..b8ce1dfbbe 100644 --- a/subsys/Kconfig +++ b/subsys/Kconfig @@ -19,3 +19,4 @@ source "subsys/fs/Kconfig" source "subsys/usb/Kconfig" +source "subsys/bluetooth/Kconfig" diff --git a/subsys/Makefile b/subsys/Makefile index 3abd44b8fb..fb90626559 100644 --- a/subsys/Makefile +++ b/subsys/Makefile @@ -1,2 +1,3 @@ obj-$(CONFIG_FILE_SYSTEM) += fs/ obj-$(CONFIG_USB) += usb/ +obj-$(CONFIG_BLUETOOTH) += bluetooth/ diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig new file mode 100644 index 0000000000..4b5d4e742c --- /dev/null +++ b/subsys/bluetooth/Kconfig @@ -0,0 +1,18 @@ +# Kconfig - Bluetooth configuration options +# +# Copyright (c) 2016 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +source "subsys/bluetooth/host/Kconfig" diff --git a/subsys/bluetooth/Makefile b/subsys/bluetooth/Makefile new file mode 100644 index 0000000000..8b9f92aebd --- /dev/null +++ b/subsys/bluetooth/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_BLUETOOTH) += host/ diff --git a/net/bluetooth/Kconfig b/subsys/bluetooth/host/Kconfig similarity index 100% rename from net/bluetooth/Kconfig rename to subsys/bluetooth/host/Kconfig diff --git a/net/bluetooth/Makefile b/subsys/bluetooth/host/Makefile similarity index 100% rename from net/bluetooth/Makefile rename to subsys/bluetooth/host/Makefile diff --git a/net/bluetooth/a2dp.c b/subsys/bluetooth/host/a2dp.c similarity index 100% rename from net/bluetooth/a2dp.c rename to subsys/bluetooth/host/a2dp.c diff --git a/net/bluetooth/a2dp_internal.h b/subsys/bluetooth/host/a2dp_internal.h similarity index 100% rename from net/bluetooth/a2dp_internal.h rename to subsys/bluetooth/host/a2dp_internal.h diff --git a/net/bluetooth/at.c b/subsys/bluetooth/host/at.c similarity index 100% rename from net/bluetooth/at.c rename to subsys/bluetooth/host/at.c diff --git a/net/bluetooth/at.h b/subsys/bluetooth/host/at.h similarity index 100% rename from net/bluetooth/at.h rename to subsys/bluetooth/host/at.h diff --git a/net/bluetooth/att.c b/subsys/bluetooth/host/att.c similarity index 100% rename from net/bluetooth/att.c rename to subsys/bluetooth/host/att.c diff --git a/net/bluetooth/att_internal.h b/subsys/bluetooth/host/att_internal.h similarity index 100% rename from net/bluetooth/att_internal.h rename to subsys/bluetooth/host/att_internal.h diff --git a/net/bluetooth/avdtp.c b/subsys/bluetooth/host/avdtp.c similarity index 100% rename from net/bluetooth/avdtp.c rename to subsys/bluetooth/host/avdtp.c diff --git a/net/bluetooth/avdtp_internal.h b/subsys/bluetooth/host/avdtp_internal.h similarity index 100% rename from net/bluetooth/avdtp_internal.h rename to subsys/bluetooth/host/avdtp_internal.h diff --git a/net/bluetooth/conn.c b/subsys/bluetooth/host/conn.c similarity index 100% rename from net/bluetooth/conn.c rename to subsys/bluetooth/host/conn.c diff --git a/net/bluetooth/conn_internal.h b/subsys/bluetooth/host/conn_internal.h similarity index 100% rename from net/bluetooth/conn_internal.h rename to subsys/bluetooth/host/conn_internal.h diff --git a/net/bluetooth/ecc.h b/subsys/bluetooth/host/ecc.h similarity index 99% rename from net/bluetooth/ecc.h rename to subsys/bluetooth/host/ecc.h index 411f2ca49b..db4758a3b2 100644 --- a/net/bluetooth/ecc.h +++ b/subsys/bluetooth/host/ecc.h @@ -71,4 +71,3 @@ typedef void (*bt_dh_key_cb_t)(const uint8_t key[32]); * @return Zero on success or negative error code otherwise */ int bt_dh_key_gen(const uint8_t remote_pk[64], bt_dh_key_cb_t cb); - diff --git a/net/bluetooth/gatt.c b/subsys/bluetooth/host/gatt.c similarity index 100% rename from net/bluetooth/gatt.c rename to subsys/bluetooth/host/gatt.c diff --git a/net/bluetooth/gatt_internal.h b/subsys/bluetooth/host/gatt_internal.h similarity index 100% rename from net/bluetooth/gatt_internal.h rename to subsys/bluetooth/host/gatt_internal.h diff --git a/net/bluetooth/hci_core.c b/subsys/bluetooth/host/hci_core.c similarity index 100% rename from net/bluetooth/hci_core.c rename to subsys/bluetooth/host/hci_core.c diff --git a/net/bluetooth/hci_core.h b/subsys/bluetooth/host/hci_core.h similarity index 100% rename from net/bluetooth/hci_core.h rename to subsys/bluetooth/host/hci_core.h diff --git a/net/bluetooth/hci_ecc.c b/subsys/bluetooth/host/hci_ecc.c similarity index 100% rename from net/bluetooth/hci_ecc.c rename to subsys/bluetooth/host/hci_ecc.c diff --git a/net/bluetooth/hci_ecc.h b/subsys/bluetooth/host/hci_ecc.h similarity index 100% rename from net/bluetooth/hci_ecc.h rename to subsys/bluetooth/host/hci_ecc.h diff --git a/net/bluetooth/hci_raw.c b/subsys/bluetooth/host/hci_raw.c similarity index 100% rename from net/bluetooth/hci_raw.c rename to subsys/bluetooth/host/hci_raw.c diff --git a/net/bluetooth/hfp_hf.c b/subsys/bluetooth/host/hfp_hf.c similarity index 100% rename from net/bluetooth/hfp_hf.c rename to subsys/bluetooth/host/hfp_hf.c diff --git a/net/bluetooth/hfp_internal.h b/subsys/bluetooth/host/hfp_internal.h similarity index 100% rename from net/bluetooth/hfp_internal.h rename to subsys/bluetooth/host/hfp_internal.h diff --git a/net/bluetooth/keys.c b/subsys/bluetooth/host/keys.c similarity index 99% rename from net/bluetooth/keys.c rename to subsys/bluetooth/host/keys.c index 710032eb5d..095ed4654f 100644 --- a/net/bluetooth/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -170,4 +170,3 @@ void bt_keys_clear(struct bt_keys *keys) memset(keys, 0, sizeof(*keys)); } - diff --git a/net/bluetooth/keys.h b/subsys/bluetooth/host/keys.h similarity index 100% rename from net/bluetooth/keys.h rename to subsys/bluetooth/host/keys.h diff --git a/net/bluetooth/keys_br.c b/subsys/bluetooth/host/keys_br.c similarity index 100% rename from net/bluetooth/keys_br.c rename to subsys/bluetooth/host/keys_br.c diff --git a/net/bluetooth/l2cap.c b/subsys/bluetooth/host/l2cap.c similarity index 100% rename from net/bluetooth/l2cap.c rename to subsys/bluetooth/host/l2cap.c diff --git a/net/bluetooth/l2cap_br.c b/subsys/bluetooth/host/l2cap_br.c similarity index 100% rename from net/bluetooth/l2cap_br.c rename to subsys/bluetooth/host/l2cap_br.c diff --git a/net/bluetooth/l2cap_internal.h b/subsys/bluetooth/host/l2cap_internal.h similarity index 100% rename from net/bluetooth/l2cap_internal.h rename to subsys/bluetooth/host/l2cap_internal.h diff --git a/net/bluetooth/log.c b/subsys/bluetooth/host/log.c similarity index 100% rename from net/bluetooth/log.c rename to subsys/bluetooth/host/log.c diff --git a/net/bluetooth/monitor.c b/subsys/bluetooth/host/monitor.c similarity index 100% rename from net/bluetooth/monitor.c rename to subsys/bluetooth/host/monitor.c diff --git a/net/bluetooth/monitor.h b/subsys/bluetooth/host/monitor.h similarity index 100% rename from net/bluetooth/monitor.h rename to subsys/bluetooth/host/monitor.h diff --git a/net/bluetooth/rfcomm.c b/subsys/bluetooth/host/rfcomm.c similarity index 100% rename from net/bluetooth/rfcomm.c rename to subsys/bluetooth/host/rfcomm.c diff --git a/net/bluetooth/rfcomm_internal.h b/subsys/bluetooth/host/rfcomm_internal.h similarity index 100% rename from net/bluetooth/rfcomm_internal.h rename to subsys/bluetooth/host/rfcomm_internal.h diff --git a/net/bluetooth/sdp.c b/subsys/bluetooth/host/sdp.c similarity index 100% rename from net/bluetooth/sdp.c rename to subsys/bluetooth/host/sdp.c diff --git a/net/bluetooth/sdp_internal.h b/subsys/bluetooth/host/sdp_internal.h similarity index 100% rename from net/bluetooth/sdp_internal.h rename to subsys/bluetooth/host/sdp_internal.h diff --git a/net/bluetooth/smp.c b/subsys/bluetooth/host/smp.c similarity index 100% rename from net/bluetooth/smp.c rename to subsys/bluetooth/host/smp.c diff --git a/net/bluetooth/smp.h b/subsys/bluetooth/host/smp.h similarity index 100% rename from net/bluetooth/smp.h rename to subsys/bluetooth/host/smp.h diff --git a/net/bluetooth/smp_null.c b/subsys/bluetooth/host/smp_null.c similarity index 100% rename from net/bluetooth/smp_null.c rename to subsys/bluetooth/host/smp_null.c diff --git a/net/bluetooth/uuid.c b/subsys/bluetooth/host/uuid.c similarity index 100% rename from net/bluetooth/uuid.c rename to subsys/bluetooth/host/uuid.c