aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/hci_core.h
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-02 17:37:33 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 17:42:57 +0200
commitc46245b3efce80884acf65c01443582aec1f31ed (patch)
treeb48318f715ab35c33e3729d92c7420fdc3c173cb /include/net/bluetooth/hci_core.h
parentBluetooth: Pass store hint to mgmt_new_conn_param (diff)
downloadlinux-dev-c46245b3efce80884acf65c01443582aec1f31ed.tar.xz
linux-dev-c46245b3efce80884acf65c01443582aec1f31ed.zip
Bluetooth: Make is_identity_address a global function
There are more places that can take advantage of is_identity_address() besides hci_core.c. This patch moves the function to hci_core.h and gives it the appropriate hci_ prefix. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net/bluetooth/hci_core.h')
-rw-r--r--include/net/bluetooth/hci_core.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index d0bca13843ce..92f1bad6e22d 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1179,6 +1179,18 @@ static inline bool hci_bdaddr_is_rpa(bdaddr_t *bdaddr, u8 addr_type)
return false;
}
+static inline bool hci_is_identity_address(bdaddr_t *addr, u8 addr_type)
+{
+ if (addr_type == ADDR_LE_DEV_PUBLIC)
+ return true;
+
+ /* Check for Random Static address type */
+ if ((addr->b[5] & 0xc0) == 0xc0)
+ return true;
+
+ return false;
+}
+
static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev,
bdaddr_t *bdaddr, u8 addr_type)
{