aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/smp.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-01-15 23:10:31 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-13 10:01:28 -0500
commit51a8efd7d02c13cb1c6fdd1cd66788792a3fcc7c (patch)
tree819b6bfcb3b898be27d67a942d75aafbc10f24c5 /net/bluetooth/smp.c
parent1dc06093a9f353ef19b7b5180602884d0ce065c5 (diff)
Bluetooth: Rename conn->pend to conn->flags
These flags can and will be used for more general purpose values than just pending state transitions so the more common name "flags" makes more sense than "pend". Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r--net/bluetooth/smp.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 65a90242d990..e08fe6c9c9c9 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -261,7 +261,7 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send)
261 smp_send_cmd(conn, SMP_CMD_PAIRING_FAIL, sizeof(reason), 261 smp_send_cmd(conn, SMP_CMD_PAIRING_FAIL, sizeof(reason),
262 &reason); 262 &reason);
263 263
264 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->pend); 264 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->flags);
265 mgmt_auth_failed(conn->hcon->hdev, conn->dst, reason); 265 mgmt_auth_failed(conn->hcon->hdev, conn->dst, reason);
266 cancel_delayed_work_sync(&conn->security_timer); 266 cancel_delayed_work_sync(&conn->security_timer);
267 smp_chan_destroy(conn); 267 smp_chan_destroy(conn);
@@ -449,7 +449,7 @@ static void random_work(struct work_struct *work)
449 memset(stk + smp->smp_key_size, 0, 449 memset(stk + smp->smp_key_size, 0,
450 SMP_MAX_ENC_KEY_SIZE - smp->smp_key_size); 450 SMP_MAX_ENC_KEY_SIZE - smp->smp_key_size);
451 451
452 if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->pend)) { 452 if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags)) {
453 reason = SMP_UNSPECIFIED; 453 reason = SMP_UNSPECIFIED;
454 goto error; 454 goto error;
455 } 455 }
@@ -506,7 +506,7 @@ void smp_chan_destroy(struct l2cap_conn *conn)
506{ 506{
507 struct smp_chan *smp = conn->smp_chan; 507 struct smp_chan *smp = conn->smp_chan;
508 508
509 clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->pend); 509 clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags);
510 510
511 if (smp->tfm) 511 if (smp->tfm)
512 crypto_free_blkcipher(smp->tfm); 512 crypto_free_blkcipher(smp->tfm);
@@ -571,7 +571,7 @@ static u8 smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb)
571 if (conn->hcon->link_mode & HCI_LM_MASTER) 571 if (conn->hcon->link_mode & HCI_LM_MASTER)
572 return SMP_CMD_NOTSUPP; 572 return SMP_CMD_NOTSUPP;
573 573
574 if (!test_and_set_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->pend)) 574 if (!test_and_set_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags))
575 smp = smp_chan_create(conn); 575 smp = smp_chan_create(conn);
576 576
577 smp = conn->smp_chan; 577 smp = conn->smp_chan;
@@ -707,8 +707,7 @@ static u8 smp_ltk_encrypt(struct l2cap_conn *conn)
707 if (!key) 707 if (!key)
708 return 0; 708 return 0;
709 709
710 if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, 710 if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags))
711 &hcon->pend))
712 return 1; 711 return 1;
713 712
714 master = (void *) key->data; 713 master = (void *) key->data;
@@ -733,7 +732,7 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb)
733 if (smp_ltk_encrypt(conn)) 732 if (smp_ltk_encrypt(conn))
734 return 0; 733 return 0;
735 734
736 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->pend)) 735 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags))
737 return 0; 736 return 0;
738 737
739 smp = smp_chan_create(conn); 738 smp = smp_chan_create(conn);
@@ -772,7 +771,7 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level)
772 if (smp_ltk_encrypt(conn)) 771 if (smp_ltk_encrypt(conn))
773 goto done; 772 goto done;
774 773
775 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->pend)) 774 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags))
776 return 0; 775 return 0;
777 776
778 smp = smp_chan_create(conn); 777 smp = smp_chan_create(conn);
@@ -908,7 +907,7 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force)
908 907
909 BT_DBG("conn %p force %d", conn, force); 908 BT_DBG("conn %p force %d", conn, force);
910 909
911 if (!test_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->pend)) 910 if (!test_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags))
912 return 0; 911 return 0;
913 912
914 rsp = (void *) &smp->prsp[1]; 913 rsp = (void *) &smp->prsp[1];
@@ -982,7 +981,7 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force)
982 } 981 }
983 982
984 if (conn->hcon->out || force) { 983 if (conn->hcon->out || force) {
985 clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->pend); 984 clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags);
986 cancel_delayed_work_sync(&conn->security_timer); 985 cancel_delayed_work_sync(&conn->security_timer);
987 smp_chan_destroy(conn); 986 smp_chan_destroy(conn);
988 } 987 }