diff options
-rw-r--r-- | net/bluetooth/Kconfig | 8 | ||||
-rw-r--r-- | net/bluetooth/Makefile | 3 | ||||
-rw-r--r-- | net/bluetooth/hci_debugfs.h | 22 |
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 | ||
94 | config 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 | |||
94 | source "drivers/bluetooth/Kconfig" | 102 | source "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 | ||
14 | bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ | 14 | bluetooth-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 | ||
18 | bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o | ||
18 | bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o | 19 | bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o |
19 | 20 | ||
20 | subdir-ccflags-y += -D__CHECK_ENDIAN__ | 21 | subdir-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 | |||
23 | void hci_debugfs_create_common(struct hci_dev *hdev); | 25 | void hci_debugfs_create_common(struct hci_dev *hdev); |
24 | void hci_debugfs_create_bredr(struct hci_dev *hdev); | 26 | void hci_debugfs_create_bredr(struct hci_dev *hdev); |
25 | void hci_debugfs_create_le(struct hci_dev *hdev); | 27 | void hci_debugfs_create_le(struct hci_dev *hdev); |
26 | void hci_debugfs_create_conn(struct hci_conn *conn); | 28 | void hci_debugfs_create_conn(struct hci_conn *conn); |
29 | |||
30 | #else | ||
31 | |||
32 | static inline void hci_debugfs_create_common(struct hci_dev *hdev) | ||
33 | { | ||
34 | } | ||
35 | |||
36 | static inline void hci_debugfs_create_bredr(struct hci_dev *hdev) | ||
37 | { | ||
38 | } | ||
39 | |||
40 | static inline void hci_debugfs_create_le(struct hci_dev *hdev) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | static inline void hci_debugfs_create_conn(struct hci_conn *conn) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | #endif | ||