Skip to content

Commit fe613a2

Browse files
Zhengping JiangTzung-Bi Shih
authored andcommitted
CHROMIUM: Bluetooth: hci_sync: keep advertisements during power off
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]>
1 parent ba37c15 commit fe613a2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

net/bluetooth/hci_sync.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,12 +1037,16 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
10371037

10381038
/* Updating parameters of an active instance will return a
10391039
* Command Disallowed error, so we must first disable the
1040-
* instance if it is active.
1040+
* instance if it is active. This call may fail if the instance
1041+
* has been removed from the controller.
10411042
*/
10421043
if (adv && !adv->pending) {
10431044
err = hci_disable_ext_adv_instance_sync(hdev, instance);
10441045
if (err)
1045-
return err;
1046+
bt_dev_dbg(hdev, "Error code %d while disabling \
1047+
instance %d. Continue \
1048+
re-registering the instance",
1049+
err, instance);
10461050
}
10471051

10481052
flags = hci_adv_instance_flags(hdev, instance);
@@ -5186,10 +5190,6 @@ static int hci_power_off_sync(struct hci_dev *hdev)
51865190
return err;
51875191
}
51885192

5189-
err = hci_clear_adv_sync(hdev, NULL, false);
5190-
if (err)
5191-
return err;
5192-
51935193
err = hci_stop_discovery_sync(hdev);
51945194
if (err)
51955195
return err;

0 commit comments

Comments
 (0)