Re: [PATCH v2 2/4] Bluetooth: Don't send device found events during passive scanning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johan,

On 03/24/2014 05:48 AM, johan.hedberg@xxxxxxxxx wrote:
From: Johan Hedberg <johan.hedberg@xxxxxxxxx>

Passive LE scanning is only used by the kernel-internal connection
establishment procedure. It makes therefore little sense to send device
found events to user space.

Not sure this patch is necessary. This feature is already garanteed by this patch 12602d0cc005354a519b3eba443d7912ab71313a .

Signed-off-by: Johan Hedberg <johan.hedberg@xxxxxxxxx>
---
  net/bluetooth/hci_event.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 43872af20aa4..403c1d96331a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3944,8 +3944,12 @@ static void check_pending_le_conn(struct hci_dev *hdev, bdaddr_t *addr,
  static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
  			       u8 bdaddr_type, s8 rssi, u8 *data, u8 len)
  {
-	if (type == LE_ADV_IND || type == LE_ADV_DIRECT_IND)
-		check_pending_le_conn(hdev, bdaddr, bdaddr_type);
+	/* Passive scanning shouldn't trigger any device found events */
+	if (hdev->le_scan_type == LE_SCAN_PASSIVE) {
+		if (type == LE_ADV_IND || type == LE_ADV_DIRECT_IND)
+			check_pending_le_conn(hdev, bdaddr, bdaddr_type);
+	    return;
+	}

Additionally, as a side effect of this change, automatic connection won't be establish while discovery is running anymore. So it can add even more delay to our reconnection procedure (10.24 seconds max). Did you considered this?

BR,

Andre
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux