diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-02-18 09:19:34 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-02-18 09:47:03 +0100 |
commit | 301cb2d85eb89140eaff8c22066a4bfd774960a3 (patch) | |
tree | 501ec2485d4b01e1252019862c7b80dd904fdb60 /include/net/bluetooth | |
parent | Bluetooth: Add basic IRK management support (diff) | |
download | linux-301cb2d85eb89140eaff8c22066a4bfd774960a3.tar.xz linux-301cb2d85eb89140eaff8c22066a4bfd774960a3.zip |
Bluetooth: Add hci_bdaddr_is_rpa convenience function
When implementing support for Resolvable Private Addresses (RPAs) we'll
need to in several places be able to identify such addresses. This patch
adds a simple convenience function to do the identification of the
address type.
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.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index eac422337582..86ea4bab9e77 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -1071,6 +1071,17 @@ static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type) return false; } +static inline bool hci_bdaddr_is_rpa(bdaddr_t *bdaddr, u8 addr_type) +{ + if (addr_type != 0x01) + return false; + + if ((bdaddr->b[5] & 0xc0) == 0x40) + return true; + + return false; +} + int hci_register_cb(struct hci_cb *hcb); int hci_unregister_cb(struct hci_cb *hcb); |