aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-06-24 06:15:50 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:45 -0400
commit0663b297f1953e5d84928722e44f71272f5ff058 (patch)
treeaee0803ea892e127f9e7cb8f3abb1e16867d2537
parent7652ff6aeaf0eeaec1f2e7e2f3ce0e588447dbd1 (diff)
Bluetooth: Rename HCI_DEBUG_KEYS to HCI_KEEP_DEBUG_KEYS
We're planning to add a flag to actively use debug keys in addition to simply just accepting them, which makes the current generically named DEBUG_KEYS flag a bit confusing. Since the flag in practice affects whether the kernel keeps debug keys around or not rename it to HCI_KEEP_DEBUG_KEYS. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--include/net/bluetooth/hci.h2
-rw-r--r--net/bluetooth/hci_event.c2
-rw-r--r--net/bluetooth/mgmt.c14
3 files changed, 11 insertions, 7 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 6b8371d73d3d..ffb489e3946d 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -124,7 +124,7 @@ enum {
124 HCI_MGMT, 124 HCI_MGMT,
125 HCI_PAIRABLE, 125 HCI_PAIRABLE,
126 HCI_SERVICE_CACHE, 126 HCI_SERVICE_CACHE,
127 HCI_DEBUG_KEYS, 127 HCI_KEEP_DEBUG_KEYS,
128 HCI_UNREGISTER, 128 HCI_UNREGISTER,
129 HCI_USER_CHANNEL, 129 HCI_USER_CHANNEL,
130 130
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 47bd48a597bd..b0fdeec2f2ca 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3066,7 +3066,7 @@ static void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
3066 BT_DBG("%s found key type %u for %pMR", hdev->name, key->type, 3066 BT_DBG("%s found key type %u for %pMR", hdev->name, key->type,
3067 &ev->bdaddr); 3067 &ev->bdaddr);
3068 3068
3069 if (!test_bit(HCI_DEBUG_KEYS, &hdev->dev_flags) && 3069 if (!test_bit(HCI_KEEP_DEBUG_KEYS, &hdev->dev_flags) &&
3070 key->type == HCI_LK_DEBUG_COMBINATION) { 3070 key->type == HCI_LK_DEBUG_COMBINATION) {
3071 BT_DBG("%s ignoring debug key", hdev->name); 3071 BT_DBG("%s ignoring debug key", hdev->name);
3072 goto not_found; 3072 goto not_found;
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index bb5b04191253..634b44ddc9f9 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -440,7 +440,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
440 if (test_bit(HCI_SC_ENABLED, &hdev->dev_flags)) 440 if (test_bit(HCI_SC_ENABLED, &hdev->dev_flags))
441 settings |= MGMT_SETTING_SECURE_CONN; 441 settings |= MGMT_SETTING_SECURE_CONN;
442 442
443 if (test_bit(HCI_DEBUG_KEYS, &hdev->dev_flags)) 443 if (test_bit(HCI_KEEP_DEBUG_KEYS, &hdev->dev_flags))
444 settings |= MGMT_SETTING_DEBUG_KEYS; 444 settings |= MGMT_SETTING_DEBUG_KEYS;
445 445
446 if (test_bit(HCI_PRIVACY, &hdev->dev_flags)) 446 if (test_bit(HCI_PRIVACY, &hdev->dev_flags))
@@ -2414,9 +2414,11 @@ static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data,
2414 hci_link_keys_clear(hdev); 2414 hci_link_keys_clear(hdev);
2415 2415
2416 if (cp->debug_keys) 2416 if (cp->debug_keys)
2417 changed = !test_and_set_bit(HCI_DEBUG_KEYS, &hdev->dev_flags); 2417 changed = !test_and_set_bit(HCI_KEEP_DEBUG_KEYS,
2418 &hdev->dev_flags);
2418 else 2419 else
2419 changed = test_and_clear_bit(HCI_DEBUG_KEYS, &hdev->dev_flags); 2420 changed = test_and_clear_bit(HCI_KEEP_DEBUG_KEYS,
2421 &hdev->dev_flags);
2420 2422
2421 if (changed) 2423 if (changed)
2422 new_settings(hdev, NULL); 2424 new_settings(hdev, NULL);
@@ -4349,9 +4351,11 @@ static int set_debug_keys(struct sock *sk, struct hci_dev *hdev,
4349 hci_dev_lock(hdev); 4351 hci_dev_lock(hdev);
4350 4352
4351 if (cp->val) 4353 if (cp->val)
4352 changed = !test_and_set_bit(HCI_DEBUG_KEYS, &hdev->dev_flags); 4354 changed = !test_and_set_bit(HCI_KEEP_DEBUG_KEYS,
4355 &hdev->dev_flags);
4353 else 4356 else
4354 changed = test_and_clear_bit(HCI_DEBUG_KEYS, &hdev->dev_flags); 4357 changed = test_and_clear_bit(HCI_KEEP_DEBUG_KEYS,
4358 &hdev->dev_flags);
4355 4359
4356 err = send_settings_rsp(sk, MGMT_OP_SET_DEBUG_KEYS, hdev); 4360 err = send_settings_rsp(sk, MGMT_OP_SET_DEBUG_KEYS, hdev);
4357 if (err < 0) 4361 if (err < 0)