Bluetooth: Ignore inquiry results from periodic inquiry
authorAndre Guedes <aguedespe@gmail.com>
Wed, 21 Mar 2012 03:03:38 +0000 (00:03 -0300)
committerGustavo Padovan <gustavo@padovan.org>
Wed, 9 May 2012 03:41:34 +0000 (00:41 -0300)
This patch changes inquiry result function handlers so they ignore
inquiry result events if periodic inquiry is enabled.

Signed-off-by: Andre Guedes <aguedespe@gmail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
net/bluetooth/hci_event.c

index a61838b74257847a713a6d8dc11ef2006b7defe0..1778b18ffd97c7200c59c4434370ed9153cbd944 100644 (file)
@@ -1722,6 +1722,9 @@ static inline void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *
        if (!num_rsp)
                return;
 
+       if (test_bit(HCI_PERIODIC_INQ, &hdev->dev_flags))
+               return;
+
        hci_dev_lock(hdev);
 
        for (; num_rsp; num_rsp--, info++) {
@@ -2826,6 +2829,9 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct
        if (!num_rsp)
                return;
 
+       if (test_bit(HCI_PERIODIC_INQ, &hdev->dev_flags))
+               return;
+
        hci_dev_lock(hdev);
 
        if ((skb->len - 1) / num_rsp != sizeof(struct inquiry_info_with_rssi)) {
@@ -2997,6 +3003,9 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct
        if (!num_rsp)
                return;
 
+       if (test_bit(HCI_PERIODIC_INQ, &hdev->dev_flags))
+               return;
+
        hci_dev_lock(hdev);
 
        for (; num_rsp; num_rsp--, info++) {