Bluetooth: fix service discovery behaviour for empty uuids filter
commit82f8b651a94d5c7090563fe55cfdb286c461a16c
authorJakub Pawlowski <jpawlowski@google.com>
Thu, 5 Mar 2015 00:24:26 +0000 (4 16:24 -0800)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 5 Mar 2015 07:50:50 +0000 (5 09:50 +0200)
tree8f18cc6e68060a709189c5af747c55e740a7469b
parent2976cdeb27c83c83bf010a314309f07659ead228
Bluetooth: fix service discovery behaviour for empty uuids filter

This patch fixes service discovery behaviour, when provided uuid filter
is empty and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Before this
patch, empty uuid filter was unable to trigger scan restart, and that
caused inconsistent behaviour in applications.

Example: two DBus clients call BlueZ, one to find all devices with
service abcd, second to find all devices with rssi smaller than -90.
Sum of those filters, that is passed to mgmt_service_scan is empty
filter, with no rssi or uuids set.
That caused kernel not to restart scan when quirk was set.
That was inconsistent with what happen when there's only one of those
two filters set (scan is restarted and reports devices).

To fix that, new variable hdev->discovery.result_filtering was
introduced. It can indicate that filtered scan is running, no matter
what uuid or rssi filter is set.

Signed-off-by: Jakub Pawlowski <jpawlowski@google.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
include/net/bluetooth/hci_core.h
net/bluetooth/mgmt.c