diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-07-30 02:22:22 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-30 13:28:41 -0400 |
commit | b6ae8457ac5c727a2bb85eb8f2e22375d44d2b2d (patch) | |
tree | e521a2da7697c9dcd87aeeaaaaaf21165a4fa73b /net/bluetooth | |
parent | bdb9434664d026ea63ad086443160dd4ed347758 (diff) |
Bluetooth: Rename HCI_PAIRABLE to HCI_BONDABLE
The HCI_PAIRABLE flag isn't actually controlling whether we're pairable
but whether we're bondable. Therefore, rename it accordingly.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_core.c | 4 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 4 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 8 | ||||
-rw-r--r-- | net/bluetooth/smp.c | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 61bd1a8c5849..32b96f1aaf42 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -2521,14 +2521,14 @@ int hci_dev_open(__u16 dev) | |||
2521 | flush_workqueue(hdev->req_workqueue); | 2521 | flush_workqueue(hdev->req_workqueue); |
2522 | 2522 | ||
2523 | /* For controllers not using the management interface and that | 2523 | /* For controllers not using the management interface and that |
2524 | * are brought up using legacy ioctl, set the HCI_PAIRABLE bit | 2524 | * are brought up using legacy ioctl, set the HCI_BONDABLE bit |
2525 | * so that pairing works for them. Once the management interface | 2525 | * so that pairing works for them. Once the management interface |
2526 | * is in use this bit will be cleared again and userspace has | 2526 | * is in use this bit will be cleared again and userspace has |
2527 | * to explicitly enable it. | 2527 | * to explicitly enable it. |
2528 | */ | 2528 | */ |
2529 | if (!test_bit(HCI_USER_CHANNEL, &hdev->dev_flags) && | 2529 | if (!test_bit(HCI_USER_CHANNEL, &hdev->dev_flags) && |
2530 | !test_bit(HCI_MGMT, &hdev->dev_flags)) | 2530 | !test_bit(HCI_MGMT, &hdev->dev_flags)) |
2531 | set_bit(HCI_PAIRABLE, &hdev->dev_flags); | 2531 | set_bit(HCI_BONDABLE, &hdev->dev_flags); |
2532 | 2532 | ||
2533 | err = hci_dev_do_open(hdev); | 2533 | err = hci_dev_do_open(hdev); |
2534 | 2534 | ||
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 623501ddd1b8..c43cee4fcffd 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -3119,7 +3119,7 @@ static void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
3119 | hci_conn_drop(conn); | 3119 | hci_conn_drop(conn); |
3120 | } | 3120 | } |
3121 | 3121 | ||
3122 | if (!test_bit(HCI_PAIRABLE, &hdev->dev_flags) && | 3122 | if (!test_bit(HCI_BONDABLE, &hdev->dev_flags) && |
3123 | !test_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags)) { | 3123 | !test_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags)) { |
3124 | hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY, | 3124 | hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY, |
3125 | sizeof(ev->bdaddr), &ev->bdaddr); | 3125 | sizeof(ev->bdaddr), &ev->bdaddr); |
@@ -3652,7 +3652,7 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
3652 | /* Allow pairing if we're pairable, the initiators of the | 3652 | /* Allow pairing if we're pairable, the initiators of the |
3653 | * pairing or if the remote is not requesting bonding. | 3653 | * pairing or if the remote is not requesting bonding. |
3654 | */ | 3654 | */ |
3655 | if (test_bit(HCI_PAIRABLE, &hdev->dev_flags) || | 3655 | if (test_bit(HCI_BONDABLE, &hdev->dev_flags) || |
3656 | test_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags) || | 3656 | test_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags) || |
3657 | (conn->remote_auth & ~0x01) == HCI_AT_NO_BONDING) { | 3657 | (conn->remote_auth & ~0x01) == HCI_AT_NO_BONDING) { |
3658 | struct hci_cp_io_capability_reply cp; | 3658 | struct hci_cp_io_capability_reply cp; |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 0b15b7618beb..edb1a62054c9 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -603,7 +603,7 @@ static u32 get_current_settings(struct hci_dev *hdev) | |||
603 | if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags)) | 603 | if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags)) |
604 | settings |= MGMT_SETTING_DISCOVERABLE; | 604 | settings |= MGMT_SETTING_DISCOVERABLE; |
605 | 605 | ||
606 | if (test_bit(HCI_PAIRABLE, &hdev->dev_flags)) | 606 | if (test_bit(HCI_BONDABLE, &hdev->dev_flags)) |
607 | settings |= MGMT_SETTING_PAIRABLE; | 607 | settings |= MGMT_SETTING_PAIRABLE; |
608 | 608 | ||
609 | if (test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags)) | 609 | if (test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags)) |
@@ -1152,7 +1152,7 @@ static void mgmt_init_hdev(struct sock *sk, struct hci_dev *hdev) | |||
1152 | * for mgmt we require user-space to explicitly enable | 1152 | * for mgmt we require user-space to explicitly enable |
1153 | * it | 1153 | * it |
1154 | */ | 1154 | */ |
1155 | clear_bit(HCI_PAIRABLE, &hdev->dev_flags); | 1155 | clear_bit(HCI_BONDABLE, &hdev->dev_flags); |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | static int read_controller_info(struct sock *sk, struct hci_dev *hdev, | 1158 | static int read_controller_info(struct sock *sk, struct hci_dev *hdev, |
@@ -1946,9 +1946,9 @@ static int set_pairable(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1946 | hci_dev_lock(hdev); | 1946 | hci_dev_lock(hdev); |
1947 | 1947 | ||
1948 | if (cp->val) | 1948 | if (cp->val) |
1949 | changed = !test_and_set_bit(HCI_PAIRABLE, &hdev->dev_flags); | 1949 | changed = !test_and_set_bit(HCI_BONDABLE, &hdev->dev_flags); |
1950 | else | 1950 | else |
1951 | changed = test_and_clear_bit(HCI_PAIRABLE, &hdev->dev_flags); | 1951 | changed = test_and_clear_bit(HCI_BONDABLE, &hdev->dev_flags); |
1952 | 1952 | ||
1953 | err = send_settings_rsp(sk, MGMT_OP_SET_PAIRABLE, hdev); | 1953 | err = send_settings_rsp(sk, MGMT_OP_SET_PAIRABLE, hdev); |
1954 | if (err < 0) | 1954 | if (err < 0) |
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index eaa8e7482bb4..fd3294300803 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -307,7 +307,7 @@ static void build_pairing_cmd(struct l2cap_conn *conn, | |||
307 | struct hci_dev *hdev = hcon->hdev; | 307 | struct hci_dev *hdev = hcon->hdev; |
308 | u8 local_dist = 0, remote_dist = 0; | 308 | u8 local_dist = 0, remote_dist = 0; |
309 | 309 | ||
310 | if (test_bit(HCI_PAIRABLE, &conn->hcon->hdev->dev_flags)) { | 310 | if (test_bit(HCI_BONDABLE, &conn->hcon->hdev->dev_flags)) { |
311 | local_dist = SMP_DIST_ENC_KEY | SMP_DIST_SIGN; | 311 | local_dist = SMP_DIST_ENC_KEY | SMP_DIST_SIGN; |
312 | remote_dist = SMP_DIST_ENC_KEY | SMP_DIST_SIGN; | 312 | remote_dist = SMP_DIST_ENC_KEY | SMP_DIST_SIGN; |
313 | authreq |= SMP_AUTH_BONDING; | 313 | authreq |= SMP_AUTH_BONDING; |
@@ -704,7 +704,7 @@ static u8 smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb) | |||
704 | if (!smp) | 704 | if (!smp) |
705 | return SMP_UNSPECIFIED; | 705 | return SMP_UNSPECIFIED; |
706 | 706 | ||
707 | if (!test_bit(HCI_PAIRABLE, &hdev->dev_flags) && | 707 | if (!test_bit(HCI_BONDABLE, &hdev->dev_flags) && |
708 | (req->auth_req & SMP_AUTH_BONDING)) | 708 | (req->auth_req & SMP_AUTH_BONDING)) |
709 | return SMP_PAIRING_NOTSUPP; | 709 | return SMP_PAIRING_NOTSUPP; |
710 | 710 | ||
@@ -930,7 +930,7 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb) | |||
930 | if (!smp) | 930 | if (!smp) |
931 | return SMP_UNSPECIFIED; | 931 | return SMP_UNSPECIFIED; |
932 | 932 | ||
933 | if (!test_bit(HCI_PAIRABLE, &hcon->hdev->dev_flags) && | 933 | if (!test_bit(HCI_BONDABLE, &hcon->hdev->dev_flags) && |
934 | (rp->auth_req & SMP_AUTH_BONDING)) | 934 | (rp->auth_req & SMP_AUTH_BONDING)) |
935 | return SMP_PAIRING_NOTSUPP; | 935 | return SMP_PAIRING_NOTSUPP; |
936 | 936 | ||