[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: 89fb8acc38852116d38d721ad394aad7f2871670
Status in newer kernel trees: 6.15.y | Present (different SHA1: db2d6aa98a23) 6.12.y | Present (different SHA1: 6e5dc6c4581c)
Note: The patch differs from the upstream commit: --- 1: 89fb8acc38852 ! 1: 2986967377cd5 Bluetooth: HCI: Set extended advertising data synchronously @@ Metadata ## Commit message ## Bluetooth: HCI: Set extended advertising data synchronously
+ commit 89fb8acc38852116d38d721ad394aad7f2871670 upstream. + + [This patch deviates from the upstream version because 3 functions in + hci_sync.c (hci_set_ext_adv_data_sync, hci_set_adv_data_sync and + hci_update_adv_data_sync) had to be moved up within the file. The + content of these functions differs between 6.6 and newer kernels.] + Currently, for controllers with extended advertising, the advertising data is set in the asynchronous response handler for extended adverstising params. As most advertising settings are performed in a @@ net/bluetooth/hci_sync.c: static int hci_set_adv_set_random_addr_sync(struct hci + +static int hci_set_ext_adv_data_sync(struct hci_dev *hdev, u8 instance) +{ -+ DEFINE_FLEX(struct hci_cp_le_set_ext_adv_data, pdu, data, length, -+ HCI_MAX_EXT_AD_LENGTH); ++ struct { ++ struct hci_cp_le_set_ext_adv_data cp; ++ u8 data[HCI_MAX_EXT_AD_LENGTH]; ++ } pdu; + u8 len; + struct adv_info *adv = NULL; + int err; + ++ memset(&pdu, 0, sizeof(pdu)); ++ + if (instance) { + adv = hci_find_adv_instance(hdev, instance); + if (!adv || !adv->adv_data_changed) + return 0; + } + -+ len = eir_create_adv_data(hdev, instance, pdu->data, -+ HCI_MAX_EXT_AD_LENGTH); ++ len = eir_create_adv_data(hdev, instance, pdu.data); + -+ pdu->length = len; -+ pdu->handle = adv ? adv->handle : instance; -+ pdu->operation = LE_SET_ADV_DATA_OP_COMPLETE; -+ pdu->frag_pref = LE_SET_ADV_DATA_NO_FRAG; ++ pdu.cp.length = len; ++ pdu.cp.handle = instance; ++ pdu.cp.operation = LE_SET_ADV_DATA_OP_COMPLETE; ++ pdu.cp.frag_pref = LE_SET_ADV_DATA_NO_FRAG; + + err = __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_EXT_ADV_DATA, -+ struct_size(pdu, data, len), pdu, ++ sizeof(pdu.cp) + len, &pdu.cp, + HCI_CMD_TIMEOUT); + if (err) + return err; @@ net/bluetooth/hci_sync.c: static int hci_set_adv_set_random_addr_sync(struct hci + if (adv) { + adv->adv_data_changed = false; + } else { -+ memcpy(hdev->adv_data, pdu->data, len); ++ memcpy(hdev->adv_data, pdu.data, len); + hdev->adv_data_len = len; + } + @@ net/bluetooth/hci_sync.c: static int hci_set_adv_set_random_addr_sync(struct hci + + memset(&cp, 0, sizeof(cp)); + -+ len = eir_create_adv_data(hdev, instance, cp.data, sizeof(cp.data)); ++ len = eir_create_adv_data(hdev, instance, cp.data); + + /* There's nothing to do if the data hasn't changed */ + if (hdev->adv_data_len == len && @@ net/bluetooth/hci_sync.c: int hci_le_terminate_big_sync(struct hci_dev *hdev, u8
-static int hci_set_ext_adv_data_sync(struct hci_dev *hdev, u8 instance) -{ -- DEFINE_FLEX(struct hci_cp_le_set_ext_adv_data, pdu, data, length, -- HCI_MAX_EXT_AD_LENGTH); +- struct { +- struct hci_cp_le_set_ext_adv_data cp; +- u8 data[HCI_MAX_EXT_AD_LENGTH]; +- } pdu; - u8 len; - struct adv_info *adv = NULL; - int err; - +- memset(&pdu, 0, sizeof(pdu)); +- - if (instance) { - adv = hci_find_adv_instance(hdev, instance); - if (!adv || !adv->adv_data_changed) - return 0; - } - -- len = eir_create_adv_data(hdev, instance, pdu->data, -- HCI_MAX_EXT_AD_LENGTH); +- len = eir_create_adv_data(hdev, instance, pdu.data); - -- pdu->length = len; -- pdu->handle = adv ? adv->handle : instance; -- pdu->operation = LE_SET_ADV_DATA_OP_COMPLETE; -- pdu->frag_pref = LE_SET_ADV_DATA_NO_FRAG; +- pdu.cp.length = len; +- pdu.cp.handle = instance; +- pdu.cp.operation = LE_SET_ADV_DATA_OP_COMPLETE; +- pdu.cp.frag_pref = LE_SET_ADV_DATA_NO_FRAG; - - err = __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_EXT_ADV_DATA, -- struct_size(pdu, data, len), pdu, +- sizeof(pdu.cp) + len, &pdu.cp, - HCI_CMD_TIMEOUT); - if (err) - return err; @@ net/bluetooth/hci_sync.c: int hci_le_terminate_big_sync(struct hci_dev *hdev, u8 - if (adv) { - adv->adv_data_changed = false; - } else { -- memcpy(hdev->adv_data, pdu->data, len); +- memcpy(hdev->adv_data, pdu.data, len); - hdev->adv_data_len = len; - } - @@ net/bluetooth/hci_sync.c: int hci_le_terminate_big_sync(struct hci_dev *hdev, u8 - - memset(&cp, 0, sizeof(cp)); - -- len = eir_create_adv_data(hdev, instance, cp.data, sizeof(cp.data)); +- len = eir_create_adv_data(hdev, instance, cp.data); - - /* There's nothing to do if the data hasn't changed */ - if (hdev->adv_data_len == len && ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success |