|
@@ -2650,6 +2650,27 @@ int mgmt_interleaved_discovery(struct hci_dev *hdev)
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
+static int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status)
|
|
|
+{
|
|
|
+ struct pending_cmd *cmd;
|
|
|
+ u8 type;
|
|
|
+ int err;
|
|
|
+
|
|
|
+ hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
|
|
|
+
|
|
|
+ cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, hdev);
|
|
|
+ if (!cmd)
|
|
|
+ return -ENOENT;
|
|
|
+
|
|
|
+ type = hdev->discovery.type;
|
|
|
+
|
|
|
+ err = cmd_complete(cmd->sk, hdev->id, cmd->opcode, mgmt_status(status),
|
|
|
+ &type, sizeof(type));
|
|
|
+ mgmt_pending_remove(cmd);
|
|
|
+
|
|
|
+ return err;
|
|
|
+}
|
|
|
+
|
|
|
static void start_discovery_complete(struct hci_dev *hdev, u8 status)
|
|
|
{
|
|
|
BT_DBG("status %d", status);
|
|
@@ -4190,27 +4211,6 @@ int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
|
|
|
sizeof(*ev) + eir_len, NULL);
|
|
|
}
|
|
|
|
|
|
-int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status)
|
|
|
-{
|
|
|
- struct pending_cmd *cmd;
|
|
|
- u8 type;
|
|
|
- int err;
|
|
|
-
|
|
|
- hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
|
|
|
-
|
|
|
- cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, hdev);
|
|
|
- if (!cmd)
|
|
|
- return -ENOENT;
|
|
|
-
|
|
|
- type = hdev->discovery.type;
|
|
|
-
|
|
|
- err = cmd_complete(cmd->sk, hdev->id, cmd->opcode, mgmt_status(status),
|
|
|
- &type, sizeof(type));
|
|
|
- mgmt_pending_remove(cmd);
|
|
|
-
|
|
|
- return err;
|
|
|
-}
|
|
|
-
|
|
|
int mgmt_stop_discovery_failed(struct hci_dev *hdev, u8 status)
|
|
|
{
|
|
|
struct pending_cmd *cmd;
|