Bluetooth: Fix discovery filter when no RSSI is available
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 5 Dec 2014 12:03:34 +0000 (13:03 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 5 Dec 2014 12:14:26 +0000 (14:14 +0200)
When no RSSI value is available then make sure that the result is
filtered out when the RSSI threshold filter is active.

This means that all Bluetooth 1.1 or earlier devices will not
report any results when using a RSSI threshold filter.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_event.c
net/bluetooth/mgmt.c

index f4e2a61..527dfdc 100644 (file)
@@ -2043,13 +2043,14 @@ static void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb)
                data.pscan_mode         = info->pscan_mode;
                memcpy(data.dev_class, info->dev_class, 3);
                data.clock_offset       = info->clock_offset;
-               data.rssi               = 0x00;
+               data.rssi               = HCI_RSSI_INVALID;
                data.ssp_mode           = 0x00;
 
                flags = hci_inquiry_cache_update(hdev, &data, false);
 
                mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00,
-                                 info->dev_class, 0, flags, NULL, 0, NULL, 0);
+                                 info->dev_class, HCI_RSSI_INVALID,
+                                 flags, NULL, 0, NULL, 0);
        }
 
        hci_dev_unlock(hdev);
Simple merge