diff options
-rw-r--r-- | net/bluetooth/hci_event.c | 5 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index f4e2a61bb6aa..527dfdc9d8c8 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -2043,13 +2043,14 @@ static void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
2043 | data.pscan_mode = info->pscan_mode; | 2043 | data.pscan_mode = info->pscan_mode; |
2044 | memcpy(data.dev_class, info->dev_class, 3); | 2044 | memcpy(data.dev_class, info->dev_class, 3); |
2045 | data.clock_offset = info->clock_offset; | 2045 | data.clock_offset = info->clock_offset; |
2046 | data.rssi = 0x00; | 2046 | data.rssi = HCI_RSSI_INVALID; |
2047 | data.ssp_mode = 0x00; | 2047 | data.ssp_mode = 0x00; |
2048 | 2048 | ||
2049 | flags = hci_inquiry_cache_update(hdev, &data, false); | 2049 | flags = hci_inquiry_cache_update(hdev, &data, false); |
2050 | 2050 | ||
2051 | mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, | 2051 | mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, |
2052 | info->dev_class, 0, flags, NULL, 0, NULL, 0); | 2052 | info->dev_class, HCI_RSSI_INVALID, |
2053 | flags, NULL, 0, NULL, 0); | ||
2053 | } | 2054 | } |
2054 | 2055 | ||
2055 | hci_dev_unlock(hdev); | 2056 | hci_dev_unlock(hdev); |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 326609fa3bda..3ca2818d1c8b 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -7006,9 +7006,12 @@ void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
7006 | * if such a RSSI threshold is specified. If a RSSI threshold has | 7006 | * if such a RSSI threshold is specified. If a RSSI threshold has |
7007 | * been specified, then all results with a RSSI smaller than the | 7007 | * been specified, then all results with a RSSI smaller than the |
7008 | * RSSI threshold will be dropped. | 7008 | * RSSI threshold will be dropped. |
7009 | * | ||
7010 | * For BR/EDR devices (pre 1.2) providing no RSSI during inquiry, | ||
7011 | * the results are also dropped. | ||
7009 | */ | 7012 | */ |
7010 | if (hdev->discovery.rssi != HCI_RSSI_INVALID && | 7013 | if (hdev->discovery.rssi != HCI_RSSI_INVALID && |
7011 | rssi < hdev->discovery.rssi) | 7014 | (rssi < hdev->discovery.rssi || rssi == HCI_RSSI_INVALID)) |
7012 | return; | 7015 | return; |
7013 | 7016 | ||
7014 | /* Make sure that the buffer is big enough. The 5 extra bytes | 7017 | /* Make sure that the buffer is big enough. The 5 extra bytes |
@@ -7019,6 +7022,10 @@ void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
7019 | 7022 | ||
7020 | memset(buf, 0, sizeof(buf)); | 7023 | memset(buf, 0, sizeof(buf)); |
7021 | 7024 | ||
7025 | /* Reset invalid RSSI to 0 to keep backwards API compliance */ | ||
7026 | if (rssi == HCI_RSSI_INVALID) | ||
7027 | rssi = 0; | ||
7028 | |||
7022 | bacpy(&ev->addr.bdaddr, bdaddr); | 7029 | bacpy(&ev->addr.bdaddr, bdaddr); |
7023 | ev->addr.type = link_to_bdaddr(link_type, addr_type); | 7030 | ev->addr.type = link_to_bdaddr(link_type, addr_type); |
7024 | ev->rssi = rssi; | 7031 | ev->rssi = rssi; |