aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-02 10:37:33 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:57 -0400
commitc46245b3efce80884acf65c01443582aec1f31ed (patch)
treeb48318f715ab35c33e3729d92c7420fdc3c173cb
parentf4869e2adb7ab9d09a9335b4e26a63ec413f2c6f (diff)
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>
-rw-r--r--include/net/bluetooth/hci_core.h12
-rw-r--r--net/bluetooth/hci_core.c14
2 files changed, 13 insertions, 13 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)
1179 return false; 1179 return false;
1180} 1180}
1181 1181
1182static inline bool hci_is_identity_address(bdaddr_t *addr, u8 addr_type)
1183{
1184 if (addr_type == ADDR_LE_DEV_PUBLIC)
1185 return true;
1186
1187 /* Check for Random Static address type */
1188 if ((addr->b[5] & 0xc0) == 0xc0)
1189 return true;
1190
1191 return false;
1192}
1193
1182static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev, 1194static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev,
1183 bdaddr_t *bdaddr, u8 addr_type) 1195 bdaddr_t *bdaddr, u8 addr_type)
1184{ 1196{
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index a3cd0bbd3518..1fff3d890f41 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3412,18 +3412,6 @@ static bool is_connected(struct hci_dev *hdev, bdaddr_t *addr, u8 type)
3412 return true; 3412 return true;
3413} 3413}
3414 3414
3415static bool is_identity_address(bdaddr_t *addr, u8 addr_type)
3416{
3417 if (addr_type == ADDR_LE_DEV_PUBLIC)
3418 return true;
3419
3420 /* Check for Random Static address type */
3421 if ((addr->b[5] & 0xc0) == 0xc0)
3422 return true;
3423
3424 return false;
3425}
3426
3427/* This function requires the caller holds hdev->lock */ 3415/* This function requires the caller holds hdev->lock */
3428struct bdaddr_list *hci_pend_le_conn_lookup(struct hci_dev *hdev, 3416struct bdaddr_list *hci_pend_le_conn_lookup(struct hci_dev *hdev,
3429 bdaddr_t *addr, u8 addr_type) 3417 bdaddr_t *addr, u8 addr_type)
@@ -3504,7 +3492,7 @@ struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
3504{ 3492{
3505 struct hci_conn_params *params; 3493 struct hci_conn_params *params;
3506 3494
3507 if (!is_identity_address(addr, addr_type)) 3495 if (!hci_is_identity_address(addr, addr_type))
3508 return NULL; 3496 return NULL;
3509 3497
3510 params = hci_conn_params_lookup(hdev, addr, addr_type); 3498 params = hci_conn_params_lookup(hdev, addr, addr_type);