Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -void hci_update_background_scan(struct hci_dev *hdev)
- +void hci_update_background_scan(struct hci_dev *hdev, struct hci_request *req)
- {
- - struct hci_request req;
- + struct hci_request local_req;
- struct hci_conn *conn;
- int err;
- @@ -5724,7 +5724,10 @@ void hci_update_background_scan(struct hci_dev *hdev)
- */
- hci_discovery_filter_clear(hdev);
- - hci_req_init(&req, hdev);
- + if (!req) {
- + req = &local_req;
- + hci_req_init(req, hdev);
- + }
- if (list_empty(&hdev->pend_le_conns) &&
- list_empty(&hdev->pend_le_reports)) {
- @@ -5737,7 +5740,7 @@ void hci_update_background_scan(struct hci_dev *hdev)
- if (!test_bit(HCI_LE_SCAN, &hdev->dev_flags))
- return;
- - hci_req_add_le_scan_disable(&req);
- + hci_req_add_le_scan_disable(req);
- BT_DBG("%s stopping background scanning", hdev->name);
- } else {
- @@ -5757,14 +5760,18 @@ void hci_update_background_scan(struct hci_dev *hdev)
- * don't miss any advertising (due to duplicates filter).
- */
- if (test_bit(HCI_LE_SCAN, &hdev->dev_flags))
- - hci_req_add_le_scan_disable(&req);
- + hci_req_add_le_scan_disable(req);
- - hci_req_add_le_passive_scan(&req);
- + hci_req_add_le_passive_scan(req);
- BT_DBG("%s starting background scanning", hdev->name);
- }
- - err = hci_req_run(&req, update_background_scan_complete);
- + /* Callers providing a req are responsible for calling req_run */
- + if (req != &local_req)
- + return;
- +
- + err = hci_req_run(req, update_background_scan_complete);
- if (err)
- BT_ERR("Failed to run HCI request: err %d", err);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement