Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352241
b: refs/heads/master
c: 0410675
h: refs/heads/master
i:
  352239: 3a68e96
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo Padovan committed Jan 10, 2013
1 parent f294e59 commit 219cb7d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7e80f25ae2296d78163d75d753c796270464000
refs/heads/master: 04106755763f558886a631338d12546345bae6e9
46 changes: 30 additions & 16 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2382,31 +2382,45 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev,

switch (hdev->discovery.type) {
case DISCOV_TYPE_BREDR:
if (lmp_bredr_capable(hdev))
err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR);
else
err = -ENOTSUPP;
if (!lmp_bredr_capable(hdev)) {
err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY,
MGMT_STATUS_NOT_SUPPORTED);
mgmt_pending_remove(cmd);
goto failed;
}

err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR);
break;

case DISCOV_TYPE_LE:
if (lmp_host_le_capable(hdev))
err = hci_le_scan(hdev, LE_SCAN_TYPE, LE_SCAN_INT,
LE_SCAN_WIN, LE_SCAN_TIMEOUT_LE_ONLY);
else
err = -ENOTSUPP;
if (!lmp_host_le_capable(hdev)) {
err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY,
MGMT_STATUS_NOT_SUPPORTED);
mgmt_pending_remove(cmd);
goto failed;
}

err = hci_le_scan(hdev, LE_SCAN_TYPE, LE_SCAN_INT,
LE_SCAN_WIN, LE_SCAN_TIMEOUT_LE_ONLY);
break;

case DISCOV_TYPE_INTERLEAVED:
if (lmp_host_le_capable(hdev) && lmp_bredr_capable(hdev))
err = hci_le_scan(hdev, LE_SCAN_TYPE, LE_SCAN_INT,
LE_SCAN_WIN,
LE_SCAN_TIMEOUT_BREDR_LE);
else
err = -ENOTSUPP;
if (!lmp_host_le_capable(hdev) || !lmp_bredr_capable(hdev)) {
err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY,
MGMT_STATUS_NOT_SUPPORTED);
mgmt_pending_remove(cmd);
goto failed;
}

err = hci_le_scan(hdev, LE_SCAN_TYPE, LE_SCAN_INT, LE_SCAN_WIN,
LE_SCAN_TIMEOUT_BREDR_LE);
break;

default:
err = -EINVAL;
err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY,
MGMT_STATUS_INVALID_PARAMS);
mgmt_pending_remove(cmd);
goto failed;
}

if (err < 0)
Expand Down

0 comments on commit 219cb7d

Please sign in to comment.