Bluetooth: Remove start discovery handling from hci_event.c

Since all mgmt start discovery command status and command complete
events are now handled in start_discovery_complete callback in mgmt.c,
we can remove this handling from hci_event.c.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Move discovery macros to hci_core.h

Some of the discovery macros will be used in hci_core so we need to
define them in commom place such as hci_core.h.

This patch moves discovery macros to hci_core.h and also adds the
DISCOV_ prefix to them.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Update le_scan_disable_work to use HCI request

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Update stop_discovery to use HCI request

This patch modifies the stop_discovery function so it uses the new
HCI request framework.

We build the HCI request according to the current discovery state
and run the HCI request. We also register the stop_discovery_complete
request callback which handles all mgmt command status and command
complete events for mgmt stop discovery command.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Remove stop discovery handling from hci_event.c

Since all mgmt stop discovery command status and command complete
events are now handled in stop_discovery_complete callback in mgmt.c,
we can remove this handling from hci_event.c.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Refactor hci_cc_le_set_scan_enable

This patch does a trivial refactoring in hci_cc_le_set_scan_enable.
Since start and stop discovery command failure are now handled in
mgmt layer, the status check became empty. So, we can move it to
outside the switch statement.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Don't send Device Found event

This patch changes mgmt_device_found so no event is sent if we are
not running the device discovery procedure.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Remove LE scan helpers

This patch removes the LE scan helpers hci_le_scan and hci_cancel_
le_scan and all code related to it. We now use the HCI request
framework in device discovery functionality and this helper are
no longer needed.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Remove inquiry helpers

This patch removes hci_do_inquiry and hci_cancel_inquiry helpers. We
now use the HCI request framework in device discovery functionality
and these helpers are no longer needed.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Remove empty event handler

This patch removes the hci_cc_le_set_scan_param event handler. This
handler became empty since we use the HCI request framework to enable
LE scanning.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Rename le_scan_disable delayed work

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>