Commit 8b90129c authored by Andre Guedes's avatar Andre Guedes Committed by Gustavo F. Padovan

Bluetooth: Check capabilities in BR/EDR and LE-Only discovery

This patch add an extra check for BR/EDR and LE-Only discovery.
This way, we are able to return error immediately if the discovery
type requested is not supported by the device.
Signed-off-by: default avatarAndre Guedes <andre.guedes@openbossa.org>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 1de028ce
...@@ -2602,12 +2602,18 @@ static int start_discovery(struct sock *sk, u16 index, ...@@ -2602,12 +2602,18 @@ static int start_discovery(struct sock *sk, u16 index,
switch (hdev->discovery.type) { switch (hdev->discovery.type) {
case DISCOV_TYPE_BREDR: case DISCOV_TYPE_BREDR:
err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR); if (lmp_bredr_capable(hdev))
err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR);
else
err = -ENOTSUPP;
break; break;
case DISCOV_TYPE_LE: case DISCOV_TYPE_LE:
err = hci_le_scan(hdev, LE_SCAN_TYPE, LE_SCAN_INT, 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); LE_SCAN_WIN, LE_SCAN_TIMEOUT_LE_ONLY);
else
err = -ENOTSUPP;
break; break;
case DISCOV_TYPE_INTERLEAVED: case DISCOV_TYPE_INTERLEAVED:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment