summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorAndre Guedes <aguedespe@gmail.com>2012-03-21 00:03:37 -0300
committerGustavo Padovan <gustavo@padovan.org>2012-05-09 00:41:34 -0300
commit642be6c768bd686577ffe6ebcc5e6132a932537b (patch)
tree74d65aaac3cb9ef55c7ac33ccc22ba719839b37d /net/bluetooth/mgmt.c
parentae854a70df3e2183a8db7a98a0deceee111c4542 (diff)
downloadblackbird-op-linux-642be6c768bd686577ffe6ebcc5e6132a932537b.tar.gz
blackbird-op-linux-642be6c768bd686577ffe6ebcc5e6132a932537b.zip
Bluetooth: Check HCI_PERIODIC_INQ in start_discovery
This patch adds a HCI_PERIODIC_INQ check to start_discovery. If periodic inquiry is enabled, we fail MGMT Start Discovery command with MGMT_STATUS_BUSY code. Signed-off-by: Andre Guedes <aguedespe@gmail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 2975a10fca07..4bb0a130e7d9 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2315,6 +2315,12 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev,
goto failed;
}
+ if (test_bit(HCI_PERIODIC_INQ, &hdev->dev_flags)) {
+ err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY,
+ MGMT_STATUS_BUSY);
+ goto failed;
+ }
+
if (hdev->discovery.state != DISCOVERY_STOPPED) {
err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY,
MGMT_STATUS_BUSY);
OpenPOWER on IntegriCloud