aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-05-29 08:02:59 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-12-03 10:51:16 -0500
commitf3a73d97b3b78584e111478d07dfd063453f112e (patch)
treec00dcbd2a83abb6a8c722f2141c8cbddd59dfd59
parent0ac3dbf9995281261abecfd2970406dd4e07955b (diff)
Bluetooth: Rename hci_find_ltk_by_addr to hci_find_ltk
Now that hci_find_ltk_by_addr is the only LTK lookup function there's no need to keep the long name anymore. This patch shortens the function name to simply hci_find_ltk. 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.h4
-rw-r--r--net/bluetooth/hci_core.c6
-rw-r--r--net/bluetooth/hci_event.c3
-rw-r--r--net/bluetooth/smp.c6
4 files changed, 8 insertions, 11 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index b41969b561d8..90929641d0f0 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -924,8 +924,8 @@ struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
924struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, 924struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
925 u8 addr_type, u8 type, u8 authenticated, 925 u8 addr_type, u8 type, u8 authenticated,
926 u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand); 926 u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand);
927struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, 927struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
928 u8 addr_type, u8 role); 928 u8 addr_type, u8 role);
929int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type); 929int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type);
930void hci_smp_ltks_clear(struct hci_dev *hdev); 930void hci_smp_ltks_clear(struct hci_dev *hdev);
931int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 931int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index cb9bc8e2c58d..6c3220e9484f 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3185,8 +3185,8 @@ static u8 ltk_role(u8 type)
3185 return HCI_ROLE_SLAVE; 3185 return HCI_ROLE_SLAVE;
3186} 3186}
3187 3187
3188struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, 3188struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
3189 u8 addr_type, u8 role) 3189 u8 addr_type, u8 role)
3190{ 3190{
3191 struct smp_ltk *k; 3191 struct smp_ltk *k;
3192 3192
@@ -3313,7 +3313,7 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
3313 struct smp_ltk *key, *old_key; 3313 struct smp_ltk *key, *old_key;
3314 u8 role = ltk_role(type); 3314 u8 role = ltk_role(type);
3315 3315
3316 old_key = hci_find_ltk_by_addr(hdev, bdaddr, addr_type, role); 3316 old_key = hci_find_ltk(hdev, bdaddr, addr_type, role);
3317 if (old_key) 3317 if (old_key)
3318 key = old_key; 3318 key = old_key;
3319 else { 3319 else {
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 0058b545c5ed..34ecbf0b7e5b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4590,8 +4590,7 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
4590 if (conn == NULL) 4590 if (conn == NULL)
4591 goto not_found; 4591 goto not_found;
4592 4592
4593 ltk = hci_find_ltk_by_addr(hdev, &conn->dst, conn->dst_type, 4593 ltk = hci_find_ltk(hdev, &conn->dst, conn->dst_type, conn->role);
4594 conn->role);
4595 if (!ltk) 4594 if (!ltk)
4596 goto not_found; 4595 goto not_found;
4597 4596
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 4ecbf2774fbd..0973e37073e2 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1118,8 +1118,7 @@ static bool smp_ltk_encrypt(struct l2cap_conn *conn, u8 sec_level)
1118 struct smp_ltk *key; 1118 struct smp_ltk *key;
1119 struct hci_conn *hcon = conn->hcon; 1119 struct hci_conn *hcon = conn->hcon;
1120 1120
1121 key = hci_find_ltk_by_addr(hcon->hdev, &hcon->dst, hcon->dst_type, 1121 key = hci_find_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, hcon->role);
1122 hcon->role);
1123 if (!key) 1122 if (!key)
1124 return false; 1123 return false;
1125 1124
@@ -1152,8 +1151,7 @@ bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level,
1152 */ 1151 */
1153 if (key_pref == SMP_USE_LTK && 1152 if (key_pref == SMP_USE_LTK &&
1154 test_bit(HCI_CONN_STK_ENCRYPT, &hcon->flags) && 1153 test_bit(HCI_CONN_STK_ENCRYPT, &hcon->flags) &&
1155 hci_find_ltk_by_addr(hcon->hdev, &hcon->dst, hcon->dst_type, 1154 hci_find_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, hcon->role))
1156 hcon->role))
1157 return false; 1155 return false;
1158 1156
1159 if (hcon->sec_level >= sec_level) 1157 if (hcon->sec_level >= sec_level)