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

Signed-off-by: Zhengping Jiang <[email protected]>
  • Loading branch information
Zhengping Jiang authored and Tzung-Bi Shih committed Jan 3, 2023
1 parent ba37c15 commit fe613a2
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 @@ -1037,12 +1037,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 @@ -5186,10 +5190,6 @@ static int hci_power_off_sync(struct hci_dev *hdev)
return err;
}

err = hci_clear_adv_sync(hdev, NULL, false);
if (err)
return err;

err = hci_stop_discovery_sync(hdev);
if (err)
return err;
Expand Down

0 comments on commit fe613a2

Please sign in to comment.