Bluetooth: Remove broken force_lesc_support debugfs option
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 31 Dec 2014 22:43:17 +0000 (14:43 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 2 Jan 2015 21:22:03 +0000 (22:22 +0100)
The force_lesc_support debugfs option never really worked. It has a race
condition between creating the debugfs entry and registering the L2CAP
fixed channel for BR/EDR SMP support.

Also this has been replaced with a working force_bredr_smp debugfs
switch that developers can use now.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
include/net/bluetooth/hci.h
net/bluetooth/hci_debugfs.c

index fddb93f168b86cf1bc25573e48338bc0f8ed8ab5..884ba004237ef40e69e9d09fa0c987043093f8f3 100644 (file)
@@ -173,7 +173,6 @@ enum {
 enum {
        HCI_DUT_MODE,
        HCI_FORCE_SC,
-       HCI_FORCE_LESC,
        HCI_FORCE_BREDR_SMP,
        HCI_FORCE_STATIC_ADDR,
 };
index ee33ce88d3d82caf82475150ec93b75203e237d9..dc8f994a957b0e9cd0c3725dc948dc1f53aa71ce 100644 (file)
@@ -421,50 +421,6 @@ static const struct file_operations force_sc_support_fops = {
        .llseek         = default_llseek,
 };
 
-static ssize_t force_lesc_support_read(struct file *file,
-                                      char __user *user_buf,
-                                      size_t count, loff_t *ppos)
-{
-       struct hci_dev *hdev = file->private_data;
-       char buf[3];
-
-       buf[0] = test_bit(HCI_FORCE_LESC, &hdev->dbg_flags) ? 'Y': 'N';
-       buf[1] = '\n';
-       buf[2] = '\0';
-       return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
-}
-
-static ssize_t force_lesc_support_write(struct file *file,
-                                       const char __user *user_buf,
-                                       size_t count, loff_t *ppos)
-{
-       struct hci_dev *hdev = file->private_data;
-       char buf[32];
-       size_t buf_size = min(count, (sizeof(buf)-1));
-       bool enable;
-
-       if (copy_from_user(buf, user_buf, buf_size))
-               return -EFAULT;
-
-       buf[buf_size] = '\0';
-       if (strtobool(buf, &enable))
-               return -EINVAL;
-
-       if (enable == test_bit(HCI_FORCE_LESC, &hdev->dbg_flags))
-               return -EALREADY;
-
-       change_bit(HCI_FORCE_LESC, &hdev->dbg_flags);
-
-       return count;
-}
-
-static const struct file_operations force_lesc_support_fops = {
-       .open           = simple_open,
-       .read           = force_lesc_support_read,
-       .write          = force_lesc_support_write,
-       .llseek         = default_llseek,
-};
-
 static int idle_timeout_set(void *data, u64 val)
 {
        struct hci_dev *hdev = data;
@@ -568,11 +524,6 @@ void hci_debugfs_create_bredr(struct hci_dev *hdev)
 
                debugfs_create_file("force_sc_support", 0644, hdev->debugfs,
                                    hdev, &force_sc_support_fops);
-
-               if (lmp_le_capable(hdev))
-                       debugfs_create_file("force_lesc_support", 0644,
-                                           hdev->debugfs, hdev,
-                                           &force_lesc_support_fops);
        }
 
        if (lmp_sniff_capable(hdev)) {