···43244324 if (ll_privacy_capable(hdev))43254325 hdev->conn_flags |= HCI_CONN_FLAG_ADDRESS_RESOLUTION;4326432643274327+ /* Mark PAST if supported */43284328+ if (past_capable(hdev))43294329+ hdev->conn_flags |= HCI_CONN_FLAG_PAST;43304330+43274331 /* If the controller supports Extended Scanner Filter43284332 * Policies, enable the corresponding event.43294333 */···70287024 hci_dev_unlock(hdev);70297025}7030702670277027+static int hci_le_past_params_sync(struct hci_dev *hdev, struct hci_conn *conn,70287028+ struct hci_conn *acl, struct bt_iso_qos *qos)70297029+{70307030+ struct hci_cp_le_past_params cp;70317031+ int err;70327032+70337033+ memset(&cp, 0, sizeof(cp));70347034+ cp.handle = cpu_to_le16(acl->handle);70357035+ /* An HCI_LE_Periodic_Advertising_Sync_Transfer_Received event is sent70367036+ * to the Host. HCI_LE_Periodic_Advertising_Report events will be70377037+ * enabled with duplicate filtering enabled.70387038+ */70397039+ cp.mode = 0x03;70407040+ cp.skip = cpu_to_le16(qos->bcast.skip);70417041+ cp.sync_timeout = cpu_to_le16(qos->bcast.sync_timeout);70427042+ cp.cte_type = qos->bcast.sync_cte_type;70437043+70447044+ /* HCI_LE_PAST_PARAMS command returns a command complete event so it70457045+ * cannot wait for HCI_EV_LE_PAST_RECEIVED.70467046+ */70477047+ err = __hci_cmd_sync_status(hdev, HCI_OP_LE_PAST_PARAMS,70487048+ sizeof(cp), &cp, HCI_CMD_TIMEOUT);70497049+ if (err)70507050+ return err;70517051+70527052+ /* Wait for HCI_EV_LE_PAST_RECEIVED event */70537053+ return __hci_cmd_sync_status_sk(hdev, HCI_OP_NOP, 0, NULL,70547054+ HCI_EV_LE_PAST_RECEIVED,70557055+ conn->conn_timeout, NULL);70567056+}70577057+70317058static int hci_le_pa_create_sync(struct hci_dev *hdev, void *data)70327059{70337060 struct hci_cp_le_pa_create_sync cp;70347034- struct hci_conn *conn = data;70617061+ struct hci_conn *conn = data, *le;70357062 struct bt_iso_qos *qos = &conn->iso_qos;70367063 int err;70377064···70937058 set_bit(HCI_CONN_CREATE_PA_SYNC, &conn->flags);7094705970957060 hci_update_passive_scan_sync(hdev);70617061+70627062+ /* Check if PAST is possible:70637063+ *70647064+ * 1. Check if an ACL connection with the destination address exists70657065+ * 2. Check if that HCI_CONN_FLAG_PAST has been set which indicates that70667066+ * user really intended to use PAST.70677067+ */70687068+ le = hci_conn_hash_lookup_le(hdev, &conn->dst, conn->dst_type);70697069+ if (le) {70707070+ struct hci_conn_params *params;70717071+70727072+ params = hci_conn_params_lookup(hdev, &le->dst, le->dst_type);70737073+ if (params && params->flags & HCI_CONN_FLAG_PAST) {70747074+ err = hci_le_past_params_sync(hdev, conn, le, qos);70757075+ if (!err)70767076+ goto done;70777077+ }70787078+ }7096707970977080 /* SID has not been set listen for HCI_EV_LE_EXT_ADV_REPORT to update70987081 * it.