Commit 93c311a0 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: Make mgmt power down notification for BR/EDR explicit

The management interface only operates on BR/EDR controllers. The check
for the power down notification is a bit intermixed with the check if
controller auto power off is active. Since there are more than just
BR/EDR controllers supported, make this check explicit since the auto
power off check also applies to AMP controllers and it has to happen
in this exact order. Otherwise the bit will not be cleared.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 004b0258
...@@ -1393,12 +1393,13 @@ static int hci_dev_do_close(struct hci_dev *hdev) ...@@ -1393,12 +1393,13 @@ static int hci_dev_do_close(struct hci_dev *hdev)
hdev->flags = 0; hdev->flags = 0;
hdev->dev_flags &= ~HCI_PERSISTENT_MASK; hdev->dev_flags &= ~HCI_PERSISTENT_MASK;
if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags) && if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags)) {
hdev->dev_type == HCI_BREDR) { if (hdev->dev_type == HCI_BREDR) {
hci_dev_lock(hdev); hci_dev_lock(hdev);
mgmt_powered(hdev, 0); mgmt_powered(hdev, 0);
hci_dev_unlock(hdev); hci_dev_unlock(hdev);
} }
}
/* Controller radio is available but is currently powered down */ /* Controller radio is available but is currently powered down */
hdev->amp_status = AMP_STATUS_POWERED_DOWN; hdev->amp_status = AMP_STATUS_POWERED_DOWN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment