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: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
static void hci_discov_off(struct work_struct *work)
{
struct hci_dev *hdev;
+ struct hci_request req;
u8 scan = SCAN_PAGE;
hdev = container_of(work, struct hci_dev, discov_off.work);
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;