Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/4] Bluetooth: Don't send device found events during passive scanning
@ 2014-03-25  8:30 johan.hedberg
  2014-03-25  8:30 ` [PATCH 2/4] Bluetooth: Add scan_rsp parameter to mgmt_device_found() johan.hedberg
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: johan.hedberg @ 2014-03-25  8:30 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

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.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 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 0c393fbae6e9..2388f2c09887 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3964,8 +3964,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;
+	}
 
 	mgmt_device_found(hdev, bdaddr, LE_LINK, bdaddr_type, NULL, rssi, 0, 1,
 			  data, len);
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-03-25  8:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-25  8:30 [PATCH 1/4] Bluetooth: Don't send device found events during passive scanning johan.hedberg
2014-03-25  8:30 ` [PATCH 2/4] Bluetooth: Add scan_rsp parameter to mgmt_device_found() johan.hedberg
2014-03-25  8:43   ` Marcel Holtmann
2014-03-25  8:30 ` [PATCH 3/4] Bluetooth: Merge ADV_IND/ADV_SCAN_IND and SCAN_RSP together johan.hedberg
2014-03-25  8:40   ` Marcel Holtmann
2014-03-25  8:30 ` [PATCH 4/4] Bluetooth: Add directed advertising support through connect() johan.hedberg
2014-03-25  8:46   ` Marcel Holtmann
2014-03-25  8:43 ` [PATCH 1/4] Bluetooth: Don't send device found events during passive scanning Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox