提交 426c189a 编写于 作者: A Andre Guedes 提交者: Johan Hedberg

Bluetooth: Change interleaved discovery behavior

According to last discussion on IRC, if an interleaved discovery is
issued, but the device is not dual mode, we should return error
instead of performing a regular BR/EDR or LE-only discovery.
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>
上级 978c93b9
...@@ -2540,29 +2540,6 @@ static int remove_remote_oob_data(struct sock *sk, u16 index, ...@@ -2540,29 +2540,6 @@ static int remove_remote_oob_data(struct sock *sk, u16 index,
return err; return err;
} }
static int discovery(struct hci_dev *hdev)
{
int err;
if (lmp_host_le_capable(hdev)) {
if (lmp_bredr_capable(hdev)) {
err = hci_le_scan(hdev, LE_SCAN_TYPE,
LE_SCAN_INT, LE_SCAN_WIN,
LE_SCAN_TIMEOUT_BREDR_LE);
} else {
hdev->discovery.type = DISCOV_TYPE_LE;
err = hci_le_scan(hdev, LE_SCAN_TYPE,
LE_SCAN_INT, LE_SCAN_WIN,
LE_SCAN_TIMEOUT_LE_ONLY);
}
} else {
hdev->discovery.type = DISCOV_TYPE_BREDR;
err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR);
}
return err;
}
int mgmt_interleaved_discovery(struct hci_dev *hdev) int mgmt_interleaved_discovery(struct hci_dev *hdev)
{ {
int err; int err;
...@@ -2632,7 +2609,11 @@ static int start_discovery(struct sock *sk, u16 index, ...@@ -2632,7 +2609,11 @@ static int start_discovery(struct sock *sk, u16 index,
break; break;
case DISCOV_TYPE_INTERLEAVED: case DISCOV_TYPE_INTERLEAVED:
err = discovery(hdev); 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;
break; break;
default: default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册