aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_request.h
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-11-16 05:52:21 -0500
committerMarcel Holtmann <marcel@holtmann.org>2015-12-09 18:51:47 -0500
commit01b1cb87d37fb19cdaa5e7002416fdde156873d0 (patch)
tree87fdc0ba8b3872cea7267fb3a3b3b7ed101ffbba /net/bluetooth/hci_request.h
parentad2c8c73d29702c3193f739390f6661f9a4ecad9 (diff)
Bluetooth: Run page scan updates through hdev->req_workqueue
Since Add/Remove Device perform the page scan updates independently from the HCI command completion we've introduced a potential race when multiple mgmt commands are queued. Doing the page scan updates through the req_workqueue ensures that the state changes are performed in a race-free manner. At the same time, to make the request helper more widely usable, extend it to also cover Inquiry Scan changes since those are behind the same HCI command. This is also reflected in the new name of the API as well as the work struct name. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_request.h')
-rw-r--r--net/bluetooth/hci_request.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/bluetooth/hci_request.h b/net/bluetooth/hci_request.h
index 6b9e59f7f7a9..cc8275520fb2 100644
--- a/net/bluetooth/hci_request.h
+++ b/net/bluetooth/hci_request.h
@@ -61,8 +61,12 @@ void hci_req_add_le_passive_scan(struct hci_request *req);
61/* Returns true if HCI commands were queued */ 61/* Returns true if HCI commands were queued */
62bool hci_req_stop_discovery(struct hci_request *req); 62bool hci_req_stop_discovery(struct hci_request *req);
63 63
64void hci_update_page_scan(struct hci_dev *hdev); 64static inline void hci_req_update_scan(struct hci_dev *hdev)
65void __hci_update_page_scan(struct hci_request *req); 65{
66 queue_work(hdev->req_workqueue, &hdev->scan_update);
67}
68
69void __hci_req_update_scan(struct hci_request *req);
66 70
67int hci_update_random_address(struct hci_request *req, bool require_privacy, 71int hci_update_random_address(struct hci_request *req, bool require_privacy,
68 u8 *own_addr_type); 72 u8 *own_addr_type);