Bluetooth: Provide option to enable/disable debugfs information
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 14 Feb 2015 21:40:06 +0000 (13:40 -0800)
committerJohan Hedberg <johan.hedberg@intel.com>
Sun, 15 Feb 2015 16:54:13 +0000 (18:54 +0200)
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>
net/bluetooth/Kconfig
net/bluetooth/Makefile
net/bluetooth/hci_debugfs.h

index 7de74635a110cbbecbaaddf31ac5d39708362397..b8c794b87523857b9a658526ebb92dd21b22dd57 100644 (file)
@@ -91,4 +91,12 @@ config BT_SELFTEST_SMP
          Run test cases for SMP cryptographic functionality, including both
          legacy SMP as well as the Secure Connections features.
 
+config BT_DEBUGFS
+       bool "Export Bluetooth internals in debugfs"
+       depends on BT && DEBUG_FS
+       default y
+       help
+         Provide extensive information about internal Bluetooth states
+         in debugfs.
+
 source "drivers/bluetooth/Kconfig"
index 8e96e30722668a8fa92663c1ee1ba17f2f74abd1..5d608799717e10d0043f3a61d8fad48c9217dc93 100644 (file)
@@ -13,8 +13,9 @@ bluetooth_6lowpan-y := 6lowpan.o
 
 bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \
        hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \
-       a2mp.o amp.o ecc.o hci_request.o hci_debugfs.o
+       a2mp.o amp.o ecc.o hci_request.o
 
+bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o
 bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o
 
 subdir-ccflags-y += -D__CHECK_ENDIAN__
index fb68efe083c55c9c05d1716c04f8b3d380a2eb78..4444dc8cedc21a6f8237e31adf337feefe477c11 100644 (file)
    SOFTWARE IS DISCLAIMED.
 */
 
+#if IS_ENABLED(CONFIG_BT_DEBUGFS)
+
 void hci_debugfs_create_common(struct hci_dev *hdev);
 void hci_debugfs_create_bredr(struct hci_dev *hdev);
 void hci_debugfs_create_le(struct hci_dev *hdev);
 void hci_debugfs_create_conn(struct hci_conn *conn);
+
+#else
+
+static inline void hci_debugfs_create_common(struct hci_dev *hdev)
+{
+}
+
+static inline void hci_debugfs_create_bredr(struct hci_dev *hdev)
+{
+}
+
+static inline void hci_debugfs_create_le(struct hci_dev *hdev)
+{
+}
+
+static inline void hci_debugfs_create_conn(struct hci_conn *conn)
+{
+}
+
+#endif