Bluetooth: Use HCI request in interleaved discovery

In order to have a better HCI error handling in interleaved discovery
functionality, we should use the HCI request framework.

This patch updates le_scan_disable_work function so it uses the
HCI request framework instead of the hci_send_cmd helper. A complete
callback is registered (le_scan_disable_work_complete function) so we
are able to trigger the inquiry procedure (if we are running the
interleaved discovery) or to stop the discovery procedure (if we are
running LE-only discovery).

This patch also removes the extra logic in hci_cc_le_set_scan_enable
to trigger the inquiry procedure and the mgmt_interleaved_discovery
function since they become useless.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
This commit is contained in:
Andre Guedes
2013-04-30 15:29:32 -03:00
committed by Gustavo Padovan
parent 0d8cc935e0
commit 4c87eaab01
4 changed files with 65 additions and 30 deletions

View File

@@ -2621,23 +2621,6 @@ static int remove_remote_oob_data(struct sock *sk, struct hci_dev *hdev,
return err;
}
int mgmt_interleaved_discovery(struct hci_dev *hdev)
{
int err;
BT_DBG("%s", hdev->name);
hci_dev_lock(hdev);
err = hci_do_inquiry(hdev, DISCOV_INTERLEAVED_INQUIRY_LEN);
if (err < 0)
hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
hci_dev_unlock(hdev);
return err;
}
static int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status)
{
struct pending_cmd *cmd;