Skip to content

Commit

Permalink
CHROMIUM: Bluetooth: hci_sync: keep advertisements during power off
Browse files Browse the repository at this point in the history
Remove the clearing advertisement step during the power-off, so the
advertisements can be re-registered during the power-on. Ignore the
error when disabling advertisement in the setup function, because
the controller may have removed the instance. If the instance has been
remove in the controller, the instance can be configured and
re-registered.

BUG=b:230393301
TEST=bluetooth_AdapterAdvHealth.adv_reboot_advertising_test

Change-Id: I341f07f06afa34528b3c457e6bdfbf47906b533f
Signed-off-by: Zhengping Jiang <jiangzp@google.com>
Kcr-patch: fa821523e188e56f46befdba3dc803fefdc8ece4492cea846b8d97d1.patch
  • Loading branch information
Zhengping Jiang authored and Bartłomiej Bujak committed Jul 15, 2024
1 parent bec50dd commit c792684
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/bluetooth/hci_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,12 +1133,16 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)

/* Updating parameters of an active instance will return a
* Command Disallowed error, so we must first disable the
* instance if it is active.
* instance if it is active. This call may fail if the instance
* has been removed from the controller.
*/
if (adv && !adv->pending) {
err = hci_disable_ext_adv_instance_sync(hdev, instance);
if (err)
return err;
bt_dev_dbg(hdev, "Error code %d while disabling \
instance %d. Continue \
re-registering the instance",
err, instance);
}

flags = hci_adv_instance_flags(hdev, instance);
Expand Down Expand Up @@ -5522,10 +5526,6 @@ static int hci_power_off_sync(struct hci_dev *hdev)
goto out;
}

err = hci_clear_adv_sync(hdev, NULL, false);
if (err)
goto out;

err = hci_stop_discovery_sync(hdev);
if (err)
goto out;
Expand Down

0 comments on commit c792684

Please sign in to comment.