diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-12-05 05:45:21 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-12-05 06:12:58 -0500 |
commit | 0256325ed666af8346c89deb9d437c2209f463cb (patch) | |
tree | 57c63cb418cf1470b07420326d3d5583e99cd34a /include/net | |
parent | 66ea9427e08cb0a856006012b15e6b93ce379115 (diff) |
Bluetooth: Add helper function for clearing the discovery filter
The discovery filter allocates memory for its UUID list. So use
a helper function to free it and reset it to default states.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 83ca58b9f4c1..f07b1450b3c2 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -509,6 +509,14 @@ static inline void discovery_init(struct hci_dev *hdev) | |||
509 | hdev->discovery.rssi = HCI_RSSI_INVALID; | 509 | hdev->discovery.rssi = HCI_RSSI_INVALID; |
510 | } | 510 | } |
511 | 511 | ||
512 | static inline void hci_discovery_filter_clear(struct hci_dev *hdev) | ||
513 | { | ||
514 | hdev->discovery.rssi = HCI_RSSI_INVALID; | ||
515 | hdev->discovery.uuid_count = 0; | ||
516 | kfree(hdev->discovery.uuids); | ||
517 | hdev->discovery.uuids = NULL; | ||
518 | } | ||
519 | |||
512 | bool hci_discovery_active(struct hci_dev *hdev); | 520 | bool hci_discovery_active(struct hci_dev *hdev); |
513 | 521 | ||
514 | void hci_discovery_set_state(struct hci_dev *hdev, int state); | 522 | void hci_discovery_set_state(struct hci_dev *hdev, int state); |