mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
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>
This commit is contained in:
parent
f4869e2adb
commit
c46245b3ef
@ -1179,6 +1179,18 @@ static inline bool hci_bdaddr_is_rpa(bdaddr_t *bdaddr, u8 addr_type)
|
|||||||
return false;
|
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,
|
static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev,
|
||||||
bdaddr_t *bdaddr, u8 addr_type)
|
bdaddr_t *bdaddr, u8 addr_type)
|
||||||
{
|
{
|
||||||
|
@ -3412,18 +3412,6 @@ static bool is_connected(struct hci_dev *hdev, bdaddr_t *addr, u8 type)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This function requires the caller holds hdev->lock */
|
/* This function requires the caller holds hdev->lock */
|
||||||
struct bdaddr_list *hci_pend_le_conn_lookup(struct hci_dev *hdev,
|
struct bdaddr_list *hci_pend_le_conn_lookup(struct hci_dev *hdev,
|
||||||
bdaddr_t *addr, u8 addr_type)
|
bdaddr_t *addr, u8 addr_type)
|
||||||
@ -3504,7 +3492,7 @@ struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
|
|||||||
{
|
{
|
||||||
struct hci_conn_params *params;
|
struct hci_conn_params *params;
|
||||||
|
|
||||||
if (!is_identity_address(addr, addr_type))
|
if (!hci_is_identity_address(addr, addr_type))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
params = hci_conn_params_lookup(hdev, addr, addr_type);
|
params = hci_conn_params_lookup(hdev, addr, addr_type);
|
||||||
|
Loading…
Reference in New Issue
Block a user