diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-10-24 21:12:03 +0300 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-11-01 20:26:58 -0200 |
commit | f15504788d7b1613ef2ef0a673cfe250c16a6b0d (patch) | |
tree | 3eb8d4ba792ad9417ac3469db0519240a004e002 /net/bluetooth/hci_core.c | |
parent | 33f8f5269ea7c220e18a15959dad2b42e1b61051 (diff) | |
download | linux-f15504788d7b1613ef2ef0a673cfe250c16a6b0d.tar.bz2 |
Bluetooth: Disallow LE scanning and connecting in peripheral role
When an adapter is in the LE peripheral role scanning for other devices
or initiating connections to them is not allowed. This patch makes sure
that such attempts will result in appropriate error returns.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r-- | net/bluetooth/hci_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 5a3400d8a6e5..515d0c394f35 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -1577,6 +1577,9 @@ int hci_le_scan(struct hci_dev *hdev, u8 type, u16 interval, u16 window, BT_DBG("%s", hdev->name); + if (test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags)) + return -ENOTSUPP; + if (work_busy(&hdev->le_scan)) return -EINPROGRESS; |