Removed dead code
This commit is contained in:
@@ -310,334 +310,6 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
}
|
||||
|
||||
}
|
||||
#if 0
|
||||
//!TODO : smae function can be written to handle csi_resources
|
||||
void update_csi_bitlen (NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_list_t *UE_list, int UE_id, module_id_t Mod_idP) {
|
||||
uint8_t csi_report_id = 0;
|
||||
uint8_t csi_resourceidx =0;
|
||||
uint8_t csi_ssb_idx =0;
|
||||
uint16_t period, offset;
|
||||
NR_CSI_ReportPeriodicityAndOffset_PR p_and_o;
|
||||
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type;
|
||||
NR_CSI_ResourceConfigId_t csi_ResourceConfigId;
|
||||
|
||||
for (csi_report_id=0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++){
|
||||
csi_ResourceConfigId=csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->resourcesForChannelMeasurement;
|
||||
reportQuantity_type = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportQuantity.present;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].reportQuantity_type = reportQuantity_type;
|
||||
p_and_o = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.present;
|
||||
|
||||
switch(p_and_o){
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots4:
|
||||
period = 4;
|
||||
offset = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.choice.slots4;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots5:
|
||||
period = 5;
|
||||
offset = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.choice.slots5;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots8:
|
||||
period = 8;
|
||||
offset = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.choice.slots8;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots10:
|
||||
period = 10;
|
||||
offset = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.choice.slots10;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots16:
|
||||
period = 16;
|
||||
offset = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.choice.slots16;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots20:
|
||||
period = 20;
|
||||
offset = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.choice.slots20;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots40:
|
||||
period = 40;
|
||||
offset = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.choice.slots40;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots80:
|
||||
period = 80;
|
||||
offset = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.choice.slots80;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots160:
|
||||
period = 160;
|
||||
offset = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.choice.slots160;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots320:
|
||||
period = 320;
|
||||
offset = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"No periodicity and offset resource found in CSI report");
|
||||
}
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].periodicity=period;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].offset=offset;
|
||||
|
||||
for ( csi_resourceidx = 0; csi_resourceidx < csi_MeasConfig->csi_ResourceConfigToAddModList->list.count; csi_resourceidx++) {
|
||||
if ( csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[csi_resourceidx]->csi_ResourceConfigId != csi_ResourceConfigId)
|
||||
continue;
|
||||
else {
|
||||
uint8_t nb_ssb_resources =0;
|
||||
//Finding the CSI_RS or SSB Resources
|
||||
if ( NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) {
|
||||
|
||||
if (NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled ==
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->groupBasedBeamReporting.present ) {
|
||||
if (NULL != csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->groupBasedBeamReporting.choice.disabled->nrofReportedRS)
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.nb_ssbri_cri = *(csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->groupBasedBeamReporting.choice.disabled->nrofReportedRS)+1;
|
||||
else
|
||||
/*! From Spec 38.331
|
||||
* nrofReportedRS
|
||||
* The number (N) of measured RS resources to be reported per report setting in a non-group-based report. N <= N_max, where N_max is either 2 or 4 depending on UE
|
||||
* capability. FFS: The signaling mechanism for the gNB to select a subset of N beams for the UE to measure and report.
|
||||
* When the field is absent the UE applies the value 1
|
||||
*/
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.nb_ssbri_cri= 1;
|
||||
}else
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.nb_ssbri_cri= 2;
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == UE_list->csi_report_template[UE_id][csi_report_id].reportQuantity_type) {
|
||||
for ( csi_ssb_idx = 0; csi_ssb_idx < csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count; csi_ssb_idx++) {
|
||||
if (csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceSetId ==
|
||||
*(csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[csi_resourceidx]->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.array[0])){ ///We can configure only one SSB resource set from spec 38.331 IE CSI-ResourceConfig
|
||||
|
||||
nb_ssb_resources= csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceList.list.count;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].SSB_Index_list = csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceList.list.array;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_Index_list = NULL;
|
||||
}
|
||||
break ;
|
||||
}
|
||||
} else /*if (NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP == UE_list->csi_report_template[UE_id][csi_report_id].reportQuantity_type)*/{
|
||||
for ( csi_ssb_idx = 0; csi_ssb_idx < csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.count; csi_ssb_idx++) {
|
||||
if (csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_ssb_idx]->nzp_CSI_ResourceSetId ==
|
||||
*(csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[csi_resourceidx]->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.array[0])) { ///For periodic and semi-persistent CSI Resource Settings, the number of CSI-RS Resource Sets configured is limited to S=1 for spec 38.212
|
||||
|
||||
nb_ssb_resources= csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_ssb_idx]->nzp_CSI_RS_Resources.list.count;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_Index_list = csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_ssb_idx]->nzp_CSI_RS_Resources.list.array;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].SSB_Index_list = NULL;
|
||||
}
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
if (nb_ssb_resources) {
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen =ceil(log2 (nb_ssb_resources));
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.rsrp_bitlen = 7; //From spec 38.212 Table 6.3.1.1.2-6: CRI, SSBRI, and RSRP
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.diff_rsrp_bitlen =4; //From spec 38.212 Table 6.3.1.1.2-6: CRI, SSBRI, and RSRP
|
||||
} else {
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen =0;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.rsrp_bitlen = 0;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.diff_rsrp_bitlen =0;
|
||||
}
|
||||
|
||||
LOG_I (MAC, "UCI: CSI_bit len : ssbri %d, rsrp: %d, diff_rsrp: %d",
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen,
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.rsrp_bitlen,
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.diff_rsrp_bitlen);
|
||||
}
|
||||
|
||||
uint8_t ri_restriction;
|
||||
uint8_t ri_bitlen;
|
||||
uint8_t nb_allowed_ri;
|
||||
uint8_t max_ri;
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI==reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI==reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1_CQI==reportQuantity_type||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1==reportQuantity_type){
|
||||
|
||||
for ( csi_ssb_idx = 0; csi_ssb_idx < csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count; csi_ssb_idx++) {
|
||||
if (csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_ssb_idx]->nzp_CSI_ResourceSetId ==
|
||||
*(csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[csi_resourceidx]->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.array[0])) { ///For periodic and semi-persistent CSI Resource Settings, the number of CSI-RS Resource Sets configured is limited to S=1 for spec 38.212
|
||||
|
||||
nb_ssb_resources= csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_ssb_idx]->nzp_CSI_RS_Resources.list.count;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].CSI_Index_list = csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_ssb_idx]->nzp_CSI_RS_Resources.list.array;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].SSB_Index_list = NULL;
|
||||
}
|
||||
break ;
|
||||
}
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cri_bitlen=ceil(log2 (nb_ssb_resources));
|
||||
|
||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->codebookConfig->codebookType.choice.type1->subType.present){
|
||||
|
||||
switch (RC.nrrrc[Mod_idP]->carrier.pdsch_AntennaPorts) {
|
||||
case 1:;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.ri_bitlen=0;
|
||||
break;
|
||||
case 2:
|
||||
/* From Spec 38.212
|
||||
* If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator
|
||||
* values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6,
|
||||
* TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause
|
||||
* 5.2.2.2.1 [6, TS 38.214].
|
||||
*
|
||||
* But from Current RRC ASN structures nrofCQIsPerReport is not present. Present a dummy variable is present so using it to
|
||||
* calculate RI for antennas equal or more than two.
|
||||
* */
|
||||
AssertFatal (NULL!=csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->dummy, "nrofCQIsPerReport is not present");
|
||||
|
||||
ri_restriction = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
||||
if (0==*(csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->dummy)){ /* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
config when equalent ASN structure present */
|
||||
nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0), &max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
else{
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction, &max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
ri_bitlen = ri_bitlen<1?ri_bitlen:1; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
||||
break;
|
||||
case 4:
|
||||
AssertFatal (NULL!=csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->dummy, "nrofCQIsPerReport is not present");
|
||||
|
||||
ri_restriction = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
||||
if (0==*(csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->dummy)){ /* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
config when equalent ASN structure present */
|
||||
nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0), &max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
else{
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction,&max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
ri_bitlen = ri_bitlen<2?ri_bitlen:2; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
||||
break;
|
||||
case 6:
|
||||
case 8:
|
||||
AssertFatal (NULL!=csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->dummy, "nrofCQIsPerReport is not present");
|
||||
|
||||
ri_restriction = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
||||
if (0==*(csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->dummy)){ /* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
config when equalent ASN structure present */
|
||||
nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0),&max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
else{
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction, &max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
//ri_bitlen = ri_bitlen<1?ri_bitlen:1; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
||||
break;
|
||||
default:
|
||||
//UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.ri_bitlen=0;
|
||||
AssertFatal(RC.nrrrc[Mod_idP]->carrier.pdsch_AntennaPorts>8,"Number of antennas %d are out of range", RC.nrrrc[Mod_idP]->carrier.pdsch_AntennaPorts);
|
||||
break;
|
||||
}
|
||||
}
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.li_bitlen=0;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cqi_bitlen=0;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.pmi_x1_bitlen=0;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.pmi_x2_bitlen=0;
|
||||
}
|
||||
|
||||
if( NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI==reportQuantity_type ){
|
||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->codebookConfig->codebookType.choice.type1->subType.present){
|
||||
|
||||
switch (RC.nrrrc[Mod_idP]->carrier.pdsch_AntennaPorts) {
|
||||
case 1:;
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.li_bitlen=0;
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 8:
|
||||
/* From Spec 38.212
|
||||
* If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator
|
||||
* values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6,
|
||||
* TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause
|
||||
* 5.2.2.2.1 [6, TS 38.214].
|
||||
*
|
||||
* But from Current RRC ASN structures nrofCQIsPerReport is not present. Present a dummy variable is present so using it to
|
||||
* calculate RI for antennas equal or more than two.
|
||||
* */
|
||||
//! TODO: The bit length of LI is as follows LI = log2(RI), Need to confirm wheather we should consider maximum RI can be reported from ri_restricted
|
||||
// or we should consider reported RI. If we need to consider reported RI for calculating LI bit length then we need to modify the code.
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.li_bitlen=ceil(log2(max_ri))<2?ceil(log2(max_ri)):2;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(RC.nrrrc[Mod_idP]->carrier.pdsch_AntennaPorts>8,"Number of antennas %d are out of range", RC.nrrrc[Mod_idP]->carrier.pdsch_AntennaPorts);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI==reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI==reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1_CQI==reportQuantity_type){
|
||||
|
||||
|
||||
switch (RC.nrrrc[Mod_idP]->carrier.pdsch_AntennaPorts){
|
||||
case 1:;
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 8:
|
||||
/* From Spec 38.212
|
||||
* If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator
|
||||
* values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6,
|
||||
* TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause
|
||||
* 5.2.2.2.1 [6, TS 38.214].
|
||||
*
|
||||
* But from Current RRC ASN structures nrofCQIsPerReport is not present. Present a dummy variable is present so using it to
|
||||
* calculate RI for antennas equal or more than two.
|
||||
* */
|
||||
|
||||
if (max_ri > 4 && max_ri < 8){
|
||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->codebookConfig->codebookType.choice.type1->subType.present){
|
||||
if (NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI==csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportFreqConfiguration->cqi_FormatIndicator)
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cqi_bitlen = 8;
|
||||
else
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cqi_bitlen = 4;
|
||||
}
|
||||
}else{ //This condition will work even for type1-multipanel.
|
||||
if (NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI==csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportFreqConfiguration->cqi_FormatIndicator)
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cqi_bitlen = 4;
|
||||
else
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cqi_bitlen = 2;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(RC.nrrrc[Mod_idP]->carrier.pdsch_AntennaPorts>8,"Number of antennas %d are out of range", RC.nrrrc[Mod_idP]->carrier.pdsch_AntennaPorts);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI==reportQuantity_type){
|
||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->codebookConfig->codebookType.choice.type1->subType.present){
|
||||
switch (csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present){
|
||||
case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two:
|
||||
if (max_ri ==1)
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.pmi_x1_bitlen = 2;
|
||||
else if (max_ri ==2)
|
||||
UE_list->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.pmi_x1_bitlen = 1;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present!=NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two,
|
||||
"Not handled Yet %d", csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
extern uint16_t sl_ahead;
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
@@ -779,7 +451,6 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
UE_info->secondaryCellGroup[UE_id] = secondaryCellGroup;
|
||||
LOG_I(PHY,"Modified UE_id %d/%x with secondaryCellGroup\n",UE_id,rnti);
|
||||
}
|
||||
//update_csi_bitlen (secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_list, UE_id, Mod_idP);
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
|
||||
|
||||
|
||||
@@ -293,59 +293,6 @@ void schedule_nr_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subfram
|
||||
}
|
||||
}
|
||||
*/
|
||||
/*
|
||||
void copy_nr_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
|
||||
{
|
||||
int CC_id;
|
||||
gNB_MAC_INST *mac = RC.nrmac[module_idP];
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
nfapi_ul_config_request_t *ul_req = &mac->UL_tti_req[CC_id];
|
||||
|
||||
*ul_req = *ul_req_tmp;
|
||||
|
||||
// Restore the pointer
|
||||
ul_req->ul_config_request_body.ul_config_pdu_list = ul_req_pdu;
|
||||
ul_req->sfn_sf = (frameP<<7) + slotP;
|
||||
ul_req_tmp->ul_config_request_body.number_of_pdus = 0;
|
||||
|
||||
if (ul_req->ul_config_request_body.number_of_pdus>0)
|
||||
{
|
||||
LOG_D(PHY, "%s() active NOW (frameP:%d slotP:%d) pdus:%d\n", __FUNCTION__, frameP, slotP, ul_req->ul_config_request_body.number_of_pdus);
|
||||
}
|
||||
|
||||
memcpy((void*)ul_req->ul_config_request_body.ul_config_pdu_list,
|
||||
(void*)ul_req_tmp->ul_config_request_body.ul_config_pdu_list,
|
||||
ul_req->ul_config_request_body.number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
void nr_schedule_pusch(int Mod_idP,
|
||||
int UE_id,
|
||||
int num_slots_per_tdd,
|
||||
int ul_slots,
|
||||
frame_t frameP,
|
||||
sub_frame_t slotP) {
|
||||
|
||||
nfapi_nr_ul_tti_request_t *UL_tti_req = &RC.nrmac[Mod_idP]->UL_tti_req[0];
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
|
||||
int k = slotP + ul_slots - num_slots_per_tdd;
|
||||
NR_sched_pusch_t *pusch = &UE_info->UE_sched_ctrl[UE_id].sched_pusch[k];
|
||||
if ((pusch->active == true) && (frameP == pusch->frame) && (slotP == pusch->slot)) {
|
||||
UL_tti_req->SFN = pusch->frame;
|
||||
UL_tti_req->Slot = pusch->slot;
|
||||
UL_tti_req->pdus_list[UL_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE;
|
||||
UL_tti_req->pdus_list[UL_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_pusch_pdu_t);
|
||||
UL_tti_req->pdus_list[UL_tti_req->n_pdus].pusch_pdu = pusch->pusch_pdu;
|
||||
UL_tti_req->n_pdus+=1;
|
||||
memset((void *) &UE_info->UE_sched_ctrl[UE_id].sched_pusch[k],
|
||||
0, sizeof(NR_sched_pusch));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
bool is_xlsch_in_slot(uint64_t bitmap, sub_frame_t slot) {
|
||||
return (bitmap >> slot) & 0x01;
|
||||
|
||||
@@ -1172,8 +1172,6 @@ void tci_handling(module_id_t Mod_idP, int UE_id, int CC_id, NR_UE_sched_ctrl_t
|
||||
int cqi_idx = 0;
|
||||
int curr_ssb_beam_index = 0; //ToDo: yet to know how to identify the serving ssb beam index
|
||||
uint8_t target_ssb_beam_index = curr_ssb_beam_index;
|
||||
//uint8_t max_reported_RSRP = 16;
|
||||
//int serving_SSB_Beam_RSRP;
|
||||
uint8_t is_triggering_ssb_beam_switch =0;
|
||||
uint8_t ssb_idx = 0;
|
||||
int pdsch_bwp_id =0;
|
||||
@@ -1182,16 +1180,12 @@ void tci_handling(module_id_t Mod_idP, int UE_id, int CC_id, NR_UE_sched_ctrl_t
|
||||
uint8_t idx = 0;
|
||||
int bwp_id = 1;
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
|
||||
//NR_COMMON_channels_t *cc = RC.nrmac[Mod_idP]->common_channels;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup = UE_info->secondaryCellGroup[UE_id];
|
||||
NR_BWP_Downlink_t *bwp = secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1];
|
||||
//NR_CSI_MeasConfig_t *csi_MeasConfig = UE_info->secondaryCellGroup[UE_id]->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
|
||||
//bwp indicator
|
||||
int n_dl_bwp = secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count;
|
||||
uint8_t nr_ssbri_cri = 0;
|
||||
uint8_t nb_of_csi_ssb_report = UE_info->csi_report_template[UE_id][cqi_idx].nb_of_csi_ssb_report;
|
||||
//uint8_t bitlen_ssbri = log (nb_of_csi_ssb_report)/log (2);
|
||||
//uint8_t max_rsrp_reported = -1;
|
||||
int better_rsrp_reported = -140-(-0); /*minimum_measured_RSRP_value - minimum_differntail_RSRP_value*///considering the minimum RSRP value as better RSRP initially
|
||||
uint8_t diff_rsrp_idx = 0;
|
||||
uint8_t i, j;
|
||||
@@ -1213,9 +1207,6 @@ void tci_handling(module_id_t Mod_idP, int UE_id, int CC_id, NR_UE_sched_ctrl_t
|
||||
//for all reported SSB
|
||||
for (idx = 0; idx < nb_of_csi_ssb_report; idx++) {
|
||||
nr_ssbri_cri = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri;
|
||||
//if group based beam Reporting is disabled
|
||||
/*if(NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled ==
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList->list.array[0]->groupBasedBeamReporting.present ) {*/
|
||||
//extracting the ssb indexes
|
||||
for (ssb_idx = 0; ssb_idx < nr_ssbri_cri; ssb_idx++) {
|
||||
ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[ssb_idx];
|
||||
@@ -1224,7 +1215,7 @@ void tci_handling(module_id_t Mod_idP, int UE_id, int CC_id, NR_UE_sched_ctrl_t
|
||||
//if strongest measured RSRP is configured
|
||||
strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
|
||||
ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp;
|
||||
LOG_I(MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
|
||||
LOG_D(MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
|
||||
|
||||
//if current ssb rsrp is greater than better rsrp
|
||||
if(ssb_rsrp[idx * nb_of_csi_ssb_report] > better_rsrp_reported) {
|
||||
@@ -1241,40 +1232,13 @@ void tci_handling(module_id_t Mod_idP, int UE_id, int CC_id, NR_UE_sched_ctrl_t
|
||||
target_ssb_beam_index = idx * nb_of_csi_ssb_report + diff_rsrp_idx;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
//}
|
||||
//if group based beam reporting is enabled
|
||||
else if (NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled !=
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList->list.array[0]->groupBasedBeamReporting.present ) {
|
||||
//extracting the ssb indexes
|
||||
//for group based reporting only 2 SSB RS are reported, 38.331
|
||||
for (ssb_idx = 0; ssb_idx < 2; ssb_idx++) {
|
||||
ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.CRI_SSBRI[ssb_idx];
|
||||
}
|
||||
|
||||
strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.RSRP);
|
||||
ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp;
|
||||
|
||||
if(ssb_rsrp[idx * nb_of_csi_ssb_report] > better_rsrp_reported) {
|
||||
better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report];
|
||||
target_ssb_beam_index = idx * nb_of_csi_ssb_report;
|
||||
}
|
||||
|
||||
ssb_rsrp[idx * nb_of_csi_ssb_report + 1] = get_diff_rsrp(sched_ctrl->CSI_report[UE_id][idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx], strongest_ssb_rsrp);
|
||||
|
||||
if(ssb_rsrp[idx * nb_of_csi_ssb_report + 1] > better_rsrp_reported) {
|
||||
better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report + 1];
|
||||
target_ssb_beam_index = idx * nb_of_csi_ssb_report + 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if(ssb_index[target_ssb_beam_index] != ssb_index[curr_ssb_beam_index] && ssb_rsrp[target_ssb_beam_index] > ssb_rsrp[curr_ssb_beam_index]) {
|
||||
if( ssb_rsrp[target_ssb_beam_index] - ssb_rsrp[curr_ssb_beam_index] > L1_RSRP_HYSTERIS) {
|
||||
is_triggering_ssb_beam_switch = 1;
|
||||
LOG_I(MAC, "Triggering ssb beam switching using tci\n");
|
||||
LOG_D(MAC, "Triggering ssb beam switching using tci\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1430,13 +1394,11 @@ void extract_pucch_csi_report (NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
|
||||
UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report = 0;
|
||||
for ( csi_report_id =0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++ ) {
|
||||
//Assuming in periodic reporting for one slot can be configured with only one CSI-ReportConfig
|
||||
// if (csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]->reportConfigType.present == NR_CSI_ReportConfig__reportConfigType_PR_periodic) {
|
||||
//Has to implement according to reportSlotConfig type
|
||||
/*reportQuantity must be considered according to the current scheduled
|
||||
CSI-ReportConfig if multiple CSI-ReportConfigs present*/
|
||||
reportQuantity_type = UE_info->csi_report_template[UE_id][csi_report_id].reportQuantity_type;
|
||||
LOG_I(PHY,"SFN/SF:%d%d reportQuantity type = %d\n",frame,slot,reportQuantity_type);
|
||||
LOG_D(PHY,"SFN/SF:%d%d reportQuantity type = %d\n",frame,slot,reportQuantity_type);
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP == reportQuantity_type) {
|
||||
@@ -1477,7 +1439,7 @@ void extract_pucch_csi_report (NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
*(UE_info->csi_report_template[UE_id][csi_report_id].CSI_Index_list[cri_ssbri_bitlen>0?((*payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
|
||||
|
||||
*payload >>= cri_ssbri_bitlen;
|
||||
LOG_I(PHY,"SSB_index = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]);
|
||||
LOG_D(PHY,"SSB_index = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]);
|
||||
}
|
||||
|
||||
reverse_n_bits(payload, 7);
|
||||
@@ -1490,63 +1452,13 @@ void extract_pucch_csi_report (NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
*payload >>= 4;
|
||||
}
|
||||
UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report++;
|
||||
LOG_I(MAC,"csi_payload size = %d, rsrp_id = %d\n",payload_size, sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
|
||||
LOG_D(MAC,"csi_payload size = %d, rsrp_id = %d\n",payload_size, sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
|
||||
}
|
||||
}
|
||||
|
||||
if ( !(reportQuantity_type))
|
||||
AssertFatal(reportQuantity_type, "reportQuantity is not configured");
|
||||
|
||||
#if 0
|
||||
|
||||
if ( NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1 == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1_CQI == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI== reportQuantity_type) {
|
||||
// Handling of extracting cri
|
||||
sched_ctrl->CSI_report[UE_id][cqi_idx].choice.cri_ri_li_pmi_cqi_report.cri = calloc ( 1, ceil(bitlen_cri/8));
|
||||
*(sched_ctrl->CSI_report[UE_id][cqi_idx].choice.cri_ri_li_pmi_cqi_report.cri) = *((uint32_t *)payload) & ~(~1<<(bitlen_cri-1));
|
||||
*payload >>= bitlen_cri;
|
||||
|
||||
if ( 1 == RC.nrrrc[gnb_mod_idP]->carrier.pdsch_AntennaPorts ) {
|
||||
/** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */
|
||||
sched_ctrl->CSI_report[UE_id][cqi_idx].choice.cri_ri_li_pmi_cqi_report->ri = NULL;
|
||||
} else {
|
||||
//Handling for the ri for multiple csi ports
|
||||
}
|
||||
}
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI== reportQuantity_type) {
|
||||
if ( 1 == RC.nrrrc[gnb_mod_idP]->carrier.pdsch_AntennaPorts )
|
||||
/** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */
|
||||
sched_ctrl->CSI_report[UE_id][cqi_idx].choice.cri_ri_li_pmi_cqi_report->li = NULL;
|
||||
else {
|
||||
//Handle for li for multiple CSI ports
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: check for zero padding if available shift payload to the number of zero padding bits
|
||||
|
||||
if ( NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI== reportQuantity_type) {
|
||||
if ( 1 == RC.nrrrc[gnb_mod_idP]->carrier.pdsch_AntennaPorts ) {
|
||||
/** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */
|
||||
sched_ctrl->CSI_report[UE_id][cqi_idx].choice.cri_ri_li_pmi_cqi_report->pmi_x1 = NULL;
|
||||
sched_ctrl->CSI_report[UE_id][cqi_idx].choice.cri_ri_li_pmi_cqi_report->pmi_x2 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if ( NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1_CQI == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI == reportQuantity_type ||
|
||||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI== reportQuantity_type) {
|
||||
/** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */
|
||||
*(sched_ctrl->CSI_report[UE_id][cqi_idx].choice.cri_ri_li_pmi_cqi_report->cqi) = *(payload) & 0x0f;
|
||||
*(payload) >>= 4;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user