diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-19 22:38:21 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-10-20 18:05:40 +0200 |
commit | 4b580614e1435628490a1762726638546f3a5e4e (patch) | |
tree | 0e622d789b3265ff6642ff3b48966980bae73549 /net/bluetooth | |
parent | Bluetooth: Move mgmt_pending_find to avoid forward declarations (diff) | |
download | linux-4b580614e1435628490a1762726638546f3a5e4e.tar.xz linux-4b580614e1435628490a1762726638546f3a5e4e.zip |
Bluetooth: Fix sending write_scan_enable when BR/EDR is disabled
We should only send the HCI_Write_Scan_Enable command from
mgmt_set_powered_failed() when BR/EDR support is enabled. This is
particularly important when the discoverable setting is also tied to LE.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 20f6309f8245..67b95a80f829 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -4337,7 +4337,6 @@ void mgmt_set_powered_failed(struct hci_dev *hdev, int err) void mgmt_discoverable_timeout(struct hci_dev *hdev) { struct hci_request req; - u8 scan = SCAN_PAGE; hci_dev_lock(hdev); @@ -4349,7 +4348,11 @@ void mgmt_discoverable_timeout(struct hci_dev *hdev) clear_bit(HCI_LIMITED_DISCOVERABLE, &hdev->dev_flags); hci_req_init(&req, hdev); - hci_req_add(&req, HCI_OP_WRITE_SCAN_ENABLE, sizeof(scan), &scan); + if (test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags)) { + u8 scan = SCAN_PAGE; + hci_req_add(&req, HCI_OP_WRITE_SCAN_ENABLE, + sizeof(scan), &scan); + } update_class(&req); hci_req_run(&req, NULL); |