diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-07-19 10:03:40 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-08-06 14:02:54 -0400 |
commit | bb4b2a9ae38ef3bac69627f35e4f916752631fd1 (patch) | |
tree | 451a3577621b6169767a5f3605b9cf536e0a804f /net/bluetooth/hci_core.c | |
parent | 3f1732462c0e45ac9b0c09035751d7b2c1b89cc0 (diff) |
Bluetooth: mgmt: Managing only BR/EDR HCI controllers
Add check that HCI controller is BR/EDR. AMP controller shall not be
managed by mgmt interface and consequently user space.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
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 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index d4de5db18d5a..fa974a19d365 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -696,7 +696,8 @@ int hci_dev_open(__u16 dev) | |||
696 | hci_dev_hold(hdev); | 696 | hci_dev_hold(hdev); |
697 | set_bit(HCI_UP, &hdev->flags); | 697 | set_bit(HCI_UP, &hdev->flags); |
698 | hci_notify(hdev, HCI_DEV_UP); | 698 | hci_notify(hdev, HCI_DEV_UP); |
699 | if (!test_bit(HCI_SETUP, &hdev->dev_flags)) { | 699 | if (!test_bit(HCI_SETUP, &hdev->dev_flags) && |
700 | mgmt_valid_hdev(hdev)) { | ||
700 | hci_dev_lock(hdev); | 701 | hci_dev_lock(hdev); |
701 | mgmt_powered(hdev, 1); | 702 | mgmt_powered(hdev, 1); |
702 | hci_dev_unlock(hdev); | 703 | hci_dev_unlock(hdev); |
@@ -797,7 +798,8 @@ static int hci_dev_do_close(struct hci_dev *hdev) | |||
797 | * and no tasks are scheduled. */ | 798 | * and no tasks are scheduled. */ |
798 | hdev->close(hdev); | 799 | hdev->close(hdev); |
799 | 800 | ||
800 | if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags)) { | 801 | if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags) && |
802 | mgmt_valid_hdev(hdev)) { | ||
801 | hci_dev_lock(hdev); | 803 | hci_dev_lock(hdev); |
802 | mgmt_powered(hdev, 0); | 804 | mgmt_powered(hdev, 0); |
803 | hci_dev_unlock(hdev); | 805 | hci_dev_unlock(hdev); |