提交 8b90129c 编写于 作者: A Andre Guedes 提交者: 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: NAndre Guedes <andre.guedes@openbossa.org>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 1de028ce
......@@ -2602,12 +2602,18 @@ static int start_discovery(struct sock *sk, u16 index,
switch (hdev->discovery.type) {
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;
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);
else
err = -ENOTSUPP;
break;
case DISCOV_TYPE_INTERLEAVED:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册