Bluetooth: Report LE devices
authorAndre Guedes <andre.guedes@openbossa.org>
Tue, 10 Jan 2012 21:20:50 +0000 (18:20 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 13 Feb 2012 15:01:27 +0000 (17:01 +0200)
Devices found during LE scan should be reported to userspace through
mgmt_device_found events.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_event.c

index 3323dc6c9868a0a0029222ea1dc284c86afc1be6..42d63522270fc6ce14d624c2e022de22fea00821 100644 (file)
@@ -3208,6 +3208,7 @@ static inline void hci_le_adv_report_evt(struct hci_dev *hdev,
 {
        u8 num_reports = skb->data[0];
        void *ptr = &skb->data[1];
+       s8 rssi;
 
        hci_dev_lock(hdev);
 
@@ -3216,6 +3217,10 @@ static inline void hci_le_adv_report_evt(struct hci_dev *hdev,
 
                hci_add_adv_entry(hdev, ev);
 
+               rssi = ev->data[ev->length];
+               mgmt_device_found(hdev, &ev->bdaddr, LE_LINK, ev->bdaddr_type,
+                                       NULL, rssi, 0, ev->data, ev->length);
+
                ptr += sizeof(*ev) + ev->length + 1;
        }