Skip to content

Commit b6ae845

Browse files
jhedbergholtmann
authored andcommitted
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>
1 parent bdb9434 commit b6ae845

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎include/net/bluetooth/hci.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ enum {
167167
HCI_AUTO_OFF,
168168
HCI_RFKILLED,
169169
HCI_MGMT,
170-
HCI_PAIRABLE,
170+
HCI_BONDABLE,
171171
HCI_SERVICE_CACHE,
172172
HCI_KEEP_DEBUG_KEYS,
173173
HCI_USE_DEBUG_KEYS,

‎net/bluetooth/hci_core.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2521,14 +2521,14 @@ int hci_dev_open(__u16 dev)
25212521
flush_workqueue(hdev->req_workqueue);
25222522

25232523
/* 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
25252525
* so that pairing works for them. Once the management interface
25262526
* is in use this bit will be cleared again and userspace has
25272527
* to explicitly enable it.
25282528
*/
25292529
if (!test_bit(HCI_USER_CHANNEL, &hdev->dev_flags) &&
25302530
!test_bit(HCI_MGMT, &hdev->dev_flags))
2531-
set_bit(HCI_PAIRABLE, &hdev->dev_flags);
2531+
set_bit(HCI_BONDABLE, &hdev->dev_flags);
25322532

25332533
err = hci_dev_do_open(hdev);
25342534

‎net/bluetooth/hci_event.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3119,7 +3119,7 @@ static void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
31193119
hci_conn_drop(conn);
31203120
}
31213121

3122-
if (!test_bit(HCI_PAIRABLE, &hdev->dev_flags) &&
3122+
if (!test_bit(HCI_BONDABLE, &hdev->dev_flags) &&
31233123
!test_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags)) {
31243124
hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY,
31253125
sizeof(ev->bdaddr), &ev->bdaddr);
@@ -3652,7 +3652,7 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
36523652
/* Allow pairing if we're pairable, the initiators of the
36533653
* pairing or if the remote is not requesting bonding.
36543654
*/
3655-
if (test_bit(HCI_PAIRABLE, &hdev->dev_flags) ||
3655+
if (test_bit(HCI_BONDABLE, &hdev->dev_flags) ||
36563656
test_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags) ||
36573657
(conn->remote_auth & ~0x01) == HCI_AT_NO_BONDING) {
36583658
struct hci_cp_io_capability_reply cp;

‎net/bluetooth/mgmt.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
603603
if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags))
604604
settings |= MGMT_SETTING_DISCOVERABLE;
605605

606-
if (test_bit(HCI_PAIRABLE, &hdev->dev_flags))
606+
if (test_bit(HCI_BONDABLE, &hdev->dev_flags))
607607
settings |= MGMT_SETTING_PAIRABLE;
608608

609609
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)
11521152
* for mgmt we require user-space to explicitly enable
11531153
* it
11541154
*/
1155-
clear_bit(HCI_PAIRABLE, &hdev->dev_flags);
1155+
clear_bit(HCI_BONDABLE, &hdev->dev_flags);
11561156
}
11571157

11581158
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,
19461946
hci_dev_lock(hdev);
19471947

19481948
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);
19501950
else
1951-
changed = test_and_clear_bit(HCI_PAIRABLE, &hdev->dev_flags);
1951+
changed = test_and_clear_bit(HCI_BONDABLE, &hdev->dev_flags);
19521952

19531953
err = send_settings_rsp(sk, MGMT_OP_SET_PAIRABLE, hdev);
19541954
if (err < 0)

‎net/bluetooth/smp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static void build_pairing_cmd(struct l2cap_conn *conn,
307307
struct hci_dev *hdev = hcon->hdev;
308308
u8 local_dist = 0, remote_dist = 0;
309309

310-
if (test_bit(HCI_PAIRABLE, &conn->hcon->hdev->dev_flags)) {
310+
if (test_bit(HCI_BONDABLE, &conn->hcon->hdev->dev_flags)) {
311311
local_dist = SMP_DIST_ENC_KEY | SMP_DIST_SIGN;
312312
remote_dist = SMP_DIST_ENC_KEY | SMP_DIST_SIGN;
313313
authreq |= SMP_AUTH_BONDING;
@@ -704,7 +704,7 @@ static u8 smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb)
704704
if (!smp)
705705
return SMP_UNSPECIFIED;
706706

707-
if (!test_bit(HCI_PAIRABLE, &hdev->dev_flags) &&
707+
if (!test_bit(HCI_BONDABLE, &hdev->dev_flags) &&
708708
(req->auth_req & SMP_AUTH_BONDING))
709709
return SMP_PAIRING_NOTSUPP;
710710

@@ -930,7 +930,7 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb)
930930
if (!smp)
931931
return SMP_UNSPECIFIED;
932932

933-
if (!test_bit(HCI_PAIRABLE, &hcon->hdev->dev_flags) &&
933+
if (!test_bit(HCI_BONDABLE, &hcon->hdev->dev_flags) &&
934934
(rp->auth_req & SMP_AUTH_BONDING))
935935
return SMP_PAIRING_NOTSUPP;
936936

0 commit comments

Comments
 (0)