Commit 0663b297 authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann

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: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 7652ff6a
...@@ -124,7 +124,7 @@ enum { ...@@ -124,7 +124,7 @@ enum {
HCI_MGMT, HCI_MGMT,
HCI_PAIRABLE, HCI_PAIRABLE,
HCI_SERVICE_CACHE, HCI_SERVICE_CACHE,
HCI_DEBUG_KEYS, HCI_KEEP_DEBUG_KEYS,
HCI_UNREGISTER, HCI_UNREGISTER,
HCI_USER_CHANNEL, HCI_USER_CHANNEL,
......
...@@ -3066,7 +3066,7 @@ static void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -3066,7 +3066,7 @@ static void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
BT_DBG("%s found key type %u for %pMR", hdev->name, key->type, BT_DBG("%s found key type %u for %pMR", hdev->name, key->type,
&ev->bdaddr); &ev->bdaddr);
if (!test_bit(HCI_DEBUG_KEYS, &hdev->dev_flags) && if (!test_bit(HCI_KEEP_DEBUG_KEYS, &hdev->dev_flags) &&
key->type == HCI_LK_DEBUG_COMBINATION) { key->type == HCI_LK_DEBUG_COMBINATION) {
BT_DBG("%s ignoring debug key", hdev->name); BT_DBG("%s ignoring debug key", hdev->name);
goto not_found; goto not_found;
......
...@@ -440,7 +440,7 @@ static u32 get_current_settings(struct hci_dev *hdev) ...@@ -440,7 +440,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
if (test_bit(HCI_SC_ENABLED, &hdev->dev_flags)) if (test_bit(HCI_SC_ENABLED, &hdev->dev_flags))
settings |= MGMT_SETTING_SECURE_CONN; settings |= MGMT_SETTING_SECURE_CONN;
if (test_bit(HCI_DEBUG_KEYS, &hdev->dev_flags)) if (test_bit(HCI_KEEP_DEBUG_KEYS, &hdev->dev_flags))
settings |= MGMT_SETTING_DEBUG_KEYS; settings |= MGMT_SETTING_DEBUG_KEYS;
if (test_bit(HCI_PRIVACY, &hdev->dev_flags)) 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,9 +2414,11 @@ static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data,
hci_link_keys_clear(hdev); hci_link_keys_clear(hdev);
if (cp->debug_keys) if (cp->debug_keys)
changed = !test_and_set_bit(HCI_DEBUG_KEYS, &hdev->dev_flags); changed = !test_and_set_bit(HCI_KEEP_DEBUG_KEYS,
&hdev->dev_flags);
else else
changed = test_and_clear_bit(HCI_DEBUG_KEYS, &hdev->dev_flags); changed = test_and_clear_bit(HCI_KEEP_DEBUG_KEYS,
&hdev->dev_flags);
if (changed) if (changed)
new_settings(hdev, NULL); new_settings(hdev, NULL);
...@@ -4349,9 +4351,11 @@ static int set_debug_keys(struct sock *sk, struct hci_dev *hdev, ...@@ -4349,9 +4351,11 @@ static int set_debug_keys(struct sock *sk, struct hci_dev *hdev,
hci_dev_lock(hdev); hci_dev_lock(hdev);
if (cp->val) if (cp->val)
changed = !test_and_set_bit(HCI_DEBUG_KEYS, &hdev->dev_flags); changed = !test_and_set_bit(HCI_KEEP_DEBUG_KEYS,
&hdev->dev_flags);
else else
changed = test_and_clear_bit(HCI_DEBUG_KEYS, &hdev->dev_flags); changed = test_and_clear_bit(HCI_KEEP_DEBUG_KEYS,
&hdev->dev_flags);
err = send_settings_rsp(sk, MGMT_OP_SET_DEBUG_KEYS, hdev); err = send_settings_rsp(sk, MGMT_OP_SET_DEBUG_KEYS, hdev);
if (err < 0) if (err < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment