Commit b1e73124 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: Use hci_request for discoverable timeout handling

When the discoverable timeout triggers and it is time to turn inquiry
scan back off, use the HCI request framework to do it.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 8d6083fe
...@@ -1789,6 +1789,7 @@ static void hci_power_off(struct work_struct *work) ...@@ -1789,6 +1789,7 @@ static void hci_power_off(struct work_struct *work)
static void hci_discov_off(struct work_struct *work) static void hci_discov_off(struct work_struct *work)
{ {
struct hci_dev *hdev; struct hci_dev *hdev;
struct hci_request req;
u8 scan = SCAN_PAGE; u8 scan = SCAN_PAGE;
hdev = container_of(work, struct hci_dev, discov_off.work); hdev = container_of(work, struct hci_dev, discov_off.work);
...@@ -1797,7 +1798,9 @@ static void hci_discov_off(struct work_struct *work) ...@@ -1797,7 +1798,9 @@ static void hci_discov_off(struct work_struct *work)
hci_dev_lock(hdev); hci_dev_lock(hdev);
hci_send_cmd(hdev, HCI_OP_WRITE_SCAN_ENABLE, sizeof(scan), &scan); hci_req_init(&req, hdev);
hci_req_add(&req, HCI_OP_WRITE_SCAN_ENABLE, sizeof(scan), &scan);
hci_req_run(&req, NULL);
hdev->discov_timeout = 0; hdev->discov_timeout = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment