Bluetooth: hci_sync: revert some mesh modifications

commit 46c0d947b64ac8efcf89dd754213dab5d1bd00aa upstream.

This reverts minor parts of the changes made in commit b338d91703
("Bluetooth: Implement support for Mesh"). It looks like these changes
were only made for development purposes but shouldn't have been part of
the commit.

Fixes: b338d91703 ("Bluetooth: Implement support for Mesh")
Cc: stable@vger.kernel.org
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Christian Eggers
2025-06-25 15:09:29 +02:00
committed by Greg Kroah-Hartman
parent 3c0c18ef4c
commit 7e88ad41b6

View File

@@ -2010,13 +2010,10 @@ static int hci_clear_adv_sets_sync(struct hci_dev *hdev, struct sock *sk)
static int hci_clear_adv_sync(struct hci_dev *hdev, struct sock *sk, bool force) static int hci_clear_adv_sync(struct hci_dev *hdev, struct sock *sk, bool force)
{ {
struct adv_info *adv, *n; struct adv_info *adv, *n;
int err = 0;
if (ext_adv_capable(hdev)) if (ext_adv_capable(hdev))
/* Remove all existing sets */ /* Remove all existing sets */
err = hci_clear_adv_sets_sync(hdev, sk); return hci_clear_adv_sets_sync(hdev, sk);
if (ext_adv_capable(hdev))
return err;
/* This is safe as long as there is no command send while the lock is /* This is safe as long as there is no command send while the lock is
* held. * held.
@@ -2044,13 +2041,11 @@ static int hci_clear_adv_sync(struct hci_dev *hdev, struct sock *sk, bool force)
static int hci_remove_adv_sync(struct hci_dev *hdev, u8 instance, static int hci_remove_adv_sync(struct hci_dev *hdev, u8 instance,
struct sock *sk) struct sock *sk)
{ {
int err = 0; int err;
/* If we use extended advertising, instance has to be removed first. */ /* If we use extended advertising, instance has to be removed first. */
if (ext_adv_capable(hdev)) if (ext_adv_capable(hdev))
err = hci_remove_ext_adv_instance_sync(hdev, instance, sk); return hci_remove_ext_adv_instance_sync(hdev, instance, sk);
if (ext_adv_capable(hdev))
return err;
/* This is safe as long as there is no command send while the lock is /* This is safe as long as there is no command send while the lock is
* held. * held.
@@ -2149,16 +2144,13 @@ int hci_read_tx_power_sync(struct hci_dev *hdev, __le16 handle, u8 type)
int hci_disable_advertising_sync(struct hci_dev *hdev) int hci_disable_advertising_sync(struct hci_dev *hdev)
{ {
u8 enable = 0x00; u8 enable = 0x00;
int err = 0;
/* If controller is not advertising we are done. */ /* If controller is not advertising we are done. */
if (!hci_dev_test_flag(hdev, HCI_LE_ADV)) if (!hci_dev_test_flag(hdev, HCI_LE_ADV))
return 0; return 0;
if (ext_adv_capable(hdev)) if (ext_adv_capable(hdev))
err = hci_disable_ext_adv_instance_sync(hdev, 0x00); return hci_disable_ext_adv_instance_sync(hdev, 0x00);
if (ext_adv_capable(hdev))
return err;
return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_ADV_ENABLE, return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_ADV_ENABLE,
sizeof(enable), &enable, HCI_CMD_TIMEOUT); sizeof(enable), &enable, HCI_CMD_TIMEOUT);