Commit bb284455 authored by francescomani's avatar francescomani

fixes in CSI UE reception and reporting for multiple BWPs

parent 3bc86d69
...@@ -2484,6 +2484,11 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, ...@@ -2484,6 +2484,11 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac,
NR_CSI_ReportConfig_t *csirep = csi_measconfig->csi_ReportConfigToAddModList->list.array[csi_report_id]; NR_CSI_ReportConfig_t *csirep = csi_measconfig->csi_ReportConfigToAddModList->list.array[csi_report_id];
if(csirep->reportConfigType.present == NR_CSI_ReportConfig__reportConfigType_PR_periodic){ if(csirep->reportConfigType.present == NR_CSI_ReportConfig__reportConfigType_PR_periodic){
const NR_PUCCH_CSI_Resource_t *pucchcsires = csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list.array[0];
if(pucchcsires->uplinkBandwidthPartId != bwp_id)
continue;
int period, offset; int period, offset;
csi_period_offset(csirep, NULL, &period, &offset); csi_period_offset(csirep, NULL, &period, &offset);
...@@ -2532,7 +2537,7 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, ...@@ -2532,7 +2537,7 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac,
} }
AssertFatal(found != -1, AssertFatal(found != -1,
"CSI resource not found among PUCCH resources\n"); "CSI resource not found among PUCCH resources\n");
LOG_D(NR_MAC, "CSI reporting in frame %d slot %d CSI report ID %ld\n", frame, slot, csirep->reportConfigId);
pucch->resource_indicator = found; pucch->resource_indicator = found;
csi_bits += nr_get_csi_payload(mac, pucch, csi_report_id, csi_measconfig); csi_bits += nr_get_csi_payload(mac, pucch, csi_report_id, csi_measconfig);
} }
...@@ -2683,9 +2688,9 @@ uint8_t get_csirs_RI_PMI_CQI_payload(NR_UE_MAC_INST_t *mac, ...@@ -2683,9 +2688,9 @@ uint8_t get_csirs_RI_PMI_CQI_payload(NR_UE_MAC_INST_t *mac,
if (csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_idx]->nzp_CSI_ResourceSetId == if (csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_idx]->nzp_CSI_ResourceSetId ==
*(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.array[0])) { *(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.array[0])) {
nr_csi_report_t *csi_report = &mac->csi_report_template[csi_reportconfig->reportConfigId]; nr_csi_report_t *csi_report = &mac->csi_report_template[csi_idx];
compute_csi_bitlen(csi_MeasConfig, mac->csi_report_template); compute_csi_bitlen(csi_MeasConfig, mac->csi_report_template);
n_bits = nr_get_csi_bitlen(mac->csi_report_template, csi_reportconfig->reportConfigId); n_bits = nr_get_csi_bitlen(mac->csi_report_template, csi_idx);
int cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; int cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen;
int ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen; int ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen;
...@@ -2740,9 +2745,9 @@ uint8_t get_csirs_RSRP_payload(NR_UE_MAC_INST_t *mac, ...@@ -2740,9 +2745,9 @@ uint8_t get_csirs_RSRP_payload(NR_UE_MAC_INST_t *mac,
if (csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_idx]->nzp_CSI_ResourceSetId == if (csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_idx]->nzp_CSI_ResourceSetId ==
*(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.array[0])) { *(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.array[0])) {
nr_csi_report_t *csi_report = &mac->csi_report_template[csi_reportconfig->reportConfigId]; nr_csi_report_t *csi_report = &mac->csi_report_template[csi_idx];
compute_csi_bitlen(csi_MeasConfig, mac->csi_report_template); compute_csi_bitlen(csi_MeasConfig, mac->csi_report_template);
n_bits = nr_get_csi_bitlen(mac->csi_report_template, csi_reportconfig->reportConfigId); n_bits = nr_get_csi_bitlen(mac->csi_report_template, csi_idx);
int cri_ssbri_bitlen = csi_report->CSI_report_bitlen.cri_ssbri_bitlen; int cri_ssbri_bitlen = csi_report->CSI_report_bitlen.cri_ssbri_bitlen;
int rsrp_bitlen = csi_report->CSI_report_bitlen.rsrp_bitlen; int rsrp_bitlen = csi_report->CSI_report_bitlen.rsrp_bitlen;
......
...@@ -2512,8 +2512,25 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { ...@@ -2512,8 +2512,25 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) {
uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
// looking for the correct CSI-RS resource in current BWP
NR_NZP_CSI_RS_ResourceSetId_t *nzp = NULL;
for (int csi_list=0; csi_list<csi_measconfig->csi_ResourceConfigToAddModList->list.count; csi_list++) {
NR_CSI_ResourceConfig_t *csires = csi_measconfig->csi_ResourceConfigToAddModList->list.array[csi_list];
if(csires->bwp_Id == dl_bwp_id &&
csires->csi_RS_ResourceSetList.present == NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB &&
csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList) {
nzp = csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.array[0];
}
}
if (nzp == NULL)
return; // no resource associated to current BWP
for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){
nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id];
// reception of CSI-RS only for current BWP
if (nzpcsi->nzp_CSI_RS_ResourceId != *nzp)
continue;
csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset); csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset);
if((frame*nr_slots_per_frame[mu]+slot-offset)%period != 0) if((frame*nr_slots_per_frame[mu]+slot-offset)%period != 0)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment