aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-12-31 17:43:18 -0500
committerMarcel Holtmann <marcel@holtmann.org>2015-01-02 16:22:04 -0500
commit05b3c3e7905d00a1fe2e9184fdd9b5eac427c736 (patch)
tree4251d1ca90974e4bee900fed331ecd23e8285c4c /net/bluetooth
parent91389af67c3a8d8f9eca5f51deda58fae4d9326e (diff)
Bluetooth: Remove no longer needed force_sc_support debugfs option
The force_sc_support debugfs option was introduced to easily work with pre-production Bluetooth 4.1 silicon. This option is no longer needed since controllers supporting BR/EDR Secure Connections feature are now available. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_debugfs.c49
-rw-r--r--net/bluetooth/mgmt.c11
2 files changed, 4 insertions, 56 deletions
diff --git a/net/bluetooth/hci_debugfs.c b/net/bluetooth/hci_debugfs.c
index dc8f994a957b..d72ebc2b11fa 100644
--- a/net/bluetooth/hci_debugfs.c
+++ b/net/bluetooth/hci_debugfs.c
@@ -375,52 +375,6 @@ static const struct file_operations sc_only_mode_fops = {
375 .llseek = default_llseek, 375 .llseek = default_llseek,
376}; 376};
377 377
378static ssize_t force_sc_support_read(struct file *file, char __user *user_buf,
379 size_t count, loff_t *ppos)
380{
381 struct hci_dev *hdev = file->private_data;
382 char buf[3];
383
384 buf[0] = test_bit(HCI_FORCE_SC, &hdev->dbg_flags) ? 'Y': 'N';
385 buf[1] = '\n';
386 buf[2] = '\0';
387 return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
388}
389
390static ssize_t force_sc_support_write(struct file *file,
391 const char __user *user_buf,
392 size_t count, loff_t *ppos)
393{
394 struct hci_dev *hdev = file->private_data;
395 char buf[32];
396 size_t buf_size = min(count, (sizeof(buf)-1));
397 bool enable;
398
399 if (test_bit(HCI_UP, &hdev->flags))
400 return -EBUSY;
401
402 if (copy_from_user(buf, user_buf, buf_size))
403 return -EFAULT;
404
405 buf[buf_size] = '\0';
406 if (strtobool(buf, &enable))
407 return -EINVAL;
408
409 if (enable == test_bit(HCI_FORCE_SC, &hdev->dbg_flags))
410 return -EALREADY;
411
412 change_bit(HCI_FORCE_SC, &hdev->dbg_flags);
413
414 return count;
415}
416
417static const struct file_operations force_sc_support_fops = {
418 .open = simple_open,
419 .read = force_sc_support_read,
420 .write = force_sc_support_write,
421 .llseek = default_llseek,
422};
423
424static int idle_timeout_set(void *data, u64 val) 378static int idle_timeout_set(void *data, u64 val)
425{ 379{
426 struct hci_dev *hdev = data; 380 struct hci_dev *hdev = data;
@@ -521,9 +475,6 @@ void hci_debugfs_create_bredr(struct hci_dev *hdev)
521 hdev, &auto_accept_delay_fops); 475 hdev, &auto_accept_delay_fops);
522 debugfs_create_file("sc_only_mode", 0444, hdev->debugfs, 476 debugfs_create_file("sc_only_mode", 0444, hdev->debugfs,
523 hdev, &sc_only_mode_fops); 477 hdev, &sc_only_mode_fops);
524
525 debugfs_create_file("force_sc_support", 0644, hdev->debugfs,
526 hdev, &force_sc_support_fops);
527 } 478 }
528 479
529 if (lmp_sniff_capable(hdev)) { 480 if (lmp_sniff_capable(hdev)) {
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 3d2f7ad1e655..6b3f5537e441 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -570,8 +570,7 @@ static u32 get_supported_settings(struct hci_dev *hdev)
570 settings |= MGMT_SETTING_HS; 570 settings |= MGMT_SETTING_HS;
571 } 571 }
572 572
573 if (lmp_sc_capable(hdev) || 573 if (lmp_sc_capable(hdev))
574 test_bit(HCI_FORCE_SC, &hdev->dbg_flags))
575 settings |= MGMT_SETTING_SECURE_CONN; 574 settings |= MGMT_SETTING_SECURE_CONN;
576 } 575 }
577 576
@@ -4727,8 +4726,8 @@ static int set_secure_conn(struct sock *sk, struct hci_dev *hdev,
4727 4726
4728 BT_DBG("request for %s", hdev->name); 4727 BT_DBG("request for %s", hdev->name);
4729 4728
4730 if (!test_bit(HCI_LE_ENABLED, &hdev->dev_flags) && 4729 if (!lmp_sc_capable(hdev) &&
4731 !lmp_sc_capable(hdev) && !test_bit(HCI_FORCE_SC, &hdev->dbg_flags)) 4730 !test_bit(HCI_LE_ENABLED, &hdev->dev_flags))
4732 return cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN, 4731 return cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN,
4733 MGMT_STATUS_NOT_SUPPORTED); 4732 MGMT_STATUS_NOT_SUPPORTED);
4734 4733
@@ -4738,9 +4737,7 @@ static int set_secure_conn(struct sock *sk, struct hci_dev *hdev,
4738 4737
4739 hci_dev_lock(hdev); 4738 hci_dev_lock(hdev);
4740 4739
4741 if (!hdev_is_powered(hdev) || 4740 if (!hdev_is_powered(hdev) || !lmp_sc_capable(hdev) ||
4742 (!lmp_sc_capable(hdev) &&
4743 !test_bit(HCI_FORCE_SC, &hdev->dbg_flags)) ||
4744 !test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags)) { 4741 !test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags)) {
4745 bool changed; 4742 bool changed;
4746 4743