aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-02 23:09:24 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 17:42:59 +0200
commit079446c8a254d65da0378a45c2106dbf1ff6a769 (patch)
tree792dc9bf8672d48baa127fe6cae36bac537ecbf0 /net/bluetooth
parentBluetooth: Add support for background LE scanning (diff)
downloadlinux-dev-079446c8a254d65da0378a45c2106dbf1ff6a769.tar.xz
linux-dev-079446c8a254d65da0378a45c2106dbf1ff6a769.zip
Bluetooth: Support scanning for devices using RPA
When we're scanning for specific devices that use an RPA we need to convert the RPA to the identity address before looking up the entry in the connection parameters. This patch adds the necessary code to do this in the process_adv_report() function. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_event.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 87a704bd7eb7..dd70e3a4fea5 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4231,6 +4231,7 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
*/
if (hdev->le_scan_type == LE_SCAN_PASSIVE) {
struct hci_conn_params *param;
+ struct smp_irk *irk;
if (type == LE_ADV_IND || type == LE_ADV_DIRECT_IND)
check_pending_le_conn(hdev, bdaddr, bdaddr_type);
@@ -4241,6 +4242,17 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
if (type == LE_ADV_DIRECT_IND)
return;
+ /* Check if we need to convert to identity address */
+ irk = hci_get_irk(hdev, bdaddr, bdaddr_type);
+ if (irk) {
+ bdaddr = &irk->bdaddr;
+ bdaddr_type = irk->addr_type;
+ }
+
+ /* The conn params list only contains identity addresses */
+ if (!hci_is_identity_address(bdaddr, bdaddr_type))
+ return;
+
param = hci_conn_params_lookup(hdev, bdaddr, bdaddr_type);
if (!param || param->auto_connect != HCI_AUTO_CONN_REPORT)
return;