aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-02-14 16:40:06 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2015-02-15 11:54:13 -0500
commit035a07d5df7003bc6954f0aa42174416b775021c (patch)
tree5ae43717e095a0ff44fcb8eea1164ee22654d8ab
parent18835dfa3ac526b25f74af3a61829f02fe92a317 (diff)
Bluetooth: Provide option to enable/disable debugfs information
The Bluetooth controllers can export extensive information about internal states via debugfs. This patch provides an option to choose if these information are provided or not. For backwards compatibility with existing kernel configuration, this option defaults to yes. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/Kconfig8
-rw-r--r--net/bluetooth/Makefile3
-rw-r--r--net/bluetooth/hci_debugfs.h22
3 files changed, 32 insertions, 1 deletions
diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig
index 7de74635a110..b8c794b87523 100644
--- a/net/bluetooth/Kconfig
+++ b/net/bluetooth/Kconfig
@@ -91,4 +91,12 @@ config BT_SELFTEST_SMP
91 Run test cases for SMP cryptographic functionality, including both 91 Run test cases for SMP cryptographic functionality, including both
92 legacy SMP as well as the Secure Connections features. 92 legacy SMP as well as the Secure Connections features.
93 93
94config BT_DEBUGFS
95 bool "Export Bluetooth internals in debugfs"
96 depends on BT && DEBUG_FS
97 default y
98 help
99 Provide extensive information about internal Bluetooth states
100 in debugfs.
101
94source "drivers/bluetooth/Kconfig" 102source "drivers/bluetooth/Kconfig"
diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile
index 8e96e3072266..5d608799717e 100644
--- a/net/bluetooth/Makefile
+++ b/net/bluetooth/Makefile
@@ -13,8 +13,9 @@ bluetooth_6lowpan-y := 6lowpan.o
13 13
14bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ 14bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \
15 hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \ 15 hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \
16 a2mp.o amp.o ecc.o hci_request.o hci_debugfs.o 16 a2mp.o amp.o ecc.o hci_request.o
17 17
18bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o
18bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o 19bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o
19 20
20subdir-ccflags-y += -D__CHECK_ENDIAN__ 21subdir-ccflags-y += -D__CHECK_ENDIAN__
diff --git a/net/bluetooth/hci_debugfs.h b/net/bluetooth/hci_debugfs.h
index fb68efe083c5..4444dc8cedc2 100644
--- a/net/bluetooth/hci_debugfs.h
+++ b/net/bluetooth/hci_debugfs.h
@@ -20,7 +20,29 @@
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
23#if IS_ENABLED(CONFIG_BT_DEBUGFS)
24
23void hci_debugfs_create_common(struct hci_dev *hdev); 25void hci_debugfs_create_common(struct hci_dev *hdev);
24void hci_debugfs_create_bredr(struct hci_dev *hdev); 26void hci_debugfs_create_bredr(struct hci_dev *hdev);
25void hci_debugfs_create_le(struct hci_dev *hdev); 27void hci_debugfs_create_le(struct hci_dev *hdev);
26void hci_debugfs_create_conn(struct hci_conn *conn); 28void hci_debugfs_create_conn(struct hci_conn *conn);
29
30#else
31
32static inline void hci_debugfs_create_common(struct hci_dev *hdev)
33{
34}
35
36static inline void hci_debugfs_create_bredr(struct hci_dev *hdev)
37{
38}
39
40static inline void hci_debugfs_create_le(struct hci_dev *hdev)
41{
42}
43
44static inline void hci_debugfs_create_conn(struct hci_conn *conn)
45{
46}
47
48#endif