aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-06-24 06:15:53 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:46 -0400
commitaf6a9c321384400efab1726636e8189737bbbd09 (patch)
tree19d78ce4b6c45487461c107d69a01377ce3458d0
parent6d5650c4e519794fcc441635ea54f47d68140c93 (diff)
Bluetooth: Convert hcon->flush_key to a proper flag
There's no point in having boolean variables in the hci_conn struct since it already has a flags member. This patch converts the flush_key member into a proper flag. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--include/net/bluetooth/hci_core.h2
-rw-r--r--net/bluetooth/hci_event.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 888911d205dc..4f70605e0399 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -394,7 +394,6 @@ struct hci_conn {
394 __u8 remote_cap; 394 __u8 remote_cap;
395 __u8 remote_auth; 395 __u8 remote_auth;
396 __u8 remote_id; 396 __u8 remote_id;
397 bool flush_key;
398 397
399 unsigned int sent; 398 unsigned int sent;
400 399
@@ -524,6 +523,7 @@ enum {
524 HCI_CONN_AES_CCM, 523 HCI_CONN_AES_CCM,
525 HCI_CONN_POWER_SAVE, 524 HCI_CONN_POWER_SAVE,
526 HCI_CONN_REMOTE_OOB, 525 HCI_CONN_REMOTE_OOB,
526 HCI_CONN_FLUSH_KEY,
527}; 527};
528 528
529static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) 529static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index c92c5a020fe7..90cba6a8293b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2159,7 +2159,8 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
2159 mgmt_device_disconnected(hdev, &conn->dst, conn->type, conn->dst_type, 2159 mgmt_device_disconnected(hdev, &conn->dst, conn->type, conn->dst_type,
2160 reason, mgmt_connected); 2160 reason, mgmt_connected);
2161 2161
2162 if (conn->type == ACL_LINK && conn->flush_key) 2162 if (conn->type == ACL_LINK &&
2163 test_bit(HCI_CONN_FLUSH_KEY, &conn->flags))
2163 hci_remove_link_key(hdev, &conn->dst); 2164 hci_remove_link_key(hdev, &conn->dst);
2164 2165
2165 params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); 2166 params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
@@ -3145,7 +3146,10 @@ static void hci_link_key_notify_evt(struct hci_dev *hdev, struct sk_buff *skb)
3145 list_del(&key->list); 3146 list_del(&key->list);
3146 kfree(key); 3147 kfree(key);
3147 } else if (conn) { 3148 } else if (conn) {
3148 conn->flush_key = !persistent; 3149 if (persistent)
3150 clear_bit(HCI_CONN_FLUSH_KEY, &conn->flags);
3151 else
3152 set_bit(HCI_CONN_FLUSH_KEY, &conn->flags);
3149 } 3153 }
3150 3154
3151unlock: 3155unlock: