aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-02-18 10:14:36 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-02-18 11:58:21 -0500
commit2426f3a5945ce1dfdb04aaf26748a987be49ff7c (patch)
tree0b8b88270bc085ac7a35c5c7480df145a1c44929 /include/net/bluetooth
parenta7ec73386ce2a8ab351ee8ab6a1e5475f72617dc (diff)
Bluetooth: Add convenience function for fetching IRKs
There are many situations where we need to check if an LE address is an RPA and if so try to look up the IRK for it. To simplify such cases this patch adds a convenience function for the job. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/hci_core.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index ac468de11cb7..4461c0051228 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1083,6 +1083,15 @@ static inline bool hci_bdaddr_is_rpa(bdaddr_t *bdaddr, u8 addr_type)
1083 return false; 1083 return false;
1084} 1084}
1085 1085
1086static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev,
1087 bdaddr_t *bdaddr, u8 addr_type)
1088{
1089 if (!hci_bdaddr_is_rpa(bdaddr, addr_type))
1090 return NULL;
1091
1092 return hci_find_irk_by_rpa(hdev, bdaddr);
1093}
1094
1086int hci_register_cb(struct hci_cb *hcb); 1095int hci_register_cb(struct hci_cb *hcb);
1087int hci_unregister_cb(struct hci_cb *hcb); 1096int hci_unregister_cb(struct hci_cb *hcb);
1088 1097