2012-05-31 23:01:41

by Andre Guedes

[permalink] [raw]
Subject: [PATCH] Bluetooth: Filter duplicated reports in LE scan

This patch enables filtering duplicated advertising reports during
LE scan.

Some LE devices advertise using very small intervals generating lots
of equal advertising report events to the host. Each event generates
a mgmt_device_found event which is copied to userspace.

Enabling this feature, duplicated advertising reports are filtered
at controller's link layer. This way, the controller doesn't wake up
the host to report duplicated advertising reports and, consequently,
less data is copied to userspace.

Signed-off-by: Andre Guedes <[email protected]>
---
net/bluetooth/hci_core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 979556a..cf39e95 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1526,6 +1526,7 @@ static void le_scan_enable_req(struct hci_dev *hdev, unsigned long opt)

memset(&cp, 0, sizeof(cp));
cp.enable = 1;
+ cp.filter_dup = 1;

hci_send_cmd(hdev, HCI_OP_LE_SET_SCAN_ENABLE, sizeof(cp), &cp);
}
--
1.7.10.2



2012-06-01 22:51:00

by Gustavo Padovan

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Filter duplicated reports in LE scan

Hi Andre,

* Andre Guedes <[email protected]> [2012-05-31 20:01:41 -0300]:

> This patch enables filtering duplicated advertising reports during
> LE scan.
>
> Some LE devices advertise using very small intervals generating lots
> of equal advertising report events to the host. Each event generates
> a mgmt_device_found event which is copied to userspace.
>
> Enabling this feature, duplicated advertising reports are filtered
> at controller's link layer. This way, the controller doesn't wake up
> the host to report duplicated advertising reports and, consequently,
> less data is copied to userspace.
>
> Signed-off-by: Andre Guedes <[email protected]>
> ---
> net/bluetooth/hci_core.c | 1 +
> 1 file changed, 1 insertion(+)

Patch has been applied to bluetooth-next. Thanks.

Gustavo