From 2959b347043ad6b61ed428434349c062a7a09c97 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 2 Jun 2021 12:37:43 +0200 Subject: [PATCH 001/196] 2 port CSI configuration --- openair2/RRC/NR/rrc_gNB_reconfig.c | 41 +++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 88c1154cca..50b8ff308c 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1147,16 +1147,15 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0)); nzpcsi0->nzp_CSI_RS_ResourceId = 0; NR_CSI_RS_ResourceMapping_t resourceMapping; - resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2; + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); - resourceMapping.frequencyDomainAllocation.choice.row2.size = 2; - resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=0; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]=16; - resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1; + resourceMapping.frequencyDomainAllocation.choice.row2.size = 1; + resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 2; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=4; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; resourceMapping.firstOFDMSymbolInTimeDomain = 6; resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; - resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; resourceMapping.density.choice.one = (NULL_t)0; resourceMapping.freqBand.startingRB = 0; @@ -1230,15 +1229,33 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco pucchcsires1->uplinkBandwidthPartId=1; pucchcsires1->pucch_Resource=2; ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); - csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP; - csirep1->reportQuantity.choice.cri_RSRP=(NULL_t)0; + csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI; + csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0; csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration)); - csirep1->reportFreqConfiguration->cqi_FormatIndicator = NULL; - csirep1->reportFreqConfiguration->pmi_FormatIndicator=NULL; + csirep1->reportFreqConfiguration->cqi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->cqi_FormatIndicator)); + *csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; + csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator)); + *csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; csirep1->reportFreqConfiguration->csi_ReportingBand=NULL; csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; - csirep1->codebookConfig=NULL; + csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig)); + csirep1->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1; + csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1)); + csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel)); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present=NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two= + calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two)); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03; + csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1; csirep1->dummy = NULL; csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled)); From c3627daa22f295ddba197bd37bd3ad256fb0425a Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 3 Jun 2021 16:03:48 +0200 Subject: [PATCH 002/196] update in CSI meas computation, including PMI for 2 port --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 186 ++++++++++-------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 8 +- 2 files changed, 103 insertions(+), 91 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 413a57d2fd..cefcc17e0b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -149,7 +149,7 @@ void nr_schedule_pucch(int Mod_idP, //! Calculating number of bits set -uint8_t number_of_bits_set (uint8_t buf,uint8_t * max_ri){ +uint8_t number_of_bits_set (uint8_t buf){ uint8_t nb_of_bits_set = 0; uint8_t mask = 0xff; uint8_t index = 0; @@ -160,14 +160,13 @@ uint8_t number_of_bits_set (uint8_t buf,uint8_t * max_ri){ mask>>=1; } - *max_ri = 8-index; return nb_of_bits_set; } void compute_rsrp_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, uint8_t nb_resources, - nr_csi_report_t *csi_report){ + nr_csi_report_t *csi_report) { if (NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled == csi_reportconfig->groupBasedBeamReporting.present) { if (NULL != csi_reportconfig->groupBasedBeamReporting.choice.disabled->nrofReportedRS) @@ -199,42 +198,24 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, nr_csi_report_t *csi_report){ struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig; - uint8_t nb_allowed_ri, ri_restriction,ri_bitlen; - uint8_t max_ri = 0; + uint8_t nb_allowed_ri, ri_bitlen; + uint8_t ri_restriction = 0; if (codebookConfig == NULL) { csi_report->csi_meas_bitlen.ri_bitlen=0; - return max_ri; + return ri_restriction; } // codebook type1 single panel if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present){ struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two){ - // two antenna ports case - /* 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_reportconfig->dummy, "nrofCQIsPerReport is not present"); ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]; - /* Replace dummy with the nrofCQIsPerReport from the CSIreport - config when equalent ASN structure present */ - if (0==*(csi_reportconfig->dummy)){ - 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)); - } + nb_allowed_ri = number_of_bits_set(ri_restriction); + 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 csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen; } @@ -242,109 +223,122 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) { // 4 ports - AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present"); ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]; - /* Replace dummy with the nrofCQIsPerReport from the CSIreport - config when equalent ASN structure present*/ - if (0==*(csi_reportconfig->dummy)){ - 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)); - } + nb_allowed_ri = number_of_bits_set(ri_restriction); + 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 csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen; } else { // more than 4 ports - AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present"); ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]; - /* Replace dummy with the nrofCQIsPerReport from the CSIreport - config when equalent ASN structure present */ - if (0==*(csi_reportconfig->dummy)){ - 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)); - } + nb_allowed_ri = number_of_bits_set(ri_restriction); + ri_bitlen = ceil(log2(nb_allowed_ri)); + csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen; } } - return max_ri; + return ri_restriction; } else AssertFatal(1==0,"Other configurations not yet implemented\n"); } void compute_li_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, - uint8_t max_ri, + uint8_t ri_restriction, nr_csi_report_t *csi_report){ struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig; - if (codebookConfig == NULL) { - csi_report->csi_meas_bitlen.li_bitlen=0; - return; + for(int i=0; i<8; i++) { + if (codebookConfig == NULL || ((ri_restriction>>i)&0x01) == 0) + csi_report->csi_meas_bitlen.li_bitlen[i]=0; + else { + // codebook type1 single panel + if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present) + csi_report->csi_meas_bitlen.li_bitlen[i]=ceil(log2(i+1))<2?ceil(log2(i+1)):2; + else + AssertFatal(1==0,"Other configurations not yet implemented\n"); + } } - // codebook type1 single panel - if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present){ - /* 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. - csi_report->csi_meas_bitlen.li_bitlen=ceil(log2(max_ri))<2?ceil(log2(max_ri)):2; - } - else - AssertFatal(1==0,"Other configurations not yet implemented\n"); } +void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, + uint8_t ri_restriction, + nr_csi_report_t *csi_report){ + + struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig; + for(int i=0; i<8; i++) { + csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=0; + csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=0; + if (codebookConfig == NULL || ((ri_restriction>>i)&0x01) == 0) + return; + else { + if(codebookConfig->codebookType.present == NR_CodebookConfig__codebookType_PR_type1) { + if(codebookConfig->codebookType.choice.type1->subType.present == NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) { + if(codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present == + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) { + if (i==0) + csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=2; + if (i==1) + csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=1; + } + else + AssertFatal(1==0,"More than 2 port not yet implemented\n"); + } + else + AssertFatal(1==0,"Type1 Multi-panel Codebook Config not yet implemented\n"); + } + else + AssertFatal(1==0,"Type2 Codebook Config not yet implemented\n"); + } + } +} + void compute_cqi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, - uint8_t max_ri, + uint8_t ri_restriction, nr_csi_report_t *csi_report){ struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig; struct NR_CSI_ReportConfig__reportFreqConfiguration *freq_config = csi_reportconfig->reportFreqConfiguration; if (*freq_config->cqi_FormatIndicator == NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI) { - csi_report->csi_meas_bitlen.cqi_bitlen = 4; - if(codebookConfig != NULL) { - if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel == codebookConfig->codebookType.choice.type1->subType.present){ - struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; - if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) { - if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present > - NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) { - // more than 4 antenna ports - if (max_ri > 4) - csi_report->csi_meas_bitlen.cqi_bitlen += 4; // CQI for second TB + for(int i=0; i<8; i++) { + if ((ri_restriction>>i)&0x01) { + csi_report->csi_meas_bitlen.cqi_bitlen[i] = 4; + if(codebookConfig != NULL) { + if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel == codebookConfig->codebookType.choice.type1->subType.present){ + struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; + if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) { + if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present > + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) { + // more than 4 antenna ports + if (i > 4) + csi_report->csi_meas_bitlen.cqi_bitlen[i] += 4; // CQI for second TB + } + } } } } + else + csi_report->csi_meas_bitlen.cqi_bitlen[i] = 0; } } else AssertFatal(1==0,"Sub-band CQI reporting not yet supported"); } + //!TODO : same function can be written to handle csi_resources void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_info, int UE_id, module_id_t Mod_idP){ uint8_t csi_report_id = 0; uint8_t nb_resources = 0; - uint8_t max_ri = 0; + uint8_t ri_restriction; NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type; NR_CSI_ResourceConfigId_t csi_ResourceConfigId; struct NR_CSI_ResourceConfig *csi_resourceconfig; @@ -417,8 +411,14 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in break; case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI): csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources)); - max_ri = compute_ri_bitlen(csi_reportconfig, csi_report); - compute_cqi_bitlen(csi_reportconfig, max_ri, csi_report); + ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); + compute_cqi_bitlen(csi_reportconfig, ri_restriction, csi_report); + break; + case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI): + csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources)); + ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); + compute_cqi_bitlen(csi_reportconfig, ri_restriction, csi_report); + compute_pmi_bitlen(csi_reportconfig, ri_restriction, csi_report); break; default: AssertFatal(1==0,"Not yet supported CSI report quantity type"); @@ -431,7 +431,8 @@ uint16_t nr_get_csi_bitlen(int Mod_idP, int UE_id, uint8_t csi_report_id) { - uint16_t csi_bitlen =0; + uint16_t csi_bitlen = 0; + uint16_t max_bitlen = 0; NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; L1_RSRP_bitlen_t * CSI_report_bitlen = NULL; CSI_Meas_bitlen_t * csi_meas_bitlen = NULL; @@ -444,7 +445,18 @@ uint16_t nr_get_csi_bitlen(int Mod_idP, (CSI_report_bitlen->nb_ssbri_cri -1 ))); } else{ csi_meas_bitlen = &(UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen); //This might need to be moodif for Aperiodic CSI-RS measurements - csi_bitlen+= (csi_meas_bitlen->cri_bitlen +csi_meas_bitlen->ri_bitlen+csi_meas_bitlen->li_bitlen+csi_meas_bitlen->cqi_bitlen+csi_meas_bitlen->pmi_x1_bitlen+csi_meas_bitlen->pmi_x2_bitlen); + uint16_t temp_bitlen; + for (int i=0; i<8; i++) { + temp_bitlen = (csi_meas_bitlen->cri_bitlen+ + csi_meas_bitlen->ri_bitlen+ + csi_meas_bitlen->li_bitlen[i]+ + csi_meas_bitlen->cqi_bitlen[i]+ + csi_meas_bitlen->pmi_x1_bitlen[i]+ + csi_meas_bitlen->pmi_x2_bitlen[i]); + if(temp_bitlen>max_bitlen) + max_bitlen = temp_bitlen; + } + csi_bitlen += max_bitlen; } return csi_bitlen; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 3ef1042eac..0f89d5624f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -469,10 +469,10 @@ typedef struct { typedef struct{ uint8_t cri_bitlen; uint8_t ri_bitlen; - uint8_t li_bitlen; - uint8_t pmi_x1_bitlen; - uint8_t pmi_x2_bitlen; - uint8_t cqi_bitlen; + uint8_t li_bitlen[8]; + uint8_t pmi_x1_bitlen[8]; + uint8_t pmi_x2_bitlen[8]; + uint8_t cqi_bitlen[8]; } CSI_Meas_bitlen_t; typedef struct nr_csi_report { From 9cda0a0cede01d346c13bdffb24d9bfe9f9b828b Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 4 Jun 2021 09:54:01 +0200 Subject: [PATCH 003/196] update in CSI report evaluation including PMI --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 146 ++++++++++++++---- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + 2 files changed, 114 insertions(+), 33 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index cefcc17e0b..8ab42af750 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -284,9 +284,9 @@ void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, if(codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) { if (i==0) - csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=2; + csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=2; if (i==1) - csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=1; + csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=1; } else AssertFatal(1==0,"More than 2 port not yet implemented\n"); @@ -338,7 +338,6 @@ void compute_cqi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_info, int UE_id, module_id_t Mod_idP){ uint8_t csi_report_id = 0; uint8_t nb_resources = 0; - uint8_t ri_restriction; NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type; NR_CSI_ResourceConfigId_t csi_ResourceConfigId; struct NR_CSI_ResourceConfig *csi_resourceconfig; @@ -411,14 +410,14 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in break; case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI): csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources)); - ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); - compute_cqi_bitlen(csi_reportconfig, ri_restriction, csi_report); + csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); + compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); break; case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI): csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources)); - ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); - compute_cqi_bitlen(csi_reportconfig, ri_restriction, csi_report); - compute_pmi_bitlen(csi_reportconfig, ri_restriction, csi_report); + csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); + compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); + compute_pmi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); break; default: AssertFatal(1==0,"Not yet supported CSI report quantity type"); @@ -870,7 +869,8 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, int *cumul_bits, NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type){ - uint8_t cri_ssbri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen; + nr_csi_report_t *csi_report = &UE_info->csi_report_template[UE_id][csi_report_id]; + uint8_t cri_ssbri_bitlen = csi_report->CSI_report_bitlen.cri_ssbri_bitlen; uint16_t curr_payload; /*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report @@ -892,17 +892,17 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, */ int idx = 0; //Since for SSB RSRP reporting in RRC can configure only one ssb resource set per one report config - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri = UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.nb_ssbri_cri; + sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits); if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = - *(UE_info->csi_report_template[UE_id][csi_report_id].SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); + *(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); else sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = - *(UE_info->csi_report_template[UE_id][csi_report_id].CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); + *(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *cumul_bits += cri_ssbri_bitlen; LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); @@ -917,7 +917,7 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, sched_ctrl->CSI_report[idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; *cumul_bits += 4; } - UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report++; + csi_report->nb_of_csi_ssb_report++; LOG_D(MAC,"rsrp_id = %d rsrp = %d\n", sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP, get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP)); @@ -935,33 +935,96 @@ void evaluate_cri_report(uint8_t *payload, sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.cri = temp_cri; } -void evaluate_ri_report(uint8_t *payload, - uint8_t ri_bitlen, - NR_UE_sched_ctrl_t *sched_ctrl){ +int evaluate_ri_report(uint8_t *payload, + uint8_t ri_bitlen, + uint8_t ri_restriction, + int cumul_bits, + NR_UE_sched_ctrl_t *sched_ctrl){ - AssertFatal(1==0,"Evaluation of RI report not yet implemented\n"); + int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? + uint8_t ri_index = pickandreverse_bits(payload, ri_bitlen, cumul_bits); + int count=0; + for (int i=0; i<8; i++) { + if ((ri_restriction>>i)&0x01) { + if(count == ri_index) { + sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.ri = i; + LOG_I(MAC,"CSI Reported Rank %d\n", i+1); + return i; + } + count++; + } + } + AssertFatal(1==0, "Decoded ri %d does not correspond to any valid value in ri_restriction %d\n",ri_index,ri_restriction); } void evaluate_cqi_report(uint8_t *payload, - uint8_t cqi_bitlen, - int *cumul_bits, + nr_csi_report_t *csi_report, + int cumul_bits, + uint8_t ri, NR_UE_sched_ctrl_t *sched_ctrl){ //TODO sub-band CQI report not yet implemented int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? - - uint8_t temp_cqi = pickandreverse_bits(payload, 4, *cumul_bits); + int cqi_bitlen = csi_report->csi_meas_bitlen.cqi_bitlen[ri]; + + uint8_t temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); + sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; - *cumul_bits += 4; LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); if (cqi_bitlen > 4) { - temp_cqi = pickandreverse_bits(payload, 4, *cumul_bits); + temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; LOG_D(MAC,"Wide-band CQI for the second TB %d\n", temp_cqi); } } + +uint8_t evaluate_pmi_report(uint8_t *payload, + nr_csi_report_t *csi_report, + int cumul_bits, + uint8_t ri, + NR_UE_sched_ctrl_t *sched_ctrl){ + + int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? + int x1_bitlen = csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]; + int x2_bitlen = csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri]; + int tot_bitlen = x1_bitlen + x2_bitlen; + + //in case of 2 port CSI configuration x1 is empty and the information bits are in x2 + int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits); + + sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x1, + sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x2); + + return tot_bitlen; + +} + + +void skip_zero_padding(int *cumul_bits, + nr_csi_report_t *csi_report, + uint8_t ri, + uint16_t max_bitlen) { + + // actual number of reported bits depends on the reported rank + // zero padding bits are added to have a predetermined max bit length to decode + + uint16_t reported_bitlen = csi_report->csi_meas_bitlen.cri_bitlen+ + csi_report->csi_meas_bitlen.ri_bitlen+ + csi_report->csi_meas_bitlen.li_bitlen[ri]+ + csi_report->csi_meas_bitlen.cqi_bitlen[ri]+ + csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]+ + csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri]; + + cumul_bits+=(max_bitlen-reported_bitlen); + +} + + void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu, frame_t frame, @@ -974,21 +1037,24 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, RC.nrmac[Mod_idP]->common_channels->ServingCellConfigCommon; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; uint8_t *payload = uci_pdu->csi_part1.csi_part1_payload; + uint16_t bitlen = uci_pdu->csi_part1.csi_part1_bit_len; NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type = NR_CSI_ReportConfig__reportQuantity_PR_NOTHING; NR_UE_info_t *UE_info = &(RC.nrmac[Mod_idP]->UE_info); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; int cumul_bits = 0; + int r_index = -1; for (int csi_report_id = 0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++ ) { - UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report = 0; + nr_csi_report_t *csi_report = &UE_info->csi_report_template[UE_id][csi_report_id]; + csi_report->nb_of_csi_ssb_report = 0; uint8_t cri_bitlen = 0; uint8_t ri_bitlen = 0; - uint8_t cqi_bitlen = 0; + uint8_t pmi_bitlen = 0; NR_CSI_ReportConfig_t *csirep = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]; int period, offset; csi_period_offset(csirep, NULL, &period, &offset); // verify if report with current id has been scheduled for this frame and slot if ((n_slots_frame*frame + slot - offset)%period == 0) { - reportQuantity_type = UE_info->csi_report_template[UE_id][csi_report_id].reportQuantity_type; + reportQuantity_type = csi_report->reportQuantity_type; LOG_I(MAC,"SFN/SF:%d/%d reportQuantity type = %d\n",frame,slot,reportQuantity_type); switch(reportQuantity_type){ case NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP: @@ -998,18 +1064,32 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, evaluate_rsrp_report(UE_info,sched_ctrl,UE_id,csi_report_id,payload,&cumul_bits,reportQuantity_type); break; case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI: - cri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cri_bitlen; + cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; if(cri_bitlen) evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl); cumul_bits += cri_bitlen; - ri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.ri_bitlen; + ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen; if(ri_bitlen) - evaluate_ri_report(payload,ri_bitlen,sched_ctrl); + r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl); cumul_bits += ri_bitlen; - //TODO add zero padding bits when needed - cqi_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cqi_bitlen; - if(cqi_bitlen) - evaluate_cqi_report(payload,cqi_bitlen,&cumul_bits,sched_ctrl); + if (r_index != -1) + skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + break; + case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI: + cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; + if(cri_bitlen) + evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl); + cumul_bits += cri_bitlen; + ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen; + if(ri_bitlen) + r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl); + cumul_bits += ri_bitlen; + if (r_index != -1) + skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); + pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + cumul_bits += pmi_bitlen; + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); break; default: AssertFatal(1==0, "Invalid or not supported CSI measurement report\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 0f89d5624f..ca8d56a618 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -467,6 +467,7 @@ typedef struct { }L1_RSRP_bitlen_t; typedef struct{ + uint8_t ri_restriction; uint8_t cri_bitlen; uint8_t ri_bitlen; uint8_t li_bitlen[8]; From 4b0883f2e06a7ba503f9aae3eebdb2abb00f9273 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 4 Jun 2021 11:56:15 +0200 Subject: [PATCH 004/196] adding cri_RI_LI_PMI_CQI option --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 8ab42af750..d7480e08e3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -419,6 +419,13 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); compute_pmi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); break; + case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI): + csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources)); + csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); + compute_li_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); + compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); + compute_pmi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); + break; default: AssertFatal(1==0,"Not yet supported CSI report quantity type"); } @@ -1005,6 +1012,24 @@ uint8_t evaluate_pmi_report(uint8_t *payload, } +int evaluate_li_report(uint8_t *payload, + nr_csi_report_t *csi_report, + int cumul_bits, + uint8_t ri, + NR_UE_sched_ctrl_t *sched_ctrl){ + + int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? + int li_bitlen = csi_report->csi_meas_bitlen.li_bitlen[ri]; + + if (li_bitlen>0) { + int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits); + LOG_I(MAC,"LI %d\n",temp_li); + sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.li = temp_li; + } + return li_bitlen; + +} + void skip_zero_padding(int *cumul_bits, nr_csi_report_t *csi_report, uint8_t ri, @@ -1048,6 +1073,7 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, csi_report->nb_of_csi_ssb_report = 0; uint8_t cri_bitlen = 0; uint8_t ri_bitlen = 0; + uint8_t li_bitlen = 0; uint8_t pmi_bitlen = 0; NR_CSI_ReportConfig_t *csirep = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]; int period, offset; @@ -1091,6 +1117,23 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, cumul_bits += pmi_bitlen; evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); break; + case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI: + cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; + if(cri_bitlen) + evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl); + cumul_bits += cri_bitlen; + ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen; + if(ri_bitlen) + r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl); + cumul_bits += ri_bitlen; + li_bitlen = evaluate_li_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + cumul_bits += li_bitlen; + if (r_index != -1) + skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); + pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + cumul_bits += pmi_bitlen; + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + break; default: AssertFatal(1==0, "Invalid or not supported CSI measurement report\n"); } From c114c245de046a85082ee393178cdc58569a5b11 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 4 Jun 2021 18:19:54 +0200 Subject: [PATCH 005/196] adding rrc parameter csi-ReportingBand --- openair2/RRC/NR/rrc_gNB_reconfig.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 50b8ff308c..1738575ecb 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1236,7 +1236,12 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco *csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator)); *csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; - csirep1->reportFreqConfiguration->csi_ReportingBand=NULL; + csirep1->reportFreqConfiguration->csi_ReportingBand = calloc(1,sizeof(*csirep1->reportFreqConfiguration->csi_ReportingBand)); + csirep1->reportFreqConfiguration->csi_ReportingBand->present = NR_CSI_ReportConfig__reportFreqConfiguration__csi_ReportingBand_PR_subbands7; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.size=1; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands14.bits_unused=1; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands14.buf=malloc(1); + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands14.buf[0]=254; csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig)); @@ -1262,7 +1267,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); *csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; csirep1->cqi_Table = NULL; - csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value1; + csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2; csirep1->non_PMI_PortIndication = NULL; csirep1->ext1 = NULL; From 4819b14671742eb1291cb956409608c9b86e9cc8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 7 Jun 2021 17:36:16 +0200 Subject: [PATCH 006/196] bitlen for typeI single panel --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 205 +++++++++++++++++- 1 file changed, 203 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index d7480e08e3..5342f82faf 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -268,6 +268,202 @@ void compute_li_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, } +void get_n1n2_o1o2_singlepanel(int *n1, int *n2, int *o1, int *o2, + struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo *morethantwo) { + + // Table 5.2.2.2.1-2 in 38.214 for supported configurations + switch(morethantwo->n1_n2.present){ + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction): + *n1 = 2; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction): + *n1 = 2; + *n2 = 2; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction): + *n1 = 4; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction): + *n1 = 3; + *n2 = 2; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction): + *n1 = 6; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction): + *n1 = 4; + *n2 = 2; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction): + *n1 = 8; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction): + *n1 = 4; + *n2 = 3; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction): + *n1 = 4; + *n2 = 2; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction): + *n1 = 12; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction): + *n1 = 4; + *n2 = 4; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction): + *n1 = 8; + *n2 = 2; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction): + *n1 = 16; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + default: + AssertFatal(1==0,"Not supported configuration for n1_n2 in codebook configuration"); + } +} + +void get_x1x2_bitlen_singlepanel(int n1, int n2, int o1, int o2, + int *x1, int *x2, int rank, int codebook_mode) { + + // Table 6.3.1.1.2-1 in 38.212 + switch(rank){ + case 1: + if(n2>1) { + if (codebook_mode == 1) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 2; + } + else { + *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2/2)); + *x2 = 4; + } + } + else{ + if (codebook_mode == 1) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 2; + } + else { + *x1 = ceil(log2(n1*o1/2)); + *x2 = 4; + } + } + break; + case 2: + if(n1*n2 == 2) { + if (codebook_mode == 1) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 1; + } + else { + *x1 = ceil(log2(n1*o1/2)); + *x2 = 3; + } + *x1 += 1; + } + else { + if(n2>1) { + if (codebook_mode == 1) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 3; + } + else { + *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2/2)); + *x2 = 3; + } + } + else{ + if (codebook_mode == 1) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 1; + } + else { + *x1 = ceil(log2(n1*o1/2)); + *x2 = 3; + } + } + *x1 += 2; + } + break; + case 3: + case 4: + if(n1*n2 == 2) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 1; + } + else { + if(n1*n2 >= 8) { + *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2)) + 2; + *x2 = 1; + } + else { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)) + 2; + *x2 = 1; + } + } + break; + case 5: + case 6: + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 1; + break; + case 7: + case 8: + if(n1 == 4 && n2 == 1) { + *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2)); + *x2 = 1; + } + else { + if(n1 > 2 && n2 == 2) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2/2)); + *x2 = 1; + } + else { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 1; + } + } + break; + default: + AssertFatal(1==0,"Invalid rank in x1 x2 bit length computation\n"); + } +} + + void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, uint8_t ri_restriction, nr_csi_report_t *csi_report){ @@ -288,8 +484,13 @@ void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, if (i==1) csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=1; } - else - AssertFatal(1==0,"More than 2 port not yet implemented\n"); + else { // more than two + int n1,n2,o1,o2,x1,x2; + get_n1n2_o1o2_singlepanel(&n1,&n2,&o1,&o2,codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo); + get_x1x2_bitlen_singlepanel(n1,n2,o1,o2,&x1,&x2,i+1,codebookConfig->codebookType.choice.type1->codebookMode); + csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=x1; + csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=x2; + } } else AssertFatal(1==0,"Type1 Multi-panel Codebook Config not yet implemented\n"); From 601381cb44676a509e6b0f8188275f4154a57dff Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 8 Jun 2021 08:47:55 +0200 Subject: [PATCH 007/196] another tentative change of configuration for 2 port CSI --- openair2/RRC/NR/rrc_gNB_reconfig.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 1738575ecb..c656c47e67 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1159,7 +1159,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; resourceMapping.density.choice.one = (NULL_t)0; resourceMapping.freqBand.startingRB = 0; - resourceMapping.freqBand.nrofRBs = 104; + resourceMapping.freqBand.nrofRBs = 108; nzpcsi0->resourceMapping = resourceMapping; nzpcsi0->powerControlOffset = 0; nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); @@ -1264,9 +1264,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csirep1->dummy = NULL; csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled)); - csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); - *csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; - csirep1->cqi_Table = NULL; + //csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); + //*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; + csirep1->cqi_Table = calloc(1,sizeof(*csirep1->cqi_Table)); + *csirep1->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1; csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2; csirep1->non_PMI_PortIndication = NULL; csirep1->ext1 = NULL; From 3dbf4e94cb0278c4ee8497068428e4189b814779 Mon Sep 17 00:00:00 2001 From: Eurecom Date: Sun, 30 May 2021 23:14:12 +0200 Subject: [PATCH 008/196] handling for UL failure. added do_precoding flag to nr-ru procedures. testing with 2x2 N310. --- executables/nr-gnb.c | 2 +- executables/nr-ru.c | 1 + openair1/PHY/INIT/nr_init_ru.c | 3 +- openair1/PHY/NR_TRANSPORT/nr_ulsch.c | 2 +- openair1/SCHED_NR/nr_ru_procedures.c | 24 +- openair2/COMMON/rrc_messages_types.h | 1 + openair2/ENB_APP/enb_paramdef.h | 6 +- openair2/F1AP/f1ap_cu_ue_context_management.c | 66 ++-- openair2/F1AP/f1ap_du_ue_context_management.c | 31 +- openair2/GNB_APP/gnb_config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 59 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 1 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 1 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 7 +- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 2 +- openair2/RRC/NR/L2_nr_interface.c | 22 +- openair2/RRC/NR/rrc_gNB.c | 291 +++++++++++++++++- openair2/RRC/NR/rrc_gNB_NGAP.c | 16 + openair2/RRC/NR/rrc_gNB_NGAP.h | 4 + targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 80 ++--- 21 files changed, 501 insertions(+), 121 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index ea675eba9e..0665db8810 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -356,7 +356,7 @@ void *nrL1_stats_thread(void *param) { while (!oai_exit) { sleep(1); fd=fopen("nrL1_stats.log","w"); - AssertFatal(fd!=NULL,"Cannot open ngL1_stats.log\n"); + AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n"); dump_nr_I0_stats(fd,gNB); dump_pusch_stats(fd,gNB); // nr_dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx); diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 421ff4ad3e..b75e5c2247 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -2049,6 +2049,7 @@ static void NRRCconfig_RU(void) RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr); RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr); RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr); + RC.ru[j]->do_precoding = *(RUParamList.paramarray[j][RU_DO_PRECODING].iptr); if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) { RC.ru[j]->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt; diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index 8189a7ab34..5de9d7f495 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -138,8 +138,9 @@ int nr_phy_init_RU(RU_t *ru) { ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); for (j=0; jnb_tx; j++) { ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); + AssertFatal(ru->bw_list[i],"ru->bw_list[%d] is null\n",i); for (re=0; reofdm_symbol_size; re++) - ru->beam_weights[i][p][j][re] = ru->bw_list[j][l_ind]; + ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind]; //printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j); l_ind++; } // for j diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c index 53ff90404b..35169303ec 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c @@ -150,7 +150,7 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) { gNB->ulsch_stats[i].rnti, aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10, aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10); - else stroff+=sprintf(output+stroff," ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d\n", + else stroff+=sprintf(output+stroff," ulsch_power[%d] %d.%d ulsch_noise_power[%d] %d.%d\n", aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10, aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10); diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index c8042ecec3..d858a8a641 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -197,18 +197,17 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+j , 1); start_meas(&ru->txdataF_copy_stats); - if (ru->num_gNB == 1){ - gNB = ru->gNB_list[0]; - cfg = &gNB->gNB_config; + AssertFatal(ru->num_gNB==1,"num_gNB>1, help\n"); + gNB = ru->gNB_list[0]; + cfg = &gNB->gNB_config; - for(i=0; inb_tx; ++i){ - memcpy((void*)&ru->common.txdataF[i][j*fp->ofdm_symbol_size], - (void*)&gNB->common_vars.txdataF[i][j*fp->ofdm_symbol_size + txdataF_offset], - fp->ofdm_symbol_size*sizeof(int32_t)); + for(i=0; inb_tx; ++i){ + memcpy((void*)&ru->common.txdataF[i][j*fp->ofdm_symbol_size], + (void*)&gNB->common_vars.txdataF[i][j*fp->ofdm_symbol_size + txdataF_offset], + fp->ofdm_symbol_size*sizeof(int32_t)); - } + } - }//num_gNB == 1 stop_meas(&ru->txdataF_copy_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+j , 0); @@ -317,6 +316,13 @@ static void *nr_feptx_thread(void *param) { (void*)&ru->gNB_list[0]->common_vars.txdataF[0][txdataF_offset + l*fp->ofdm_symbol_size], (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); } + else if (ru->do_precoding == 0) { + int gNB_tx = ru->gNB_list[0]->frame_parms.nb_antennas_tx; + for (int aa=0;aanb_tx;aa++) + memcpy((void*)&ru->common.txdataF_BF[aa][l*fp->ofdm_symbol_size], + (void*)&ru->gNB_list[0]->common_vars.txdataF[aa%gNB_tx][txdataF_offset + l*fp->ofdm_symbol_size], + (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); + } else { bw = ru->beam_weights[0]; for(i=0; isymbols_per_slot>>1; ++i){ diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 64c42eaf0e..220ef60b3d 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -405,6 +405,7 @@ typedef struct NRRrcConfigurationReq_s { uint16_t mcc[PLMN_LIST_MAX_SIZE]; uint16_t mnc[PLMN_LIST_MAX_SIZE]; uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE]; + uint8_t num_plmn; NR_ServingCellConfigCommon_t *scc; NR_ServingCellConfig_t *scd; int ssb_SubcarrierOffset; diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index f26863414c..79e66881b5 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -98,6 +98,7 @@ typedef enum { #define CONFIG_STRING_RU_BF_WEIGHTS_LIST "bf_weights" #define CONFIG_STRING_RU_IF_FREQUENCY "if_freq" #define CONFIG_STRING_RU_IF_FREQ_OFFSET "if_offset" +#define CONFIG_STRING_RU_DO_PRECODING "do_precoding" #define RU_LOCAL_IF_NAME_IDX 0 #define RU_LOCAL_ADDRESS_IDX 1 @@ -127,7 +128,7 @@ typedef enum { #define RU_BF_WEIGHTS_LIST_IDX 25 #define RU_IF_FREQUENCY 26 #define RU_IF_FREQ_OFFSET 27 - +#define RU_DO_PRECODING 28 /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* RU configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -160,7 +161,8 @@ typedef enum { {CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \ {CONFIG_STRING_RU_BF_WEIGHTS_LIST, NULL, 0, iptr:NULL, defintarrayval:DEFBFW, TYPE_INTARRAY, 0}, \ {CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, u64ptr:NULL, defuintval:0, TYPE_UINT64, 0}, \ - {CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ } /*---------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.c b/openair2/F1AP/f1ap_cu_ue_context_management.c index 317f0058b2..da723ba5a3 100644 --- a/openair2/F1AP/f1ap_cu_ue_context_management.c +++ b/openair2/F1AP/f1ap_cu_ue_context_management.c @@ -39,8 +39,10 @@ #include "rrc_extern.h" #include "rrc_eNB_UE_context.h" +#include "openair2/RRC/NR/rrc_gNB_UE_context.h" #include "rrc_eNB_S1AP.h" #include "rrc_eNB_GTPV1U.h" +#include "openair2/RRC/NR/rrc_gNB_NGAP.h" extern f1ap_setup_req_t *f1ap_du_data_from_du; extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB]; @@ -1029,35 +1031,55 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, // F1AP_CriticalityDiagnostics_IE_List } - struct rrc_eNB_ue_context_s *ue_context_p = - rrc_eNB_get_ue_context(RC.rrc[instance], rnti); protocol_ctxt_t ctxt; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, instance, ENB_FLAG_YES, rnti, 0, 0, instance); - if (ue_context_p) { - /* The following is normally done in the function rrc_rx_tx() */ - rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(instance, - ue_context_p->ue_context.eNB_ue_s1ap_id); + if (RC.nrrrc[instance]->node_type == ngran_gNB_CU) { + struct rrc_gNB_ue_context_s *ue_context_p = + rrc_gNB_get_ue_context(RC.nrrrc[instance], rnti); - rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(instance, ue_context_p); - // erase data of GTP tunnels in UE context - for (int e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) { - ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0; - memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab], - 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab])); - ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0; + if (ue_context_p) { + MessageDef *msg = itti_alloc_new_message(TASK_CU_F1, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE); + NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = ue_context_p->ue_context.gNB_ue_ngap_id; + itti_send_msg_to_task(TASK_NGAP, instance, msg); + + rrc_gNB_remove_ue_context(&ctxt, RC.nrrrc[instance], ue_context_p); + } else { + LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti); } +#ifdef ITTI_SIM + return 0; +#endif - struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids = - rrc_eNB_S1AP_get_ue_ids(RC.rrc[instance], 0, - ue_context_p->ue_context.eNB_ue_s1ap_id); - if (rrc_ue_s1ap_ids) - rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids); - - /* trigger UE release in RRC */ - rrc_eNB_remove_ue_context(&ctxt, RC.rrc[instance], ue_context_p); } else { - LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti); + struct rrc_eNB_ue_context_s *ue_context_p = + rrc_eNB_get_ue_context(RC.rrc[instance], rnti); + + if (ue_context_p) { + /* The following is normally done in the function rrc_rx_tx() */ + rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(instance, + ue_context_p->ue_context.eNB_ue_s1ap_id); + + rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(instance, ue_context_p); + // erase data of GTP tunnels in UE context + for (int e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) { + ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0; + memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab], + 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab])); + ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0; + } + + struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids = + rrc_eNB_S1AP_get_ue_ids(RC.rrc[instance], 0, + ue_context_p->ue_context.eNB_ue_s1ap_id); + if (rrc_ue_s1ap_ids) + rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids); + + /* trigger UE release in RRC */ + rrc_eNB_remove_ue_context(&ctxt, RC.rrc[instance], ue_context_p); + } else { + LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti); + } } pdcp_remove_UE(&ctxt); diff --git a/openair2/F1AP/f1ap_du_ue_context_management.c b/openair2/F1AP/f1ap_du_ue_context_management.c index b79e9feb58..2a26762179 100644 --- a/openair2/F1AP/f1ap_du_ue_context_management.c +++ b/openair2/F1AP/f1ap_du_ue_context_management.c @@ -38,6 +38,8 @@ #include "rrc_extern.h" #include "rrc_eNB_UE_context.h" +#include "openair2/RRC/NR/rrc_gNB_UE_context.h" +#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" // undefine C_RNTI from // openair1/PHY/LTE_TRANSPORT/transport_common.h which @@ -664,11 +666,21 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, rnti, ctxt.rnti); int UE_out_of_sync = 0; - for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) { - if (RC.mac[instance]->UE_info.active[n] == TRUE - && rnti == UE_RNTI(instance, n)) { - UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync; - break; + if (RC.nrrrc[instance]->node_type == ngran_gNB_DU) { + for (int n = 0; n < MAX_MOBILES_PER_GNB; ++n) { + if (RC.nrmac[instance]->UE_info.active[n] == TRUE + && rnti == RC.nrmac[instance]->UE_info.rnti[n]) { + UE_out_of_sync = 0; + break; + } + } + } else { + for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) { + if (RC.mac[instance]->UE_info.active[n] == TRUE + && rnti == UE_RNTI(instance, n)) { + UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync; + break; + } } } @@ -718,6 +730,15 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, } } + if (RC.nrrrc[instance]->node_type == ngran_gNB_DU) { + // struct rrc_gNB_ue_context_s *ue_context_p; + + f1ap_ue_context_release_cplt_t cplt; + cplt.rnti = ctxt.rnti; + DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance, &cplt); + return 0; + } + struct rrc_eNB_ue_context_s *ue_context_p; ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.module_id], ctxt.rnti); diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 456d7cd6de..94337ecb58 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1028,7 +1028,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { AssertFatal(0, "The number of PLMN IDs must be in [1,6], but is %d\n", PLMNParamList.numelt); - RRC_CONFIGURATION_REQ(msg_p).num_plmn = PLMNParamList.numelt; + NRRRC_CONFIGURATION_REQ(msg_p).num_plmn = PLMNParamList.numelt; for (int l = 0; l < PLMNParamList.numelt; ++l) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index b40e411812..f17c93210e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -55,55 +55,56 @@ #include "nfapi/oai_integration/vendor_ext.h" #include "executables/nr-softmodem.h" +#include +#include + uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 }; void clear_mac_stats(gNB_MAC_INST *gNB) { memset((void*)gNB->UE_info.mac_stats,0,MAX_MOBILES_PER_GNB*sizeof(NR_mac_stats_t)); } - +#define MACSTATSSTRLEN 16384 void dump_mac_stats(gNB_MAC_INST *gNB) { NR_UE_info_t *UE_info = &gNB->UE_info; int num = 1; + FILE *fd=fopen("nrMAC_stats.log","w"); + AssertFatal(fd!=NULL,"Cannot open nrMAC_stats.log, error %s\n",strerror(errno)); + char output[MACSTATSSTRLEN]; + memset(output,0,MACSTATSSTRLEN); + int stroff=0; for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { - LOG_I(NR_MAC, "UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n", - UE_id, - UE_info->rnti[UE_id], - num++, - UE_info->num_UEs, - UE_info->UE_sched_ctrl[UE_id].ph, - UE_info->UE_sched_ctrl[UE_id].pcmax); + stroff = sprintf(output,"UE ID %d RNTI %04x (%d/%d)\n", UE_id, UE_info->rnti[UE_id], num++, UE_info->num_UEs); NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id]; const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0; - LOG_I(NR_MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n", - UE_id, - stats->dlsch_rounds[0], stats->dlsch_rounds[1], - stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, - avg_rsrp, stats->num_rsrp_meas); + stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n", + UE_id, + stats->dlsch_rounds[0], stats->dlsch_rounds[1], + stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, + avg_rsrp, stats->num_rsrp_meas); stats->num_rsrp_meas = 0; stats->cumul_rsrp = 0 ; - LOG_I(NR_MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); - const NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - LOG_I(NR_MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_errors %d, PUSCH SNR %2.1f dB, PUCCH SNR %2.1f dB, noise rssi %2.1f dB\n", - UE_id, - stats->ulsch_rounds[0], stats->ulsch_rounds[1], - stats->ulsch_rounds[2], stats->ulsch_rounds[3], - stats->ulsch_errors, - (float) sched_ctrl->pusch_snrx10 / 10, - (float) sched_ctrl->pucch_snrx10 / 10, - (float) (sched_ctrl->raw_rssi - 1280) / 10); - LOG_I(NR_MAC, - "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", - UE_id, - stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); + stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); + stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n", + UE_id, + stats->ulsch_rounds[0], stats->ulsch_rounds[1], + stats->ulsch_rounds[2], stats->ulsch_rounds[3], + stats->ulsch_DTX, + stats->ulsch_errors); + stroff+=sprintf(output+stroff, + "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", + UE_id, + stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); for (int lc_id = 0; lc_id < 63; lc_id++) { if (stats->lc_bytes_tx[lc_id] > 0) - LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); + stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); if (stats->lc_bytes_rx[lc_id] > 0) - LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); + stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); } } print_meas(&gNB->eNB_scheduler, "DL & UL scheduling timing stats", NULL, NULL); + if (stroff>0) fprintf(fd,"%s",output); + fclose(fd); } void clear_nr_nfapi_information(gNB_MAC_INST * gNB, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 5850d26f8b..14ade4fb4b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -574,6 +574,7 @@ void pf_dl(module_id_t module_id, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; + if (sched_ctrl->ul_failure==1) continue; /* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */ sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index bf444f7037..594031f124 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -659,6 +659,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { LOG_D(NR_MAC,"Detected UL Failure on PUSCH, stopping scheduling\n"); UE_info->UE_sched_ctrl[UE_id].ul_failure = 1; + nr_mac_eNB_rrc_ul_failure(gnb_mod_idP,CC_idP,frameP,slotP,rntiP); } } } else if(sduP) { diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 2d194cd16b..8d17e7100d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -609,6 +609,7 @@ typedef struct { int dlsch_current_bytes; int ulsch_rounds[8]; int ulsch_errors; + int ulsch_DTX; int ulsch_total_bytes_scheduled; int ulsch_total_bytes_rx; int ulsch_current_bytes; diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index 8278a494be..9a467aea47 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -890,7 +890,7 @@ boolean_t nr_rrc_pdcp_config_asn1_req( //ctxt_pP->configured != 2 || //srb2add_list == NULL || //drb2add_list != NULL || - drb2release_list != NULL || + //drb2release_list != NULL || //security_modeP != 255 || //kRRCenc != NULL || //kRRCint != NULL || @@ -919,6 +919,10 @@ boolean_t nr_rrc_pdcp_config_asn1_req( if (kRRCint != NULL) { /* todo */ } + + if (drb2release_list != NULL) { + // TODO + } free(kRRCenc); free(kRRCint); @@ -1184,6 +1188,7 @@ static boolean_t pdcp_data_req_drb( if (rb == NULL) { LOG_E(PDCP, "%s:%d:%s: no DRB found (rnti %d, rb_id %ld)\n", __FILE__, __LINE__, __FUNCTION__, rnti, rb_id); + nr_pdcp_manager_unlock(nr_pdcp_ue_manager); return 0; } diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 16b16cd44d..896ea35c46 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -918,7 +918,7 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt if (drb2release_listP != NULL) { LOG_E(RLC, "%s:%d:%s: TODO\n", __FILE__, __LINE__, __FUNCTION__); - exit(1); + //exit(1); } if (srb2add_listP != NULL) { diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index 2f7da79185..bef5c52316 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -361,4 +361,24 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, } return 0; -} \ No newline at end of file +} + +void nr_mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, + const int CC_idP, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rntiP) { + struct rrc_gNB_ue_context_s *ue_context_p = NULL; + ue_context_p = rrc_gNB_get_ue_context( + RC.nrrrc[Mod_instP], + rntiP); + + if (ue_context_p != NULL) { + LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP); + + if(ue_context_p->ue_context.ul_failure_timer == 0) + ue_context_p->ue_context.ul_failure_timer=1; + } else { + LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP); + } +} diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 0920b7ed17..1a1f892c87 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -2770,9 +2770,291 @@ void rrc_gNB_process_dc_overall_timeout(const module_id_t gnb_mod_idP, x2ap_ENDC rrc_remove_nsa_user(rrc, m->rnti); } +unsigned int mask_flip(unsigned int x) { + return((((x>>8) + (x<<8))&0xffff)>>6); +} + +unsigned int get_dl_bw_mask(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + + + int common_band = *rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; + if (bandNRinfo->bandNR == common_band) { + if (common_band < 257) { // FR1 + switch (common_scs) { + case NR_SubcarrierSpacing_kHz15 : + if (bandNRinfo->channelBWs_DL && + bandNRinfo->channelBWs_DL->choice.fr1 && + bandNRinfo->channelBWs_DL->choice.fr1->scs_15kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_DL->choice.fr1->scs_15kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz30 : + if (bandNRinfo->channelBWs_DL && + bandNRinfo->channelBWs_DL->choice.fr1 && + bandNRinfo->channelBWs_DL->choice.fr1->scs_30kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_DL->choice.fr1->scs_30kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz60 : + if (bandNRinfo->channelBWs_DL && + bandNRinfo->channelBWs_DL->choice.fr1 && + bandNRinfo->channelBWs_DL->choice.fr1->scs_60kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_DL->choice.fr1->scs_60kHz->buf)); + break; + } + } + else { + switch (common_scs) { + case NR_SubcarrierSpacing_kHz60 : + if (bandNRinfo->channelBWs_DL && + bandNRinfo->channelBWs_DL->choice.fr2 && + bandNRinfo->channelBWs_DL->choice.fr2->scs_60kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_DL->choice.fr2->scs_60kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz120 : + if (bandNRinfo->channelBWs_DL && + bandNRinfo->channelBWs_DL->choice.fr2 && + bandNRinfo->channelBWs_DL->choice.fr2->scs_120kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_DL->choice.fr2->scs_120kHz->buf)); + break; + } + } + } + } + return(0); +} + +unsigned int get_ul_bw_mask(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + + + int common_band = *rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]; + int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; + if (bandNRinfo->bandNR == common_band) { + if (common_band < 257) { // FR1 + switch (common_scs) { + case NR_SubcarrierSpacing_kHz15 : + if (bandNRinfo->channelBWs_UL && + bandNRinfo->channelBWs_UL->choice.fr1 && + bandNRinfo->channelBWs_UL->choice.fr1->scs_15kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_UL->choice.fr1->scs_15kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz30 : + if (bandNRinfo->channelBWs_UL && + bandNRinfo->channelBWs_UL->choice.fr1 && + bandNRinfo->channelBWs_UL->choice.fr1->scs_30kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_UL->choice.fr1->scs_30kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz60 : + if (bandNRinfo->channelBWs_UL && + bandNRinfo->channelBWs_UL->choice.fr1 && + bandNRinfo->channelBWs_UL->choice.fr1->scs_60kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_UL->choice.fr1->scs_60kHz->buf)); + break; + } + } + else { + switch (common_scs) { + case NR_SubcarrierSpacing_kHz60 : + if (bandNRinfo->channelBWs_UL && + bandNRinfo->channelBWs_UL->choice.fr2 && + bandNRinfo->channelBWs_UL->choice.fr2->scs_60kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_UL->choice.fr2->scs_60kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz120 : + if (bandNRinfo->channelBWs_UL && + bandNRinfo->channelBWs_UL->choice.fr2 && + bandNRinfo->channelBWs_UL->choice.fr2->scs_120kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_UL->choice.fr2->scs_120kHz->buf)); + break; + } + } + } + } + return(0); +} + +int is_dl_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + int common_band = *rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + if (common_band>256) { + for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; + if (bandNRinfo->bandNR == common_band && !bandNRinfo->pdsch_256QAM_FR2) return (0); + } + } + else if (cap->phy_Parameters.phy_ParametersFR1 && !cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1) return(0); + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + if (fs) { + // go through DL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsDownlinkPerCC->list.count;i++) { + if (fs->featureSetsDownlinkPerCC->list.array[i]->supportedSubcarrierSpacingDL == common_scs && + fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL && + *fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL == NR_ModulationOrder_qam256) return(1); + } + } + return(0); +} + +int is_ul_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + int common_band = *rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]; + int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; + if (bandNRinfo->bandNR == common_band && !bandNRinfo->pusch_256QAM) return (0); + } + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + if (fs) { + // go through UL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsUplinkPerCC->list.count;i++) { + if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs && + fs->featureSetsUplinkPerCC->list.array[i]->supportedModulationOrderUL && + *fs->featureSetsUplinkPerCC->list.array[i]->supportedModulationOrderUL == NR_ModulationOrder_qam256) return(1); + } + } + return(0); +} + +int get_ul_mimo_layersCB(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + if (fs) { + // go through UL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsUplinkPerCC->list.count;i++) { + if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs && + fs->featureSetsUplinkPerCC->list.array[i]->mimo_CB_PUSCH && + fs->featureSetsUplinkPerCC->list.array[i]->mimo_CB_PUSCH->maxNumberMIMO_LayersCB_PUSCH) + return(1<<*fs->featureSetsUplinkPerCC->list.array[i]->mimo_CB_PUSCH->maxNumberMIMO_LayersCB_PUSCH); + } + } + return(1); +} + +int get_ul_mimo_layers(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + if (fs) { + // go through UL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsUplinkPerCC->list.count;i++) { + if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs && + fs->featureSetsUplinkPerCC->list.array[i]->maxNumberMIMO_LayersNonCB_PUSCH) + return(1<<*fs->featureSetsUplinkPerCC->list.array[i]->maxNumberMIMO_LayersNonCB_PUSCH); + } + } + return(1); +} + +int get_dl_mimo_layers(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + if (fs) { + // go through UL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsDownlinkPerCC->list.count;i++) { + if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs && + fs->featureSetsDownlinkPerCC->list.array[i]->maxNumberMIMO_LayersPDSCH) + return(2<<*fs->featureSetsDownlinkPerCC->list.array[i]->maxNumberMIMO_LayersPDSCH); + } + } + return(1); +} void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { MessageDef *msg; + rrc_gNB_ue_context_t *ue_context_p = NULL; + FILE *fd=fopen("nrRRCstats.log","w"); + RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[ctxt_pP->module_id]->rrc_ue_head)) { + ctxt_pP->rnti = ue_context_p->ue_id_rnti; + + if (fd) { + if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == TRUE) { + fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n", + ue_context_p->ue_id_rnti, + ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.fiveg_tmsi, + ue_context_p->ue_context.ul_failure_timer); + } else { + fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n", + ue_context_p->ue_id_rnti, + ue_context_p->ue_context.ul_failure_timer); + } + + if (ue_context_p->ue_context.UE_Capability_nr) { + fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n", + get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), + get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), + is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", + is_ul_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", + get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), + get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), + get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr)); + } + } + if (ue_context_p->ue_context.ul_failure_timer > 0) { + ue_context_p->ue_context.ul_failure_timer++; + + if (ue_context_p->ue_context.ul_failure_timer >= 20000) { + // remove UE after 20 seconds after MAC (or else) has indicated UL failure + LOG_I(RRC, "Removing UE %x instance, because of uplink failure timer timeout\n", + ue_context_p->ue_context.rnti); + if(ue_context_p->ue_context.StatusRrc >= NR_RRC_CONNECTED){ + rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( + ctxt_pP->module_id, + ue_context_p, + NGAP_CAUSE_RADIO_NETWORK, + 30); + }else{ + mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); + rrc_rlc_remove_ue(ctxt_pP); + pdcp_remove_UE(ctxt_pP); + + /* remove RRC UE Context */ + ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti); + if (ue_context_p) { + rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p); + LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti); + } + } + break; // break RB_FOREACH + } + } + + if (ue_context_p->ue_context.ue_release_timer_rrc > 0) { + ue_context_p->ue_context.ue_release_timer_rrc++; + + if (ue_context_p->ue_context.ue_release_timer_rrc >= ue_context_p->ue_context.ue_release_timer_thres_rrc) { + LOG_I(NR_RRC, "Removing UE %x instance after UE_CONTEXT_RELEASE_Complete (ue_release_timer_rrc timeout)\n", + ue_context_p->ue_context.rnti); + ue_context_p->ue_context.ue_release_timer_rrc = 0; + + mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); + rrc_rlc_remove_ue(ctxt_pP); + pdcp_remove_UE(ctxt_pP); + + /* remove RRC UE Context */ + ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti); + if (ue_context_p) { + rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p); + LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti); + } + + break; // break RB_FOREACH + } + } + } + + fclose(fd); + /* send a tick to x2ap */ if (is_x2ap_enabled()){ msg = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_SUBFRAME_PROCESS); @@ -3210,6 +3492,8 @@ rrc_gNB_generate_RRCRelease( size = do_NR_RRCRelease(buffer,rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id)); ue_context_pP->ue_context.ue_reestablishment_timer = 0; ue_context_pP->ue_context.ue_release_timer = 0; + ue_context_pP->ue_context.ul_failure_timer = 0; + ue_context_pP->ue_context.ue_release_timer_rrc = 0; LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate RRCRelease (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -3243,11 +3527,13 @@ rrc_gNB_generate_RRCRelease( itti_send_msg_to_task (TASK_RRC_UE_SIM, ctxt_pP->instance, message_p); #else if (NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)) { + uint8_t *message_buffer = itti_malloc (TASK_RRC_GNB, TASK_CU_F1, size); + memcpy (message_buffer, buffer, size); MessageDef *m = itti_alloc_new_message(TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_RELEASE_CMD); F1AP_UE_CONTEXT_RELEASE_CMD(m).rnti = ctxt_pP->rnti; F1AP_UE_CONTEXT_RELEASE_CMD(m).cause = F1AP_CAUSE_RADIO_NETWORK; F1AP_UE_CONTEXT_RELEASE_CMD(m).cause_value = 10; // 10 = F1AP_CauseRadioNetwork_normal_release - F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container = buffer; + F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container = message_buffer; F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container_length = size; itti_send_msg_to_task(TASK_CU_F1, ctxt_pP->module_id, m); } else { @@ -3258,6 +3544,9 @@ rrc_gNB_generate_RRCRelease( size, buffer, PDCP_TRANSMISSION_MODE_CONTROL); + + rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(ctxt_pP->instance, ue_context_pP->ue_context.gNB_ue_ngap_id); + ue_context_pP->ue_context.ue_release_timer_rrc = 1; } #endif } diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 619880da59..dba5a2f2dc 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -735,6 +735,7 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( struct rrc_gNB_ue_context_s *ue_context_p = NULL; protocol_ctxt_t ctxt; memset(&ctxt, 0, sizeof(protocol_ctxt_t)); + ue_initial_id = NGAP_DOWNLINK_NAS (msg_p).ue_initial_id; gNB_ue_ngap_id = NGAP_DOWNLINK_NAS (msg_p).gNB_ue_ngap_id; ue_context_p = rrc_gNB_get_ue_context_from_ngap_ids(instance, ue_initial_id, gNB_ue_ngap_id); @@ -823,6 +824,7 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( { // rrc_mac_config_req_gNB #ifdef ITTI_SIM + MessageDef *message_p; uint8_t *message_buffer; message_buffer = itti_malloc (TASK_RRC_GNB, TASK_RRC_UE_SIM, length); memcpy (message_buffer, buffer, length); @@ -1174,11 +1176,25 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND( return -1; } else { ue_context_p->ue_context.ue_release_timer_ng = 0; + ue_context_p->ue_context.ue_release_timer_thres_rrc = 1000; PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0); + ctxt.eNB_index = 0; rrc_gNB_generate_RRCRelease(&ctxt, ue_context_p); return 0; } } + +void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE( + instance_t instance, + uint32_t gNB_ue_ngap_id) { + MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, MSC_NGAP_GNB, NULL, 0, + "0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" ", + gNB_ue_ngap_id); + MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE); + NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = gNB_ue_ngap_id; + itti_send_msg_to_task(TASK_NGAP, instance, msg); +} + //------------------------------------------------------------------------------ /* * Remove UE ids (ue_initial_id and ng_id) from hashtables. diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.h b/openair2/RRC/NR/rrc_gNB_NGAP.h index f13c468f94..8779d62ff6 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.h +++ b/openair2/RRC/NR/rrc_gNB_NGAP.h @@ -129,6 +129,10 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND( instance_t instance ); +void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE( + instance_t instance, + uint32_t gNB_ue_ngap_id); + void rrc_gNB_NGAP_remove_ue_ids( gNB_RRC_INST *const rrc_instance_pP, diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index fd4a830a02..f56e4e6400 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -647,69 +647,57 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp default: AssertFatal(1==0,"Shouldn't be here\n"); } - if (cc>1) { + + samples_received=0; + while (samples_received != nsamps) { + + if (cc>1) { // receive multiple channels (e.g. RF A and RF B) std::vector buff_ptrs; - samples_received=0; - - while (samples_received != nsamps) { - for (int i=0; irx_stream->recv(buff_ptrs,nsamps-samples_received, s->rx_md); - - - if ((s->wait_for_first_pps == 0) && (s->rx_md.error_code!=uhd::rx_metadata_t::ERROR_CODE_NONE)) - break; - - if ((s->wait_for_first_pps == 1) && (samples_received != nsamps)) { - printf("sleep...\n"); //usleep(100); - } - } - if (samples_received == nsamps) s->wait_for_first_pps=0; - } else { + for (int i=0; irx_stream->recv(buff_ptrs, nsamps, s->rx_md); + } else { // receive a single channel (e.g. from connector RF A) - samples_received=0; - while (samples_received != nsamps) { - samples_received += s->rx_stream->recv((void*)((int32_t*)buff_tmp[0]+samples_received), - nsamps-samples_received, s->rx_md); - - if ((s->wait_for_first_pps == 0) && (s->rx_md.error_code!=uhd::rx_metadata_t::ERROR_CODE_NONE)) - break; - - if ((s->wait_for_first_pps == 1) && (samples_received != nsamps)) { - printf("sleep...\n"); //usleep(100); - } - } - if (samples_received == nsamps) s->wait_for_first_pps=0; + samples_received += s->rx_stream->recv((void*)((int32_t*)buff_tmp[0]+samples_received), + nsamps-samples_received, s->rx_md); } + if ((s->wait_for_first_pps == 0) && (s->rx_md.error_code!=uhd::rx_metadata_t::ERROR_CODE_NONE)) + break; - // bring RX data into 12 LSBs for softmodem RX - for (int i=0; iwait_for_first_pps == 1) && (samples_received != nsamps)) { + printf("sleep...\n"); //usleep(100); + } + } + if (samples_received == nsamps) s->wait_for_first_pps=0; + + // bring RX data into 12 LSBs for softmodem RX + for (int i=0; irx_md.error_code != uhd::rx_metadata_t::ERROR_CODE_NONE) LOG_E(HW, "%s\n", s->rx_md.to_pp_string(true).c_str()); From 3e8bc05bdf7bd5eb7af12b60f300eab9c40b950a Mon Sep 17 00:00:00 2001 From: Eurecom Date: Tue, 1 Jun 2021 09:48:20 +0200 Subject: [PATCH 009/196] testing with 2x2 and 4x4 with N310, small modifications in nr_ru_procedures and usrp_lib.cpp for multiple antennas --- executables/nr-ru.c | 2 + openair1/PHY/INIT/nr_init_ru.c | 56 ++++++++++---------- openair1/SCHED_NR/nr_ru_procedures.c | 26 ++++----- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 18 +++---- 4 files changed, 53 insertions(+), 49 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index b75e5c2247..56d868f62e 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1374,6 +1374,7 @@ void *ru_thread( void *param ) { } } + // At this point, all information for subframe has been received on FH interface res = pullTpool(gNB->resp_L1, gNB->threadPool); syncMsg = (processingData_L1_t *)NotifiedFifoData(res); @@ -1386,6 +1387,7 @@ void *ru_thread( void *param ) { res->key = proc->tti_rx; pushTpool(gNB->threadPool, res); + } printf( "Exiting ru_thread \n"); diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index 5de9d7f495..9d843241f6 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -122,37 +122,39 @@ int nr_phy_init_RU(RU_t *ru) { ru->num_gNB,NUMBER_OF_gNB_MAX); LOG_I(PHY,"[INIT] %s() ru->num_gNB:%d \n", __FUNCTION__, ru->num_gNB); - - int beam_count = 0; - if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1 - for (p=0;pnb_log_antennas;p++) { - //if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0 - beam_count++; - } - AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx)); - - int l_ind = 0; - for (i=0; inum_gNB; i++) { + + if (ru->do_precoding == 1) { + int beam_count = 0; + if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1 for (p=0;pnb_log_antennas;p++) { + //if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0 + beam_count++; + } + AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx)); + + int l_ind = 0; + for (i=0; inum_gNB; i++) { + for (p=0;pnb_log_antennas;p++) { //if ((fp->L_ssb >> (63-p)) & 0x01) { - ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); - for (j=0; jnb_tx; j++) { - ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); - AssertFatal(ru->bw_list[i],"ru->bw_list[%d] is null\n",i); - for (re=0; reofdm_symbol_size; re++) - ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind]; + ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); + for (j=0; jnb_tx; j++) { + ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); + AssertFatal(ru->bw_list[i],"ru->bw_list[%d] is null\n",i); + for (re=0; reofdm_symbol_size; re++) + ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind]; //printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j); - l_ind++; - } // for j - //} - } // for p - } //for i - } + l_ind++; + } // for j + //} + } // for p + } //for i + } - ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*)); - for(i=0; i< ru->nb_tx; ++i) { - ru->common.beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t)); - memset(ru->common.beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame); + ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*)); + for(i=0; i< ru->nb_tx; ++i) { + ru->common.beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t)); + memset(ru->common.beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame); + } } } // !=IF5 diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index d858a8a641..c8e047d849 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -302,15 +302,16 @@ static void *nr_feptx_thread(void *param) { ////////////precoding//////////// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 1); - start_meas(&ru->precoding_stats); + if (aa==0 && l==0) start_meas(&ru->precoding_stats); - for(i=0; inb_log_antennas; ++i) { - memcpy((void*) &ru->common.beam_id[i][slot*fp->symbols_per_slot+l], - (void*) &ru->gNB_list[0]->common_vars.beam_id[i][slot*fp->symbols_per_slot+l], - (fp->symbols_per_slot>>1)*sizeof(uint8_t)); + if (ru->do_precoding == 1) { + for(i=0; inb_log_antennas; ++i) { + memcpy((void*) &ru->common.beam_id[i][slot*fp->symbols_per_slot+l], + (void*) &ru->gNB_list[0]->common_vars.beam_id[i][slot*fp->symbols_per_slot+l], + (fp->symbols_per_slot>>1)*sizeof(uint8_t)); + } } - if (ru->nb_tx == 1 && ru->nb_log_antennas == 1) { memcpy((void*)&ru->common.txdataF_BF[0][l*fp->ofdm_symbol_size], (void*)&ru->gNB_list[0]->common_vars.txdataF[0][txdataF_offset + l*fp->ofdm_symbol_size], @@ -318,10 +319,9 @@ static void *nr_feptx_thread(void *param) { } else if (ru->do_precoding == 0) { int gNB_tx = ru->gNB_list[0]->frame_parms.nb_antennas_tx; - for (int aa=0;aanb_tx;aa++) - memcpy((void*)&ru->common.txdataF_BF[aa][l*fp->ofdm_symbol_size], - (void*)&ru->gNB_list[0]->common_vars.txdataF[aa%gNB_tx][txdataF_offset + l*fp->ofdm_symbol_size], - (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); + memcpy((void*)&ru->common.txdataF_BF[aa][l*fp->ofdm_symbol_size], + (void*)&ru->gNB_list[0]->common_vars.txdataF[aa%gNB_tx][txdataF_offset + l*fp->ofdm_symbol_size], + (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); } else { bw = ru->beam_weights[0]; @@ -337,13 +337,13 @@ static void *nr_feptx_thread(void *param) { txdataF_offset);//here } } - stop_meas(&ru->precoding_stats); + if (aa==0 && l==0) stop_meas(&ru->precoding_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 0); ////////////FEPTX//////////// - start_meas(&ru->ofdm_mod_stats); + if (aa==0 && l==0) start_meas(&ru->ofdm_mod_stats); nr_feptx0(ru,slot,start,fp->symbols_per_slot>>1,aa); - stop_meas(&ru->ofdm_mod_stats); + if (aa==0 && l==0) stop_meas(&ru->ofdm_mod_stats); if (release_thread(&feptx->mutex_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break; diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index f56e4e6400..5f065e406a 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -385,14 +385,14 @@ static int trx_usrp_write(openair0_device *device, #if defined(__x86_64) || defined(__i386__) #ifdef __AVX2__ nsamps2 = (nsamps+7)>>3; - __m256i buff_tx[8][nsamps2]; + __m256i buff_tx[cc<2?2:cc][nsamps2]; #else nsamps2 = (nsamps+3)>>2; - __m128i buff_tx[8][nsamps2]; + __m128i buff_tx[cc<2?2:cc][nsamps2]; #endif #elif defined(__arm__) nsamps2 = (nsamps+3)>>2; - int16x8_t buff_tx[8][nsamps2]; + int16x8_t buff_tx[cc<2?2:cc][nsamps2]; #else #error Unsupported CPU architecture, USRP device cannot be built #endif @@ -523,14 +523,14 @@ void *trx_usrp_write_thread(void * arg){ #if defined(__x86_64) || defined(__i386__) #ifdef __AVX2__ nsamps2 = (nsamps+7)>>3; - __m256i buff_tx[8][nsamps2]; + __m256i buff_tx[cc<2?2:cc][nsamps2]; #else nsamps2 = (nsamps+3)>>2; - __m128i buff_tx[8][nsamps2]; + __m128i buff_tx[cc<2?2:cc][nsamps2]; #endif #elif defined(__arm__) nsamps2 = (nsamps+3)>>2; - int16x8_t buff_tx[8][nsamps2]; + int16x8_t buff_tx[cc<2?2:cc][nsamps2]; #else #error Unsupported CPU architecture, USRP device cannot be built #endif @@ -625,14 +625,14 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp #if defined(__x86_64) || defined(__i386__) #ifdef __AVX2__ nsamps2 = (nsamps+7)>>3; - __m256i buff_tmp[4][nsamps2]; + __m256i buff_tmp[cc<2 ? 2 : cc][nsamps2]; #else nsamps2 = (nsamps+3)>>2; - __m128i buff_tmp[4][nsamps2]; + __m128i buff_tmp[cc<2 ? 2 : cc][nsamps2]; #endif #elif defined(__arm__) nsamps2 = (nsamps+3)>>2; - int16x8_t buff_tmp[4][nsamps2]; + int16x8_t buff_tmp[cc<2 ? 2 : cc][nsamps2]; #endif int rxshift; From 5451db54f1b95a8feeb5b1b2a3b030c7925abcdd Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 9 Jun 2021 15:27:34 +0200 Subject: [PATCH 010/196] RRC configuration for CSI-IM --- openair2/RRC/NR/rrc_gNB_reconfig.c | 40 +++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index f5832e44ce..9727369a2b 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1123,9 +1123,33 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig)); secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig; - csi_MeasConfig->csi_IM_ResourceToAddModList = NULL; + csi_MeasConfig->csi_IM_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceToAddModList)); + NR_CSI_IM_Resource_t *imres0 = calloc(1,sizeof(*imres0)); + imres0->csi_IM_ResourceId = 0; + imres0->csi_IM_ResourceElementPattern = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern)); + imres0->csi_IM_ResourceElementPattern->present = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1; + imres0->csi_IM_ResourceElementPattern->choice.pattern1 = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern->choice.pattern1)); + imres0->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1 = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1__subcarrierLocation_p1_s4; + imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6; + imres0->freqBand = calloc(1,sizeof(*imres0->freqBand)); + imres0->freqBand->startingRB = 0; + imres0->freqBand->nrofRBs = 108; + imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset)); + imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; + imres0->periodicityAndOffset->choice.slots320 = 0; + + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres0); + + csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList)); + NR_CSI_IM_ResourceSet_t *imset0 = calloc(1,sizeof(*imset0)); + imset0->csi_IM_ResourceSetId = 0; + NR_CSI_IM_ResourceId_t *res0 = calloc(1,sizeof(*res0)); + *res0 = 0; + ASN_SEQUENCE_ADD(&imset0->csi_IM_Resources,res0); + + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset0); + csi_MeasConfig->csi_IM_ResourceToReleaseList = NULL; - csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL; csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL; csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList)); @@ -1212,13 +1236,23 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires1); + NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2)); + csires2->csi_ResourceConfigId=2; + csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList; + csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList)); + NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00)); + *csiim00 = 0; + ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2); + csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList)); csi_MeasConfig->csi_ReportConfigToReleaseList = NULL; NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1)); csirep1->reportConfigId=0; csirep1->carrier=NULL; csirep1->resourcesForChannelMeasurement=0; - csirep1->csi_IM_ResourcesForInterference=NULL; + csirep1->csi_IM_ResourcesForInterference=calloc(1,sizeof(*csirep1->csi_IM_ResourcesForInterference)); + *csirep1->csi_IM_ResourcesForInterference=2; csirep1->nzp_CSI_RS_ResourcesForInterference=NULL; csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic)); From 0f5071c166f13af9ce5b6f6a7e05b064fa1aaefd Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 11 Jun 2021 12:06:13 +0200 Subject: [PATCH 011/196] bugfix in zero padding --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index ca070e5685..696a05c0bd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1250,8 +1250,7 @@ void skip_zero_padding(int *cumul_bits, csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]+ csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri]; - cumul_bits+=(max_bitlen-reported_bitlen); - + *cumul_bits+=(max_bitlen-reported_bitlen); } From 71a9ee0c4ecbdec05331473e2d022bd6ff75a4c2 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 15 Jun 2021 18:04:06 +0200 Subject: [PATCH 012/196] flexible csi configuration including do_csirs config parameter --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/COMMON/rrc_messages_types.h | 1 + openair2/GNB_APP/gnb_config.c | 2 + openair2/GNB_APP/gnb_paramdef.h | 7 +- openair2/LAYER2/NR_MAC_gNB/config.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 301 ++++++------ openair2/RRC/NR/nr_rrc_defs.h | 1 + openair2/RRC/NR/nr_rrc_proto.h | 8 +- openair2/RRC/NR/rrc_gNB.c | 1 + openair2/RRC/NR/rrc_gNB_nsa.c | 2 + openair2/RRC/NR/rrc_gNB_reconfig.c | 440 +++++++++++------- 12 files changed, 433 insertions(+), 336 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 54c3a68631..0955588679 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -750,7 +750,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 1c28591aba..e79dc063b3 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -693,7 +693,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 220ef60b3d..ca4011231a 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -411,6 +411,7 @@ typedef struct NRRrcConfigurationReq_s { int ssb_SubcarrierOffset; int pdsch_AntennaPorts; int pusch_AntennaPorts; + int do_CSIRS; int pusch_TargetSNRx10; int pucch_TargetSNRx10; } gNB_RrcConfigurationReq; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 94337ecb58..f0c83715dc 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1045,6 +1045,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr; printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; + printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 6d9c9b8342..e2a666c16a 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -116,6 +116,7 @@ typedef enum { #define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset" #define GNB_CONFIG_STRING_PDSCHANTENNAPORTS "pdsch_AntennaPorts" #define GNB_CONFIG_STRING_PUSCHANTENNAPORTS "pusch_AntennaPorts" +#define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS" #define GNB_CONFIG_STRING_NRCELLID "nr_cellid" /*-----------------------------------------------------------------------------------------------------------------------------------------*/ @@ -140,7 +141,8 @@ typedef enum { {GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_NRCELLID , NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ +{GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_NRCELLID , NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ } #define GNB_GNB_ID_IDX 0 @@ -160,7 +162,8 @@ typedef enum { #define GNB_SSB_SUBCARRIEROFFSET_IDX 14 #define GNB_PDSCH_ANTENNAPORTS_IDX 15 #define GNB_PUSCH_ANTENNAPORTS_IDX 16 -#define GNB_NRCELLID_IDX 17 +#define GNB_DO_CSIRS_IDX 17 +#define GNB_NRCELLID_IDX 18 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define GNBPARAMS_CHECK { \ diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 3046bde098..5e5f9e4145 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -376,7 +376,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ssb_SubcarrierOffset, pdsch_AntennaPorts, pusch_AntennaPorts, - scc); + scc); LOG_D(NR_MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req); // if in nFAPI mode diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index cdb1045438..ca0c68bf06 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2056,185 +2056,186 @@ void nr_csirs_scheduling(int Mod_idP, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id]; NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; - NR_NZP_CSI_RS_Resource_t *nzpcsi; - int period, offset; - nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body; - NR_BWP_Downlink_t *bwp=CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[sched_ctrl->active_bwp->bwp_Id-1]; + if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList != NULL) { - AssertFatal(csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count>0,"NO CSI report configuration available"); + NR_NZP_CSI_RS_Resource_t *nzpcsi; + int period, offset; - for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ - nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; - NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; - csi_period_offset(NULL,nzpcsi,&period,&offset); + nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body; + NR_BWP_Downlink_t *bwp=CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[sched_ctrl->active_bwp->bwp_Id-1]; - if((frame*n_slots_frame+slot-offset)%period == 0) { + for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ + nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; + NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; + csi_period_offset(NULL,nzpcsi,&period,&offset); - LOG_I(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot); + if((frame*n_slots_frame+slot-offset)%period == 0) { - nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; - memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); - dl_tti_csirs_pdu->PDUType = NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE; - dl_tti_csirs_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_csi_rs_pdu)); + LOG_I(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot); - nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csirs_pdu_rel15 = &dl_tti_csirs_pdu->csi_rs_pdu.csi_rs_pdu_rel15; + nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; + memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); + dl_tti_csirs_pdu->PDUType = NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE; + dl_tti_csirs_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_csi_rs_pdu)); - csirs_pdu_rel15->bwp_size = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); - csirs_pdu_rel15->bwp_start = NRRIV2PRBOFFSET(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); - csirs_pdu_rel15->subcarrier_spacing = bwp->bwp_Common->genericParameters.subcarrierSpacing; - if (bwp->bwp_Common->genericParameters.cyclicPrefix) - csirs_pdu_rel15->cyclic_prefix = *bwp->bwp_Common->genericParameters.cyclicPrefix; - else - csirs_pdu_rel15->cyclic_prefix = 0; + nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csirs_pdu_rel15 = &dl_tti_csirs_pdu->csi_rs_pdu.csi_rs_pdu_rel15; - csirs_pdu_rel15->start_rb = resourceMapping.freqBand.startingRB; - csirs_pdu_rel15->nr_of_rbs = resourceMapping.freqBand.nrofRBs; - csirs_pdu_rel15->csi_type = 1; // NZP-CSI-RS - csirs_pdu_rel15->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain; - if (resourceMapping.firstOFDMSymbolInTimeDomain2) - csirs_pdu_rel15->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2; - csirs_pdu_rel15->cdm_type = resourceMapping.cdm_Type; - csirs_pdu_rel15->freq_density = resourceMapping.density.present; - if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5) - && (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs)) - csirs_pdu_rel15->freq_density--; - csirs_pdu_rel15->scramb_id = nzpcsi->scramblingID; - csirs_pdu_rel15->power_control_offset = nzpcsi->powerControlOffset + 8; - if (nzpcsi->powerControlOffsetSS) - csirs_pdu_rel15->power_control_offset_ss = *nzpcsi->powerControlOffsetSS; - else - csirs_pdu_rel15->power_control_offset_ss = 1; // 0 dB - switch(resourceMapping.frequencyDomainAllocation.present){ - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1: - csirs_pdu_rel15->row = 1; - csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - break; - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: - csirs_pdu_rel15->row = 2; - csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | - ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - break; - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: - csirs_pdu_rel15->row = 4; - csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - break; - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: - csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; - // determining the row of table 7.4.1.5.3-1 in 38.211 - switch(resourceMapping.nrofPorts){ - case NR_CSI_RS_ResourceMapping__nrofPorts_p1: - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p2: - csirs_pdu_rel15->row = 3; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p4: - csirs_pdu_rel15->row = 5; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p8: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { - csirs_pdu_rel15->row = 8; + csirs_pdu_rel15->bwp_size = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); + csirs_pdu_rel15->bwp_start = NRRIV2PRBOFFSET(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); + csirs_pdu_rel15->subcarrier_spacing = bwp->bwp_Common->genericParameters.subcarrierSpacing; + if (bwp->bwp_Common->genericParameters.cyclicPrefix) + csirs_pdu_rel15->cyclic_prefix = *bwp->bwp_Common->genericParameters.cyclicPrefix; + else + csirs_pdu_rel15->cyclic_prefix = 0; + + csirs_pdu_rel15->start_rb = resourceMapping.freqBand.startingRB; + csirs_pdu_rel15->nr_of_rbs = resourceMapping.freqBand.nrofRBs; + csirs_pdu_rel15->csi_type = 1; // NZP-CSI-RS + csirs_pdu_rel15->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain; + if (resourceMapping.firstOFDMSymbolInTimeDomain2) + csirs_pdu_rel15->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2; + csirs_pdu_rel15->cdm_type = resourceMapping.cdm_Type; + csirs_pdu_rel15->freq_density = resourceMapping.density.present; + if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5) + && (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs)) + csirs_pdu_rel15->freq_density--; + csirs_pdu_rel15->scramb_id = nzpcsi->scramblingID; + csirs_pdu_rel15->power_control_offset = nzpcsi->powerControlOffset + 8; + if (nzpcsi->powerControlOffsetSS) + csirs_pdu_rel15->power_control_offset_ss = *nzpcsi->powerControlOffsetSS; + else + csirs_pdu_rel15->power_control_offset_ss = 1; // 0 dB + switch(resourceMapping.frequencyDomainAllocation.present){ + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1: + csirs_pdu_rel15->row = 1; + csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: + csirs_pdu_rel15->row = 2; + csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | + ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: + csirs_pdu_rel15->row = 4; + csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: + csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; + // determining the row of table 7.4.1.5.3-1 in 38.211 + switch(resourceMapping.nrofPorts){ + case NR_CSI_RS_ResourceMapping__nrofPorts_p1: + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p2: + csirs_pdu_rel15->row = 3; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p4: + csirs_pdu_rel15->row = 5; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); - } - else{ - int num_k = 0; - for (int k=0; k<6; k++) - num_k+=(((csirs_pdu_rel15->freq_domain)>>k)&0x01); - if(num_k==4) { - csirs_pdu_rel15->row = 6; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - } - else { - csirs_pdu_rel15->row = 7; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p8: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { + csirs_pdu_rel15->row = 8; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); } - } - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p12: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { - csirs_pdu_rel15->row = 10; + else{ + int num_k = 0; + for (int k=0; k<6; k++) + num_k+=(((csirs_pdu_rel15->freq_domain)>>k)&0x01); + if(num_k==4) { + csirs_pdu_rel15->row = 6; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + } + else { + csirs_pdu_rel15->row = 7; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + } + } + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p12: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { + csirs_pdu_rel15->row = 10; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + } + else { + csirs_pdu_rel15->row = 9; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + } + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p16: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_pdu_rel15->row = 12; + else + csirs_pdu_rel15->row = 11; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); - } - else { - csirs_pdu_rel15->row = 9; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - } - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p16: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) - csirs_pdu_rel15->row = 12; - else - csirs_pdu_rel15->row = 11; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p24: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { - csirs_pdu_rel15->row = 14; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); - } - else{ - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { - csirs_pdu_rel15->row = 15; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0); - } - else { - csirs_pdu_rel15->row = 13; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p24: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { + csirs_pdu_rel15->row = 14; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); } - } - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p32: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { - csirs_pdu_rel15->row = 17; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); - } - else{ - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { - csirs_pdu_rel15->row = 18; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0); + else{ + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { + csirs_pdu_rel15->row = 15; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0); + } + else { + csirs_pdu_rel15->row = 13; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + } } - else { - csirs_pdu_rel15->row = 16; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p32: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { + csirs_pdu_rel15->row = 17; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); } - } - break; - default: - AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n"); - } - break; - default: - AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n"); + else{ + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { + csirs_pdu_rel15->row = 18; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0); + } + else { + csirs_pdu_rel15->row = 16; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + } + } + break; + default: + AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n"); + } + break; + default: + AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n"); + } + dl_req->nPDUs++; } - dl_req->nPDUs++; } } } } - bool find_free_CCE(module_id_t module_id, sub_frame_t slot, int UE_id){ diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index 5efb2e1e64..d64f3a8eb7 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -447,6 +447,7 @@ typedef struct { int pusch_AntennaPorts; int pusch_TargetSNRx10; int pucch_TargetSNRx10; + int do_CSIRS; NR_BCCH_DL_SCH_Message_t *siblock1; NR_ServingCellConfigCommon_t *servingcellconfigcommon; NR_PDCCH_ConfigSIB1_t *pdcch_ConfigSIB1; diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index ff7547832e..a78ee128ff 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -84,15 +84,19 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CellGroupConfig_t *secondaryCellGroup, int scg_id, int servCellIndex, - int n_physical_antenna_ports, + int dl_antenna_ports, + int do_csirs, int initial_csi_index, int uid); +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs); + void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, - int n_physical_antenna_ports, + int dl_antenna_ports, + int do_csirs, int initial_csi_index, int uid); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 1a1f892c87..a3fba59dff 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -330,6 +330,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset; rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts; rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts; + rrc->carrier.do_CSIRS = configuration->do_CSIRS; /// System Information INIT pthread_mutex_init(&rrc->cell_info_mutex,NULL); rrc->cell_info_configured = 0; diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index e18895e0bd..658b85c245 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -245,6 +245,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, + carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); } else { @@ -253,6 +254,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, + carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); } diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 9727369a2b..05919ce679 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -128,7 +128,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CellGroupConfig_t *secondaryCellGroup, int scg_id, int servCellIndex, - int n_physical_antenna_ports, + int dl_antenna_ports, + int do_csirs, int initial_csi_index, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); @@ -1039,8 +1040,14 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial)); pucchspatial->pucch_SpatialRelationInfoId = 1; pucchspatial->servingCellId = NULL; - pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index; - pucchspatial->referenceSignal.choice.csi_RS_Index = 0; + if(do_csirs) { + pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index; + pucchspatial->referenceSignal.choice.csi_RS_Index = 0; + } + else { + pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index; + pucchspatial->referenceSignal.choice.ssb_Index = 0; + } pucchspatial->pucch_PathlossReferenceRS_Id = 0; pucchspatial->p0_PUCCH_Id = 1; pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0; @@ -1123,76 +1130,56 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig)); secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig; - csi_MeasConfig->csi_IM_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceToAddModList)); - NR_CSI_IM_Resource_t *imres0 = calloc(1,sizeof(*imres0)); - imres0->csi_IM_ResourceId = 0; - imres0->csi_IM_ResourceElementPattern = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern)); - imres0->csi_IM_ResourceElementPattern->present = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1; - imres0->csi_IM_ResourceElementPattern->choice.pattern1 = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern->choice.pattern1)); - imres0->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1 = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1__subcarrierLocation_p1_s4; - imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6; - imres0->freqBand = calloc(1,sizeof(*imres0->freqBand)); - imres0->freqBand->startingRB = 0; - imres0->freqBand->nrofRBs = 108; - imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset)); - imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; - imres0->periodicityAndOffset->choice.slots320 = 0; - - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres0); - - csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList)); - NR_CSI_IM_ResourceSet_t *imset0 = calloc(1,sizeof(*imset0)); - imset0->csi_IM_ResourceSetId = 0; - NR_CSI_IM_ResourceId_t *res0 = calloc(1,sizeof(*res0)); - *res0 = 0; - ASN_SEQUENCE_ADD(&imset0->csi_IM_Resources,res0); - - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset0); + if (do_csirs && dl_antenna_ports > 1) { + csi_MeasConfig->csi_IM_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceToAddModList)); + NR_CSI_IM_Resource_t *imres0 = calloc(1,sizeof(*imres0)); + imres0->csi_IM_ResourceId = 0; + imres0->csi_IM_ResourceElementPattern = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern)); + imres0->csi_IM_ResourceElementPattern->present = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1; + imres0->csi_IM_ResourceElementPattern->choice.pattern1 = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern->choice.pattern1)); + imres0->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1 = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1__subcarrierLocation_p1_s4; + imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6; + imres0->freqBand = calloc(1,sizeof(*imres0->freqBand)); + imres0->freqBand->startingRB = 0; + imres0->freqBand->nrofRBs = 108; + imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset)); + imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; + imres0->periodicityAndOffset->choice.slots320 = 0; + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres0); + csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList)); + NR_CSI_IM_ResourceSet_t *imset0 = calloc(1,sizeof(*imset0)); + imset0->csi_IM_ResourceSetId = 0; + NR_CSI_IM_ResourceId_t *res0 = calloc(1,sizeof(*res0)); + *res0 = 0; + ASN_SEQUENCE_ADD(&imset0->csi_IM_Resources,res0); + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset0); + } + else { + csi_MeasConfig->csi_IM_ResourceToAddModList = NULL; + csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL; + } csi_MeasConfig->csi_IM_ResourceToReleaseList = NULL; csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL; - csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList)); - NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0)); - nzpcsirs0->nzp_CSI_ResourceSetId = 0; - NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0)); - *nzpid0 = 0; - ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0); - nzpcsirs0->repetition = NULL; - nzpcsirs0->aperiodicTriggeringOffset = NULL; - nzpcsirs0->trs_Info = NULL; - ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0); + if (do_csirs) { + csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList)); + NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0)); + nzpcsirs0->nzp_CSI_ResourceSetId = 0; + NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0)); + *nzpid0 = 0; + ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0); + nzpcsirs0->repetition = NULL; + nzpcsirs0->aperiodicTriggeringOffset = NULL; + nzpcsirs0->trs_Info = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0); + } + else + csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = NULL; csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL; - csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)); - - NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0)); - nzpcsi0->nzp_CSI_RS_ResourceId = 0; - NR_CSI_RS_ResourceMapping_t resourceMapping; - resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; - resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); - resourceMapping.frequencyDomainAllocation.choice.row2.size = 1; - resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 2; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=4; - resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; - resourceMapping.firstOFDMSymbolInTimeDomain = 6; - resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; - resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; - resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; - resourceMapping.density.choice.one = (NULL_t)0; - resourceMapping.freqBand.startingRB = 0; - resourceMapping.freqBand.nrofRBs = 108; - nzpcsi0->resourceMapping = resourceMapping; - nzpcsi0->powerControlOffset = 0; - nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); - *nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0; - nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId; - nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); - nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; - nzpcsi0->periodicityAndOffset->choice.slots320 = 0; - nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL; - ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); + config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,do_csirs); csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList)); csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL; @@ -1211,18 +1198,21 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0); csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList)); - csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL; - NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0)); - csires0->csi_ResourceConfigId=0; - csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB; - csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB)); - csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList)); - NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0)); - *nzp0 = 0; - ASN_SEQUENCE_ADD(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0); - csires0->bwp_Id = 1; - csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0); + + if (do_csirs) { + csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL; + NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0)); + csires0->csi_ResourceConfigId=0; + csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB; + csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB)); + csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList)); + NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0)); + *nzp0 = 0; + ASN_SEQUENCE_ADD(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0); + csires0->bwp_Id = 1; + csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0); + } NR_CSI_ResourceConfig_t *csires1 = calloc(1,sizeof(*csires1)); csires1->csi_ResourceConfigId=1; @@ -1236,111 +1226,147 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires1); - NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2)); - csires2->csi_ResourceConfigId=2; - csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList; - csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList)); - NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00)); - *csiim00 = 0; - ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2); + if (do_csirs && dl_antenna_ports > 1) { + NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2)); + csires2->csi_ResourceConfigId=2; + csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList; + csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList)); + NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00)); + *csiim00 = 0; + ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2); + } - csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList)); - csi_MeasConfig->csi_ReportConfigToReleaseList = NULL; - NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1)); - csirep1->reportConfigId=0; - csirep1->carrier=NULL; - csirep1->resourcesForChannelMeasurement=0; - csirep1->csi_IM_ResourcesForInterference=calloc(1,sizeof(*csirep1->csi_IM_ResourcesForInterference)); - *csirep1->csi_IM_ResourcesForInterference=2; - csirep1->nzp_CSI_RS_ResourcesForInterference=NULL; - csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; - csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic)); - csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; - csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 9 + (20 * uid) % 320; NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1)); pucchcsires1->uplinkBandwidthPartId=1; pucchcsires1->pucch_Resource=2; - ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); - csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI; - csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0; - csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration)); - csirep1->reportFreqConfiguration->cqi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->cqi_FormatIndicator)); - *csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; - csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator)); - *csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; - csirep1->reportFreqConfiguration->csi_ReportingBand = calloc(1,sizeof(*csirep1->reportFreqConfiguration->csi_ReportingBand)); - csirep1->reportFreqConfiguration->csi_ReportingBand->present = NR_CSI_ReportConfig__reportFreqConfiguration__csi_ReportingBand_PR_subbands7; - csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.size=1; - csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.bits_unused=1; - csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf=malloc(1); - csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf[0]=254; - csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; - csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; - csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig)); - csirep1->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1; - csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1)); - csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel)); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present=NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two= - calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two)); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03; - csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1; - csirep1->dummy = NULL; - csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; - csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled)); - //csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); - //*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; - csirep1->cqi_Table = calloc(1,sizeof(*csirep1->cqi_Table)); - *csirep1->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1; - csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2; - csirep1->non_PMI_PortIndication = NULL; - csirep1->ext1 = NULL; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep1); + csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList)); + csi_MeasConfig->csi_ReportConfigToReleaseList = NULL; + if (dl_antenna_ports > 1) { + NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1)); + csirep1->reportConfigId=0; + csirep1->carrier=NULL; + csirep1->resourcesForChannelMeasurement=0; + csirep1->csi_IM_ResourcesForInterference=calloc(1,sizeof(*csirep1->csi_IM_ResourcesForInterference)); + *csirep1->csi_IM_ResourcesForInterference=2; + csirep1->nzp_CSI_RS_ResourcesForInterference=NULL; + csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; + csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic)); + csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; + csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 9 + (20 * uid) % 320; + ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); + csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI; + csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0; + csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration)); + csirep1->reportFreqConfiguration->cqi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->cqi_FormatIndicator)); + *csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; + csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator)); + *csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; + csirep1->reportFreqConfiguration->csi_ReportingBand = calloc(1,sizeof(*csirep1->reportFreqConfiguration->csi_ReportingBand)); + csirep1->reportFreqConfiguration->csi_ReportingBand->present = NR_CSI_ReportConfig__reportFreqConfiguration__csi_ReportingBand_PR_subbands7; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.size=1; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.bits_unused=1; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf=malloc(1); + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf[0]=254; + csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; + csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; + csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig)); + csirep1->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1; + csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1)); + csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel)); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present= + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two= + calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two)); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03; + csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1; + csirep1->dummy = NULL; + csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; + csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled)); + //csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); + //*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; + csirep1->cqi_Table = calloc(1,sizeof(*csirep1->cqi_Table)); + *csirep1->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1; + csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2; + csirep1->non_PMI_PortIndication = NULL; + csirep1->ext1 = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep1); + } - NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2)); - csirep2->reportConfigId=1; - csirep2->carrier=NULL; - csirep2->resourcesForChannelMeasurement=1; - csirep2->csi_IM_ResourcesForInterference=NULL; - csirep2->nzp_CSI_RS_ResourcesForInterference=NULL; - csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; - csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic)); - csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; - csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 29 + (20 * uid) % 320; - ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); - csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP; - csirep2->reportQuantity.choice.ssb_Index_RSRP=(NULL_t)0; - csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration)); - csirep2->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; - csirep2->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; - csirep2->reportFreqConfiguration->csi_ReportingBand=NULL; - csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; - csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; - csirep2->codebookConfig= NULL; - - csirep2->dummy = NULL; - csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; - csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled)); - csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); - *csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; - - csirep2->cqi_Table = calloc(1,sizeof(*csirep2->cqi_Table)); - *csirep2->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1; - csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1; - csirep2->non_PMI_PortIndication = NULL; - csirep2->ext1 = NULL; - - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2); + if (do_csirs) { + NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2)); + csirep2->reportConfigId=1; + csirep2->carrier=NULL; + csirep2->resourcesForChannelMeasurement=0; + csirep2->csi_IM_ResourcesForInterference=NULL; + csirep2->nzp_CSI_RS_ResourcesForInterference=NULL; + csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; + csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic)); + csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; + csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 29 + (20 * uid) % 320; + ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); + csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP; + csirep2->reportQuantity.choice.cri_RSRP=(NULL_t)0; + csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration)); + csirep2->reportFreqConfiguration->cqi_FormatIndicator = NULL; + csirep2->reportFreqConfiguration->pmi_FormatIndicator=NULL; + csirep2->reportFreqConfiguration->csi_ReportingBand=NULL; + csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; + csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; + csirep2->codebookConfig=NULL; + csirep2->dummy = NULL; + csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; + csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled)); + csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); + *csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; + csirep2->cqi_Table = NULL; + csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1; + csirep2->non_PMI_PortIndication = NULL; + csirep2->ext1 = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2); + } + else{ + NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2)); + csirep2->reportConfigId=1; + csirep2->carrier=NULL; + csirep2->resourcesForChannelMeasurement=1; + csirep2->csi_IM_ResourcesForInterference=NULL; + csirep2->nzp_CSI_RS_ResourcesForInterference=NULL; + csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; + csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic)); + csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; + csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 29 + (20 * uid) % 320; + ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); + csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP; + csirep2->reportQuantity.choice.ssb_Index_RSRP=(NULL_t)0; + csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration)); + csirep2->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; + csirep2->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; + csirep2->reportFreqConfiguration->csi_ReportingBand=NULL; + csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; + csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; + csirep2->codebookConfig= NULL; + csirep2->dummy = NULL; + csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; + csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled)); + csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); + *csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; + csirep2->cqi_Table = calloc(1,sizeof(*csirep2->cqi_Table)); + *csirep2->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1; + csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1; + csirep2->non_PMI_PortIndication = NULL; + csirep2->ext1 = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2); + } secondaryCellGroup->spCellConfig->spCellConfigDedicated->sCellDeactivationTimer=NULL; secondaryCellGroup->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig=NULL; @@ -1351,11 +1377,65 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco } + +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs) { + + if (do_csirs) { + csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)); + NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0)); + nzpcsi0->nzp_CSI_RS_ResourceId = 0; + NR_CSI_RS_ResourceMapping_t resourceMapping; + switch (dl_antenna_ports) { + case 1: + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2; + resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); + resourceMapping.frequencyDomainAllocation.choice.row2.size = 2; + resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=0; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]=16; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM; + break; + case 2: + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; + resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); + resourceMapping.frequencyDomainAllocation.choice.row2.size = 1; + resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 2; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=4; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; + break; + default: + AssertFatal(1==0,"Number of ports not yet supported\n"); + } + resourceMapping.firstOFDMSymbolInTimeDomain = 6; + resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; + resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; + resourceMapping.density.choice.one = (NULL_t)0; + resourceMapping.freqBand.startingRB = 0; + resourceMapping.freqBand.nrofRBs = 108; + nzpcsi0->resourceMapping = resourceMapping; + nzpcsi0->powerControlOffset = 0; + nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); + *nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0; + nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId; + nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; + nzpcsi0->periodicityAndOffset->choice.slots320 = 0; + nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); + } + else + csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL; +} + + void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, - int n_physical_antenna_ports, + int dl_antenna_ports, + int do_csirs, int initial_csi_index, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); @@ -1369,9 +1449,11 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon secondaryCellGroup, 1, 1, - n_physical_antenna_ports, + dl_antenna_ports, + do_csirs, initial_csi_index, uid); + xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); char scg_buffer[1024]; From 3ca8ee8601a728d0899e1a58fdc660daa7717885 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 16 Jun 2021 10:51:17 +0200 Subject: [PATCH 013/196] some cleanup and fixes --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 44 +++++++++++------------ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 +-- openair2/LAYER2/NR_MAC_gNB/config.c | 3 +- openair2/RRC/NR/nr_rrc_defs.h | 1 - openair2/RRC/NR/nr_rrc_proto.h | 2 -- openair2/RRC/NR/rrc_gNB_nsa.c | 3 -- openair2/RRC/NR/rrc_gNB_reconfig.c | 6 ++-- 7 files changed, 29 insertions(+), 34 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index b1dbc7c7d9..75b48d5823 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -278,20 +278,20 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers); #endif - for (int ap=0; apnrOfLayers; ap++) { + for (int nl=0; nlnrOfLayers; nl++) { // DMRS params for this ap - get_Wt(Wt, ap, dmrs_Type); - get_Wf(Wf, ap, dmrs_Type); - delta = get_delta(ap, dmrs_Type); - l_prime = 0; // single symbol ap 0 + get_Wt(Wt, nl, dmrs_Type); + get_Wf(Wf, nl, dmrs_Type); + delta = get_delta(nl, dmrs_Type); + l_prime = 0; // single symbol nl 0 l0 = get_l0(rel15->dlDmrsSymbPos); l_overline = l0; #ifdef DEBUG_DLSCH_MAPPING uint8_t dmrs_symbol = l0+l_prime; - printf("DMRS Type %d params for ap %d: Wt %d %d \t Wf %d %d \t delta %d \t l_prime %d \t l0 %d\tDMRS symbol %d\n", - 1+dmrs_Type,ap, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime, l0, dmrs_symbol); + printf("DMRS Type %d params for nl %d: Wt %d %d \t Wf %d %d \t delta %d \t l_prime %d \t l0 %d\tDMRS symbol %d\n", + 1+dmrs_Type,nl, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime, l0, dmrs_symbol); #endif uint16_t m=0, dmrs_idx=0; @@ -365,7 +365,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, if(ptrs_symbol){ is_ptrs_re = is_ptrs_subcarrier(k, rel15->rnti, - ap, + nl, rel15->dmrsConfigType, rel15->PTRSFreqDensity, rel15->rbSize, @@ -376,12 +376,12 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, /* Map DMRS Symbol */ if ( ( dmrs_symbol_map & (1 << l) ) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + dmrs_idx, l, k, k_prime, n, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif dmrs_idx++; k_prime++; @@ -390,30 +390,30 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, } /* Map PTRS Symbol */ else if(is_ptrs_re){ - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF_precoding[nl])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + ((int16_t*)txdataF_precoding[nl])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif ptrs_idx++; } /* Map DATA Symbol */ else if( (!(dmrs_symbol_map & (1 << l))) || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[nl][m<<1]) >> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[nl][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + m, l, k, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif m++; } /* mute RE */ else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; } if (++k >= frame_parms->ofdm_symbol_size) k -= frame_parms->ofdm_symbol_size; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 55c8021d75..5890c44341 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -94,7 +94,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ nr_generate_pss(gNB->d_pss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_sss(gNB->d_sss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); - if (cfg->carrier_config.num_tx_ant.value <= 4) + if (fp->Lmax == 4) nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); else nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); @@ -212,7 +212,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, //apply the OFDM symbol rotation here for (aa=0; aacarrier_config.num_tx_ant.value; aa++) { - apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size); + apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 5e5f9e4145..95b3f4b7e2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -273,8 +273,9 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts cfg->ssb_table.ssb_mask_list[1].ssb_mask.tl.tag = NFAPI_NR_CONFIG_SSB_MASK_TAG; cfg->num_tlv+=2; + // logical antenna ports cfg->carrier_config.num_tx_ant.value = pdsch_AntennaPorts; - AssertFatal(pdsch_AntennaPorts > 0 && pdsch_AntennaPorts < 13, "pdsch_AntennaPorts in 1...12\n"); + AssertFatal(pdsch_AntennaPorts > 0 && pdsch_AntennaPorts < 33, "pdsch_AntennaPorts in 1...32\n"); cfg->carrier_config.num_tx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_TX_ANT_TAG; int num_ssb=0; diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index d64f3a8eb7..cbc703f115 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -454,7 +454,6 @@ typedef struct { NR_CellGroupConfig_t *secondaryCellGroup[MAX_NR_RRC_UE_CONTEXTS]; NR_SRB_INFO SI; NR_SRB_INFO Srb0; - int initial_csi_index[MAX_NR_RRC_UE_CONTEXTS]; int p_gNB; } rrc_gNB_carrier_data_t; diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index a78ee128ff..b93b5d627b 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -86,7 +86,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int servCellIndex, int dl_antenna_ports, int do_csirs, - int initial_csi_index, int uid); void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs); @@ -97,7 +96,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, int do_csirs, - int initial_csi_index, int uid); void fill_default_rbconfig(NR_RadioBearerConfig_t *rbconfig, diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index cd557f5113..4056235dfb 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -152,7 +152,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ue_context_p->ue_context.reconfig->criticalExtensions.present = NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration; NR_RRCReconfiguration_IEs_t *reconfig_ies=calloc(1,sizeof(NR_RRCReconfiguration_IEs_t)); ue_context_p->ue_context.reconfig->criticalExtensions.choice.rrcReconfiguration = reconfig_ies; - carrier->initial_csi_index[ue_context_p->local_uid + 1] = 0; ue_context_p->ue_context.rb_config = calloc(1,sizeof(NR_RRCReconfiguration_t)); if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1 || get_softmodem_params()->sa == 1){ fill_default_rbconfig(ue_context_p->ue_context.rb_config, @@ -246,7 +245,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, carrier->do_CSIRS, - carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); } else { fill_default_reconfig(carrier->servingcellconfigcommon, @@ -255,7 +253,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, carrier->do_CSIRS, - carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); } ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity; diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index e98fdf1af6..08273c4984 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -130,8 +130,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int servCellIndex, int dl_antenna_ports, int do_csirs, - int initial_csi_index, int uid) { + AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n"); @@ -1236,6 +1236,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00)); *csiim00 = 0; ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); + csires2->bwp_Id = 1; + csires2->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2); } @@ -1438,7 +1440,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, int do_csirs, - int initial_csi_index, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); AssertFatal(reconfig!=NULL,"reconfig is null\n"); @@ -1453,7 +1454,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon 1, dl_antenna_ports, do_csirs, - initial_csi_index, uid); xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); From 63d0c085a6d686aa33a3dfdf731fcc291b88cdad Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 16 Jun 2021 18:47:03 +0200 Subject: [PATCH 014/196] fixing dlsim ulsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 0955588679..54c3a68631 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -750,7 +750,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index e79dc063b3..1c28591aba 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -693,7 +693,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); From 5d34f4906d62d1e7ef925fe826831edb6fa50b39 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 10:04:03 +0200 Subject: [PATCH 015/196] set mcs from csi report --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 64 ++++++++++ .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 113 +++++++++--------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 4 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 5 +- 5 files changed, 128 insertions(+), 60 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 14ade4fb4b..a93782090a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -601,7 +601,7 @@ void pf_dl(module_id_t module_id, continue; /* Calculate coeff */ - sched_pdsch->mcs = 9; + set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs]; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index ca0c68bf06..5058ee8d40 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -112,6 +112,20 @@ uint8_t nr_ss_first_symb_idx_scs_120_120_mux3[4] = {4,8,2,6}; uint8_t nr_max_number_of_candidates_per_slot[4] = {44, 36, 22, 20}; uint8_t nr_max_number_of_cces_per_slot[4] = {56, 56, 48, 32}; +// CQI TABLES +// Table 1 (38.214 5.2.2.1-2) +uint16_t cqi_table1[16][2] = {{0,0},{2,78},{2,120},{2,193},{2,308},{2,449},{2,602},{4,378}, + {4,490},{4,616},{6,466},{6,567},{6,666},{6,772},{6,873},{6,948}}; + +// Table 2 (38.214 5.2.2.1-3) +uint16_t cqi_table2[16][2] = {{0,0},{2,78},{2,193},{2,449},{4,378},{4,490},{4,616},{6,466}, + {6,567},{6,666},{6,772},{6,873},{8,711},{8,797},{8,885},{8,948}}; + +// Table 2 (38.214 5.2.2.1-4) +uint16_t cqi_table3[16][2] = {{0,0},{2,30},{2,50},{2,78},{2,120},{2,193},{2,308},{2,449}, + {2,602},{4,378},{4,490},{4,616},{6,466},{6,567},{6,666},{6,772}}; + + static inline uint8_t get_max_candidates(uint8_t scs) { AssertFatal(scs<4, "Invalid PDCCH subcarrier spacing %d\n", scs); return (nr_max_number_of_candidates_per_slot[scs]); @@ -122,6 +136,55 @@ static inline uint8_t get_max_cces(uint8_t scs) { return (nr_max_number_of_cces_per_slot[scs]); } + +void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, + NR_UE_sched_ctrl_t *sched_ctrl, + uint8_t mcs_table_idx) { + + if (sched_ctrl->set_mcs) { + + // TODO for wideband case and multiple TB + int cqi_idx = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb; + uint16_t target_coderate,target_qm; + if (cqi_idx>0) { + int cqi_table = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cqi_table; + AssertFatal(cqi_table == mcs_table_idx, "Indices of MCS tables don't correspond\n"); + switch (cqi_table) { + case 0: + target_qm = cqi_table1[cqi_idx][0]; + target_coderate = cqi_table1[cqi_idx][0]; + break; + case 1: + target_qm = cqi_table2[cqi_idx][0]; + target_coderate = cqi_table2[cqi_idx][0]; + break; + case 2: + target_qm = cqi_table3[cqi_idx][0]; + target_coderate = cqi_table3[cqi_idx][0]; + break; + default: + AssertFatal(1==0,"Invalid cqi table index %d\n",cqi_table); + } + int max_mcs = 28; + int R,Qm; + if (mcs_table_idx == 1) + max_mcs = 27; + for (int i=0; i<=max_mcs; i++) { + R = nr_get_code_rate_dl(i, mcs_table_idx); + Qm = nr_get_Qm_dl(i, mcs_table_idx); + if ((Qm == target_qm) && (target_coderate <= R)) { + sched_pdsch->mcs = i; + break; + } + } + } + else // default value + sched_pdsch->mcs = 9; + + sched_ctrl->set_mcs = FALSE; + } +} + NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc, NR_BWP_Downlink_t *bwp, NR_SearchSpace_t *ss, @@ -1839,6 +1902,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; memset(sched_ctrl, 0, sizeof(*sched_ctrl)); + sched_ctrl->set_mcs = TRUE; sched_ctrl->ta_frame = 0; sched_ctrl->ta_update = 31; sched_ctrl->ta_apply = false; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 696a05c0bd..7d3985ac28 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -921,37 +921,34 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { idx: resource set index */ - //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; - //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]; - } + nr_ssbri_cri = sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri; + //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.choice.ssb_cri_report.CRI_SSBRI[ssb_idx]; + } - //if strongest measured RSRP is configured - strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP); - // including ssb rsrp in mac stats - stats->cumul_rsrp += strongest_ssb_rsrp; - stats->num_rsrp_meas++; - ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp; - LOG_D(MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp); + //if strongest measured RSRP is configured + strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP); + // including ssb rsrp in mac stats + stats->cumul_rsrp += strongest_ssb_rsrp; + stats->num_rsrp_meas++; + ssb_rsrp[idx * nb_of_csi_ssb_report] = 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) { - better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report]; - target_ssb_beam_index = idx * nb_of_csi_ssb_report; - } + //if current ssb rsrp is greater than better 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; + } - for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) { - ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp); + for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) { + ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp); - //if current reported rsrp is greater than better rsrp - if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) { - better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx]; - target_ssb_beam_index = idx * nb_of_csi_ssb_report + diff_rsrp_idx; - } - } + //if current reported rsrp is greater than better rsrp + if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) { + better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx]; + target_ssb_beam_index = idx * nb_of_csi_ssb_report + diff_rsrp_idx; + } } @@ -1103,36 +1100,35 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, multiple simultaneous spatial domain receive filter */ - int idx = 0; //Since for SSB RSRP reporting in RRC can configure only one ssb resource set per one report config - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; + sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; - for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { + for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits); if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = + sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = *(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); else - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = + sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = *(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *cumul_bits += cri_ssbri_bitlen; - LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); + LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); } curr_payload = pickandreverse_bits(payload, 7, *cumul_bits); - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP = curr_payload & 0x7f; + sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP = curr_payload & 0x7f; *cumul_bits += 7; - for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) { + for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) { curr_payload = pickandreverse_bits(payload, 4, *cumul_bits); - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; + sched_ctrl->CSI_report.choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; *cumul_bits += 4; } csi_report->nb_of_csi_ssb_report++; LOG_D(MAC,"rsrp_id = %d rsrp = %d\n", - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP, - get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP)); + sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP, + get_measured_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP)); } @@ -1141,10 +1137,8 @@ void evaluate_cri_report(uint8_t *payload, int cumul_bits, NR_UE_sched_ctrl_t *sched_ctrl){ - int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? - uint8_t temp_cri = pickandreverse_bits(payload, cri_bitlen, cumul_bits); - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.cri = temp_cri; + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cri = temp_cri; } int evaluate_ri_report(uint8_t *payload, @@ -1153,13 +1147,12 @@ int evaluate_ri_report(uint8_t *payload, int cumul_bits, NR_UE_sched_ctrl_t *sched_ctrl){ - int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? uint8_t ri_index = pickandreverse_bits(payload, ri_bitlen, cumul_bits); int count=0; for (int i=0; i<8; i++) { if ((ri_restriction>>i)&0x01) { if(count == ri_index) { - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.ri = i; + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.ri = i; LOG_I(MAC,"CSI Reported Rank %d\n", i+1); return i; } @@ -1174,21 +1167,29 @@ void evaluate_cqi_report(uint8_t *payload, nr_csi_report_t *csi_report, int cumul_bits, uint8_t ri, - NR_UE_sched_ctrl_t *sched_ctrl){ + NR_UE_sched_ctrl_t *sched_ctrl, + long *cqi_Table){ //TODO sub-band CQI report not yet implemented - int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? int cqi_bitlen = csi_report->csi_meas_bitlen.cqi_bitlen[ri]; uint8_t temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; + // NR_CSI_ReportConfig__cqi_Table_table1 = 0 + // NR_CSI_ReportConfig__cqi_Table_table2 = 1 + // NR_CSI_ReportConfig__cqi_Table_table3 = 2 + if (cqi_Table) + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cqi_table = *cqi_Table; + else + AssertFatal(1==0,"CQI Table not present in RRC configuration\n"); + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); if (cqi_bitlen > 4) { temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; LOG_D(MAC,"Wide-band CQI for the second TB %d\n", temp_cqi); } + sched_ctrl->set_mcs = TRUE; } @@ -1198,7 +1199,6 @@ uint8_t evaluate_pmi_report(uint8_t *payload, uint8_t ri, NR_UE_sched_ctrl_t *sched_ctrl){ - int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? int x1_bitlen = csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]; int x2_bitlen = csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri]; int tot_bitlen = x1_bitlen + x2_bitlen; @@ -1206,11 +1206,11 @@ uint8_t evaluate_pmi_report(uint8_t *payload, //in case of 2 port CSI configuration x1 is empty and the information bits are in x2 int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits); - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x1, - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x2); + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x1, + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x2); return tot_bitlen; @@ -1223,13 +1223,12 @@ int evaluate_li_report(uint8_t *payload, uint8_t ri, NR_UE_sched_ctrl_t *sched_ctrl){ - int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? int li_bitlen = csi_report->csi_meas_bitlen.li_bitlen[ri]; if (li_bitlen>0) { int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits); LOG_I(MAC,"LI %d\n",temp_li); - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.li = temp_li; + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.li = temp_li; } return li_bitlen; @@ -1304,7 +1303,7 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, cumul_bits += ri_bitlen; if (r_index != -1) skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); - evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table); break; case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI: cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; @@ -1319,7 +1318,7 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); cumul_bits += pmi_bitlen; - evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table); break; case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI: cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; @@ -1336,7 +1335,7 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); cumul_bits += pmi_bitlen; - evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table); break; default: AssertFatal(1==0, "Invalid or not supported CSI measurement report\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 680a6e6dd4..98fb961cc8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -415,6 +415,10 @@ int16_t ssb_index_from_prach(module_id_t module_idP, void find_SSB_and_RO_available(module_id_t module_idP); +void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, + NR_UE_sched_ctrl_t *sched_ctrl, + uint8_t mcs_table_idx); + void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp); void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 8d17e7100d..3ab4bb66ea 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -441,6 +441,7 @@ struct CRI_RI_LI_PMI_CQI { uint8_t pmi_x2; uint8_t wb_cqi_1tb; uint8_t wb_cqi_2tb; + uint8_t cqi_table; }; typedef struct CRI_SSB_RSRP { @@ -573,9 +574,9 @@ typedef struct { int pusch_consecutive_dtx_cnt; int pucch_consecutive_dtx_cnt; int ul_failure; - struct CSI_Report CSI_report[MAX_CSI_REPORTS]; + struct CSI_Report CSI_report; bool SR; - + bool set_mcs; /// information about every HARQ process NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES]; /// HARQ processes that are free From 40c51ebc0b9db0ff43ea406643225e86c6a185d5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 10:37:34 +0200 Subject: [PATCH 016/196] tbs computation on the fly in pf_dl --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index a93782090a..16bed9fcd5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -602,7 +602,16 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); - uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs]; + const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); + const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); + uint32_t tbs = nr_compute_tbs(Qm, + R, + 1, /* rbSize */ + 10, /* hypothetical number of slots */ + 0, /* N_PRB_DMRS * N_DMRS_SLOT */ + 0 /* N_PRB_oh, 0 for initialBWP */, + 0 /* tb_scaling */, + 1 /* nrOfLayers */) >> 3; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]); From 311b97685e79a421b17ea4da57178ee164631295 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 16 Jun 2021 16:59:04 +0200 Subject: [PATCH 017/196] gNB: add nrOfLayers to sched_pdsch --- openair1/SIMULATION/NR_PHY/dlsim.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 +++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 54c3a68631..17cf1d77dd 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -274,6 +274,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, * configuration */ ps->mcsTableIdx = g_mcsTableIdx; + sched_pdsch->nrOfLayers = g_nrOfLayers; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->tb_size = nr_compute_tbs(sched_pdsch->Qm, @@ -283,7 +284,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - 1 /* nrOfLayers */) + sched_pdsch->nrOfLayers) >> 3; /* the simulator assumes the HARQ PID is equal to the slot number */ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 16bed9fcd5..8e6ee912f3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -602,6 +602,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); + sched_pdsch->nrOfLayers = 1; const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); uint32_t tbs = nr_compute_tbs(Qm, @@ -611,7 +612,7 @@ void pf_dl(module_id_t module_id, 0, /* N_PRB_DMRS * N_DMRS_SLOT */ 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - 1 /* nrOfLayers */) >> 3; + sched_pdsch->nrOfLayers) >> 3; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]); @@ -828,7 +829,7 @@ void nr_schedule_ue_spec(module_id_t module_id, const rnti_t rnti = UE_info->rnti[UE_id]; /* POST processing */ - const int nrOfLayers = 1; + const uint8_t nrOfLayers = sched_pdsch->nrOfLayers; const uint16_t R = sched_pdsch->R; const uint8_t Qm = sched_pdsch->Qm; const uint32_t TBS = sched_pdsch->tb_size; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 6e1b99fa6b..56034353ac 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -370,6 +370,7 @@ void nr_preprocessor_phytest(module_id_t module_id, nr_set_pdsch_semi_static( scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); + sched_pdsch->nrOfLayers = 1; sched_pdsch->mcs = target_dl_mcs; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -380,7 +381,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - 1 /* nrOfLayers */) + sched_pdsch->nrOfLayers) >> 3; /* get the PID of a HARQ process awaiting retransmission, or -1 otherwise */ diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 3ab4bb66ea..0c460fcc9b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -383,6 +383,7 @@ typedef struct NR_sched_pdsch { uint8_t mcs; /// TBS-related info + uint8_t nrOfLayers; uint16_t R; uint8_t Qm; uint32_t tb_size; From 39defb49edda1d2b43a424a58dc9e0df1e04cf69 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 10:54:52 +0200 Subject: [PATCH 018/196] passing nroflayers to nr_find_nb_rb --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 9 +++++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 8e6ee912f3..089096d1dc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -491,6 +491,7 @@ bool allocate_dl_retransmission(module_id_t module_id, uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, retInfo->R, + retInfo->nrOfLayers, temp_ps.nrOfSymbols, temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT, retInfo->tb_size, @@ -704,6 +705,7 @@ void pf_dl(module_id_t module_id, + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); nr_find_nb_rb(sched_pdsch->Qm, sched_pdsch->R, + sched_pdsch->nrOfLayers, ps->nrOfSymbols, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, sched_ctrl->num_total_bytes + oh, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 5058ee8d40..316a6d4f49 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -284,6 +284,7 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, bool nr_find_nb_rb(uint16_t Qm, uint16_t R, + uint8_t nrOfLayers, uint16_t nb_symb_sch, uint16_t nb_dmrs_prb, uint32_t bytes, @@ -293,7 +294,7 @@ bool nr_find_nb_rb(uint16_t Qm, { /* is the maximum (not even) enough? */ *nb_rb = nb_rb_max; - *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; + *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3; /* check whether it does not fit, or whether it exactly fits. Some algorithms * might depend on the return value! */ if (bytes > *tbs) @@ -303,7 +304,7 @@ bool nr_find_nb_rb(uint16_t Qm, /* is the minimum enough? */ *nb_rb = 1; - *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; + *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3; if (bytes <= *tbs) return true; @@ -312,7 +313,7 @@ bool nr_find_nb_rb(uint16_t Qm, int hi = nb_rb_max; int lo = 1; for (int p = (hi + lo) / 2; lo + 1 < hi; p = (hi + lo) / 2) { - const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; + const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3; if (bytes == TBS) { hi = p; break; @@ -323,7 +324,7 @@ bool nr_find_nb_rb(uint16_t Qm, } } *nb_rb = hi; - *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; + *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3; /* return whether we could allocate all bytes and stay below nb_rb_max */ return *tbs >= bytes && *nb_rb <= nb_rb_max; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 594031f124..b9b3f336fa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -889,6 +889,7 @@ bool allocate_ul_retransmission(module_id_t module_id, uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, retInfo->R, + 1, // layers temp_ps.nrOfSymbols, temp_ps.N_PRB_DMRS * temp_ps.num_dmrs_symb, retInfo->tb_size, @@ -1146,6 +1147,7 @@ void pf_ul(module_id_t module_id, uint32_t TBS = 0; nr_find_nb_rb(sched_pusch->Qm, sched_pusch->R, + 1, // layers ps->nrOfSymbols, ps->N_PRB_DMRS * ps->num_dmrs_symb, B, diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 98fb961cc8..0c41c1dbdf 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -426,6 +426,7 @@ bool find_free_CCE(module_id_t module_id, sub_frame_t slot, int UE_id); bool nr_find_nb_rb(uint16_t Qm, uint16_t R, + uint8_t nrOfLayers, uint16_t nb_symb_sch, uint16_t nb_dmrs_prb, uint32_t bytes, From 5e4d40b1ec16cd72874aa26bf692b08106832a87 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 12:55:43 +0200 Subject: [PATCH 019/196] bugfix in rrc configuration --- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 08273c4984..b3baf2068c 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1247,7 +1247,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList)); csi_MeasConfig->csi_ReportConfigToReleaseList = NULL; - if (dl_antenna_ports > 1) { + if (do_csirs && dl_antenna_ports > 1) { NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1)); csirep1->reportConfigId=0; csirep1->carrier=NULL; From 0ec932b57fb4fb16352626e2d1c3c362a7f0aaa5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 13:18:45 +0200 Subject: [PATCH 020/196] nb of layers from CSI Report --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 9 +++++++++ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 089096d1dc..8fcb544f18 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -603,7 +603,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); - sched_pdsch->nrOfLayers = 1; + set_dl_nrOfLayers(sched_pdsch,sched_ctrl); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); uint32_t tbs = nr_compute_tbs(Qm, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 316a6d4f49..0cf70e6ebc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -137,6 +137,15 @@ static inline uint8_t get_max_cces(uint8_t scs) { } +void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, + NR_UE_sched_ctrl_t *sched_ctrl) { + + // for now this should be enough + // if there is not csi report RI is 0 from initialization + sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.ri + 1; + +} + void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t mcs_table_idx) { diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 0c41c1dbdf..eba95b5cdc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -419,6 +419,9 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t mcs_table_idx); +void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, + NR_UE_sched_ctrl_t *sched_ctrl); + void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp); void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp); From 549e3a9159497a8ce0051d5be4ef541d1c591bd5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 18:21:25 +0200 Subject: [PATCH 021/196] remove choice in CSI report structure --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 7 ++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 50 +++++++++---------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 7 +-- 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 0cf70e6ebc..6822354ad3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -142,7 +142,7 @@ void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, // for now this should be enough // if there is not csi report RI is 0 from initialization - sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.ri + 1; + sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1; } @@ -151,12 +151,11 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, uint8_t mcs_table_idx) { if (sched_ctrl->set_mcs) { - // TODO for wideband case and multiple TB - int cqi_idx = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb; + int cqi_idx = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb; uint16_t target_coderate,target_qm; if (cqi_idx>0) { - int cqi_table = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cqi_table; + int cqi_table = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table; AssertFatal(cqi_table == mcs_table_idx, "Indices of MCS tables don't correspond\n"); switch (cqi_table) { case 0: diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 7d3985ac28..ead2ad4d95 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -921,14 +921,14 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { idx: resource set index */ - nr_ssbri_cri = sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri; + nr_ssbri_cri = sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri; //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.choice.ssb_cri_report.CRI_SSBRI[ssb_idx]; + ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[ssb_idx]; } //if strongest measured RSRP is configured - strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP); + strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP); // including ssb rsrp in mac stats stats->cumul_rsrp += strongest_ssb_rsrp; stats->num_rsrp_meas++; @@ -942,7 +942,7 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { } for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) { - ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp); + ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp); //if current reported rsrp is greater than better rsrp if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) { @@ -1100,35 +1100,35 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, multiple simultaneous spatial domain receive filter */ - sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; + sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; - for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { + for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits); if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) - sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = + sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = *(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); else - sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = + sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = *(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *cumul_bits += cri_ssbri_bitlen; - LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); + LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); } curr_payload = pickandreverse_bits(payload, 7, *cumul_bits); - sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP = curr_payload & 0x7f; + sched_ctrl->CSI_report.ssb_cri_report.RSRP = curr_payload & 0x7f; *cumul_bits += 7; - for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) { + for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) { curr_payload = pickandreverse_bits(payload, 4, *cumul_bits); - sched_ctrl->CSI_report.choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; + sched_ctrl->CSI_report.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; *cumul_bits += 4; } csi_report->nb_of_csi_ssb_report++; LOG_D(MAC,"rsrp_id = %d rsrp = %d\n", - sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP, - get_measured_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP)); + sched_ctrl->CSI_report.ssb_cri_report.RSRP, + get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP)); } @@ -1138,7 +1138,7 @@ void evaluate_cri_report(uint8_t *payload, NR_UE_sched_ctrl_t *sched_ctrl){ uint8_t temp_cri = pickandreverse_bits(payload, cri_bitlen, cumul_bits); - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cri = temp_cri; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cri = temp_cri; } int evaluate_ri_report(uint8_t *payload, @@ -1152,7 +1152,7 @@ int evaluate_ri_report(uint8_t *payload, for (int i=0; i<8; i++) { if ((ri_restriction>>i)&0x01) { if(count == ri_index) { - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.ri = i; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri = i; LOG_I(MAC,"CSI Reported Rank %d\n", i+1); return i; } @@ -1179,14 +1179,14 @@ void evaluate_cqi_report(uint8_t *payload, // NR_CSI_ReportConfig__cqi_Table_table2 = 1 // NR_CSI_ReportConfig__cqi_Table_table3 = 2 if (cqi_Table) - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cqi_table = *cqi_Table; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table = *cqi_Table; else AssertFatal(1==0,"CQI Table not present in RRC configuration\n"); - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; - LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; + LOG_I(MAC,"Wide-band CQI for the first TB %d %p\n", temp_cqi,&sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb); if (cqi_bitlen > 4) { temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; LOG_D(MAC,"Wide-band CQI for the second TB %d\n", temp_cqi); } sched_ctrl->set_mcs = TRUE; @@ -1206,11 +1206,11 @@ uint8_t evaluate_pmi_report(uint8_t *payload, //in case of 2 port CSI configuration x1 is empty and the information bits are in x2 int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits); - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x1, - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x2); + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1, + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2); return tot_bitlen; @@ -1228,7 +1228,7 @@ int evaluate_li_report(uint8_t *payload, if (li_bitlen>0) { int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits); LOG_I(MAC,"LI %d\n",temp_li); - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.li = temp_li; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.li = temp_li; } return li_bitlen; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 0c460fcc9b..81df35cf06 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -453,11 +453,8 @@ typedef struct CRI_SSB_RSRP { } CRI_SSB_RSRP_t; struct CSI_Report { - NR_CSI_Report_Config_PR present; - union Config_CSI_Report { - struct CRI_RI_LI_PMI_CQI cri_ri_li_pmi_cqi_report; - struct CRI_SSB_RSRP ssb_cri_report; - } choice; + struct CRI_RI_LI_PMI_CQI cri_ri_li_pmi_cqi_report; + struct CRI_SSB_RSRP ssb_cri_report; }; #define MAX_SR_BITLEN 8 From d3ad905324d37eee84018737c0415162671b1d55 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 18:24:13 +0200 Subject: [PATCH 022/196] remove debug print from log --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index ead2ad4d95..fc96deabb2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1183,7 +1183,7 @@ void evaluate_cqi_report(uint8_t *payload, else AssertFatal(1==0,"CQI Table not present in RRC configuration\n"); sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; - LOG_I(MAC,"Wide-band CQI for the first TB %d %p\n", temp_cqi,&sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb); + LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); if (cqi_bitlen > 4) { temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; From ee2f133cae28f7841c104d19fa8495c50e1c47e4 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 21 Jun 2021 12:19:39 +0200 Subject: [PATCH 023/196] max mimo layers depending on antenna ports from config file --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 5890c44341..6d071f0f8c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -591,7 +591,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { LOG_D(PHY,"frame %d, slot %d: PUCCH signal energy %d\n",frame_rx,slot_rx,power_rxF); nr_decode_pucch0(gNB, - frame_rx, + frame_rx, slot_rx, uci_pdu_format0, pucch_pdu); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index b3baf2068c..653ce34d7b 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1122,7 +1122,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco pdsch_servingcellconfig->pucch_Cell= NULL; pdsch_servingcellconfig->ext1=calloc(1,sizeof(*pdsch_servingcellconfig->ext1)); pdsch_servingcellconfig->ext1->maxMIMO_Layers = calloc(1,sizeof(*pdsch_servingcellconfig->ext1->maxMIMO_Layers)); - *pdsch_servingcellconfig->ext1->maxMIMO_Layers = 2; + *pdsch_servingcellconfig->ext1->maxMIMO_Layers = dl_antenna_ports; pdsch_servingcellconfig->ext1->processingType2Enabled = NULL; secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig=NULL; From ed54f5981847104e9cfc2851df5625cc88c24f0c Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 22 Jun 2021 18:29:22 +0200 Subject: [PATCH 024/196] handling dl dmrs ports at phy --- common/utils/nr/nr_common.c | 18 ++ common/utils/nr/nr_common.h | 2 +- .../nfapi/public_inc/fapi_nr_ue_interface.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 10 +- .../PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 2 + openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 1 + openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 9 +- openair2/LAYER2/NR_MAC_UE/mac_extern.h | 8 +- openair2/LAYER2/NR_MAC_UE/mac_vars.c | 274 +++++++++--------- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 99 ++++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 +- 11 files changed, 235 insertions(+), 193 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index cc2860191a..001f7a4739 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -196,6 +196,24 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx) { } } +int get_dmrs_port(int nl, uint16_t dmrs_ports) { + + if (dmrs_ports == 0) return 0; // dci 1_0 + int p = -1; + int found = -1; + for (int i=0; i<12; i++) { // loop over dmrs ports + if((dmrs_ports>>i)&0x01) { // check if current bit is 1 + found++; + if (found == nl) { // found antenna port number corresponding to current layer + p = i; + break; + } + } + } + AssertFatal(p>-1,"No dmrs port corresponding to layer %d found\n",nl); + return p; +} + int get_subband_size(int NPRB,int size) { // implements table 5.2.1.4-2 from 36.214 // diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 6389c2c094..b95fdd5046 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -62,7 +62,7 @@ uint8_t nr_get_Qm(uint8_t Imcs, uint8_t table_idx); uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); int get_subband_size(int NPRB,int size); void SLIV2SL(int SLIV,int *S,int *L); - +int get_dmrs_port(int nl, uint16_t dmrs_ports); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index c0abf6acb0..4bdd3c24cb 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -465,7 +465,7 @@ typedef struct { uint8_t pucch_resource_id; uint8_t pdsch_to_harq_feedback_time_ind; uint8_t n_dmrs_cdm_groups; - uint8_t dmrs_ports[10]; + uint16_t dmrs_ports; uint8_t n_front_load_symb; uint8_t tci_state; fapi_nr_dl_srs_config_t srs_config; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 75b48d5823..6e379fdf75 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -38,6 +38,7 @@ #include "PHY/NR_REFSIG/ptrs_nr.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "LAYER2/NR_MAC_gNB/mac_proto.h" +#include "common/utils/nr/nr_common.h" //#define DEBUG_DLSCH //#define DEBUG_DLSCH_MAPPING @@ -279,11 +280,12 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers); #endif for (int nl=0; nlnrOfLayers; nl++) { - + + int dmrs_port = get_dmrs_port(nl,rel15->dmrsPorts); // DMRS params for this ap - get_Wt(Wt, nl, dmrs_Type); - get_Wf(Wf, nl, dmrs_Type); - delta = get_delta(nl, dmrs_Type); + get_Wt(Wt, dmrs_port, dmrs_Type); + get_Wf(Wf, dmrs_port, dmrs_Type); + delta = get_delta(dmrs_port, dmrs_Type); l_prime = 0; // single symbol nl 0 l0 = get_l0(rel15->dlDmrsSymbPos); l_overline = l0; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index f3cca9e33d..9371c802f1 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -300,6 +300,8 @@ typedef struct { uint8_t dmrsConfigType; // Number of DMRS CDM groups with no data uint8_t n_dmrs_cdm_groups; + /// DMRS ports bitmap + uint16_t dmrs_ports; /// Starting Symbol number uint16_t start_symbol; /// Current subband PMI allocation diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index c276de847d..06975b026f 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -116,6 +116,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos; dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType; dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups; + dlsch0_harq->dmrs_ports = dlsch_config_pdu->dmrs_ports; dlsch0_harq->mcs = dlsch_config_pdu->mcs; dlsch0_harq->rvidx = dlsch_config_pdu->rv; dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index e3d4c54f5a..7ebba83408 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -761,17 +761,18 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_ uint16_t s1 = dlsch0_harq->nb_symbols; bool is_SI = dlsch0->rnti_type == _SI_RNTI_; - LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x\n",ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0->harq_processes[harq_pid]->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0->harq_processes[harq_pid]->dlDmrsSymbPos); + LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x\n", + ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0_harq->dlDmrsSymbPos); for (m = s0; m < (s0 +s1); m++) { - if (((1<harq_processes[harq_pid]->dlDmrsSymbPos) > 0) { - for (uint8_t aatx=0; aatxharq_processes[harq_pid]->Nl; aatx++) {//for MIMO Config: it shall loop over no_layers + if (((1<dlDmrsSymbPos) > 0) { + for (uint8_t aatx=0; aatxNl; aatx++) {//for MIMO Config: it shall loop over no_layers nr_pdsch_channel_estimation(ue, proc, 0 /*eNB_id*/, is_SI, nr_slot_rx, - aatx /*p*/, + get_dmrs_port(aatx,dlsch0_harq->dmrs_ports), m, BWPStart, ue->frame_parms.first_carrier_offset+(BWPStart + pdsch_start_rb)*12, diff --git a/openair2/LAYER2/NR_MAC_UE/mac_extern.h b/openair2/LAYER2/NR_MAC_UE/mac_extern.h index e551790f7a..3affa41d51 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_extern.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_extern.h @@ -57,12 +57,12 @@ extern const uint8_t table_7_3_1_1_2_21[19][4]; extern const uint8_t table_7_3_1_1_2_22[6][5]; extern const uint8_t table_7_3_1_1_2_23[5][6]; extern const uint8_t table_7_3_2_3_3_1[12][5]; -extern const uint8_t table_7_3_2_3_3_2_oneCodeword[31][6]; +extern const uint8_t table_7_3_2_3_3_2_oneCodeword[31][10]; extern const uint8_t table_7_3_2_3_3_2_twoCodeword[4][10]; -extern const uint8_t table_7_3_2_3_3_3_oneCodeword[24][5]; +extern const uint8_t table_7_3_2_3_3_3_oneCodeword[24][7]; extern const uint8_t table_7_3_2_3_3_3_twoCodeword[2][7]; -extern const uint8_t table_7_3_2_3_3_4_oneCodeword[58][6]; -extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10]; +extern const uint8_t table_7_3_2_3_3_4_oneCodeword[58][14]; +extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][14]; extern const uint16_t table_7_2_1[16]; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_vars.c b/openair2/LAYER2/NR_MAC_UE/mac_vars.c index 383267090f..b435dd773f 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_vars.c +++ b/openair2/LAYER2/NR_MAC_UE/mac_vars.c @@ -257,161 +257,161 @@ const uint8_t table_7_3_1_1_2_23[5][6] = { }; const uint8_t table_7_3_2_3_3_1[12][5] = { - {1,0,0,0,0}, {1,1,0,0,0}, {1,0,1,0,0}, - {2,0,0,0,0}, + {1,1,1,0,0}, {2,1,0,0,0}, - {2,2,0,0,0}, - {2,3,0,0,0}, {2,0,1,0,0}, - {2,2,3,0,0}, - {2,0,1,2,0}, - {2,0,1,2,3}, - {2,0,2,0,0} + {2,0,0,1,0}, + {2,0,0,0,1}, + {2,1,1,0,0}, + {2,0,0,1,1}, + {2,1,1,1,0}, + {2,1,1,1,1}, + {2,1,0,1,0} }; -const uint8_t table_7_3_2_3_3_2_oneCodeword[31][6] = { - {1,0,0,0,0,1}, - {1,1,0,0,0,1}, - {1,0,1,0,0,1}, - {2,0,0,0,0,1}, - {2,1,0,0,0,1}, - {2,2,0,0,0,1}, - {2,3,0,0,0,1}, - {2,0,1,0,0,1}, - {2,2,3,0,0,1}, - {2,0,1,2,0,1}, - {2,0,1,2,3,1}, - {2,0,2,0,0,1}, - {2,0,0,0,0,2}, - {2,1,0,0,0,2}, - {2,2,0,0,0,2}, - {2,3,0,0,0,2}, - {2,4,0,0,0,2}, - {2,5,0,0,0,2}, - {2,6,0,0,0,2}, - {2,7,0,0,0,2}, - {2,0,1,0,0,2}, - {2,2,3,0,0,2}, - {2,4,5,0,0,2}, - {2,6,7,0,0,2}, - {2,0,4,0,0,2}, - {2,2,6,0,0,2}, - {2,0,1,4,0,2}, - {2,2,3,6,0,2}, - {2,0,1,4,5,2}, - {2,2,3,6,7,2}, - {2,0,2,4,6,2} +const uint8_t table_7_3_2_3_3_2_oneCodeword[31][10] = { + {1,1,0,0,0,0,0,0,0,1}, + {1,0,1,0,0,0,0,0,0,1}, + {1,1,1,0,0,0,0,0,0,1}, + {2,1,0,0,0,0,0,0,0,1}, + {2,0,1,0,0,0,0,0,0,1}, + {2,0,0,1,0,0,0,0,0,1}, + {2,0,0,0,1,0,0,0,0,1}, + {2,1,1,0,0,0,0,0,0,1}, + {2,0,0,1,1,0,0,0,0,1}, + {2,1,1,1,0,0,0,0,0,1}, + {2,1,1,1,1,0,0,0,0,1}, + {2,1,0,1,0,0,0,0,0,1}, + {2,1,0,0,0,0,0,0,0,2}, + {2,0,1,0,0,0,0,0,0,2}, + {2,0,0,1,0,0,0,0,0,2}, + {2,0,0,0,1,0,0,0,0,2}, + {2,0,0,0,0,1,0,0,0,2}, + {2,0,0,0,0,0,1,0,0,2}, + {2,0,0,0,0,0,0,1,0,2}, + {2,0,0,0,0,0,0,0,1,2}, + {2,1,1,0,0,0,0,0,0,2}, + {2,0,0,1,1,0,0,0,0,2}, + {2,0,0,0,0,1,1,0,0,2}, + {2,0,0,0,0,0,0,1,1,2}, + {2,1,0,0,0,1,0,0,0,2}, + {2,0,0,1,0,0,0,1,0,2}, + {2,1,1,0,0,1,0,0,0,2}, + {2,0,0,1,1,0,0,1,0,2}, + {2,1,1,0,0,1,1,0,0,2}, + {2,0,0,1,1,0,0,1,1,2}, + {2,1,0,1,0,1,0,1,0,2} }; const uint8_t table_7_3_2_3_3_2_twoCodeword[4][10] = { - {2,0,1,2,3,4,0,0,0,2}, - {2,0,1,2,3,4,6,0,0,2}, - {2,0,1,2,3,4,5,6,0,2}, - {2,0,1,2,3,4,5,6,7,2} + {2,1,1,1,1,1,0,0,0,2}, + {2,1,1,1,1,1,0,1,0,2}, + {2,1,1,1,1,1,1,1,0,2}, + {2,1,1,1,1,1,1,1,1,2} }; -const uint8_t table_7_3_2_3_3_3_oneCodeword[24][5] = { - {1,0,0,0,0}, - {1,1,0,0,0}, - {1,0,1,0,0}, - {2,0,0,0,0}, - {2,1,0,0,0}, - {2,2,0,0,0}, - {2,3,0,0,0}, - {2,0,1,0,0}, - {2,2,3,0,0}, - {2,0,1,2,0}, - {2,0,1,2,3}, - {3,0,0,0,0}, - {3,1,0,0,0}, - {3,2,0,0,0}, - {3,3,0,0,0}, - {3,4,0,0,0}, - {3,5,0,0,0}, - {3,0,1,0,0}, - {3,2,3,0,0}, - {3,4,5,0,0}, - {3,0,1,2,0}, - {3,3,4,5,0}, - {3,0,1,2,3}, - {2,0,2,0,0} +const uint8_t table_7_3_2_3_3_3_oneCodeword[24][7] = { + {1,1,0,0,0,0,0}, + {1,0,1,0,0,0,0}, + {1,1,1,0,0,0,0}, + {2,1,0,0,0,0,0}, + {2,0,1,0,0,0,0}, + {2,0,0,1,0,0,0}, + {2,0,0,0,1,0,0}, + {2,1,1,0,0,0,0}, + {2,0,0,1,1,0,0}, + {2,1,1,1,0,0,0}, + {2,1,1,1,1,0,0}, + {3,1,0,0,0,0,0}, + {3,0,1,0,0,0,0}, + {3,0,0,1,0,0,0}, + {3,0,0,0,1,0,0}, + {3,0,0,0,0,1,0}, + {3,0,0,0,0,0,1}, + {3,1,1,0,0,0,0}, + {3,0,0,1,1,0,0}, + {3,0,0,0,0,1,1}, + {3,1,1,1,0,0,0}, + {3,0,0,0,1,1,1}, + {3,1,1,1,1,0,0}, + {3,1,0,1,0,0,0} }; const uint8_t table_7_3_2_3_3_3_twoCodeword[2][7] = { - {3,0,1,2,3,4,0}, - {3,0,1,2,3,4,5} + {3,1,1,1,1,1,0}, + {3,1,1,1,1,1,1} }; -const uint8_t table_7_3_2_3_3_4_oneCodeword[58][6] = { - {1,0,0,0,0,1}, - {1,1,0,0,0,1}, - {1,0,1,0,0,1}, - {2,0,0,0,0,1}, - {2,1,0,0,0,1}, - {2,2,0,0,0,1}, - {2,3,0,0,0,1}, - {2,0,1,0,0,1}, - {2,2,3,0,0,1}, - {2,0,1,2,0,1}, - {2,0,1,2,3,1}, - {3,0,0,0,0,1}, - {3,1,0,0,0,1}, - {3,2,0,0,0,1}, - {3,3,0,0,0,1}, - {3,4,0,0,0,1}, - {3,5,0,0,0,1}, - {3,0,1,0,0,1}, - {3,2,3,0,0,1}, - {3,4,5,0,0,1}, - {3,0,1,2,0,1}, - {3,3,4,5,0,1}, - {3,0,1,2,3,1}, - {2,0,2,0,0,1}, - {3,0,0,0,0,2}, - {3,1,0,0,0,2}, - {3,2,0,0,0,2}, - {3,3,0,0,0,2}, - {3,4,0,0,0,2}, - {3,5,0,0,0,2}, - {3,6,0,0,0,2}, - {3,7,0,0,0,2}, - {3,8,0,0,0,2}, - {3,9,0,0,0,2}, - {3,10,0,0,0,2}, - {3,11,0,0,0,2}, - {3,0,1,0,0,2}, - {3,2,3,0,0,2}, - {3,4,5,0,0,2}, - {3,6,7,0,0,2}, - {3,8,9,0,0,2}, - {3,10,11,0,0,2}, - {3,0,1,6,0,2}, - {3,2,3,8,0,2}, - {3,4,5,10,0,2}, - {3,0,1,6,7,2}, - {3,2,3,8,9,2}, - {3,4,5,10,11,2}, - {1,0,0,0,0,2}, - {1,1,0,0,0,2}, - {1,6,0,0,0,2}, - {1,7,0,0,0,2}, - {1,0,1,0,0,2}, - {1,6,7,0,0,2}, - {2,0,1,0,0,2}, - {2,2,3,0,0,2}, - {2,6,7,0,0,2}, - {2,8,9,0,0,2} +const uint8_t table_7_3_2_3_3_4_oneCodeword[58][14] = { + {1,1,0,0,0,0,0,0,0,0,0,0,0,1}, + {1,0,1,0,0,0,0,0,0,0,0,0,0,1}, + {1,1,1,0,0,0,0,0,0,0,0,0,0,1}, + {2,1,0,0,0,0,0,0,0,0,0,0,0,1}, + {2,0,1,0,0,0,0,0,0,0,0,0,0,1}, + {2,0,0,1,0,0,0,0,0,0,0,0,0,1}, + {2,0,0,0,1,0,0,0,0,0,0,0,0,1}, + {2,1,1,0,0,0,0,0,0,0,0,0,0,1}, + {2,0,0,1,1,0,0,0,0,0,0,0,0,1}, + {2,1,1,1,0,0,0,0,0,0,0,0,0,1}, + {2,1,1,1,1,0,0,0,0,0,0,0,0,1}, + {3,1,0,0,0,0,0,0,0,0,0,0,0,1}, + {3,0,1,0,0,0,0,0,0,0,0,0,0,1}, + {3,0,0,1,0,0,0,0,0,0,0,0,0,1}, + {3,0,0,0,1,0,0,0,0,0,0,0,0,1}, + {3,0,0,0,0,1,0,0,0,0,0,0,0,1}, + {3,0,0,0,0,0,1,0,0,0,0,0,0,1}, + {3,1,1,0,0,0,0,0,0,0,0,0,0,1}, + {3,0,0,1,1,0,0,0,0,0,0,0,0,1}, + {3,0,0,0,0,1,1,0,0,0,0,0,0,1}, + {3,1,1,1,0,0,0,0,0,0,0,0,0,1}, + {3,0,0,0,1,1,1,0,0,0,0,0,0,1}, + {3,1,1,1,1,0,0,0,0,0,0,0,0,1}, + {2,1,0,1,0,0,0,0,0,0,0,0,0,1}, + {3,1,0,0,0,0,0,0,0,0,0,0,0,2}, + {3,0,1,0,0,0,0,0,0,0,0,0,0,2}, + {3,0,0,1,0,0,0,0,0,0,0,0,0,2}, + {3,0,0,0,1,0,0,0,0,0,0,0,0,2}, + {3,0,0,0,0,1,0,0,0,0,0,0,0,2}, + {3,0,0,0,0,0,1,0,0,0,0,0,0,2}, + {3,0,0,0,0,0,0,1,0,0,0,0,0,2}, + {3,0,0,0,0,0,0,0,1,0,0,0,0,2}, + {3,0,0,0,0,0,0,0,0,1,0,0,0,2}, + {3,0,0,0,0,0,0,0,0,0,1,0,0,2}, + {3,0,0,0,0,0,0,0,0,0,0,1,0,2}, + {3,0,0,0,0,0,0,0,0,0,0,0,1,2}, + {3,1,1,0,0,0,0,0,0,0,0,0,0,2}, + {3,0,0,1,1,0,0,0,0,0,0,0,0,2}, + {3,0,0,0,0,1,1,0,0,0,0,0,0,2}, + {3,0,0,0,0,0,0,1,1,0,0,0,0,2}, + {3,0,0,0,0,0,0,0,0,1,1,0,0,2}, + {3,0,0,0,0,0,0,0,0,0,0,1,1,2}, + {3,1,1,0,0,0,0,1,0,0,0,0,0,2}, + {3,0,0,1,1,0,0,0,0,1,0,0,0,2}, + {3,0,0,0,0,1,1,0,0,0,0,1,0,2}, + {3,1,1,0,0,0,0,1,1,0,0,0,0,2}, + {3,0,0,1,1,0,0,0,0,1,1,0,0,2}, + {3,0,0,0,0,1,1,0,0,0,0,1,1,2}, + {1,1,0,0,0,0,0,0,0,0,0,0,0,2}, + {1,0,1,0,0,0,0,0,0,0,0,0,0,2}, + {1,0,0,0,0,0,0,1,0,0,0,0,0,2}, + {1,0,0,0,0,0,0,0,1,0,0,0,0,2}, + {1,1,1,0,0,0,0,0,0,0,0,0,0,2}, + {1,0,0,0,0,0,0,1,1,0,0,0,0,2}, + {2,1,1,0,0,0,0,0,0,0,0,0,0,2}, + {2,0,0,1,1,0,0,0,0,0,0,0,0,2}, + {2,0,0,0,0,0,0,1,1,0,0,0,0,2}, + {2,0,0,0,0,0,0,0,0,1,1,0,0,2} }; -const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10] = { - {3,0,1,2,3,4,0,0,0,1}, - {3,0,1,2,3,4,5,0,0,1}, - {2,0,1,2,3,6,0,0,0,2}, - {2,0,1,2,3,6,8,0,0,2}, - {2,0,1,2,3,6,7,8,0,2}, - {2,0,1,2,3,6,7,8,9,2} +const uint8_t table_7_3_2_3_3_4_twoCodeword[6][14] = { + {3,1,1,1,1,1,0,0,0,0,0,0,0,1}, + {3,1,1,1,1,1,1,0,0,0,0,0,0,1}, + {2,1,1,1,1,0,0,1,0,0,0,0,0,2}, + {2,1,1,1,1,0,0,1,0,1,0,0,0,2}, + {2,1,1,1,1,0,0,1,1,1,0,0,0,2}, + {2,1,1,1,1,0,0,1,1,1,1,0,0,2}, }; // table 7.2-1 TS 38.321 diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 2bac03fc4f..1a1c8920c0 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -698,6 +698,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1; else dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 2; + dlsch_config_pdu_1_0->dmrs_ports = 0; /* VRB_TO_PRB_MAPPING */ dlsch_config_pdu_1_0->vrb_to_prb_mapping = (dci->vrb_to_prb_mapping.val == 0) ? vrb_to_prb_mapping_non_interleaved:vrb_to_prb_mapping_interleaved; /* MCS TABLE INDEX */ @@ -974,31 +975,35 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr if ((dmrs_type == NULL) && (max_length == NULL)){ // Table 7.3.1.2.2-1: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=1 dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_1[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_1[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_1[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_1[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_1[dci->antenna_ports.val][4]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_1[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_1[dci->antenna_ports.val][4]<<3)); } if ((dmrs_type == NULL) && (max_length != NULL)){ // Table 7.3.1.2.2-2: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=2 if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][4]; - dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][5]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][6]<<5) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][7]<<6) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][8]<<7)); + dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][9]; } if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][4]; - dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][5]; - dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][6]; - dlsch_config_pdu_1_1->dmrs_ports[6] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][7]; - dlsch_config_pdu_1_1->dmrs_ports[7] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][8]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][6]<<5) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][7]<<6) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][8]<<7)); dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][9]; } } @@ -1006,41 +1011,55 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr // Table 7.3.1.2.2-3: Antenna port(s) (1000 + DMRS port), dmrs-Type=2, maxLength=1 if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][4]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][6]<<5)); } if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][4]; - dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][5]; - dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][6]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][6]<<5)); } } if ((dmrs_type != NULL) && (max_length != NULL)){ // Table 7.3.1.2.2-4: Antenna port(s) (1000 + DMRS port), dmrs-Type=2, maxLength=2 if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][4]; - dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][5]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][6]<<5) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][7]<<6) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][8]<<7) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][9]<<8) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][10]<<9) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][11]<<10) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][12]<<11)); + dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][13]; } if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][4]; - dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][5]; - dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][6]; - dlsch_config_pdu_1_1->dmrs_ports[6] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][7]; - dlsch_config_pdu_1_1->dmrs_ports[7] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][8]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][6]<<5) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][7]<<6) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][8]<<7) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][9]<<8) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][10]<<9) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][11]<<10) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][12]<<11)); dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][9]; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 8fcb544f18..36e1ff7735 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -694,8 +694,7 @@ void pf_dl(module_id_t module_id, const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2); if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) - nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->pucch_allocation = alloc; From ee2079816bc8b10c9be5bf3fce29f6a915c70b3c Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 23 Jun 2021 18:30:24 +0200 Subject: [PATCH 025/196] handling dl dmrs ports at mac and other modifications for semi static parameters for dlsch --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 41 +++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 10 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 117 ++++++++++++++---- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 10 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 9 +- 6 files changed, 123 insertions(+), 66 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 17cf1d77dd..b112790859 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -273,8 +273,8 @@ void nr_dlsim_preprocessor(module_id_t module_id, /* the following might override the table that is mandated by RRC * configuration */ ps->mcsTableIdx = g_mcsTableIdx; + ps->nrOfLayers = g_nrOfLayers; - sched_pdsch->nrOfLayers = g_nrOfLayers; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->tb_size = nr_compute_tbs(sched_pdsch->Qm, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 36e1ff7735..2f6cf456a4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -453,8 +453,6 @@ bool allocate_dl_retransmission(module_id_t module_id, int rbStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; - const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2); int rbSize = 0; const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; @@ -474,9 +472,8 @@ bool allocate_dl_retransmission(module_id_t module_id, } /* check whether we need to switch the TDA allocation since the last * (re-)transmission */ - if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) - nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); + if (ps->time_domain_allocation != tda || ps->nrOfLayers != UE_info->layers[UE_id]) + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, ps); } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ @@ -485,13 +482,12 @@ bool allocate_dl_retransmission(module_id_t module_id, while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) rbSize++; NR_pdsch_semi_static_t temp_ps; - nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, &temp_ps); + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, &temp_ps); uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, retInfo->R, - retInfo->nrOfLayers, + temp_ps.nrOfLayers, temp_ps.nrOfSymbols, temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT, retInfo->tb_size, @@ -603,7 +599,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); - set_dl_nrOfLayers(sched_pdsch,sched_ctrl); + UE_info->layers[UE_id] = set_dl_nrOfLayers(sched_ctrl); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); uint32_t tbs = nr_compute_tbs(Qm, @@ -613,7 +609,7 @@ void pf_dl(module_id_t module_id, 0, /* N_PRB_DMRS * N_DMRS_SLOT */ 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - sched_pdsch->nrOfLayers) >> 3; + UE_info->layers[UE_id]) >> 3; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]); @@ -691,10 +687,9 @@ void pf_dl(module_id_t module_id, const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; - const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2); - if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); + if (ps->nrOfLayers != UE_info->layers[UE_id] || + ps->time_domain_allocation != tda) + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, ps); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->pucch_allocation = alloc; @@ -704,7 +699,7 @@ void pf_dl(module_id_t module_id, + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); nr_find_nb_rb(sched_pdsch->Qm, sched_pdsch->R, - sched_pdsch->nrOfLayers, + ps->nrOfLayers, ps->nrOfSymbols, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, sched_ctrl->num_total_bytes + oh, @@ -829,17 +824,17 @@ void nr_schedule_ue_spec(module_id_t module_id, const rnti_t rnti = UE_info->rnti[UE_id]; - /* POST processing */ - const uint8_t nrOfLayers = sched_pdsch->nrOfLayers; - const uint16_t R = sched_pdsch->R; - const uint8_t Qm = sched_pdsch->Qm; - const uint32_t TBS = sched_pdsch->tb_size; - /* pre-computed PDSCH values that only change if time domain * allocation/DMRS parameters change. Updated in the preprocessor through * nr_set_pdsch_semi_static() */ NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; + /* POST processing */ + const uint8_t nrOfLayers = ps->nrOfLayers; + const uint16_t R = sched_pdsch->R; + const uint8_t Qm = sched_pdsch->Qm; + const uint32_t TBS = sched_pdsch->tb_size; + int8_t current_harq_pid = sched_pdsch->dl_harq_pid; if (current_harq_pid < 0) { /* PP has not selected a specific HARQ Process, get a new one */ @@ -949,7 +944,7 @@ void nr_schedule_ue_spec(module_id_t module_id, pdsch_pdu->dlDmrsScramblingId = *scc->physCellId; pdsch_pdu->SCID = 0; pdsch_pdu->numDmrsCdmGrpsNoData = ps->numDmrsCdmGrpsNoData; - pdsch_pdu->dmrsPorts = 1; + pdsch_pdu->dmrsPorts = (1<resourceAlloc = 1; @@ -1031,7 +1026,7 @@ void nr_schedule_ue_spec(module_id_t module_id, dci_payload.tpc = sched_ctrl->tpc1; // TPC for PUCCH: table 7.2.1-1 in 38.213 dci_payload.pucch_resource_indicator = pucch->resource_indicator; dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; // PDSCH to HARQ TI - dci_payload.antenna_ports.val = 0; // nb of cdm groups w/o data 1 and dmrs port 0 + dci_payload.antenna_ports.val = ps->dmrs_ports_id; dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID; LOG_D(NR_MAC, "%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), " diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 56034353ac..c6bd51c46b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -365,12 +365,10 @@ void nr_preprocessor_phytest(module_id_t module_id, sched_pdsch->rbStart = rbStart; sched_pdsch->rbSize = rbSize; const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; - const uint8_t num_dmrs_cdm_grps_no_data = 1; - if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) - nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); + int nrOfLayers = 1; + if (ps->time_domain_allocation != tda || ps->nrOfLayers != nrOfLayers) + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, nrOfLayers, sched_ctrl, ps); - sched_pdsch->nrOfLayers = 1; sched_pdsch->mcs = target_dl_mcs; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -381,7 +379,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - sched_pdsch->nrOfLayers) + ps->nrOfLayers) >> 3; /* get the PID of a HARQ process awaiting retransmission, or -1 otherwise */ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 6822354ad3..a05d585941 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -137,12 +137,11 @@ static inline uint8_t get_max_cces(uint8_t scs) { } -void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, - NR_UE_sched_ctrl_t *sched_ctrl) { +uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl) { - // for now this should be enough + // TODO check this but it should be enough for now // if there is not csi report RI is 0 from initialization - sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1; + return (sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1); } @@ -193,6 +192,36 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, } } +void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) { + + //TODO first basic implementation of dmrs port selection + // only vaild for a single codeword + // for now it assumes a selection of Nl consecutive dmrs ports + // and a single front loaded symbol + // dmrs_ports_id is the index of Tables 7.3.1.2.2-1/2/3/4 + + switch (ps->nrOfLayers) { + case 1: + ps->dmrs_ports_id = 0; + ps->numDmrsCdmGrpsNoData = 1; + break; + case 2: + ps->dmrs_ports_id = 2; + ps->numDmrsCdmGrpsNoData = 1; + break; + case 3: + ps->dmrs_ports_id = 9; + ps->numDmrsCdmGrpsNoData = 2; + break; + case 4: + ps->dmrs_ports_id = 10; + ps->numDmrsCdmGrpsNoData = 2; + break; + default: + AssertFatal(1==0,"Number of layers %d\n not supported or not valid\n",ps->nrOfLayers); + } +} + NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc, NR_BWP_Downlink_t *bwp, NR_SearchSpace_t *ss, @@ -341,20 +370,11 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *secondaryCellGroup, const NR_BWP_Downlink_t *bwp, int tda, - uint8_t num_dmrs_cdm_grps_no_data, + uint8_t layers, + NR_UE_sched_ctrl_t *sched_ctrl, NR_pdsch_semi_static_t *ps) { - ps->time_domain_allocation = tda; - const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ? - bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; - AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count); - const int mapping_type = tdaList->list.array[tda]->mappingType; - const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; - SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols); - - ps->mcsTableIdx = 0; if (bwp && bwp->bwp_Dedicated && bwp->bwp_Dedicated->pdsch_Config && @@ -367,14 +387,57 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, } else ps->mcsTableIdx = 0; - ps->numDmrsCdmGrpsNoData = num_dmrs_cdm_grps_no_data; - ps->dmrsConfigType = bwp!=NULL ? (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0; + NR_PDSCH_Config_t *pdsch_Config; + if (bwp && + bwp->bwp_Dedicated && + bwp->bwp_Dedicated->pdsch_Config && + bwp->bwp_Dedicated->pdsch_Config->choice.setup) + pdsch_Config = bwp->bwp_Dedicated->pdsch_Config->choice.setup; + else + pdsch_Config = NULL; - // if no data in dmrs cdm group is 1 only even REs have no data - // if no data in dmrs cdm group is 2 both odd and even REs have no data - ps->N_PRB_DMRS = num_dmrs_cdm_grps_no_data * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); - ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwp ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type); - ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); + if (ps->time_domain_allocation != tda) { + ps->time_domain_allocation = tda; + const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ? + bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count); + ps->mapping_type = tdaList->list.array[tda]->mappingType; + if (pdsch_Config) { + if (ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB) + ps->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_Type == NULL ? 0 : 1; + else + ps->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1; + } + else + ps->dmrsConfigType = NFAPI_NR_DMRS_TYPE1; + const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; + SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols); + ps->dl_dmrs_symb_pos = fill_dmrs_mask(pdsch_Config, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type); + ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); + } + + const long dci_format = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; + if (dci_format == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0 || + pdsch_Config == NULL) { + if (ps->nrOfSymbols == 2 && ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB) + ps->numDmrsCdmGrpsNoData = 1; + else { + if (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1) + ps->numDmrsCdmGrpsNoData = 2; + else + ps->numDmrsCdmGrpsNoData = 3; + } + ps->dmrs_ports_id = 0; + } + else { + if (ps->nrOfLayers != layers) { + ps->nrOfLayers = layers; + set_dl_dmrs_ports(ps); + } + } + + ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); } void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, @@ -671,7 +734,7 @@ void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, } void config_uldci(const NR_BWP_Uplink_t *ubwp, - const NR_ServingCellConfigCommon_t *scc, + const NR_ServingCellConfigCommon_t *scc, const nfapi_nr_pusch_pdu_t *pusch_pdu, dci_pdu_rel15_t *dci_pdu_rel15, int dci_format, @@ -810,15 +873,15 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, // This function configures pucch pdu fapi structure void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, - NR_ServingCellConfigCommon_t *scc, - NR_CellGroupConfig_t *CellGroup, - NR_BWP_Uplink_t *bwp, + NR_ServingCellConfigCommon_t *scc, + NR_CellGroupConfig_t *CellGroup, + NR_BWP_Uplink_t *bwp, uint16_t rnti, uint8_t pucch_resource, uint16_t O_csi, uint16_t O_ack, uint8_t O_sr, - int r_pucch) { + int r_pucch) { NR_PUCCH_Config_t *pucch_Config; NR_PUCCH_Resource_t *pucchres; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index eba95b5cdc..a54d143f42 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -230,7 +230,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, uint16_t O_csi, uint16_t O_ack, uint8_t O_sr, - int r_pucch); + int r_pucch); void find_search_space(int ss_type, NR_BWP_Downlink_t *bwp, @@ -273,7 +273,8 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *secondaryCellGroup, const NR_BWP_Downlink_t *bwp, int tda, - uint8_t num_dmrs_cdm_grps_no_data, + uint8_t layers, + NR_UE_sched_ctrl_t *sched_ctrl, NR_pdsch_semi_static_t *ps); void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, @@ -415,12 +416,13 @@ int16_t ssb_index_from_prach(module_id_t module_idP, void find_SSB_and_RO_available(module_id_t module_idP); +void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps); + void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t mcs_table_idx); -void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, - NR_UE_sched_ctrl_t *sched_ctrl); +uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl); void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp); void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 81df35cf06..84f92fc130 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -362,12 +362,12 @@ typedef struct NR_sched_pusch { typedef struct NR_pdsch_semi_static { int time_domain_allocation; uint8_t numDmrsCdmGrpsNoData; - + int mapping_type; int startSymbolIndex; int nrOfSymbols; - + uint8_t nrOfLayers; uint8_t mcsTableIdx; - + uint8_t dmrs_ports_id; uint8_t N_PRB_DMRS; uint8_t N_DMRS_SLOT; uint16_t dl_dmrs_symb_pos; @@ -383,7 +383,6 @@ typedef struct NR_sched_pdsch { uint8_t mcs; /// TBS-related info - uint8_t nrOfLayers; uint16_t R; uint8_t Qm; uint32_t tb_size; @@ -626,7 +625,7 @@ typedef struct { NR_mac_stats_t mac_stats[MAX_MOBILES_PER_GNB]; NR_list_t list; int num_UEs; - + int layers[MAX_MOBILES_PER_GNB]; bool active[MAX_MOBILES_PER_GNB]; rnti_t rnti[MAX_MOBILES_PER_GNB]; NR_CellGroupConfig_t *CellGroup[MAX_MOBILES_PER_GNB]; From c9a3125937745258d7d01d5bc48387a51486b3b2 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 24 Jun 2021 14:37:24 +0200 Subject: [PATCH 026/196] get nrOfLayers from DCI info at UE --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 9 ++++++++- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 06975b026f..11fe8847bb 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -122,7 +122,14 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH; dlsch0_harq->harq_ack.pucch_resource_indicator = dlsch_config_pdu->pucch_resource_id; dlsch0_harq->harq_ack.slot_for_feedback_ack = (slot+dlsch_config_pdu->pdsch_to_harq_feedback_time_ind)%frame_parms.slots_per_frame; - dlsch0_harq->Nl=1; + + //get nrOfLayers from DCI info + uint8_t Nl = 0; + for (i = 0; i < 12; i++) { // max 12 ports + if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1; + } + dlsch0_harq->Nl = Nl; + dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table; dlsch0_harq->harq_ack.rx_status = downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch0->rnti_type); if (dlsch0_harq->status != ACTIVE) { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 1a1c8920c0..db3c7dfba6 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -698,7 +698,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1; else dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 2; - dlsch_config_pdu_1_0->dmrs_ports = 0; + dlsch_config_pdu_1_0->dmrs_ports = 1; // only port 0 in case of DCI 1_0 /* VRB_TO_PRB_MAPPING */ dlsch_config_pdu_1_0->vrb_to_prb_mapping = (dci->vrb_to_prb_mapping.val == 0) ? vrb_to_prb_mapping_non_interleaved:vrb_to_prb_mapping_interleaved; /* MCS TABLE INDEX */ From a8c4dd537f4ec71ddcaf82c3d7dcb98a928b742f Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 25 Jun 2021 18:10:16 +0200 Subject: [PATCH 027/196] fill dmrs mask depending on actual number of frontloaded symbols, not maxlength --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 22 +++++-------------- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 4 +--- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 18 +++++++++------ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 4 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 4 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 8 +++---- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 17 ++++++++++++-- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + 8 files changed, 42 insertions(+), 36 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index a5a9aac7ec..d86a6ae2c6 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2352,10 +2352,6 @@ int get_num_dmrs(uint16_t dmrs_mask ) { for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); return(num_dmrs); } -/* returns the total DMRS symbols in a slot*/ -uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype){ - return get_num_dmrs(fill_dmrs_mask(pdsch_Config,dmrs_TypeA_Position,NrOfSymbols, startSymbol, mappingtype)); -} // Table 5.1.2.2.1-1 38.214 uint8_t getRBGSize(uint16_t bwp_size, long rbg_size_config) { @@ -3010,9 +3006,9 @@ int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, sl else return(slot_in_period >= slots1+tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0); } -int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI) { +int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI, int length) { - int l0;int dmrs_AdditionalPosition = 0;int maxLength = 0; + int l0;int dmrs_AdditionalPosition = 0; NR_DMRS_DownlinkConfig_t *dmrs_config = NULL; LOG_D(MAC, "NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", NrOfSymbols, startSymbol, mappingtype_fromDCI, dmrs_TypeA_Position); @@ -3024,7 +3020,6 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i // in case of DCI FORMAT 1_0 or dedicated pdsch config not received additionposition = pos2, len1 should be used // referred to section 5.1.6.2 in 38.214 dmrs_AdditionalPosition = 2; - maxLength = 1; if (pdsch_Config != NULL) { if (mappingtype_fromDCI == typeA) { // Type A @@ -3039,8 +3034,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i AssertFatal(dmrs_config != NULL," DMRS configs not present in PDSCH DMRS Downlink config\n"); - // default values of maxlength = len2, additionalposition is pos2 - if (dmrs_config->maxLength != NULL) maxLength = 2; + // default values of additionalposition is pos2 if (dmrs_config->dmrs_AdditionalPosition != NULL) dmrs_AdditionalPosition = *dmrs_config->dmrs_AdditionalPosition; } @@ -3055,11 +3049,6 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i // For TypeB, ld is the duration of the scheduled PDSCH resources ld = (mappingtype_fromDCI == typeA) ? (NrOfSymbols + startSymbol) : NrOfSymbols; - // Section 7.4.1.1.2 in Spec 38.211 - //For PDSCH Mapping typeB, if PDSCH duration ld <=4, only single symbol DMRS is supported - if (mappingtype_fromDCI == typeB && ld <= 4) - maxLength = 1; - AssertFatal(ld > 2 && ld < 15,"Illegal NrOfSymbols according to Table 5.1.2.1-1 Spec 38.214 %d\n",ld); AssertFatal((NrOfSymbols + startSymbol) < 15,"Illegal S+L according to Table 5.1.2.1-1 Spec 38.214 S:%d L:%d\n",startSymbol, NrOfSymbols); @@ -3076,7 +3065,8 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i } - if (maxLength == 1) { + // number of front loaded symbols + if (length == 1) { row = ld - 2; l_prime = table_7_4_1_1_2_3_pdsch_dmrs_positions_l[row][column]; l0 = 1 << l0; @@ -3087,7 +3077,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i l0 = 1<=0,"ERROR in configuration.Check Time Domain allocation of this Grant. l_prime < 1. row:%d, column:%d\n", row, column); l_prime = (mappingtype_fromDCI == typeA) ? (l_prime | l0) : (l_prime << startSymbol); diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index a6adb47c0a..af197fa620 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -47,7 +47,7 @@ uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn); uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw); -int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype_fromDCI); +int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype_fromDCI,int length); int is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,slot_t slotP); @@ -153,8 +153,6 @@ bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config, uint8_t *reOffset, uint8_t *maxNumPorts, uint8_t *ulPower, uint8_t NrOfSymbols); -uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype); - /* \brief Set the transform precoding according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16 @param *pusch_config, pointer to pusch config @param *ubwp pointer to uplink bwp diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index db3c7dfba6..0a705e92df 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -691,7 +691,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr mac->mib->dmrs_TypeA_Position, dlsch_config_pdu_1_0->number_symbols, dlsch_config_pdu_1_0->start_symbol, - mappingtype); + mappingtype, 1); dlsch_config_pdu_1_0->dmrsConfigType = (mac->DLbwp[0] != NULL) ? (mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0; /* number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214 version 15.9.0 Release 15 */ if (dlsch_config_pdu_1_0->number_symbols == 2) @@ -887,12 +887,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_1->start_symbol <= 3)? typeA: typeB); - /* dmrs symbol positions*/ - dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, - mac->scc->dmrs_TypeA_Position, - dlsch_config_pdu_1_1->number_symbols, - dlsch_config_pdu_1_1->start_symbol, - mappingtype); dlsch_config_pdu_1_1->dmrsConfigType = mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1; /* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214, using tables 7.3.1.2.2-1, 7.3.1.2.2-2, 7.3.1.2.2-3, 7.3.1.2.2-4 of 3GPP TS 38.212 */ @@ -964,6 +958,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr uint8_t n_codewords = 1; // FIXME!!! long *max_length = NULL; long *dmrs_type = NULL; + dlsch_config_pdu_1_1->n_front_load_symb = 1; // default value if (pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA) { max_length = pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength; dmrs_type = pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type; @@ -1063,6 +1058,15 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][9]; } } + + /* dmrs symbol positions*/ + dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, + mac->scc->dmrs_TypeA_Position, + dlsch_config_pdu_1_1->number_symbols, + dlsch_config_pdu_1_1->start_symbol, + mappingtype, + dlsch_config_pdu_1_1->n_front_load_symb); + /* TCI */ if (mac->dl_config_request.dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.tci_present_in_dci == 1){ // 0 bit if higher layer parameter tci-PresentInDCI is not enabled diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 5b69bbbbb5..bcc3059373 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1063,7 +1063,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, - mappingtype); + mappingtype, 1); int x_Overhead = 0; uint8_t tb_scaling = 0; @@ -1258,7 +1258,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra scc->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, - mappingtype); + mappingtype, 1); uint16_t N_DMRS_SLOT = get_num_dmrs(dlDmrsSymbPos); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 8b12742fcc..8d6a82a12b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -376,7 +376,7 @@ void schedule_control_sib1(module_id_t module_id, // Calculate number of PRB_DMRS uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData * 6; - uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype); + uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype, 1); uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos); LOG_D(MAC,"dlDmrsSymbPos %x\n",dlDmrsSymbPos); @@ -613,7 +613,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) // Calculate number of PRB_DMRS uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData * 6; - uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype); + uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype, 1); uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos); const uint32_t TBS = nr_compute_tbs(nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs, gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx), diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index c6bd51c46b..e6bfc73fbe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -166,10 +166,10 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex; pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols; pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, - scc->dmrs_TypeA_Position, - NrOfSymbols, - StartSymbolIndex, - mappingtype); + scc->dmrs_TypeA_Position, + NrOfSymbols, + StartSymbolIndex, + mappingtype, 1); /* AssertFatal(k0==0,"k0 is not zero for Initial DL BWP TimeDomain Alloc\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index a05d585941..e597ae936f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -200,22 +200,29 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) { // and a single front loaded symbol // dmrs_ports_id is the index of Tables 7.3.1.2.2-1/2/3/4 + // number of front loaded symbols need to be consistent with maxLength + // when a more complete implementation is done + switch (ps->nrOfLayers) { case 1: ps->dmrs_ports_id = 0; ps->numDmrsCdmGrpsNoData = 1; + ps->frontloaded_symb = 1; break; case 2: ps->dmrs_ports_id = 2; ps->numDmrsCdmGrpsNoData = 1; + ps->frontloaded_symb = 1; break; case 3: ps->dmrs_ports_id = 9; ps->numDmrsCdmGrpsNoData = 2; + ps->frontloaded_symb = 1; break; case 4: ps->dmrs_ports_id = 10; ps->numDmrsCdmGrpsNoData = 2; + ps->frontloaded_symb = 1; break; default: AssertFatal(1==0,"Number of layers %d\n not supported or not valid\n",ps->nrOfLayers); @@ -375,6 +382,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, NR_pdsch_semi_static_t *ps) { + bool reset_dmrs = false; if (bwp && bwp->bwp_Dedicated && bwp->bwp_Dedicated->pdsch_Config && @@ -397,6 +405,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, pdsch_Config = NULL; if (ps->time_domain_allocation != tda) { + reset_dmrs = true; ps->time_domain_allocation = tda; const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ? bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : @@ -413,8 +422,6 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ps->dmrsConfigType = NFAPI_NR_DMRS_TYPE1; const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols); - ps->dl_dmrs_symb_pos = fill_dmrs_mask(pdsch_Config, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type); - ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); } const long dci_format = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; @@ -429,15 +436,21 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ps->numDmrsCdmGrpsNoData = 3; } ps->dmrs_ports_id = 0; + ps->frontloaded_symb = 1; } else { if (ps->nrOfLayers != layers) { + reset_dmrs = true; ps->nrOfLayers = layers; set_dl_dmrs_ports(ps); } } ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); + if (reset_dmrs) { + ps->dl_dmrs_symb_pos = fill_dmrs_mask(pdsch_Config, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type, ps->frontloaded_symb); + ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); + } } void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 84f92fc130..3b38803dd2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -362,6 +362,7 @@ typedef struct NR_sched_pusch { typedef struct NR_pdsch_semi_static { int time_domain_allocation; uint8_t numDmrsCdmGrpsNoData; + uint8_t frontloaded_symb; int mapping_type; int startSymbolIndex; int nrOfSymbols; From 1de542eb35c91aad8f60c1ff9846ce3fbce53392 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 1 Jul 2021 14:41:05 +0200 Subject: [PATCH 028/196] removing layers from UE_info --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 17 ++++++++++------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 2f6cf456a4..fd477ae834 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -472,8 +472,8 @@ bool allocate_dl_retransmission(module_id_t module_id, } /* check whether we need to switch the TDA allocation since the last * (re-)transmission */ - if (ps->time_domain_allocation != tda || ps->nrOfLayers != UE_info->layers[UE_id]) - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, ps); + if (ps->time_domain_allocation != tda) + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, ps->nrOfLayers, sched_ctrl, ps); } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ @@ -482,7 +482,7 @@ bool allocate_dl_retransmission(module_id_t module_id, while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) rbSize++; NR_pdsch_semi_static_t temp_ps; - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, &temp_ps); + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, ps->nrOfLayers, sched_ctrl, &temp_ps); uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, @@ -563,6 +563,7 @@ void pf_dl(module_id_t module_id, float coeff_ue[MAX_MOBILES_PER_GNB]; // UEs that could be scheduled int ue_array[MAX_MOBILES_PER_GNB]; + int layers[MAX_MOBILES_PER_GNB]; NR_list_t UE_sched = { .head = -1, .next = ue_array, .tail = -1, .len = MAX_MOBILES_PER_GNB }; /* Loop UE_info->list to check retransmission */ @@ -575,6 +576,8 @@ void pf_dl(module_id_t module_id, /* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */ sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head; + layers[UE_id] = ps->nrOfLayers; // initialization of layers to the previous value in the strcuture + /* Calculate Throughput */ const float a = 0.0005f; // corresponds to 200ms window const uint32_t b = UE_info->mac_stats[UE_id].dlsch_current_bytes; @@ -599,7 +602,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); - UE_info->layers[UE_id] = set_dl_nrOfLayers(sched_ctrl); + layers[UE_id] = set_dl_nrOfLayers(sched_ctrl); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); uint32_t tbs = nr_compute_tbs(Qm, @@ -609,7 +612,7 @@ void pf_dl(module_id_t module_id, 0, /* N_PRB_DMRS * N_DMRS_SLOT */ 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - UE_info->layers[UE_id]) >> 3; + layers[UE_id]) >> 3; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]); @@ -687,9 +690,9 @@ void pf_dl(module_id_t module_id, const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - if (ps->nrOfLayers != UE_info->layers[UE_id] || + if (ps->nrOfLayers != layers[UE_id] || ps->time_domain_allocation != tda) - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, ps); + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, layers[UE_id], sched_ctrl, ps); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->pucch_allocation = alloc; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 3b38803dd2..9b88f19d14 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -626,7 +626,6 @@ typedef struct { NR_mac_stats_t mac_stats[MAX_MOBILES_PER_GNB]; NR_list_t list; int num_UEs; - int layers[MAX_MOBILES_PER_GNB]; bool active[MAX_MOBILES_PER_GNB]; rnti_t rnti[MAX_MOBILES_PER_GNB]; NR_CellGroupConfig_t *CellGroup[MAX_MOBILES_PER_GNB]; From c72156aa070f8cb2ff251e6a23f89c68ad8ba78b Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 6 Jul 2021 17:45:10 +0200 Subject: [PATCH 029/196] bugfix in set_dl_mcs --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 3aad4980bc..0d7746e196 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -372,8 +372,8 @@ void nr_processULSegment(void* arg) { rv_index, (ulsch_harq->round==0)?1:0, E, - ulsch_harq->F, - Kr-ulsch_harq->F-2*(p_decoderParms->Z))==-1) { + ulsch_harq->F, + Kr-ulsch_harq->F-2*(p_decoderParms->Z))==-1) { stop_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index fd477ae834..7ba0a9cd94 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -866,7 +866,7 @@ void nr_schedule_ue_spec(module_id_t module_id, UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; LOG_D(NR_MAC, - "%4d.%2d RNTI %04x start %3d RBs %3d startSymbol %2d nb_symbol %2d MCS %2d TBS %4d HARQ PID %2d round %d NDI %d\n", + "%4d.%2d RNTI %04x start %3d RBs %3d startSymbol %2d nb_symbol %2d MCS %2d nrOfLayers %d TBS %4d HARQ PID %2d round %d NDI %d\n", frame, slot, rnti, @@ -875,6 +875,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ps->startSymbolIndex, ps->nrOfSymbols, sched_pdsch->mcs, + nrOfLayers, TBS, current_harq_pid, harq->round, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index e597ae936f..96047d541a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -159,15 +159,15 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, switch (cqi_table) { case 0: target_qm = cqi_table1[cqi_idx][0]; - target_coderate = cqi_table1[cqi_idx][0]; + target_coderate = cqi_table1[cqi_idx][1]; break; case 1: target_qm = cqi_table2[cqi_idx][0]; - target_coderate = cqi_table2[cqi_idx][0]; + target_coderate = cqi_table2[cqi_idx][1]; break; case 2: target_qm = cqi_table3[cqi_idx][0]; - target_coderate = cqi_table3[cqi_idx][0]; + target_coderate = cqi_table3[cqi_idx][1]; break; default: AssertFatal(1==0,"Invalid cqi table index %d\n",cqi_table); From 9709b5efe70331b4dfaa0cb3edcef51c687bdbb8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 7 Jul 2021 17:41:36 +0200 Subject: [PATCH 030/196] copying retInfo to sched_pusch in the right place --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index b9b3f336fa..40f426e3d0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -846,9 +846,6 @@ bool allocate_ul_retransmission(module_id_t module_id, retInfo->frame = sched_ctrl->sched_pusch.frame; retInfo->slot = sched_ctrl->sched_pusch.slot; - // Get previous PUSCH filed info - sched_ctrl->sched_pusch = *retInfo; - NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; int rbStart = sched_ctrl->active_ubwp ? NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE) : 0; const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -907,6 +904,9 @@ bool allocate_ul_retransmission(module_id_t module_id, retInfo->rbSize = new_rbSize; retInfo->time_domain_allocation = tda; sched_ctrl->pusch_semi_static = temp_ps; + + // Get previous PUSCH filed info + sched_ctrl->sched_pusch = *retInfo; } /* Find free CCE */ @@ -1572,7 +1572,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) n_ubwp = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count; config_uldci(sched_ctrl->active_ubwp, - scc, + scc, pusch_pdu, &uldci_payload, ps->dci_format, From cdbdb15858c888c2583da1318de6d90508696dac Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 28 Apr 2021 18:06:14 +0200 Subject: [PATCH 031/196] fix 2 layer MIMO in nr_dlsim after last merge with develop --- openair1/SIMULATION/NR_PHY/dlsim.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 05d153b661..fa2290c7f6 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -240,9 +240,9 @@ void update_ptrs_config(NR_CellGroupConfig_t *secondaryCellGroup, uint16_t *rbSi void update_dmrs_config(NR_CellGroupConfig_t *scg,PHY_VARS_NR_UE *ue, int8_t* dmrs_arg); extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration -/* specific dlsim DL preprocessor: uses rbStart/rbSize/mcs from command line of +/* specific dlsim DL preprocessor: uses rbStart/rbSize/mcs/nrOfLayers from command line of dlsim, does not search for CCE/PUCCH occasion but simply sets to 0 */ -int g_mcsIndex = -1, g_mcsTableIdx = 0, g_rbStart = -1, g_rbSize = -1; +int g_mcsIndex = -1, g_mcsTableIdx = 0, g_rbStart = -1, g_rbSize = -1, g_nrOfLayers = 1; void nr_dlsim_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t slot) { @@ -267,7 +267,8 @@ void nr_dlsim_preprocessor(module_id_t module_id, UE_info->CellGroup[0], sched_ctrl->active_bwp, /* tda = */ 2, - /* num_dmrs_cdm_grps_no_data = */ 1, + g_nrOfLayers, + sched_ctrl, ps); NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; @@ -288,7 +289,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - sched_pdsch->nrOfLayers) + g_nrOfLayers) >> 3; /* the simulator assumes the HARQ PID is equal to the slot number */ @@ -356,7 +357,7 @@ int main(int argc, char **argv) // char fname[40], vname[40]; int trial, n_trials = 1, n_errors = 0, n_false_positive = 0; //int n_errors2, n_alamouti; - uint8_t transmission_mode = 1,n_tx=1,n_rx=1; + uint8_t n_tx=1,n_rx=1; uint8_t round; uint8_t num_rounds = 4; @@ -513,12 +514,11 @@ int main(int argc, char **argv) break; */ case 'x': - transmission_mode=atoi(optarg); + g_nrOfLayers=atoi(optarg); - if ((transmission_mode!=1) && - (transmission_mode!=2) && - (transmission_mode!=6)) { - printf("Unsupported transmission mode %d\n",transmission_mode); + if ((g_nrOfLayers!=1) && + (g_nrOfLayers!=2)) { + printf("Unsupported nr Of Layers %d\n",g_nrOfLayers); exit(-1); } @@ -1162,6 +1162,7 @@ int main(int argc, char **argv) } nr_ue_dcireq(&dcireq); //to be replaced with function pointer later + UE_harq_process->Nl = g_nrOfLayers; nr_ue_scheduled_response(&scheduled_response); phy_procedures_nrUE_RX(UE, From 2e8018d28f12f9cf63620ba0febbbb031d581834 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 14 Jul 2021 16:15:47 +0200 Subject: [PATCH 032/196] avoid segmentation fault in scheduling csirs for sa --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 881e1aa4c9..01e076ac8d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2207,6 +2207,10 @@ void nr_csirs_scheduling(int Mod_idP, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id]; + + if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || + !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) continue; + NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList != NULL) { From 0934403a428dc457689aa4bf55d95f8829172655 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 10 Aug 2021 14:26:09 +0200 Subject: [PATCH 033/196] bugfix in setting the nb of layers for sa --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 01e076ac8d..7bd7ba1d48 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -437,6 +437,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, } ps->dmrs_ports_id = 0; ps->frontloaded_symb = 1; + ps->nrOfLayers = 1; } else { if (ps->nrOfLayers != layers) { From 822d8e71adb624de9833b3fcf24bc3026c4f94d6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 27 Aug 2021 16:05:35 +0200 Subject: [PATCH 034/196] fixed missed initialization --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index d5e3d5987c..65e4ee32f0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -483,7 +483,7 @@ bool allocate_dl_retransmission(module_id_t module_id, rbStart++; while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) rbSize++; - NR_pdsch_semi_static_t temp_ps; + NR_pdsch_semi_static_t temp_ps = *ps; nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, ps->nrOfLayers, sched_ctrl, &temp_ps); uint32_t new_tbs; uint16_t new_rbSize; From 32bbf94c5dc5c624d1896dbacec2cf74d5029b06 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 7 Sep 2021 16:54:53 +0200 Subject: [PATCH 035/196] adding condition to use type 2 only for OAI UE --- openair2/RRC/NR/rrc_gNB_reconfig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index a7de5249f2..cc3688b424 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -632,7 +632,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco } bwp->bwp_Dedicated->pdsch_Config->choice.setup->dataScramblingIdentityPDSCH = NULL; - if (dl_antenna_ports > 1)// for MIMO, we use DMRS Config Type 2 + if ((get_softmodem_params()->do_ra || + get_softmodem_params()->phy_test) && + dl_antenna_ports > 1) // for MIMO, we use DMRS Config Type 2 but only with OAI UE bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type)); else bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL; From 736b8be64dc7563d9368357f16d52f290d507c3c Mon Sep 17 00:00:00 2001 From: francescomani Date: Sun, 12 Sep 2021 10:08:26 +0200 Subject: [PATCH 036/196] fix phy sim compilation issue --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index a4e571ca0e..2d7e2146ed 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -763,7 +763,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index e267c8b6d7..d2b951b2fa 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -712,7 +712,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); From b31199c4efbf8b6f1931b7ab1ae4aea16272efdf Mon Sep 17 00:00:00 2001 From: francescomani Date: Sun, 12 Sep 2021 11:27:45 +0200 Subject: [PATCH 037/196] make csirs prb occupation generic --- openair2/RRC/NR/rrc_gNB_reconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index ca1d8b3d9e..72357639f4 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1055,7 +1055,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6; imres0->freqBand = calloc(1,sizeof(*imres0->freqBand)); imres0->freqBand->startingRB = 0; - imres0->freqBand->nrofRBs = 108; + imres0->freqBand->nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2; imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset)); imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; imres0->periodicityAndOffset->choice.slots320 = 0; @@ -1329,7 +1329,7 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_ resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; resourceMapping.density.choice.one = (NULL_t)0; resourceMapping.freqBand.startingRB = 0; - resourceMapping.freqBand.nrofRBs = 108; + resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2; nzpcsi0->resourceMapping = resourceMapping; nzpcsi0->powerControlOffset = 0; nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); From cfccd8ece89b0944a5d1bfb442b3cce8d5beb98d Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 13 Sep 2021 10:01:05 +0200 Subject: [PATCH 038/196] fix another compilation issue --- openair2/RRC/NR/nr_rrc_proto.h | 6 +++++- openair2/RRC/NR/rrc_gNB_reconfig.c | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index e6ac34f6fe..62ff03dcdf 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -82,7 +82,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int do_csirs, int uid); -void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs); +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, + NR_CSI_MeasConfig_t *csi_MeasConfig, + int dl_antenna_ports, + int curr_bwp, + int do_csirs); void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 72357639f4..a54ce7856a 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1093,7 +1093,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL; - config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,do_csirs); + config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,curr_bwp,do_csirs); csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList)); csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL; @@ -1294,7 +1294,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco } -void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs) { +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, + NR_CSI_MeasConfig_t *csi_MeasConfig, + int dl_antenna_ports, + int curr_bwp, + int do_csirs) { if (do_csirs) { csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)); From 9fb094600f4a57373773eb4d122594b28aafd041 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 13 Sep 2021 14:54:49 +0200 Subject: [PATCH 039/196] cosmetic changes and duplicate code --- executables/nr-ru.c | 2 - openair1/SCHED_NR/nr_ru_procedures.c | 6 -- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 24 +++++ openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 4 - openair2/RRC/NR/rrc_gNB.c | 100 ++----------------- openair2/RRC/NR/rrc_gNB_NGAP.c | 2 - targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 2 +- 7 files changed, 34 insertions(+), 106 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index d7e0d0116b..2de04f4e7f 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1384,7 +1384,6 @@ void *ru_thread( void *param ) { } } - // At this point, all information for subframe has been received on FH interface res = pullTpool(gNB->resp_L1, gNB->threadPool); syncMsg = (processingData_L1_t *)NotifiedFifoData(res); @@ -1396,7 +1395,6 @@ void *ru_thread( void *param ) { syncMsg->timestamp_tx = proc->timestamp_tx; res->key = proc->tti_rx; pushTpool(gNB->threadPool, res); - } printf( "Exiting ru_thread \n"); diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index d9bf71c78b..eb0a4f8cdc 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -325,12 +325,6 @@ static void *nr_feptx_thread(void *param) { (void*)&ru->gNB_list[0]->common_vars.txdataF[aa%gNB_tx][txdataF_offset + l*fp->ofdm_symbol_size], (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); } - else if (ru->do_precoding == 0) { - int gNB_tx = ru->gNB_list[0]->frame_parms.nb_antennas_tx; - memcpy((void*)&ru->common.txdataF_BF[aa][l*fp->ofdm_symbol_size], - (void*)&ru->gNB_list[0]->common_vars.txdataF[aa%gNB_tx][txdataF_offset + l*fp->ofdm_symbol_size], - (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); - } else { bw = ru->beam_weights[0]; for(i=0; isymbols_per_slot>>1; ++i){ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 2def947d8f..c36dbb9f60 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -77,6 +77,13 @@ void dump_mac_stats(gNB_MAC_INST *gNB) int stroff=0; for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { stroff = sprintf(output,"UE ID %d RNTI %04x (%d/%d)\n", UE_id, UE_info->rnti[UE_id], num++, UE_info->num_UEs); + LOG_I(NR_MAC, "UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n", + UE_id, + UE_info->rnti[UE_id], + num++, + UE_info->num_UEs, + UE_info->UE_sched_ctrl[UE_id].ph, + UE_info->UE_sched_ctrl[UE_id].pcmax); NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id]; const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0; stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n", @@ -84,6 +91,12 @@ void dump_mac_stats(gNB_MAC_INST *gNB) stats->dlsch_rounds[0], stats->dlsch_rounds[1], stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, avg_rsrp, stats->num_rsrp_meas); + LOG_I(NR_MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n", + UE_id, + stats->dlsch_rounds[0], stats->dlsch_rounds[1], + stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, + avg_rsrp, stats->num_rsrp_meas); + stats->num_rsrp_meas = 0; stats->cumul_rsrp = 0 ; stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); @@ -97,6 +110,17 @@ void dump_mac_stats(gNB_MAC_INST *gNB) "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", UE_id, stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); + LOG_I(NR_MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); + LOG_I(NR_MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n", + UE_id, + stats->ulsch_rounds[0], stats->ulsch_rounds[1], + stats->ulsch_rounds[2], stats->ulsch_rounds[3], + stats->ulsch_DTX, + stats->ulsch_errors); + LOG_I(NR_MAC, + "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", + UE_id, + stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); for (int lc_id = 0; lc_id < 63; lc_id++) { if (stats->lc_bytes_tx[lc_id] > 0) { stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index f120ba8080..093a5fcbe1 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -932,10 +932,6 @@ boolean_t nr_rrc_pdcp_config_asn1_req( // TODO } - if (drb2release_list != NULL) { - // TODO - } - free(kRRCenc); free(kRRCint); free(kUPenc); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 07edb96cd9..53de51953e 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -3043,20 +3043,20 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[ctxt_pP->module_id]->rrc_ue_head)) { ctxt_pP->rnti = ue_context_p->ue_id_rnti; - if (fd) { - if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == TRUE) { - fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n", + if (fd) { + if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == TRUE) { + fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n", ue_context_p->ue_id_rnti, ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.fiveg_tmsi, ue_context_p->ue_context.ul_failure_timer); - } else { - fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n", + } else { + fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n", ue_context_p->ue_id_rnti, ue_context_p->ue_context.ul_failure_timer); - } + } - if (ue_context_p->ue_context.UE_Capability_nr) { - fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n", + if (ue_context_p->ue_context.UE_Capability_nr) { + fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n", get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", @@ -3064,7 +3064,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr)); - } + } } if (ue_context_p->ue_context.ul_failure_timer > 0) { ue_context_p->ue_context.ul_failure_timer++; @@ -3125,88 +3125,6 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { if (fd) fclose(fd); - ue_context_p = NULL; - fd=fopen("nrRRCstats.log","w"); - RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[ctxt_pP->module_id]->rrc_ue_head)) { - ctxt_pP->rnti = ue_context_p->ue_id_rnti; - - if (fd) { - if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == TRUE) { - fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n", - ue_context_p->ue_id_rnti, - ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.fiveg_tmsi, - ue_context_p->ue_context.ul_failure_timer); - } else { - fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n", - ue_context_p->ue_id_rnti, - ue_context_p->ue_context.ul_failure_timer); - } - - if (ue_context_p->ue_context.UE_Capability_nr) { - fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n", - get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), - get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), - is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", - is_ul_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", - get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), - get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), - get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr)); - } - } - if (ue_context_p->ue_context.ul_failure_timer > 0) { - ue_context_p->ue_context.ul_failure_timer++; - - if (ue_context_p->ue_context.ul_failure_timer >= 20000) { - // remove UE after 20 seconds after MAC (or else) has indicated UL failure - LOG_I(RRC, "Removing UE %x instance, because of uplink failure timer timeout\n", - ue_context_p->ue_context.rnti); - if(ue_context_p->ue_context.StatusRrc >= NR_RRC_CONNECTED){ - rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( - ctxt_pP->module_id, - ue_context_p, - NGAP_CAUSE_RADIO_NETWORK, - 30); - }else{ - mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); - rrc_rlc_remove_ue(ctxt_pP); - pdcp_remove_UE(ctxt_pP); - - /* remove RRC UE Context */ - ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti); - if (ue_context_p) { - rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p); - LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti); - } - } - break; // break RB_FOREACH - } - } - - if (ue_context_p->ue_context.ue_release_timer_rrc > 0) { - ue_context_p->ue_context.ue_release_timer_rrc++; - - if (ue_context_p->ue_context.ue_release_timer_rrc >= ue_context_p->ue_context.ue_release_timer_thres_rrc) { - LOG_I(NR_RRC, "Removing UE %x instance after UE_CONTEXT_RELEASE_Complete (ue_release_timer_rrc timeout)\n", - ue_context_p->ue_context.rnti); - ue_context_p->ue_context.ue_release_timer_rrc = 0; - - mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); - rrc_rlc_remove_ue(ctxt_pP); - pdcp_remove_UE(ctxt_pP); - - /* remove RRC UE Context */ - ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti); - if (ue_context_p) { - rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p); - LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti); - } - - break; // break RB_FOREACH - } - } - } - - fclose(fd); /* send a tick to x2ap */ if (is_x2ap_enabled()){ diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index a82914db6b..30c3f2f996 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -787,7 +787,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( struct rrc_gNB_ue_context_s *ue_context_p = NULL; protocol_ctxt_t ctxt; memset(&ctxt, 0, sizeof(protocol_ctxt_t)); - ue_initial_id = NGAP_DOWNLINK_NAS (msg_p).ue_initial_id; gNB_ue_ngap_id = NGAP_DOWNLINK_NAS (msg_p).gNB_ue_ngap_id; ue_context_p = rrc_gNB_get_ue_context_from_ngap_ids(instance, ue_initial_id, gNB_ue_ngap_id); @@ -876,7 +875,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( { // rrc_mac_config_req_gNB #ifdef ITTI_SIM - MessageDef *message_p; uint8_t *message_buffer; message_buffer = itti_malloc (TASK_RRC_GNB, TASK_RRC_UE_SIM, length); memcpy (message_buffer, buffer, length); diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index acd107479e..65045b1703 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -645,7 +645,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp break; default: AssertFatal(1==0,"Shouldn't be here\n"); - } + } samples_received=0; while (samples_received != nsamps) { From 97d114e0ed8dc057a1fd9f1591dcd4ae580b70ef Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 4 Oct 2021 17:11:41 +0200 Subject: [PATCH 040/196] bugfix --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 2ccc6c3e27..62ac6e57f7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -575,7 +575,6 @@ void pf_dl(module_id_t module_id, if (sched_ctrl->ul_failure==1 && get_softmodem_params()->phy_test==0) continue; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - if (sched_ctrl->ul_failure==1) continue; /* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */ sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head; From 0286138f33c5559ceca805c9a842aea241a5cc51 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Wed, 27 Oct 2021 12:09:27 +0200 Subject: [PATCH 041/196] Adaptations of the MAC scheduling to support FDD - removed calls to the TDD UL/DL configuration common in FDD mode - bugfix in the generation of prach info from index - initial adaptation of gNB schedulers - adapted PUCCH ack/nack scheduling by taking into account 6 slots min delay in FDD mode (to be integrated with latest development of PUCCH) - made the use of nr_slots_per_frame more consistent --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 11 --- openair2/GNB_APP/gnb_config.c | 13 +++- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 5 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 70 +++++++++++-------- openair2/LAYER2/NR_MAC_UE/main_ue_nr.c | 8 ++- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 10 +-- openair2/LAYER2/NR_MAC_gNB/config.c | 47 +++++++------ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 7 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 41 +++++++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 5 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 10 ++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 47 +++++++------ .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 10 ++- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + openair2/RRC/NR/MESSAGES/asn1_msg.c | 17 +++-- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 17 files changed, 178 insertions(+), 129 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 63cf6f2f2d..3135a96028 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -206,17 +206,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); } - - -/* - - if ((cfg->subframe_config.duplex_mode.value == TDD) && - ((nr_slot_select(fp,frame,slot)&NR_DOWNLINK_SLOT)==SF_DL)) return; - - // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1); - -*/ - void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { ldpcDecode_t *rdata = (ldpcDecode_t*) NotifiedFifoData(req); NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index af21fd8b08..ee20760941 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -291,9 +291,16 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { asn_sequence_del(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,i,1); } } - if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) { - free(scc->tdd_UL_DL_ConfigurationCommon->pattern2); - scc->tdd_UL_DL_ConfigurationCommon->pattern2=NULL; + + lte_frame_type_t frame_type = get_frame_type((int)*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + if (frame_type == FDD) { + free(scc->tdd_UL_DL_ConfigurationCommon); + scc->tdd_UL_DL_ConfigurationCommon = NULL; + } else { // TDD + if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) { + free(scc->tdd_UL_DL_ConfigurationCommon->pattern2); + scc->tdd_UL_DL_ConfigurationCommon->pattern2 = NULL; + } } if ((int)*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing == -1) { diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 3750bb156d..c8fa48b0ee 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -1753,9 +1753,11 @@ int get_nr_prach_info_from_index(uint8_t index, subframe = slot >> mu; s_map = table_6_3_3_2_2_prachConfig_Index[index][4]; if ( (s_map>>subframe)&0x01 ) { + *N_RA_slot = table_6_3_3_2_2_prachConfig_Index[index][6]; // Number of RACH slots within a subframe if (mu == 1) { - if ( (table_6_3_3_2_2_prachConfig_Index[index][6] <= 1) && (slot%2 == 0) ) + if ((*N_RA_slot <= 1) && (slot % 2 == 0)){ return 0; // no prach in even slots @ 30kHz for 1 prach per subframe + } } for(int i = 0; i <= subframe ; i++) { if ( (s_map >> i) & 0x01) { @@ -1764,6 +1766,7 @@ int get_nr_prach_info_from_index(uint8_t index, } if (start_symbol != NULL && N_t_slot != NULL && N_dur != NULL && format != NULL){ *start_symbol = table_6_3_3_2_2_prachConfig_Index[index][5]; + *config_period = x; *N_t_slot = table_6_3_3_2_2_prachConfig_Index[index][7]; *N_dur = table_6_3_3_2_2_prachConfig_Index[index][8]; if (table_6_3_3_2_2_prachConfig_Index[index][1] != -1) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 1accbf30cb..d848595ce4 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -228,27 +228,28 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac, } // TDD Table Configuration - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) - cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - else { - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, - "scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); - cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; - } if(cfg->cell_config.frame_duplex_type == TDD){ + if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) { + cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; + } else { + AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, + "scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); + cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; + } LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period); int return_tdd = set_tdd_config_nr_ue(cfg, - scc->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + scc->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols ); - if (return_tdd !=0) + if (return_tdd !=0) { LOG_E(PHY,"TDD configuration can not be done\n"); - else + } else { LOG_I(PHY,"TDD has been properly configurated\n"); + } } // PRACH configuration @@ -411,14 +412,14 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, } // TDD Table Configuration - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) - cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - else { - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, - "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); - cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; - } if(cfg->cell_config.frame_duplex_type == TDD){ + if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) { + cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; + } else { + AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, + "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); + cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; + } LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period); int return_tdd = set_tdd_config_nr_ue(cfg, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, @@ -427,15 +428,14 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols ); - - if (return_tdd !=0) - LOG_E(PHY,"TDD configuration can not be done\n"); - else - LOG_I(PHY,"TDD has been properly configurated\n"); + if (return_tdd !=0) { + LOG_E(PHY, "TDD configuration can not be done\n"); + } else { + LOG_I(PHY, "TDD has been properly configurated\n"); + } } - + // PRACH configuration - uint8_t nb_preambles = 64; if(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles != NULL) nb_preambles = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles; @@ -628,6 +628,7 @@ int nr_rrc_mac_config_req_ue( NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); RA_config_t *ra = &mac->ra; + fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; // TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc. @@ -642,11 +643,20 @@ int nr_rrc_mac_config_req_ue( if (sccP != NULL) { mac->scc_SIB=sccP; - LOG_D(MAC,"Keeping ServingCellConfigCommonSIB\n"); + LOG_D(NR_MAC, "In %s: Keeping ServingCellConfigCommonSIB\n", __FUNCTION__); config_common_ue_sa(mac,module_id,cc_idP); - int num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0) num_slots_ul++; - LOG_I(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul); + + int num_slots_ul = nr_slots_per_frame[mac->mib->subCarrierSpacingCommon]; + if(cfg->cell_config.frame_duplex_type == FDD){ + free(mac->scc_SIB->tdd_UL_DL_ConfigurationCommon); + mac->scc_SIB->tdd_UL_DL_ConfigurationCommon = NULL; + } else { + num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; + if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) { + num_slots_ul++; + } + } + LOG_I(NR_MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul); mac->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t)); // Setup the SSB to Rach Occasions mapping according to the config build_ssb_to_ro_map(mac);//->scc, mac->phy_config.config_req.cell_config.frame_duplex_type); @@ -665,6 +675,10 @@ int nr_rrc_mac_config_req_ue( ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; } mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; + if(cfg->cell_config.frame_duplex_type == FDD){ + free(mac->scc->tdd_UL_DL_ConfigurationCommon); + mac->scc->tdd_UL_DL_ConfigurationCommon = NULL; + } mac->physCellId = *mac->scc->physCellId; config_common_ue(mac,module_id,cc_idP); mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index b27837043f..992427b4e2 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -68,10 +68,12 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) { // point to a list of structures (one for each UL slot) to store PUSCH scheduling parameters // received from UL DCI. if (nr_ue_mac_inst->scc) { - int num_slots_ul = nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if (nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0) + NR_TDD_UL_DL_ConfigCommon_t *tdd = nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon; + int num_slots_ul = tdd ? tdd->pattern1.nrofUplinkSlots : nr_slots_per_frame[*nr_ue_mac_inst->scc->ssbSubcarrierSpacing]; + if (tdd && nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) { num_slots_ul++; - LOG_D(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul); + } + LOG_D(NR_MAC, "In %s: Initializing ul_config_request. num_slots_ul = %d\n", __FUNCTION__, num_slots_ul); nr_ue_mac_inst->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t)); } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 145b24f00e..5615c1aa95 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -148,12 +148,14 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl int mu = mac->ULbwp[0] ? mac->ULbwp[0]->bwp_Common->genericParameters.subcarrierSpacing : mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.subcarrierSpacing; - NR_TDD_UL_DL_Pattern_t *tdd_pattern = &tdd_config->pattern1; - const int num_slots_per_tdd = nr_slots_per_frame[mu] >> (7 - tdd_pattern->dl_UL_TransmissionPeriodicity); - const int num_slots_ul = tdd_pattern->nrofUplinkSlots + (tdd_pattern->nrofUplinkSymbols!=0); + const int n = nr_slots_per_frame[mu]; + const int num_slots_per_tdd = tdd_config ? (n >> (7 - tdd_config->pattern1.dl_UL_TransmissionPeriodicity)) : n; + const int num_slots_ul = tdd_config ? (tdd_config->pattern1.nrofUplinkSlots + (tdd_config->pattern1.nrofUplinkSymbols != 0)) : n; int index = slot % num_slots_ul; - LOG_D(NR_MAC, "In %s slots per tdd %d, num_slots_ul %d, index %d\n", __FUNCTION__, + LOG_D(NR_MAC, "In %s slots per %s: %d, num_slots_ul %d, index %d\n", + __FUNCTION__, + tdd_config ? "TDD" : "FDD", num_slots_per_tdd, num_slots_ul, index); diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index a2c130078e..347b3f9495 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -58,6 +58,7 @@ void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList * struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list, NR_UE_sched_ctrl_t *sched_ctrl) { + if (rlc_bearer2add_list) // keep lcids for (int i=0;ilist.count;i++) { @@ -394,18 +395,17 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts cfg->num_tlv++; // TDD Table Configuration - //cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - cfg->tdd_table.tdd_period.tl.tag = NFAPI_NR_CONFIG_TDD_PERIOD_TAG; - cfg->num_tlv++; - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) - cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - else { - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, - "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); - cfg->tdd_table.tdd_period.value = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; - } - if(cfg->cell_config.frame_duplex_type.value == TDD){ - LOG_I(NR_MAC,"Setting TDD configuration period to %d\n",cfg->tdd_table.tdd_period.value); + if (cfg->cell_config.frame_duplex_type.value == TDD){ + cfg->tdd_table.tdd_period.tl.tag = NFAPI_NR_CONFIG_TDD_PERIOD_TAG; + cfg->num_tlv++; + if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) { + cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; + } else { + AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, + "In %s: scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n", __FUNCTION__); + cfg->tdd_table.tdd_period.value = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; + } + LOG_I(NR_MAC, "Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period.value); int periods_per_frame = set_tdd_config_nr(cfg, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots, @@ -439,8 +439,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present); /* dimension UL_tti_req_ahead for number of slots in frame */ - const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; - const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; RC.nrmac[Mod_idP]->UL_tti_req_ahead[0] = calloc(n, sizeof(nfapi_nr_ul_tti_request_t)); AssertFatal(RC.nrmac[Mod_idP]->UL_tti_req_ahead[0], "could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n"); @@ -490,19 +489,23 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, find_SSB_and_RO_available(Mod_idP); - const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; - const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; - const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots; - const int nr_dlmix_slots = tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0); - const int nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0); + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; + const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; + const int nr_dlmix_slots = tdd ? tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0) : 0; + const int nr_dl_slots = tdd ? nr_dlmix_slots : n; + const int nr_ulstart_slot = tdd ? tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0) : 1; for (int slot = 0; slot < n; ++slot) { /* FIXME: it seems there is a problem with slot 0/10/slots right after UL: * we just get retransmissions. Thus, do not schedule such slots in DL */ - if (slot % nr_slots_period != 0) - RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dlmix_slots) << (slot % 64); + if (slot % nr_slots_period != 0){ + RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dl_slots) << (slot % 64); + } RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) >= nr_ulstart_slot) << (slot % 64); - LOG_D(NR_MAC, "slot %d DL %d UL %d\n", + + LOG_I(NR_MAC, "In %s: slot %d DL %d UL %d\n", + __FUNCTION__, slot, (RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] & ((uint64_t)1 << (slot % 64))) != 0, (RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] & ((uint64_t)1 << (slot % 64))) != 0); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 956a76ddbb..f961a9c01c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -170,7 +170,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, /* advance last round's future UL_tti_req to be ahead of current frame/slot */ future_ul_tti_req->SFN = (slotP == 0 ? frameP : frameP + 1) % 1024; - LOG_D(MAC,"Future_ul_tti SFN = %d for slot %d \n", future_ul_tti_req->SFN, (slotP + num_slots - 1) % num_slots); + LOG_D(NR_MAC, "In %s: UL_tti_req_ahead SFN.slot = %d.%d for slot %d \n", __FUNCTION__, future_ul_tti_req->SFN, future_ul_tti_req->Slot, (slotP + num_slots - 1) % num_slots); /* future_ul_tti_req->Slot is fixed! */ future_ul_tti_req->n_pdus = 0; future_ul_tti_req->n_ulsch = 0; @@ -367,9 +367,10 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, if (slot==0 && (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]>=257)) { const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; - const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots; + const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; + const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; const int nb_periods_per_frame = n / nr_slots_period; + // re-initialization of tdd_beam_association at beginning of frame (only for FR2) for (int i=0; itdd_beam_association[i] = -1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index c6752d37c2..8b645c06f3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -406,14 +406,19 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, uint8_t mu = *scc->ssbSubcarrierSpacing; uint8_t response_window = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow; uint8_t slot_window; + const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; // number of mixed slot or of last dl slot if there is no mixed slot - uint8_t last_dl_slot_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots; + uint8_t last_dl_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; // lenght of tdd period in slots - uint8_t tdd_period_slot = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols == 0) + uint8_t tdd_period_slot = tdd ? scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots : n_slots_frame; + + if (tdd && (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols == 0)) { last_dl_slot_period--; - if ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0)) + } + if (tdd && ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))) { tdd_period_slot++; + } switch(response_window){ case NR_RACH_ConfigGeneric__ra_ResponseWindow_sl1: @@ -714,10 +719,17 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t // beam association for FR2 int16_t *tdd_beam_association = nr_mac->tdd_beam_association; if (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257) { - uint8_t tdd_period_slot = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0)) + + const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + uint8_t tdd_period_slot = tdd ? scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots : n_slots_frame; + + if (tdd && ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))) { tdd_period_slot++; + } + int num_tdd_period = sched_slot/tdd_period_slot; + if((tdd_beam_association[num_tdd_period]!=-1)&&(tdd_beam_association[num_tdd_period]!=ra->beam_id)) return; // can't schedule retransmission in this slot else @@ -879,15 +891,18 @@ void nr_get_Msg3alloc(module_id_t module_id, ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList: scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + const int n_slots_frame = nr_slots_per_frame[mu]; + const int nrofUplinkSymbols = tdd ? tdd->nrofUplinkSymbols : 4; uint8_t k2 = 0; for (int i=0; ilist.count; i++) { startSymbolAndLength = pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; SLIV2SL(startSymbolAndLength, &StartSymbolIndex, &NrOfSymbols); // we want to transmit in the uplink symbols of mixed slot - if (NrOfSymbols == scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols) { + if (NrOfSymbols == nrofUplinkSymbols) { k2 = *pusch_TimeDomainAllocationList->list.array[i]->k2; temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 - ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; + ra->Msg3_slot = temp_slot % n_slots_frame; if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { ra->Msg3_tda_id = i; break; @@ -897,16 +912,17 @@ void nr_get_Msg3alloc(module_id_t module_id, AssertFatal(ra->Msg3_tda_id<16,"Unable to find Msg3 time domain allocation in list\n"); - if (nr_slots_per_frame[mu]>temp_slot) + if (n_slots_frame > temp_slot) ra->Msg3_frame = current_frame; else - ra->Msg3_frame = (current_frame + (temp_slot/nr_slots_per_frame[mu]))%1024; + ra->Msg3_frame = (current_frame + (temp_slot / n_slots_frame)) % 1024; // beam association for FR2 if (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257) { - uint8_t tdd_period_slot = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0)) + uint8_t tdd_period_slot = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots : n_slots_frame; + if (tdd && ((tdd->nrofDownlinkSymbols > 0) || (tdd->nrofUplinkSymbols > 0))) { tdd_period_slot++; + } int num_tdd_period = ra->Msg3_slot/tdd_period_slot; if((tdd_beam_association[num_tdd_period]!=-1)&&(tdd_beam_association[num_tdd_period]!=ra->beam_id)) AssertFatal(1==0,"Cannot schedule MSG3\n"); @@ -979,7 +995,6 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->dmrs_ports = 1; // 6.2.2 in 38.214 only port 0 to be used pusch_pdu->num_dmrs_cdm_grps_no_data = 2; // no data in dmrs symbols as in 6.2.2 in 38.214 pusch_pdu->resource_alloc = 1; //type 1 - pusch_pdu->rb_start = msg3_first_rb; if (msg3_nb_rb > pusch_pdu->bwp_size) AssertFatal(1==0,"MSG3 allocated number of RBs exceed the BWP size\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 28b7ea3c21..ccbda816f9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -266,8 +266,9 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, ssbSubcarrierOffset, offset_pointa, (*(uint32_t*)cc->MIB_pdu.payload) & ((1<<24)-1)); fill_ssb_vrb_map(cc, offset_pointa, ssb_start_symbol, CC_id); const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; - const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; - const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots; + const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; + const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n_slots_frame; num_tdd_period = rel_slot/nr_slots_period; gNB->tdd_beam_association[num_tdd_period]=i_ssb; num_ssb++; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index d32e45a379..9b8a78c198 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -124,8 +124,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * } } - const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; - const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_dl_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_dl_tda[bwp_id])); const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 668a88d746..5766b39e29 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2097,6 +2097,7 @@ void get_pdsch_to_harq_feedback(int Mod_idP, int bwp_id, NR_SearchSpace__searchSpaceType_PR ss_type, int *max_fb_time, + int *min_fb_time, uint8_t *pdsch_to_harq_feedback) { NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; @@ -2135,9 +2136,10 @@ void get_pdsch_to_harq_feedback(int Mod_idP, // common search type uses DCI format 1_0 if (ss_type == NR_SearchSpace__searchSpaceType_PR_common) { for (int i=0; i<8; i++) { - pdsch_to_harq_feedback[i] = i+1; + pdsch_to_harq_feedback[i] = i+1; // TODO take into account the min feedback time here if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; + *min_fb_time = 6; } } else { @@ -2158,12 +2160,12 @@ void get_pdsch_to_harq_feedback(int Mod_idP, } AssertFatal(found==1,"Couldn't find a ue specific searchspace\n"); - if (ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0) { for (int i=0; i<8; i++) { - pdsch_to_harq_feedback[i] = i+1; + pdsch_to_harq_feedback[i] = i+1; // TODO take into account the min feedback time here if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; + *min_fb_time = 6; } } else { @@ -2173,6 +2175,8 @@ void get_pdsch_to_harq_feedback(int Mod_idP, pdsch_to_harq_feedback[i] = *ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[i]; if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; + if(pdsch_to_harq_feedback[i]<*min_fb_time) + *min_fb_time = pdsch_to_harq_feedback[i]; } } else diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index f2ce8498fd..cccc930dce 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1173,19 +1173,21 @@ int nr_acknack_scheduling(int mod_id, const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; - const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; - const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots; - const int first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); - const int first_ul_slot_period = first_ul_slot_tdd%nr_slots_period; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; + const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n_slots_frame; + const int first_ul_slot_tdd = tdd ? tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period) : 0; + const int first_ul_slot_period = tdd ? first_ul_slot_tdd % nr_slots_period : 0; const int CC_id = 0; NR_sched_pucch_t *csi_pucch; - AssertFatal(slot < first_ul_slot_tdd + (tdd->nrofUplinkSymbols != 0), - "cannot handle multiple TDD periods (yet): slot %d first_ul_slot_tdd %d nrofUplinkSlots %ld\n", - slot, - first_ul_slot_tdd, - tdd->nrofUplinkSlots); + if (tdd) { + AssertFatal(slot < first_ul_slot_tdd + (tdd->nrofUplinkSymbols != 0), + "cannot handle multiple TDD periods (yet): slot %d first_ul_slot_tdd %d nrofUplinkSlots %ld\n", + slot, + first_ul_slot_tdd, + tdd->nrofUplinkSlots); + } /* for the moment, we consider: * * only pucch_sched[0] holds HARQ (and SR) @@ -1195,19 +1197,21 @@ int nr_acknack_scheduling(int mod_id, * * each UE has dedicated PUCCH Format 0 resources, and we use index 0! */ NR_UE_sched_ctrl_t *sched_ctrl = &RC.nrmac[mod_id]->UE_info.UE_sched_ctrl[UE_id]; NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[0]; - LOG_D(NR_MAC,"pucch_acknak %d.%d Trying to allocate pucch, current DAI %d\n",frame,slot,pucch->dai_c); + LOG_D(NR_MAC, "In %s: %d.%d Trying to allocate pucch, current DAI %d\n", __FUNCTION__, frame, slot, pucch->dai_c); + pucch->r_pucch=r_pucch; AssertFatal(pucch->csi_bits == 0, "%s(): csi_bits %d in sched_pucch[0]\n", __func__, pucch->csi_bits); + /* if the currently allocated PUCCH of this UE is full, allocate it */ if (pucch->dai_c == 2) { /* advance the UL slot information in PUCCH by one so we won't schedule in * the same slot again */ const int f = pucch->frame; const int s = pucch->ul_slot; - LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n",frame,slot,f,s); + LOG_D(NR_MAC, "In %s: %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n", __FUNCTION__, frame, slot, f, s); nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; @@ -1234,7 +1238,7 @@ int nr_acknack_scheduling(int mod_id, } } - LOG_D(NR_MAC,"pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); + LOG_D(NR_MAC, "In %s: pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n", __FUNCTION__, frame, slot, pucch->frame, pucch->ul_slot, pucch->dai_c); // this is hardcoded for now as ue specific only if we are not on the initialBWP (to be fixed to allow ue_Specific also on initialBWP NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]; @@ -1253,10 +1257,11 @@ int nr_acknack_scheduling(int mod_id, if (sched_ctrl->active_ubwp) bwp_Id = sched_ctrl->active_ubwp->bwp_Id; int max_fb_time = 0; - get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, pdsch_to_harq_feedback); + int min_fb_time = 6; + get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, &min_fb_time, pdsch_to_harq_feedback); int max_absslot = frame*n_slots_frame + slot + max_fb_time; - LOG_D(NR_MAC,"pucch_acknak 1b. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); + LOG_D(NR_MAC, "In %s: 1b. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); /* there is a HARQ. Check whether we can use it for this ACKNACK */ if (pucch->dai_c > 0) { /* this UE already has a PUCCH occasion */ @@ -1272,7 +1277,7 @@ int nr_acknack_scheduling(int mod_id, const int f = pucch->frame; const int s = pucch->ul_slot; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI > 0, cannot reach timing for pucch in %d.%d, advancing slot by 1 and trying again\n",frame,slot,f,s); + LOG_D(NR_MAC, "In %s: %d.%d DAI > 0, cannot reach timing for pucch in %d.%d, advancing slot by 1 and trying again\n", __FUNCTION__, frame, slot, f, s); nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; @@ -1286,11 +1291,11 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = i; pucch->dai_c++; // retain old resource indicator, and we are good - LOG_D(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); + LOG_D(NR_MAC, "In %s: %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); return 0; } - LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI = 0, looking for new pucch occasion\n",frame,slot); + LOG_D(NR_MAC, "In %s: %d.%d DAI = 0, looking for new pucch occasion\n", __FUNCTION__, frame, slot); /* we need to find a new PUCCH occasion */ /*Inizialization of timing information*/ @@ -1299,7 +1304,7 @@ int nr_acknack_scheduling(int mod_id, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); pucch->frame = frame; - pucch->ul_slot = first_ul_slot_tdd; + pucch->ul_slot = tdd ? first_ul_slot_tdd : first_ul_slot_tdd + min_fb_time; } // Find the right timing_indicator value. @@ -1308,7 +1313,7 @@ int nr_acknack_scheduling(int mod_id, while ((pucch->frame*n_slots_frame + pucch->ul_slot) <= max_absslot) { int i = 0; while (i < 8) { - LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", + LOG_D(NR_MAC, "In %s: pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", __FUNCTION__, i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot); if (pdsch_to_harq_feedback[i] == pucch->ul_slot - slot) { ind_found = i; @@ -1373,7 +1378,7 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = ind_found; // index in the list of timing indicators - LOG_D(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); + LOG_D(NR_MAC, "In %s: 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); pucch->dai_c++; pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 51192b4d63..64297c2617 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -165,10 +165,8 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub symb_tda_mi); } - const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; - const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; for (int slot = 0; slot < n; ++slot) { @@ -181,11 +179,12 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub LOG_D(MAC, "DL slot %d UL slot %d preferred_ul_tda %d\n", slot, sched_slot, nrmac->preferred_ul_tda[bwp_id][slot]); } - if (k2 < tdd->nrofUplinkSlots) + if (tdd && k2 < tdd->nrofUplinkSlots) { LOG_W(NR_MAC, "k2 %d < tdd->nrofUplinkSlots %ld: not all UL slots can be scheduled\n", k2, tdd->nrofUplinkSlots); + } } // For both UL-SCH except: @@ -882,8 +881,7 @@ long get_K2(NR_ServingCellConfigCommon_t *scc,NR_BWP_Uplink_t *ubwp, int time_do bool nr_UE_is_to_be_scheduled(module_id_t mod_id, int CC_id, int UE_id, frame_t frame, sub_frame_t slot) { const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; - const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; - const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const int now = frame * n + slot; const struct gNB_MAC_INST_s *nrmac = RC.nrmac[mod_id]; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index d17448437d..8147f47847 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -213,6 +213,7 @@ void get_pdsch_to_harq_feedback(int Mod_idP, int bwp_id, NR_SearchSpace__searchSpaceType_PR ss_type, int *max_fb_time, + int *min_fb_time, uint8_t *pdsch_to_harq_feedback); void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index eb6f86fda6..9f50168260 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -619,10 +619,12 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, } sib1->servingCellConfigCommon->ssb_PeriodicityServingCell = *configuration->scc->ssb_periodicityServingCell; - sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon = CALLOC(1,sizeof(struct NR_TDD_UL_DL_ConfigCommon)); - sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing = configuration->scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing; - sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->pattern1 = configuration->scc->tdd_UL_DL_ConfigurationCommon->pattern1; - sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->pattern2 = configuration->scc->tdd_UL_DL_ConfigurationCommon->pattern2; + if (configuration->scc->tdd_UL_DL_ConfigurationCommon) { + sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon = CALLOC(1,sizeof(struct NR_TDD_UL_DL_ConfigCommon)); + sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing = configuration->scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing; + sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->pattern1 = configuration->scc->tdd_UL_DL_ConfigurationCommon->pattern1; + sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->pattern2 = configuration->scc->tdd_UL_DL_ConfigurationCommon->pattern2; + } sib1->servingCellConfigCommon->ss_PBCH_BlockPower = configuration->scc->ss_PBCH_BlockPower; // ims-EmergencySupport @@ -1181,8 +1183,11 @@ void fill_initial_SpCellConfig(rnti_t rnti, // Check for above configuration and exit for now if it is not the case AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30, "SCS != 30kHz\n"); - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity==NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5, - "TDD period != 5ms : %ld\n",scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); + + if (scc->tdd_UL_DL_ConfigurationCommon) { + AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity == NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5, + "TDD period != 5ms : %ld\n", scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); + } schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8+(10*((rnti>>1)&3)) + (rnti&1); schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource)); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 980bd39c37..401a3a1aba 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -945,7 +945,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = (i<6) ? (i+2) : 0; + *delay[i] = i + 6; // (i<6) ? (i+2) : 0; // (Temp) TODO replace with param from conf ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); From a5f18dbb2067549000c19c148dde5f9130a7c8be Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Wed, 3 Nov 2021 15:31:03 +0100 Subject: [PATCH 042/196] Enhancements to the overall MAC logging - updating to NR_MAC tag - minor cleanups - added more relavant info for debugging purposes --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 6 +++--- openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c | 4 ++-- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 9 ++++++++- openair2/LAYER2/NR_MAC_UE/config_ue.c | 8 ++++---- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 11 +---------- 7 files changed, 20 insertions(+), 22 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 8bbf569814..f957c38182 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -522,7 +522,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, A = (harq_process->TBS)<<3; - LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d, Coderate %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers, R); + LOG_D(NR_PHY, "ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d, Coderate %d\n", harq_pid, A, G, mcs, n_layers, nb_rb, Qm, n_layers, R); if (R<1024) Coderate = (float) R /(float) 1024; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index ba5c65ceb7..8f0f5bea5d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -265,9 +265,9 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING, VCD_FUNCTION_IN); - LOG_D(PHY,"ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers); - LOG_D(PHY,"ulsch coding A %d G %d mod_order %d\n", A,G, mod_order); - LOG_D(PHY,"harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n", + LOG_D(NR_PHY, "ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers); + LOG_D(NR_PHY, "ulsch coding A %d G %d mod_order %d\n", A, G, mod_order); + LOG_D(NR_PHY, "harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n", harq_pid,harq_process->ndi,harq_process->pusch_pdu.pusch_data.new_data_indicator); if (harq_process->first_tx == 1 || diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c index 4fcbd322db..c33946fa5a 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c @@ -51,7 +51,7 @@ uint32_t nr_compute_tbs(uint16_t Qm, uint32_t Ninfo, Np_info, C; uint8_t n, scale; - LOG_D(NR_MAC,"nb_symb_sch %d, nb_dmrs_prb %d, nb_rb_oh %d\n",nb_symb_sch,nb_dmrs_prb,nb_rb_oh); + LOG_D(NR_MAC, "In %s: nb_symb_sch %d, nb_dmrs_prb %d, nb_rb %d, nb_rb_oh %d, tb_scaling %d Nl %d\n", __FUNCTION__, nb_symb_sch, nb_dmrs_prb, nb_rb, nb_rb_oh, tb_scaling, Nl); nbp_re = NR_NB_SC_PER_RB * nb_symb_sch - nb_dmrs_prb - nb_rb_oh; nb_re = min(156, nbp_re) * nb_rb; @@ -86,7 +86,7 @@ uint32_t nr_compute_tbs(uint16_t Qm, } } - LOG_D(NR_MAC, "In %s: Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs); + LOG_D(NR_MAC, "In %s: Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d bits\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs); return nr_tbs; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index c8fa48b0ee..341ba9c641 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2597,7 +2597,14 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr uint8_t row, colomn; int32_t l_prime; - LOG_D(NR_MAC, "PUSCH: NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", duration_in_symbols, start_symbol, mapping_type, dmrs_typeA_position); + LOG_D(NR_MAC, "In %s: PUSCH NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d additional_pos:%d, pusch_maxLength:%d\n", + __FUNCTION__, + duration_in_symbols, + start_symbol, + mapping_type, + dmrs_typeA_position, + additional_pos, + pusch_maxLength); // Section 6.4.1.1.3 in Spec 38.211 // For PDSCH Mapping TypeA, ld is duration between first OFDM of the slot and last OFDM symbol of the scheduled PUSCH resources diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index d848595ce4..3691fcee7f 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -246,9 +246,9 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac, ); if (return_tdd !=0) { - LOG_E(PHY,"TDD configuration can not be done\n"); + LOG_E(NR_PHY, "TDD configuration cannot be done\n"); } else { - LOG_I(PHY,"TDD has been properly configurated\n"); + LOG_I(NR_PHY, "TDD has been properly configurated\n"); } } @@ -429,9 +429,9 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols ); if (return_tdd !=0) { - LOG_E(PHY, "TDD configuration can not be done\n"); + LOG_E(NR_PHY, "TDD configuration can not be done\n"); } else { - LOG_I(PHY, "TDD has been properly configurated\n"); + LOG_I(NR_PHY, "TDD has been properly configurated\n"); } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 5615c1aa95..e8176f16e8 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -601,7 +601,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, pusch_config_pdu->nr_of_symbols = NrOfSymbols; l_prime_mask = get_l_prime(NrOfSymbols, mappingtype, add_pos, dmrslength, StartSymbolIndex, mac->scc ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position); - LOG_D(MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d , DMRS_MASK:%x\n", pusch_config_pdu->start_symbol_index, pusch_config_pdu->nr_of_symbols, mappingtype, l_prime_mask); + LOG_D(NR_MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d, DMRS_MASK:%x\n", pusch_config_pdu->start_symbol_index, pusch_config_pdu->nr_of_symbols, mappingtype, l_prime_mask); #ifdef DEBUG_MSG3 LOG_D(NR_MAC, "In %s BWP assignment (BWP (start %d, size %d) \n", __FUNCTION__, pusch_config_pdu->bwp_start, pusch_config_pdu->bwp_size); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 8b645c06f3..807549d595 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -988,7 +988,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->data_scrambling_id = *scc->physCellId; pusch_pdu->nrOfLayers = 1; pusch_pdu->ul_dmrs_symb_pos = get_l_prime(nr_of_symbols,mappingtype,pusch_dmrs_pos2,pusch_len1,start_symbol_index, scc->dmrs_TypeA_Position); - LOG_D(MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d , ul_dmrs_symb_pos:%x\n", start_symbol_index, nr_of_symbols, mappingtype, pusch_pdu->ul_dmrs_symb_pos); + LOG_D(NR_MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d, ul_dmrs_symb_pos:%x\n", start_symbol_index, nr_of_symbols, mappingtype, pusch_pdu->ul_dmrs_symb_pos); pusch_pdu->dmrs_config_type = 0; pusch_pdu->ul_dmrs_scrambling_id = *scc->physCellId; //If provided and the PUSCH is not a msg3 PUSCH, otherwise, L2 should set this to physical cell id. pusch_pdu->scid = 0; //DMRS sequence initialization [TS38.211, sec 6.4.1.1.1]. Should match what is sent in DCI 0_1, otherwise set to 0. @@ -1912,25 +1912,16 @@ void nr_fill_rar(uint8_t Mod_idP, rar->UL_GRANT_4 = (uint8_t) ul_grant & 0xff; #ifdef DEBUG_RAR - //LOG_I(NR_MAC, "rarbi->E = 0x%x\n", rarbi->E); - //LOG_I(NR_MAC, "rarbi->T = 0x%x\n", rarbi->T); - //LOG_I(NR_MAC, "rarbi->R = 0x%x\n", rarbi->R); - //LOG_I(NR_MAC, "rarbi->BI = 0x%x\n", rarbi->BI); - LOG_I(NR_MAC, "rarh->E = 0x%x\n", rarh->E); LOG_I(NR_MAC, "rarh->T = 0x%x\n", rarh->T); LOG_I(NR_MAC, "rarh->RAPID = 0x%x (%i)\n", rarh->RAPID, rarh->RAPID); - LOG_I(NR_MAC, "rar->R = 0x%x\n", rar->R); LOG_I(NR_MAC, "rar->TA1 = 0x%x\n", rar->TA1); - LOG_I(NR_MAC, "rar->TA2 = 0x%x\n", rar->TA2); LOG_I(NR_MAC, "rar->UL_GRANT_1 = 0x%x\n", rar->UL_GRANT_1); - LOG_I(NR_MAC, "rar->UL_GRANT_2 = 0x%x\n", rar->UL_GRANT_2); LOG_I(NR_MAC, "rar->UL_GRANT_3 = 0x%x\n", rar->UL_GRANT_3); LOG_I(NR_MAC, "rar->UL_GRANT_4 = 0x%x\n", rar->UL_GRANT_4); - LOG_I(NR_MAC, "rar->TCRNTI_1 = 0x%x\n", rar->TCRNTI_1); LOG_I(NR_MAC, "rar->TCRNTI_2 = 0x%x\n", rar->TCRNTI_2); #endif From 755c8d5055a37895c8464d6c46fcd4a3234644c8 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Wed, 3 Nov 2021 15:33:46 +0100 Subject: [PATCH 043/196] Fixed calculation of num dmrs per prb at gnb side - the param was hardcoded to 12 at gNB side while it was computed at UE side - the same function used at UE side has been moved to the common file - now the computation at gNB side is consistent with the UE --- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 8 +++++++- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 19 ++++++++++++++++++ openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 9 +++++++++ openair2/LAYER2/NR_MAC_UE/mac_proto.h | 4 ---- openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c | 20 ------------------- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 8 +++++++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 14 ++++++++++++- 7 files changed, 55 insertions(+), 27 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index b1addf740a..4357f6dd49 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -143,7 +143,13 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, ulsch_ue->Nid_cell = Nid_cell; - get_num_re_dmrs(pusch_pdu, &nb_dmrs_re_per_rb, &number_dmrs_symbols); + get_num_re_dmrs(pusch_pdu->start_symbol_index, + pusch_pdu->nr_of_symbols, + pusch_pdu->ul_dmrs_symb_pos, + pusch_pdu->dmrs_config_type, + pusch_pdu->num_dmrs_cdm_grps_no_data, + &nb_dmrs_re_per_rb, + &number_dmrs_symbols); LOG_D(PHY,"ulsch %x : start_rb %d bwp_start %d start_sc %d start_symbol %d num_symbols %d cdmgrpsnodata %d num_dmrs %d dmrs_re_per_rb %d\n", rnti,start_rb,pusch_pdu->bwp_start,start_sc,start_symbol,number_of_symbols,cdm_grps_no_data,number_dmrs_symbols,nb_dmrs_re_per_rb); diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 341ba9c641..7bf0f84f71 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -4294,3 +4294,22 @@ bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config, return valid; } +void get_num_re_dmrs(int start_symbol, + uint8_t number_of_symbols, + uint16_t ul_dmrs_symb_pos, + uint8_t dmrs_type, + uint8_t cdm_grps_no_data, + uint8_t *nb_dmrs_re_per_rb, + uint16_t *number_dmrs_symbols){ + + *number_dmrs_symbols = 0; + + for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) { + if((ul_dmrs_symb_pos >> i) & 0x01){ + *number_dmrs_symbols += 1; + } + } + + *nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6 : 4) * cdm_grps_no_data; + +} diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index e107553117..5e70cb2d4d 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -62,6 +62,15 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDLBWP, uint16_t N_RB, int bwp_id); + +void get_num_re_dmrs(int start_symbol, + uint8_t number_of_symbols, + uint16_t ul_dmrs_symb_pos, + uint8_t dmrs_type, + uint8_t cdm_grps_no_data, + uint8_t *nb_dmrs_re_per_rb, + uint16_t *number_dmrs_symbols); + void find_aggregation_candidates(uint8_t *aggregation_level, uint8_t *nr_of_candidates, NR_SearchSpace_t *ss, diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 30b87a056e..92710b3c0d 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -390,10 +390,6 @@ int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *p void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_request_t *dl_config, int rnti_type, int ss_id); void fill_dci_search_candidates(NR_SearchSpace_t *ss,fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15); -void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu, - uint8_t *nb_dmrs_re_per_rb, - uint16_t *number_dmrs_symbols); - void build_ssb_to_ro_map(NR_UE_MAC_INST_t *mac); void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint16_t *bwp_ind, uint8_t *dci_format); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c b/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c index 7f1011fb28..a8b1428673 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c @@ -160,26 +160,6 @@ int nr_get_Po_NOMINAL_PUSCH(NR_PRACH_RESOURCES_t *prach_resources, module_id_t m return receivedTargerPower; } -void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu, - uint8_t *nb_dmrs_re_per_rb, - uint16_t *number_dmrs_symbols){ - - int start_symbol = pusch_pdu->start_symbol_index; - uint8_t number_of_symbols = pusch_pdu->nr_of_symbols; - uint16_t ul_dmrs_symb_pos = pusch_pdu->ul_dmrs_symb_pos; - uint8_t dmrs_type = pusch_pdu->dmrs_config_type; - uint8_t cdm_grps_no_data = pusch_pdu->num_dmrs_cdm_grps_no_data; - - *number_dmrs_symbols = 0; - for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) { - if((ul_dmrs_symb_pos >> i) & 0x01) - *number_dmrs_symbols += 1; - } - - *nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4)*cdm_grps_no_data; - -} - // Implementation of 6.2.4 Configured ransmitted power // 3GPP TS 38.101-1 version 16.5.0 Release 16 // - diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index e8176f16e8..70abd545cd 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -842,7 +842,13 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, return -1; } - get_num_re_dmrs(pusch_config_pdu, &nb_dmrs_re_per_rb, &number_dmrs_symbols); + get_num_re_dmrs(pusch_config_pdu->start_symbol_index, + pusch_config_pdu->nr_of_symbols, + pusch_config_pdu->ul_dmrs_symb_pos, + pusch_config_pdu->dmrs_config_type, + pusch_config_pdu->num_dmrs_cdm_grps_no_data, + &nb_dmrs_re_per_rb, + &number_dmrs_symbols); // Compute TBS pusch_config_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_config_pdu->qam_mod_order, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 807549d595..16543d6a7c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -968,6 +968,9 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, int start_symbol_index,nr_of_symbols; + uint8_t nb_dmrs_re_per_rb = 0; + uint16_t number_dmrs_symbols = 0; + SLIV2SL(startSymbolAndLength, &start_symbol_index, &nr_of_symbols); pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA; @@ -1013,11 +1016,20 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->pusch_data.harq_process_id = 0; pusch_pdu->pusch_data.new_data_indicator = 1; pusch_pdu->pusch_data.num_cb = 0; + + get_num_re_dmrs(pusch_pdu->start_symbol_index, + pusch_pdu->nr_of_symbols, + pusch_pdu->ul_dmrs_symb_pos, + pusch_pdu->dmrs_config_type, + pusch_pdu->num_dmrs_cdm_grps_no_data, + &nb_dmrs_re_per_rb, + &number_dmrs_symbols); + pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, pusch_pdu->target_code_rate, pusch_pdu->rb_size, pusch_pdu->nr_of_symbols, - 12, // nb dmrs set for no data in dmrs symbol + nb_dmrs_re_per_rb*number_dmrs_symbols, // nb dmrs set for no data in dmrs symbol 0, //nb_rb_oh 0, // to verify tb scaling pusch_pdu->nrOfLayers)>>3; From 9d9bc0e718a3dc5078f5e66669139fd2508013fd Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 4 Nov 2021 10:17:45 +0100 Subject: [PATCH 044/196] Conf file for band 66 in SA mode --- .../gnb.sa.band66.fr1.106PRB.usrpn300.conf | 303 ++++++++++++++++++ 1 file changed, 303 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf new file mode 100644 index 0000000000..09772440a4 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -0,0 +1,303 @@ +Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-Eurecom-5GNRBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 0xa000; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x1; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 433096; + dl_frequencyBand = 66; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 430000; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 13475; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 66; + ul_absoluteFrequencyPointA = 350000; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 13475; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -118; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + GNB_INTERFACE_NAME_FOR_S1U = "eth0"; + GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + ulsch_max_slots_inactivity = 100; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + }; + From 565fb8834201748e339a3e290848f216f6b07d64 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 4 Nov 2021 16:08:41 +0100 Subject: [PATCH 045/196] Simplified set_tdd_config_nr_ue function - reviewed redundant code - removed unnecessary return --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 74 ++++++++++----------------- openair2/LAYER2/NR_MAC_UE/mac_proto.h | 6 +-- 2 files changed, 29 insertions(+), 51 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 3691fcee7f..d9514691ba 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -38,15 +38,27 @@ #include "common/utils/nr/nr_common.h" #include "executables/softmodem-common.h" -int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, - int mu, - int nrofDownlinkSlots, int nrofDownlinkSymbols, - int nrofUplinkSlots, int nrofUplinkSymbols) { +void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, + int mu, + NR_TDD_UL_DL_ConfigCommon_t *tdd_config) { + int nrofDownlinkSlots = tdd_config->pattern1.nrofDownlinkSlots; + int nrofDownlinkSymbols = tdd_config->pattern1.nrofDownlinkSymbols; + int nrofUplinkSlots = tdd_config->pattern1.nrofUplinkSlots; + int nrofUplinkSymbols = tdd_config->pattern1.nrofUplinkSymbols; int slot_number = 0; int nb_periods_per_frame; int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<pattern1.ext1 == NULL) { + cfg->tdd_table.tdd_period = tdd_config->pattern1.dl_UL_TransmissionPeriodicity; + } else { + AssertFatal(tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, "tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); + cfg->tdd_table.tdd_period = *tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; + } + + LOG_I(NR_MAC, "Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period); + switch(cfg->tdd_table.tdd_period) { case 0: nb_periods_per_frame = 20; // 10ms/0p5ms @@ -140,7 +152,8 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, } } - return (0); + LOG_I(NR_MAC, "TDD has been properly configurated\n"); + } @@ -228,28 +241,10 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac, } // TDD Table Configuration - if(cfg->cell_config.frame_duplex_type == TDD){ - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) { - cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - } else { - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, - "scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); - cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; - } - LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period); - int return_tdd = set_tdd_config_nr_ue(cfg, - scc->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols - ); - - if (return_tdd !=0) { - LOG_E(NR_PHY, "TDD configuration cannot be done\n"); - } else { - LOG_I(NR_PHY, "TDD has been properly configurated\n"); - } + if (cfg->cell_config.frame_duplex_type == TDD){ + set_tdd_config_nr_ue(cfg, + scc->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + scc->tdd_UL_DL_ConfigurationCommon); } // PRACH configuration @@ -412,27 +407,10 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, } // TDD Table Configuration - if(cfg->cell_config.frame_duplex_type == TDD){ - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) { - cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - } else { - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, - "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); - cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; - } - LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period); - int return_tdd = set_tdd_config_nr_ue(cfg, - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols - ); - if (return_tdd !=0) { - LOG_E(NR_PHY, "TDD configuration can not be done\n"); - } else { - LOG_I(NR_PHY, "TDD has been properly configurated\n"); - } + if (cfg->cell_config.frame_duplex_type == TDD){ + set_tdd_config_nr_ue(cfg, + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + scc->tdd_UL_DL_ConfigurationCommon); } // PRACH configuration diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 92710b3c0d..3531fa564e 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -213,9 +213,9 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, uint8_t *ulsch_buffer, uint16_t buflen); -int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int mu, - int nrofDownlinkSlots, int nrofDownlinkSymbols, - int nrofUplinkSlots, int nrofUplinkSymbols); +void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, + int mu, + NR_TDD_UL_DL_ConfigCommon_t *tdd_config); void set_harq_status(NR_UE_MAC_INST_t *mac, uint8_t pucch_id, From d872a9bc95da8dcd804650bd692221546eb812f4 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 8 Oct 2021 15:16:08 +0200 Subject: [PATCH 046/196] runmodem update for IF frequency --- doc/RUNMODEM.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index dc7a982310..f51d3a7318 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -171,15 +171,9 @@ With the RF simulator (on the same machine): ## IF setup with OAI -The -C and --CO flags can be used together at UE side to set custom downlink and uplink FR1 arbitrary frequencies for the IF equipment. +The `if_freq` and `if_freq_off` options can be used to set (via command line) custom downlink and uplink FR1 arbitrary frequencies for the IF equipment both. -In order to run this setup, the following flags are needed at the UE side: - -`-C` - -`--CO` - -and the following parameters must be configured in the RUs section of the gNB configuration file: +In the same way, the following parameters must be configured in the RUs section of the gNB configuration file: `if_freq` @@ -199,7 +193,7 @@ gNB on machine 1: UE on machine 2: -`sudo ./nr-uesoftmodem -C 2169080000 --CO -400000000` +`sudo ./nr-uesoftmodem --if_freq 2169080000 --if_freq_off -400000000` From 6784eac3f5d53e343179bb37257a72105ccd806c Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 8 Oct 2021 12:00:32 +0200 Subject: [PATCH 047/196] runmodem update for sa --- doc/RUNMODEM.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index f51d3a7318..8976cbc39c 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -151,6 +151,14 @@ At the UE the --sa flag will: 4) 5G-NR RRC Reconfiguration 5) Start Downlink and Uplink Data Transfer +Command line parameters for UE in --sa mode: +- `C` : downlink carrier frequency in Hz (default value 0) +- `CO` : uplink frequency offset for FDD in Hz (default value 0) +- `numerology` : numerology index (default value 1) +- `r` : bandwidth in terms of RBs (default value 106) +- `band` : NR band number (default value 78) +- `s` : SSB start subcarrier (default value 512) + ### Run OAI in SA mode From the `cmake_targets/ran_build/build` folder: From 3fcbfdadadf03eca0caaf54001f886f8e925933e Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 27 Sep 2021 18:45:59 +0200 Subject: [PATCH 048/196] Minimum value of DL to ACK --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/GNB_APP/gnb_config.c | 2 ++ openair2/GNB_APP/gnb_paramdef.h | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 19 +++++++++++-------- openair2/RRC/NR/nr_rrc_proto.h | 2 ++ openair2/RRC/NR/rrc_gNB_nsa.c | 2 ++ openair2/RRC/NR/rrc_gNB_reconfig.c | 5 ++++- 8 files changed, 24 insertions(+), 12 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 83d6625830..3e982eb887 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -765,7 +765,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 2, 0, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 69316d6b88..a7075eb218 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -713,7 +713,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index ee20760941..82e0233633 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1113,6 +1113,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; + printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index bf1d12825e..0c3d971569 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -149,7 +149,7 @@ typedef enum { {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ {GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ +{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ } #define GNB_GNB_ID_IDX 0 diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index f06d50be48..07648d0074 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1182,14 +1182,17 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr uint8_t feedback_ti = ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0]; - // set the harq status at MAC for feedback - set_harq_status(mac,dci->pucch_resource_indicator, - dci->harq_pid, - dlsch_config_pdu_1_1->accumulated_delta_PUCCH, - feedback_ti, - dci->dai[0].val, - dci_ind->n_CCE,dci_ind->N_CCE,0, - frame,slot); + AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d)\n", + feedback_ti,DURATION_RX_TO_TX); + + // set the harq status at MAC for feedback + set_harq_status(mac,dci->pucch_resource_indicator, + dci->harq_pid, + dlsch_config_pdu_1_1->accumulated_delta_PUCCH, + feedback_ti, + dci->dai[0].val, + dci_ind->n_CCE,dci_ind->N_CCE, + 0,frame,slot); dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DLSCH; LOG_D(MAC,"(nr_ue_procedures.c) pdu_type=%d\n\n",dl_config->dl_config_list[dl_config->number_pdus].pdu_type); diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 9465b9b4b0..22109c3029 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -79,6 +79,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int scg_id, int servCellIndex, int dl_antenna_ports, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid); @@ -90,6 +91,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid); diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 52f451d7bb..e606e22a57 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -256,6 +256,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, + carrier->minRXTXTIMEpdsch, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); @@ -265,6 +266,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, + carrier->minRXTXTIMEpdsch, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 401a3a1aba..4b8fd77dc5 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -55,6 +55,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int scg_id, int servCellIndex, int dl_antenna_ports, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid) { @@ -945,7 +946,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = i + 6; // (i<6) ? (i+2) : 0; // (Temp) TODO replace with param from conf + *delay[i] = i+minRXTXTIMEpdsch; ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); @@ -1348,6 +1349,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid) { @@ -1363,6 +1365,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon 1, 1, dl_antenna_ports, + minRXTXTIMEpdsch, do_csirs, initial_csi_index, uid); From 30cc2b764f605cf687c1d4910632e265d5b13201 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 8 Nov 2021 11:00:59 +0100 Subject: [PATCH 049/196] removing min_fb_time from acknack scheduling --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 10 +++------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 5 ++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 - 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 5766b39e29..edb3c02a49 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2097,7 +2097,6 @@ void get_pdsch_to_harq_feedback(int Mod_idP, int bwp_id, NR_SearchSpace__searchSpaceType_PR ss_type, int *max_fb_time, - int *min_fb_time, uint8_t *pdsch_to_harq_feedback) { NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; @@ -2136,10 +2135,9 @@ void get_pdsch_to_harq_feedback(int Mod_idP, // common search type uses DCI format 1_0 if (ss_type == NR_SearchSpace__searchSpaceType_PR_common) { for (int i=0; i<8; i++) { - pdsch_to_harq_feedback[i] = i+1; // TODO take into account the min feedback time here + pdsch_to_harq_feedback[i] = i+1; if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; - *min_fb_time = 6; } } else { @@ -2162,10 +2160,10 @@ void get_pdsch_to_harq_feedback(int Mod_idP, if (ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0) { for (int i=0; i<8; i++) { - pdsch_to_harq_feedback[i] = i+1; // TODO take into account the min feedback time here + pdsch_to_harq_feedback[i] = i+1; if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; - *min_fb_time = 6; + } } else { @@ -2175,8 +2173,6 @@ void get_pdsch_to_harq_feedback(int Mod_idP, pdsch_to_harq_feedback[i] = *ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[i]; if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; - if(pdsch_to_harq_feedback[i]<*min_fb_time) - *min_fb_time = pdsch_to_harq_feedback[i]; } } else diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index cccc930dce..982270b3a8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1257,8 +1257,7 @@ int nr_acknack_scheduling(int mod_id, if (sched_ctrl->active_ubwp) bwp_Id = sched_ctrl->active_ubwp->bwp_Id; int max_fb_time = 0; - int min_fb_time = 6; - get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, &min_fb_time, pdsch_to_harq_feedback); + get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, pdsch_to_harq_feedback); int max_absslot = frame*n_slots_frame + slot + max_fb_time; LOG_D(NR_MAC, "In %s: 1b. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); @@ -1304,7 +1303,7 @@ int nr_acknack_scheduling(int mod_id, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); pucch->frame = frame; - pucch->ul_slot = tdd ? first_ul_slot_tdd : first_ul_slot_tdd + min_fb_time; + pucch->ul_slot = first_ul_slot_tdd; } // Find the right timing_indicator value. diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 8147f47847..d17448437d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -213,7 +213,6 @@ void get_pdsch_to_harq_feedback(int Mod_idP, int bwp_id, NR_SearchSpace__searchSpaceType_PR ss_type, int *max_fb_time, - int *min_fb_time, uint8_t *pdsch_to_harq_feedback); void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, From c9f2f54df3b4600393af6cb407d0199c9f0d6b89 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 8 Nov 2021 15:18:05 +0100 Subject: [PATCH 050/196] using minRXTXTIMEpdsch in acknack scheduling (for common case) --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 ++-- openair1/SIMULATION/NR_PHY/ulsim.c | 4 ++-- openair2/GNB_APP/gnb_config.c | 9 +++------ openair2/LAYER2/NR_MAC_gNB/config.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 -- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 8 ++++++-- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 5 +++-- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + openair2/RRC/NR/rrc_gNB.c | 4 ++++ openair2/RRC/NR/rrc_gNB_nsa.c | 2 ++ 10 files changed, 25 insertions(+), 16 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 2f30609d7d..ea15f937fe 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -787,9 +787,9 @@ int main(int argc, char **argv) AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface"); gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 0, 0, NULL); + rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 0, 0, NULL); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); + rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); // reset preprocessor to the one of DLSIM after it has been set during // rrc_mac_config_req_gNB gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index a7075eb218..0fa5165244 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -724,9 +724,9 @@ int main(int argc, char **argv) gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,0, 0, NULL); + rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,0, 0, NULL); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); + rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 82e0233633..fa20d8e4e0 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -31,6 +31,7 @@ #include #include "common/utils/LOG/log.h" +#include "common/utils/nr/nr_common.h" #include "common/utils/LOG/log_extern.h" #include "assertions.h" #include "gnb_config.h" @@ -47,7 +48,6 @@ // #include "SystemInformationBlockType2.h" // #include "LAYER2/MAC/extern.h" // #include "LAYER2/MAC/proto.h" -#include "PHY/phy_extern.h" #include "PHY/INIT/phy_init.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "nfapi_vnf.h" @@ -947,8 +947,6 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { if (num_gnbs>0) { - - // Output a list of all gNBs. ////////// Identification parameters config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL); @@ -1112,14 +1110,12 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; + printf("SIB1 TDA %d\n",*GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; - printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); - NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; - }// }//End for (k=0; k configuration.pdsch_AntennaPorts, rrc->configuration.pusch_AntennaPorts, rrc->configuration.sib1_tda, + rrc->configuration.minRXTXTIMEpdsch, rrc->configuration.scc, NULL, 0, diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 626b6724bb..06ad17df6e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -429,6 +429,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts, int sib1_tda, + int minRXTXTIMEpdsch, NR_ServingCellConfigCommon_t *scc, NR_BCCH_BCH_Message_t *mib, int add_ue, @@ -479,6 +480,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, } } RC.nrmac[Mod_idP]->ssb_SubcarrierOffset = ssb_SubcarrierOffset; + RC.nrmac[Mod_idP]->minRXTXTIMEpdsch = minRXTXTIMEpdsch; NR_PHY_Config_t phycfg; phycfg.Mod_id = Mod_idP; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index bc1c11c1ba..77d55eb1df 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -968,8 +968,6 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, int start_symbol_index,nr_of_symbols; - uint8_t nb_dmrs_re_per_rb = 0; - uint16_t number_dmrs_symbols = 0; SLIV2SL(startSymbolAndLength, &start_symbol_index, &nr_of_symbols); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 11bee1ade6..5fdaebf637 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1180,6 +1180,8 @@ int nr_acknack_scheduling(int mod_id, const int first_ul_slot_tdd = tdd? tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period) : 0; const int first_ul_slot_period = tdd? tdd->nrofDownlinkSlots : 0; const int CC_id = 0; + const int minfbtime = RC.nrmac[mod_id]->minRXTXTIMEpdsch; + NR_sched_pucch_t *csi_pucch; if (tdd) { @@ -1270,7 +1272,8 @@ int nr_acknack_scheduling(int mod_id, int diff = pucch->ul_slot - slot; if (diff<0) diff += n_slots_frame; - if (pdsch_to_harq_feedback[i] == diff) + if (pdsch_to_harq_feedback[i] == diff && + pdsch_to_harq_feedback[i] >= minfbtime) break; ++i; } @@ -1322,7 +1325,8 @@ int nr_acknack_scheduling(int mod_id, int diff = pucch->ul_slot - slot; if (diff<0) diff += n_slots_frame; - if (pdsch_to_harq_feedback[i] == diff) { + if (pdsch_to_harq_feedback[i] == diff && + pdsch_to_harq_feedback[i] >= minfbtime) { ind_found = i; break; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 5136a4a57c..6b254cd0af 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -50,10 +50,11 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts, int sib1_tda, + int minRXTXTIMEpdsch, NR_ServingCellConfigCommon_t *scc, NR_BCCH_BCH_Message_t *mib, - int add_ue, - uint32_t rnti, + int add_ue, + uint32_t rnti, NR_CellGroupConfig_t *CellGroup); void clear_nr_nfapi_information(gNB_MAC_INST * gNB, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index b2735b2428..8690f7192f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -678,6 +678,7 @@ typedef struct gNB_MAC_INST_s { int ssb_SubcarrierOffset; /// SIB1 Time domain allocation int sib1_tda; + int minRXTXTIMEpdsch; /// Common cell resources NR_COMMON_channels_t common_channels[NFAPI_CC_MAX]; /// current PDU index (BCH,DLSCH) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 655e6973a1..85674bf9b5 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -239,6 +239,7 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIMEpdsch, (NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, 0, @@ -392,6 +393,7 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIMEpdsch, NULL, NULL, 0, @@ -585,6 +587,7 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( rrc_instance_p->carrier.pdsch_AntennaPorts, rrc_instance_p->carrier.pusch_AntennaPorts, rrc_instance_p->carrier.sib1_tda, + rrc_instance_p->carrier.minRXTXTIMEpdsch, (NR_ServingCellConfigCommon_t *)rrc_instance_p->carrier.servingcellconfigcommon, &rrc_instance_p->carrier.mib, 0, @@ -1379,6 +1382,7 @@ rrc_gNB_process_RRCReconfigurationComplete( rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIMEpdsch, NULL, NULL, 0, diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index e606e22a57..bf82888329 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -367,6 +367,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIMEpdsch, rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, 1, // add_ue flag @@ -378,6 +379,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIMEpdsch, NULL, NULL, 1, // add_ue flag From 6ce5f98c622c13c96bc401bb65be348e281b74b2 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 8 Nov 2021 16:52:00 +0100 Subject: [PATCH 051/196] some fixes --- .../gnb.band66.tm1.106PRB.usrpn300.conf | 15 +-------------- openair2/LAYER2/NR_MAC_gNB/config.c | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 4 ++-- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 850cf9a60c..5211c3de6f 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -24,6 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime_pdsch = 6; servingCellConfigCommon = ( { @@ -157,20 +158,6 @@ gNBs = # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 subcarrierSpacing = 1; - - #tdd-UL-DL-ConfigurationCommon -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - referenceSubcarrierSpacing = 1; - # pattern1 - # dl_UL_TransmissionPeriodicity - # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 - dl_UL_TransmissionPeriodicity = 6; - nrofDownlinkSlots = 7; - nrofDownlinkSymbols = 6; - nrofUplinkSlots = 2; - nrofUplinkSymbols = 4; - ssPBCH_BlockPower = -25; } diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 06ad17df6e..0a1d7bce2e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -136,6 +136,7 @@ void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sche process_rlcBearerConfig(CellGroup->rlc_BearerToAddModList,CellGroup->rlc_BearerToReleaseList,sched_ctrl); } + void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) { nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[Mod_idP]->config[0]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 5fdaebf637..ef3ac0d5f5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1174,7 +1174,7 @@ int nr_acknack_scheduling(int mod_id, const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; const int nr_mix_slots = tdd? (tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0) : 0; const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n_slots_frame; const int first_ul_slot_tdd = tdd? tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period) : 0; @@ -1311,7 +1311,7 @@ int nr_acknack_scheduling(int mod_id, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); pucch->frame = frame; - pucch->ul_slot = first_ul_slot_tdd; + pucch->ul_slot = tdd ? first_ul_slot_tdd : slot + minfbtime; } // Find the right timing_indicator value. From bde7e3a37897dbaca957f255dba4f849f01e7207 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 8 Nov 2021 17:39:58 +0100 Subject: [PATCH 052/196] fixing initialization of UL_tti_req_ahead --- openair2/LAYER2/NR_MAC_gNB/config.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 0a1d7bce2e..b7882906bc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -424,7 +424,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts } -extern uint16_t sl_ahead; + int rrc_mac_config_req_gNB(module_id_t Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, @@ -447,17 +447,16 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, "could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n"); /* fill in slot/frame numbers: slot is fixed, frame will be updated by * scheduler */ + uint16_t sf_ahead = (uint16_t) ceil((float)6/(0x01<<(*scc->ssbSubcarrierSpacing))); + uint16_t sl_ahead = sf_ahead * (0x01<<(*scc->ssbSubcarrierSpacing)); + /* consider that scheduler runs sl_ahead: the first sl_ahead slots are + * already "in the past" and thus we put frame 1 instead of 0! Note that + * extern variable sl_ahead is not initialized yet, so computing it above */ for (int i = 0; i < n; ++i) { nfapi_nr_ul_tti_request_t *req = &RC.nrmac[Mod_idP]->UL_tti_req_ahead[0][i]; - /* consider that scheduler runs sl_ahead: the first sl_ahead slots are - * already "in the past" and thus we put frame 1 instead of 0! Note that - * variable sl_ahead seems to not be correctly initialized, but I leave - * it for information purposes here (the fix would always put 0, what - * happens now, too) */ - req->SFN = i < sl_ahead; + req->SFN = i < (sl_ahead-1); req->Slot = i; } - RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL = calloc(n * MAX_BWP_SIZE, sizeof(uint16_t)); AssertFatal(RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL, From 911b38776ff8712dc4b7024bececf0e71e56212f Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 8 Nov 2021 18:07:38 +0100 Subject: [PATCH 053/196] to avoid unnecessary error message for mixed slot in fdd --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 41 ++++++++++--------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 2d658ab8f7..a5978dd635 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -97,7 +97,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * /* check that TDA index 1 fits into DL part of mixed slot, if it exists */ int tdaMi = -1; - if (tdaList->list.count > 1) { + if (tdd && tdaList->list.count > 1) { const NR_PDSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; AssertFatal(!tdaP_Mi->k0 || *tdaP_Mi->k0 == 0, "TimeDomainAllocation at index 1: non-null k0 (%ld) is not supported by the scheduler\n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 64297c2617..e0ac0c7381 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -144,27 +144,28 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub // get largest time domain allocation (TDA) for UL slot and UL in mixed slot int tdaMi = -1; - const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; - AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), - "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", - k2, - get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); - SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); - const uint16_t symb_tda_mi = ((1 << len) - 1) << start; - // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check - // whether TDA is entirely within mixed slot, UL. Note that here we assume - // that the PUCCH is scheduled in every slot, and on all RBs (which is - // mostly not true, this is a simplification) - if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { - tdaMi = 1; - } else { - LOG_E(NR_MAC, - "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", - symb_pucch, - symb_ulMixed, - symb_tda_mi); + if (tdd) { + const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; + AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), + "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", + k2, + get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); + SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); + const uint16_t symb_tda_mi = ((1 << len) - 1) << start; + // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check + // whether TDA is entirely within mixed slot, UL. Note that here we assume + // that the PUCCH is scheduled in every slot, and on all RBs (which is + // mostly not true, this is a simplification) + if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { + tdaMi = 1; + } else { + LOG_E(NR_MAC, + "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", + symb_pucch, + symb_ulMixed, + symb_tda_mi); + } } - const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; From 1624e811419e7eda1d4ad6b69bd6601aabc9a41f Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 9 Nov 2021 10:18:39 +0100 Subject: [PATCH 054/196] fixes in UL scheduler at UE --- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index dae3f6a8a3..b4938e2fe1 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1079,7 +1079,7 @@ int nr_ue_pusch_scheduler(NR_UE_MAC_INST_t *mac, // Calculate TX slot and frame *slot_tx = (current_slot + k2) % nr_slots_per_frame[mu]; - *frame_tx = ((current_slot + k2) > nr_slots_per_frame[mu]) ? (current_frame + 1) % 1024 : current_frame; + *frame_tx = ((current_slot + k2) > (nr_slots_per_frame[mu]-1)) ? (current_frame + 1) % 1024 : current_frame; } @@ -1768,7 +1768,7 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in } // CSI - if (mac->ra.ra_state == RA_SUCCEEDED) + if (mac->ra.ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test == 1) O_CSI = nr_get_csi_measurements(mac, frameP, slotP, pucch); // ACKNACK From 6087030c7884e305419b1b4a30c487d7e4534bd7 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 9 Nov 2021 13:53:58 +0100 Subject: [PATCH 055/196] adding min_rxtxtime_pdsch to fdd config file --- .../GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf index 09772440a4..0b0a46a1f1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime_pdsch = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( From 47847f170102369f54942107a22596959cdbbcbb Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 9 Nov 2021 15:57:31 +0100 Subject: [PATCH 056/196] bugfix in ul preprocessor --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index e0ac0c7381..16a77cdfcf 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1293,8 +1293,13 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t if (!is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot)) return false; - bool is_mixed_slot = is_xlsch_in_slot(nr_mac->dlsch_slot_bitmap[sched_slot / 64], sched_slot) && - is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot); + bool is_mixed_slot = false; + const NR_TDD_UL_DL_Pattern_t *tdd = + scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + + if (tdd) + is_mixed_slot = is_xlsch_in_slot(nr_mac->dlsch_slot_bitmap[sched_slot / 64], sched_slot) && + is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot); // FIXME: Avoid mixed slots for initialUplinkBWP if (sched_ctrl->active_ubwp==NULL && is_mixed_slot) From bf8a191370283f2e26dc479df7628997f949a6b8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 10 Nov 2021 15:24:08 +0100 Subject: [PATCH 057/196] fixing msg2 scheduler --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 77d55eb1df..08d0a38038 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -481,9 +481,16 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, // go to previous slot if the current scheduled slot is beyond the response window // and if the slot is not among the PDCCH monitored ones (38.213 10.1) - while (((*msg2_slot>slot_limit)&&(*msg2_frame>frame_limit)) || ((*msg2_frame*nr_slots_per_frame[mu]+*msg2_slot-monitoring_offset)%monitoring_slot_period !=0)) { - if((*msg2_slot%tdd_period_slot) > 0) + while ((*msg2_frame>frame_limit) || + ((*msg2_frame==frame_limit) && + (*msg2_slot>slot_limit)) || + ((*msg2_frame*nr_slots_per_frame[mu]+*msg2_slot-monitoring_offset)%monitoring_slot_period !=0)) { + + if(!tdd || ((*msg2_slot%tdd_period_slot) > 0)) { + if (*msg2_slot==0) + (*msg2_frame)--; (*msg2_slot)--; + } else AssertFatal(1==0,"No available DL slot to schedule msg2 has been found"); } From 26a541e2b0b9b4b7d38c75276f83a9d08e8d0255 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 10 Nov 2021 16:24:05 +0100 Subject: [PATCH 058/196] removing unnecessary free tdd_UL_DL_ConfigurationCommon --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index d9514691ba..7586342998 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -625,10 +625,7 @@ int nr_rrc_mac_config_req_ue( config_common_ue_sa(mac,module_id,cc_idP); int num_slots_ul = nr_slots_per_frame[mac->mib->subCarrierSpacingCommon]; - if(cfg->cell_config.frame_duplex_type == FDD){ - free(mac->scc_SIB->tdd_UL_DL_ConfigurationCommon); - mac->scc_SIB->tdd_UL_DL_ConfigurationCommon = NULL; - } else { + if(cfg->cell_config.frame_duplex_type == TDD){ num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) { num_slots_ul++; @@ -653,10 +650,6 @@ int nr_rrc_mac_config_req_ue( ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; } mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; - if(cfg->cell_config.frame_duplex_type == FDD){ - free(mac->scc->tdd_UL_DL_ConfigurationCommon); - mac->scc->tdd_UL_DL_ConfigurationCommon = NULL; - } mac->physCellId = *mac->scc->physCellId; config_common_ue(mac,module_id,cc_idP); mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; From 8849a5e20d78db844efa07ed4fb1cc798c61c64b Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 12 Nov 2021 09:55:58 +0100 Subject: [PATCH 059/196] fix for numDmrsCdmGrpsNoData in SA --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 043c0951d4..d9961108e0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -435,17 +435,19 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols); } - const long dci_format = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; - if (dci_format == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0 || - pdsch_Config == NULL) { - if (ps->nrOfSymbols == 2 && ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB) + const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; + int dci_format; + if (sched_ctrl->search_space) { + dci_format = f ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; + } + else { + dci_format = NR_DL_DCI_FORMAT_1_0; + } + if (dci_format == NR_DL_DCI_FORMAT_1_0) { + if (ps->nrOfSymbols == 2) ps->numDmrsCdmGrpsNoData = 1; - else { - if (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1) - ps->numDmrsCdmGrpsNoData = 2; - else - ps->numDmrsCdmGrpsNoData = 3; - } + else + ps->numDmrsCdmGrpsNoData = 2; ps->dmrs_ports_id = 0; ps->frontloaded_symb = 1; ps->nrOfLayers = 1; From b218f55a8259420d73704103bec6ccd40e7d40ab Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 15 Nov 2021 11:27:17 +0100 Subject: [PATCH 060/196] setting max mcs to the one reported by CSI --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 6 ++---- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index aca1bccd4a..f6c7a97878 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -701,7 +701,7 @@ void pf_dl(module_id_t module_id, continue; /* Calculate coeff */ - set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); + set_dl_mcs(sched_pdsch,sched_ctrl,&mac->dl_max_mcs,ps->mcsTableIdx); sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id); layers[UE_id] = set_dl_nrOfLayers(sched_ctrl); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index d9961108e0..8326dac589 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -147,6 +147,7 @@ uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl) { void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, + uint8_t *target_mcs, uint8_t mcs_table_idx) { if (sched_ctrl->set_mcs) { @@ -180,14 +181,11 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, R = nr_get_code_rate_dl(i, mcs_table_idx); Qm = nr_get_Qm_dl(i, mcs_table_idx); if ((Qm == target_qm) && (target_coderate <= R)) { - sched_pdsch->mcs = i; + *target_mcs = i; break; } } } - else // default value - sched_pdsch->mcs = 9; - sched_ctrl->set_mcs = FALSE; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index c33586741d..93b27ae7ac 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -429,6 +429,7 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps); void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, + uint8_t *target_mcs, uint8_t mcs_table_idx); uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl); From 04662813802900817dfe16004a0924d98470f263 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 15 Nov 2021 16:07:11 +0100 Subject: [PATCH 061/196] Update conf file for band 66 according to default SA mode scenario - conf file now takes into account the basic SA scenario with gNB and CN in the same PC - Network parameters and gNB interfaces have been updated accordingly --- .../gnb.sa.band66.fr1.106PRB.usrpn300.conf | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf index 0b0a46a1f1..d74bff4656 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -10,7 +10,7 @@ gNBs = gNB_name = "gNB-Eurecom-5GNRBox"; // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 0xa000; + tracking_area_code = 1; plmn_list = ({ mcc = 208; mnc = 99; @@ -22,7 +22,7 @@ gNBs = }, { sst = 1; - sd = 0x1; // 0 false, else true + sd = 0x112233; // 0 false, else true } ); @@ -217,10 +217,10 @@ gNBs = NETWORK_INTERFACES : { - GNB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - GNB_INTERFACE_NAME_FOR_S1U = "eth0"; - GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; GNB_PORT_FOR_S1U = 2152; # Spec 2152 }; @@ -282,6 +282,23 @@ rfsimulator : IQfile = "/tmp/rfsimulator.iqs"; }; +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + log_config : { global_log_level ="info"; From 7c941435ad6fccde51cb219ae12a09729e8d6369 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 15 Nov 2021 16:06:28 +0100 Subject: [PATCH 062/196] Bugfix wrong configuration of initial ack nack timing in FDD mode --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index ef3ac0d5f5..d202145864 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1310,8 +1310,9 @@ int nr_acknack_scheduling(int mod_id, AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); - pucch->frame = frame; - pucch->ul_slot = tdd ? first_ul_slot_tdd : slot + minfbtime; + const int s = tdd ? first_ul_slot_tdd : slot + minfbtime; + pucch->frame = (s < n_slots_frame - 1) ? frame : (frame + 1) % 1024; + pucch->ul_slot = s % n_slots_frame; } // Find the right timing_indicator value. From 12700a17277b27f93a2ec94136add843461c9e0a Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 15 Nov 2021 16:09:38 +0100 Subject: [PATCH 063/196] Updated band 78 conf file for SA mode --- .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 9c0427789d..82d478769c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -36,6 +36,7 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; sib1_tda = 0; + min_rxtxtime_pdsch = 6; pdcch_ConfigSIB1 = ( { From 174ee99d3c97f0cc7f45f87f6b01785f7e839afd Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 15 Nov 2021 16:47:56 +0100 Subject: [PATCH 064/196] fix in dlsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 117b5339b6..f0c1d6886d 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -268,11 +268,6 @@ void nr_dlsim_preprocessor(module_id_t module_id, NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - ps->nrOfLayers = g_nrOfLayers; - - int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats ? - NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[0], sched_ctrl->active_bwp, @@ -289,7 +284,6 @@ void nr_dlsim_preprocessor(module_id_t module_id, /* the following might override the table that is mandated by RRC * configuration */ ps->mcsTableIdx = g_mcsTableIdx; - ps->nrOfLayers = g_nrOfLayers; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); From 59e727049d2b16cdacb53e1eaaba3df1602929ff Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 16 Nov 2021 12:04:00 +0100 Subject: [PATCH 065/196] bugfix in dmrs_ports handling at UE for pdsch --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 7 +++---- openair1/SIMULATION/NR_PHY/dlsim.c | 3 +-- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 14 +++++++------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 76486fb86b..8bf88e6200 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -768,12 +768,13 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ uint16_t s1 = dlsch0_harq->nb_symbols; bool is_SI = dlsch0->rnti_type == _SI_RNTI_; - LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x\n", - ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0_harq->dlDmrsSymbPos); + LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x, Nl %d\n", + ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0_harq->dlDmrsSymbPos, dlsch0_harq->Nl); for (m = s0; m < (s0 +s1); m++) { if (dlsch0_harq->dlDmrsSymbPos & (1 << m)) { for (uint8_t aatx=0; aatxNl; aatx++) {//for MIMO Config: it shall loop over no_layers + LOG_D(PHY,"PDSCH Channel estimation gNB id %d, PDSCH antenna port %d, slot %d, symbol %d\n",0,aatx,nr_slot_rx,m); nr_pdsch_channel_estimation(ue, proc, gNB_id, @@ -784,7 +785,6 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ BWPStart, ue->frame_parms.first_carrier_offset+(BWPStart + pdsch_start_rb)*12, pdsch_nb_rb); - LOG_D(PHY,"PDSCH Channel estimation gNB id %d, PDSCH antenna port %d, slot %d, symbol %d\n",0,aatx,nr_slot_rx,m); #if 0 ///LOG_M: the channel estimation int nr_frame_rx = proc->frame_rx; @@ -1801,7 +1801,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, // do procedures for C-RNTI int ret_pdsch = 0; if (ue->dlsch[proc->thread_id][gNB_id][0]->active == 1) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_IN); ret_pdsch = nr_ue_pdsch_procedures(ue, proc, diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index f0c1d6886d..00f2b9905f 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1197,9 +1197,8 @@ int main(int argc, char **argv) } nr_ue_dcireq(&dcireq); //to be replaced with function pointer later - UE_harq_process->Nl = g_nrOfLayers; nr_ue_scheduled_response(&scheduled_response); - + phy_procedures_nrUE_RX(UE, &UE_proc, 0, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 544bc66250..59f07c70e1 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1135,7 +1135,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_1[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_1[dci->antenna_ports.val][1] + (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_1[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_1[dci->antenna_ports.val][4]<<3)); } if ((dmrs_type == NULL) && (max_length != NULL)){ @@ -1144,7 +1144,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][6]<<5) + @@ -1156,7 +1156,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][6]<<5) + @@ -1171,7 +1171,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][6]<<5)); @@ -1180,7 +1180,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][6]<<5)); @@ -1192,7 +1192,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][6]<<5) + @@ -1208,7 +1208,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][6]<<5) + From 0f48386133c6907e486a427b23c368e7fc12752c Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 10 Dec 2021 17:44:46 +0100 Subject: [PATCH 066/196] improvements in handling tdd structure --- common/utils/nr/nr_common.c | 42 +++++++++++++++++++ common/utils/nr/nr_common.h | 1 + openair2/LAYER2/NR_MAC_gNB/config.c | 23 ++++++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 11 +++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 38 +++++++++-------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 4 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 25 +++++++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 34 ++++++++------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 26 ++++++++---- 9 files changed, 141 insertions(+), 63 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index a704a66c76..4b006ca425 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -257,6 +257,48 @@ void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) { *n_rb = 6*count; } +int get_nb_periods_per_frame(uint8_t tdd_period) { + + int nb_periods_per_frame; + switch(tdd_period) { + case 0: + nb_periods_per_frame = 20; // 10ms/0p5ms + break; + + case 1: + nb_periods_per_frame = 16; // 10ms/0p625ms + break; + + case 2: + nb_periods_per_frame = 10; // 10ms/1ms + break; + + case 3: + nb_periods_per_frame = 8; // 10ms/1p25ms + break; + + case 4: + nb_periods_per_frame = 5; // 10ms/2ms + break; + + case 5: + nb_periods_per_frame = 4; // 10ms/2p5ms + break; + + case 6: + nb_periods_per_frame = 2; // 10ms/5ms + break; + + case 7: + nb_periods_per_frame = 1; // 10ms/10ms + break; + + default: + AssertFatal(1==0,"Undefined tdd period %d\n", tdd_period); + } + return nb_periods_per_frame; +} + int get_dmrs_port(int nl, uint16_t dmrs_ports) { diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index d9f2b0c03a..4165ca2d41 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -71,6 +71,7 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); int get_subband_size(int NPRB,int size); void SLIV2SL(int SLIV,int *S,int *L); int get_dmrs_port(int nl, uint16_t dmrs_ports); +int get_nb_periods_per_frame(uint8_t tdd_period); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 5223b00e2a..0c397187b5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -492,16 +492,25 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, find_SSB_and_RO_available(Mod_idP); const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; - const int nr_dlmix_slots = tdd ? tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0) : 0; - const int nr_dl_slots = tdd ? nr_dlmix_slots : n; - const int nr_ulstart_slot = tdd ? tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0) : 1; + + int nr_slots_period = n; + int nr_dl_slots = n; + int nr_ulstart_slot = 0; + if (tdd) { + nr_dl_slots = tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0); + nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0); + nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + } + else{ + if(RC.nrmac[Mod_idP]->common_channels[0].frame_type == TDD) + AssertFatal(1==0,"Dynamic TDD not handled yet\n"); + } for (int slot = 0; slot < n; ++slot) { /* FIXME: it seems there is a problem with slot 0/10/slots right after UL: - * we just get retransmissions. Thus, do not schedule such slots in DL */ - if (slot % nr_slots_period != 0){ + * we just get retransmissions. Thus, do not schedule such slots in DL in TDD */ + if (RC.nrmac[Mod_idP]->common_channels[0].frame_type == FDD || + (slot % nr_slots_period != 0)){ RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dl_slots) << (slot % 64); } RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) >= nr_ulstart_slot) << (slot % 64); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 7b6dc0e01d..1929f58943 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -36,6 +36,7 @@ #include "NR_MAC_gNB/mac_proto.h" #include "common/utils/LOG/log.h" +#include "common/utils/nr/nr_common.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" @@ -284,13 +285,11 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; if (slot==0 && (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]>=257)) { + //FR2 const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; - const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; - const int nb_periods_per_frame = n / nr_slots_period; - - // re-initialization of tdd_beam_association at beginning of frame (only for FR2) + AssertFatal(tdd,"Dynamic TDD not handled yet\n"); + const int nb_periods_per_frame = get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + // re-initialization of tdd_beam_association at beginning of frame for (int i=0; itdd_beam_association[i] = -1; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index fcfbc455ca..dcd85e880b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -397,6 +397,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, uint16_t *msg2_frame, uint16_t *msg2_slot, NR_ServingCellConfigCommon_t *scc, + lte_frame_type_t frame_type, uint16_t monitoring_slot_period, uint16_t monitoring_offset,uint8_t beam_index, uint8_t num_active_ssb, @@ -411,17 +412,20 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; // number of mixed slot or of last dl slot if there is no mixed slot - uint8_t last_dl_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; + uint8_t last_dl_slot_period = n_slots_frame-1; // lenght of tdd period in slots - uint8_t tdd_period_slot = tdd ? scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots : n_slots_frame; + uint8_t tdd_period_slot = n_slots_frame; - if (tdd && (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols == 0)) { - last_dl_slot_period--; + if (tdd) { + last_dl_slot_period = tdd->nrofDownlinkSymbols == 0? (tdd->nrofDownlinkSlots-1) : tdd->nrofDownlinkSlots; + tdd_period_slot = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - if (tdd && ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))) { - tdd_period_slot++; + else{ + if(frame_type == TDD) + AssertFatal(1==0,"Dynamic TDD not handled yet\n"); } + switch(response_window){ case NR_RACH_ConfigGeneric__ra_ResponseWindow_sl1: slot_window = 1; @@ -515,6 +519,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, gNB_MAC_INST *nr_mac = RC.nrmac[module_idP]; NR_COMMON_channels_t *cc = &nr_mac->common_channels[CC_id]; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; + lte_frame_type_t frame_type = cc->frame_type; uint8_t total_RApreambles = MAX_NUM_NR_PRACH_PREAMBLES; uint8_t num_ssb_per_RO = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present; @@ -619,6 +624,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, &msg2_frame, &msg2_slot, scc, + frame_type, monitoring_slot_period, monitoring_offset, beam_index, @@ -728,15 +734,11 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t // beam association for FR2 int16_t *tdd_beam_association = nr_mac->tdd_beam_association; if (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257) { - + // FR2 const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - uint8_t tdd_period_slot = tdd ? scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots : n_slots_frame; - - if (tdd && ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))) { - tdd_period_slot++; - } - + AssertFatal(tdd,"Dynamic TDD not handled yet\n"); + uint8_t tdd_period_slot = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); int num_tdd_period = sched_slot/tdd_period_slot; if((tdd_beam_association[num_tdd_period]!=-1)&&(tdd_beam_association[num_tdd_period]!=ra->beam_id)) @@ -886,6 +888,8 @@ void nr_get_Msg3alloc(module_id_t module_id, uint16_t msg3_nb_rb = 8; // sdu has 6 or 8 bytes + lte_frame_type_t frame_type = RC.nrmac[module_id]->common_channels->frame_type; + int mu = ubwp ? ubwp->bwp_Common->genericParameters.subcarrierSpacing : scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; @@ -901,7 +905,7 @@ void nr_get_Msg3alloc(module_id_t module_id, const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; const int n_slots_frame = nr_slots_per_frame[mu]; - const int nrofUplinkSymbols = tdd ? tdd->nrofUplinkSymbols : 4; + const int nrofUplinkSymbols = (frame_type==TDD) ? tdd->nrofUplinkSymbols : 11; // TODO change in favor of harmonization branch uint8_t k2 = 0; for (int i=0; ilist.count; i++) { startSymbolAndLength = pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; @@ -927,10 +931,8 @@ void nr_get_Msg3alloc(module_id_t module_id, // beam association for FR2 if (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257) { - uint8_t tdd_period_slot = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots : n_slots_frame; - if (tdd && ((tdd->nrofDownlinkSymbols > 0) || (tdd->nrofUplinkSymbols > 0))) { - tdd_period_slot++; - } + AssertFatal(tdd,"Dynamic TDD not handled yet\n"); + uint8_t tdd_period_slot = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); int num_tdd_period = ra->Msg3_slot/tdd_period_slot; if((tdd_beam_association[num_tdd_period]!=-1)&&(tdd_beam_association[num_tdd_period]!=ra->beam_id)) AssertFatal(1==0,"Cannot schedule MSG3\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 090c9523ef..d7a004b17f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -268,8 +268,8 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) fill_ssb_vrb_map(cc, offset_pointa, ssb_start_symbol, CC_id); const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n_slots_frame; + // FR2 is only TDD, to be fixed for flexible TDD + const int nr_slots_period = tdd ? n_slots_frame/get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity) : n_slots_frame; num_tdd_period = rel_slot/nr_slots_period; gNB->tdd_beam_association[num_tdd_period]=i_ssb; num_ssb++; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0f0f38cd75..65a97e01ac 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -62,9 +62,23 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * /* there is a mixed slot only when in TDD */ NR_ServingCellConfigCommon_t *scc = nrmac->common_channels->ServingCellConfigCommon; + lte_frame_type_t frame_type = nrmac->common_channels->frame_type; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - const int symb_dlMixed = tdd ? (1 << tdd->nrofDownlinkSymbols) - 1 : 0; + + int symb_dlMixed = 0; + int nr_mix_slots = 0; + int nr_slots_period = n; + if (tdd) { + symb_dlMixed = (1 << tdd->nrofDownlinkSymbols) - 1; + nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; + nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + } + else{ + if(frame_type == TDD) + AssertFatal(1==0,"Dynamic TDD not handled yet\n"); + } int target_ss; if (bwp) { @@ -97,7 +111,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * /* check that TDA index 1 fits into DL part of mixed slot, if it exists */ int tdaMi = -1; - if (tdd && tdaList->list.count > 1) { + if (frame_type == TDD && tdaList->list.count > 1) { const NR_PDSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; AssertFatal(!tdaP_Mi->k0 || *tdaP_Mi->k0 == 0, "TimeDomainAllocation at index 1: non-null k0 (%ld) is not supported by the scheduler\n", @@ -120,16 +134,13 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * } } - const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_dl_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_dl_tda[bwp_id])); - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; for (int i = 0; i < n; ++i) { nrmac->preferred_dl_tda[bwp_id][i] = -1; - if (!tdd || i % nr_slots_period < tdd->nrofDownlinkSlots) + if (frame_type == FDD || i % nr_slots_period < tdd->nrofDownlinkSlots) nrmac->preferred_dl_tda[bwp_id][i] = 0; - else if (tdd && nr_mix_slots && i % nr_slots_period == tdd->nrofDownlinkSlots) + else if (nr_mix_slots && i % nr_slots_period == tdd->nrofDownlinkSlots) nrmac->preferred_dl_tda[bwp_id][i] = tdaMi; LOG_D(MAC, "slot %d preferred_dl_tda %d\n", i, nrmac->preferred_dl_tda[bwp_id][i]); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 42dffee5cc..1365a02505 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -32,6 +32,7 @@ #include "NR_MAC_COMMON/nr_mac_extern.h" #include "NR_MAC_gNB/mac_proto.h" #include "common/ran_context.h" +#include "common/utils/nr/nr_common.h" #include "nfapi/oai_integration/vendor_ext.h" extern RAN_CONTEXT_t RC; @@ -1182,26 +1183,27 @@ int nr_acknack_scheduling(int mod_id, int r_pucch, int is_common) { - const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; - const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - const int nr_mix_slots = tdd? (tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0) : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n_slots_frame; - const int first_ul_slot_tdd = tdd? tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period) : 0; - const int first_ul_slot_period = tdd? tdd->nrofDownlinkSlots : 0; const int CC_id = 0; const int minfbtime = RC.nrmac[mod_id]->minRXTXTIMEpdsch; + const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels[CC_id].ServingCellConfigCommon; + const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + // initializing the values for FDD + int nr_slots_period = n_slots_frame; + int first_ul_slot_tdd = slot + minfbtime; + int first_ul_slot_period = 0; + if(tdd){ + nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); + first_ul_slot_period = tdd->nrofDownlinkSlots; + } + else{ + if(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == TDD) + AssertFatal(1==0,"Dynamic TDD not handled yet\n"); + } NR_sched_pucch_t *csi_pucch; - if (tdd) { - AssertFatal(slot < first_ul_slot_tdd + (tdd->nrofUplinkSymbols != 0), - "cannot handle multiple TDD periods (yet): slot %d first_ul_slot_tdd %d nrofUplinkSlots %ld\n", - slot, - first_ul_slot_tdd, - tdd->nrofUplinkSlots); - } - /* for the moment, we consider: * * only pucch_sched[0] holds HARQ (and SR) * * we do not multiplex with CSI, which is always in pucch_sched[2] @@ -1320,7 +1322,7 @@ int nr_acknack_scheduling(int mod_id, AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); - const int s = tdd ? first_ul_slot_tdd : slot + minfbtime; + const int s = first_ul_slot_tdd; pucch->frame = (s < n_slots_frame - 1) ? frame : (frame + 1) % 1024; pucch->ul_slot = s % n_slots_frame; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 49871670a3..37f735a0c5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -59,11 +59,24 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub /* there is a mixed slot only when in TDD */ NR_ServingCellConfigCommon_t *scc = nrmac->common_channels->ServingCellConfigCommon; + lte_frame_type_t frame_type = nrmac->common_channels->frame_type; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const int mu = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; /* Uplink symbols are at the end of the slot */ - const int symb_ulMixed = tdd ? ((1 << tdd->nrofUplinkSymbols) - 1) << (14 - tdd->nrofUplinkSymbols) : 0; + int symb_ulMixed = 0; + int nr_mix_slots = 0; + int nr_slots_period = n; + if (tdd) { + symb_ulMixed = ((1 << tdd->nrofUplinkSymbols) - 1) << (14 - tdd->nrofUplinkSymbols); + nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; + nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + } + else{ + if(frame_type == TDD) + AssertFatal(1==0,"Dynamic TDD not handled yet\n"); + } const struct NR_PUCCH_Config__resourceToAddModList *resList = ubwp->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList; // for the moment, just block any symbol that might hold a PUCCH, regardless @@ -117,7 +130,7 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub // get largest time domain allocation (TDA) for UL slot and UL in mixed slot int tdaMi = -1; - if (tdd) { + if (nr_mix_slots>0) { const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", @@ -139,16 +152,15 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub symb_tda_mi); } } - const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; + for (int slot = 0; slot < n; ++slot) { const int sched_slot = (slot + k2) % n; nrmac->preferred_ul_tda[bwp_id][slot] = -1; - if (!tdd || sched_slot % nr_slots_period >= tdd->nrofDownlinkSlots + nr_mix_slots) + if (frame_type == FDD || sched_slot % nr_slots_period >= tdd->nrofDownlinkSlots + nr_mix_slots) nrmac->preferred_ul_tda[bwp_id][slot] = 0; - else if (tdd && nr_mix_slots && sched_slot % nr_slots_period == tdd->nrofDownlinkSlots) + else if (nr_mix_slots && sched_slot % nr_slots_period == tdd->nrofDownlinkSlots) nrmac->preferred_ul_tda[bwp_id][slot] = tdaMi; LOG_D(MAC, "DL slot %d UL slot %d preferred_ul_tda %d\n", slot, sched_slot, nrmac->preferred_ul_tda[bwp_id][slot]); } From 29599ab91fd45cdf065dd2415b58f5befb212b60 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 13 Dec 2021 15:52:46 +0100 Subject: [PATCH 067/196] fixes for FDD --- ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 6f65d983d7..5211c3de6f 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime = 6; + min_rxtxtime_pdsch = 6; servingCellConfigCommon = ( { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index dcd85e880b..b70112032c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1034,12 +1034,15 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->pusch_data.harq_process_id = 0; pusch_pdu->pusch_data.new_data_indicator = 1; pusch_pdu->pusch_data.num_cb = 0; + int num_dmrs_symb = 0; + for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++) + num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1; pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, pusch_pdu->target_code_rate, pusch_pdu->rb_size, pusch_pdu->nr_of_symbols, - 12, // nb dmrs set for no data in dmrs symbol + num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol 0, //nb_rb_oh 0, // to verify tb scaling pusch_pdu->nrOfLayers)>>3; From 9f9fdb95eb4656ea6d37f003df04bdbc4f29d766 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 13 Dec 2021 16:12:10 +0100 Subject: [PATCH 068/196] fix in config file --- ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 27cf57f50a..4200300c50 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime = 6; + min_rxtxtime_pdsch = 6; servingCellConfigCommon = ( { From ad37d8ae5f1100c08efb04d9d137af64a355136b Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 10 Nov 2021 17:31:49 +0000 Subject: [PATCH 069/196] Change LOG levels --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 37 ++++++++----------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 17 ++++++--- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 37a2849d21..1ce8c238cb 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -32,9 +32,6 @@ #include "PHY/phy_extern_nr_ue.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "nr_transport_proto_ue.h" -//#include "SCHED/defs.h" -//#include "PHY/defs.h" -//#include "extern.h" #include "PHY/sse_intrin.h" #include "T.h" #include "openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h" @@ -379,10 +376,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", - frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif @@ -402,11 +397,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, nb_rb_pdsch); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (first_symbol_flag==1) { if (beamforming_mode==0){ @@ -463,9 +458,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, #endif stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif @@ -515,11 +509,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { @@ -574,11 +568,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; @@ -657,9 +651,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index bfa16ef715..bb911195c7 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -60,6 +60,7 @@ //#define NR_PDCCH_SCHED_DEBUG //#define NR_PUCCH_SCHED //#define NR_PUCCH_SCHED_DEBUG +//#define NR_PDSCH_DEBUG #ifndef PUCCH #define PUCCH @@ -1020,15 +1021,14 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "In %s DL PDU length in bits: %d, in bytes: %d \n", __FUNCTION__, dlsch0->harq_processes[harq_pid]->TBS, dlsch0->harq_processes[harq_pid]->TBS / 8); - - - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); +#ifdef NR_PDSCH_DEBUG LOG_I(PHY, " --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_I(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#endif if(is_cw1_active) { // start ldpc decode for CW 1 @@ -1080,13 +1080,20 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - +#if PHYSIM + printf(" --> Unscrambling for CW1 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + printf("AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", + frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#else LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#endif + LOG_D(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); From c713d499f4db92e9bec3d7f028b74b2863f0c93a Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 22 Dec 2021 17:40:08 +0100 Subject: [PATCH 070/196] bugfix --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index b70112032c..0c4d771afb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -458,7 +458,7 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, // slot and frame limit to transmit msg2 according to response window uint8_t slot_limit = (rach_slot + slot_window)%nr_slots_per_frame[mu]; - uint8_t frame_limit = (slot_limit>(rach_slot))? rach_frame : (rach_frame +1); + uint16_t frame_limit = (slot_limit>(rach_slot))? rach_frame : (rach_frame +1); // computing start of next period From b830090a5a525f8025c14e430f93ed5d4088129b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 22 Dec 2021 18:27:26 +0000 Subject: [PATCH 071/196] Perform frequency offset correction in two consecutive frames for SA --- openair1/PHY/NR_REFSIG/ss_pbch_nr.h | 1 + .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 37 ++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ss_pbch_nr.h b/openair1/PHY/NR_REFSIG/ss_pbch_nr.h index 52a9c41ae9..44f8549258 100644 --- a/openair1/PHY/NR_REFSIG/ss_pbch_nr.h +++ b/openair1/PHY/NR_REFSIG/ss_pbch_nr.h @@ -65,6 +65,7 @@ /* SS/PBCH parameters */ #define N_RB_SS_PBCH_BLOCK (20) #define NB_SYMBOLS_PBCH (3) +#define NR_N_SYMBOLS_SSB (4) #define IQ_SIZE (sizeof(int16_t) * 2) /* I and Q are alternatively stored into buffers */ #define N_SYMB_SLOT (14) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 767edf9cc6..3466f43452 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -42,6 +42,7 @@ #include "common_lib.h" #include +#include #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/sss_nr.h" @@ -250,21 +251,31 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, #endif // digital compensation of FFO for SSB symbols - if (ue->UE_fo_compensation){ - double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time - double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample + if (ue->UE_fo_compensation){ + double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time + double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample - int start = is*fp->samples_per_frame+ue->ssb_offset; // start for offset correction is at ssb_offset (pss time position) - int end = start + 4*(fp->ofdm_symbol_size + fp->nb_prefix_samples); // loop over samples in 4 symbols (ssb size), including prefix + // In SA we need to perform frequency offset correction in two consecutive frames because we need to decode SIB1 + // and we do not know yet in which slot it goes. - for(int n=start; nnb_antennas_rx; ar++) { - re = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n]); - im = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n+1]); - ((short *)ue->common_vars.rxdata[ar])[2*n] = (short)(round(re*cos(n*off_angle) - im*sin(n*off_angle))); - ((short *)ue->common_vars.rxdata[ar])[2*n+1] = (short)(round(re*sin(n*off_angle) + im*cos(n*off_angle))); - } - } + // start for offset correction + int start = get_softmodem_params()->sa ? + is*fp->samples_per_frame : + is*fp->samples_per_frame + ue->ssb_offset; + + // loop over samples + int end = get_softmodem_params()->sa ? + start + (fp->samples_per_frame<<1): + start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples); + + for(int n=start; nnb_antennas_rx; ar++) { + re = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n]); + im = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n+1]); + ((short *)ue->common_vars.rxdata[ar])[2*n] = (short)(round(re*cos(n*off_angle) - im*sin(n*off_angle))); + ((short *)ue->common_vars.rxdata[ar])[2*n+1] = (short)(round(re*sin(n*off_angle) + im*cos(n*off_angle))); + } + } } /* check that SSS/PBCH block is continuous inside the received buffer */ From a2014a52496747627eec5856907dded770ce3905 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 23 Dec 2021 10:36:58 +0000 Subject: [PATCH 072/196] Increase SSS phase hypothesis resolution --- openair1/PHY/NR_REFSIG/sss_nr.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/sss_nr.h b/openair1/PHY/NR_REFSIG/sss_nr.h index 12d91ed3d1..e413400097 100644 --- a/openair1/PHY/NR_REFSIG/sss_nr.h +++ b/openair1/PHY/NR_REFSIG/sss_nr.h @@ -63,18 +63,22 @@ /************** VARIABLES *****************************************/ -#define PHASE_HYPOTHESIS_NUMBER (7) +#define PHASE_HYPOTHESIS_NUMBER (16) #define INDEX_NO_PHASE_DIFFERENCE (3) /* this is for no phase shift case */ EXTERN const int16_t phase_re_nr[PHASE_HYPOTHESIS_NUMBER] #ifdef INIT_VARIABLES_SSS_NR_H -= {16383, 25101, 30791, 32767, 30791, 25101, 16383} +// -pi/3 ---- pi/3 += {16384,20173,23571,26509,28932,30791,32051,32687,32687,32051,30791, + 28932,26509,23571,20173,16384} #endif ; EXTERN const int16_t phase_im_nr[PHASE_HYPOTHESIS_NUMBER] #ifdef INIT_VARIABLES_SSS_NR_H -= {-28378, -21063, -11208, 0, 11207, 21062, 28377}; +// -pi/3 ---- pi/3 += {-28377,-25821,-22762,-19260,-15383,-11207,-6813,-2286,2286,6813,11207, + 15383,19260,22762,25821,28377} #endif ; From f508d8c80df110616e467f553629734f48ac77a6 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 23 Dec 2021 17:14:46 +0000 Subject: [PATCH 073/196] Improve frequency offset correction in two consecutive frames for SA --- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 3466f43452..dcb8035e8a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -31,8 +31,6 @@ */ #include "PHY/types.h" #include "PHY/defs_nr_UE.h" -#include "PHY/phy_extern_nr_ue.h" -#include "PHY/INIT/phy_init.h" #include "PHY/MODULATION/modulation_UE.h" #include "nr_transport_proto_ue.h" #include "PHY/NR_UE_ESTIMATION/nr_estimation.h" @@ -42,12 +40,10 @@ #include "common_lib.h" #include -#include #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/sss_nr.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" -#include "PHY/NR_TRANSPORT/nr_dci.h" extern openair0_config_t openair0_cfg[]; //static nfapi_nr_config_request_t config_t; @@ -202,6 +198,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, { int32_t sync_pos, sync_pos_frame; // k_ssb, N_ssb_crb, sync_pos2, + int32_t accumulated_freq_offset = 0; int32_t metric_tdd_ncp=0; uint8_t phase_tdd_ncp; double im, re; @@ -254,19 +251,16 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, if (ue->UE_fo_compensation){ double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample + accumulated_freq_offset += ue->common_vars.freq_offset; - // In SA we need to perform frequency offset correction in two consecutive frames because we need to decode SIB1 + // In SA we need to perform frequency offset correction until the end of buffer because we need to decode SIB1 // and we do not know yet in which slot it goes. // start for offset correction - int start = get_softmodem_params()->sa ? - is*fp->samples_per_frame : - is*fp->samples_per_frame + ue->ssb_offset; + int start = sa ? is*fp->samples_per_frame : is*fp->samples_per_frame + ue->ssb_offset; // loop over samples - int end = get_softmodem_params()->sa ? - start + (fp->samples_per_frame<<1): - start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples); + int end = sa ? n_frames*fp->samples_per_frame-1 : start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples); for(int n=start; nnb_antennas_rx; ar++) { @@ -555,6 +549,8 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, } if (dec == false) // sib1 not decoded ret = -1; + + ue->common_vars.freq_offset = accumulated_freq_offset; } // exit_fun("debug exit"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INITIAL_UE_SYNC, VCD_FUNCTION_OUT); From 22754562cf67df26b8184c894af8c890c3d33bef Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 10:26:52 +0000 Subject: [PATCH 074/196] Adjust sync based on PSS --- executables/nr-ue.c | 4 +- openair1/PHY/NR_REFSIG/pss_nr.h | 2 + openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 85 +++++++++++++++++++ openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 11 ++- ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 + .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 + 6 files changed, 101 insertions(+), 3 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 60ff40abeb..c90a5119cd 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -642,7 +642,9 @@ void *UE_thread(void *arg) { readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms); writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms); } else { - UE->rx_offset_diff = computeSamplesShift(UE); + //UE->rx_offset_diff = computeSamplesShift(UE); + + readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms) - UE->rx_offset_diff; writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms)- UE->rx_offset_diff; diff --git a/openair1/PHY/NR_REFSIG/pss_nr.h b/openair1/PHY/NR_REFSIG/pss_nr.h index b32d48a2e9..e2dd0e456b 100644 --- a/openair1/PHY/NR_REFSIG/pss_nr.h +++ b/openair1/PHY/NR_REFSIG/pss_nr.h @@ -141,6 +141,8 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain int *eNB_id, int *f_off); +int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off); + #endif #undef EXTERN diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 28b6677b2c..4ee5884afd 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "PHY/defs_nr_UE.h" @@ -975,3 +976,87 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain return(peak_position); } +int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { + + int **rxdata = ue->common_vars.rxdata; + NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; + uint8_t Nid2 = GET_NID2(frame_parms->Nid_cell); + + int maxval=0; + for (int i=0;i<2*(frame_parms->ofdm_symbol_size);i++) { + maxval = max(maxval,primary_synchro_time_nr[Nid2][i]); + maxval = max(maxval,-primary_synchro_time_nr[Nid2][i]); + } + int shift = log2_approx(maxval); + + /* Search pss in the received buffer each 4 samples which ensures a memory alignment on 128 bits (32 bits x 4 ) */ + /* This is required by SIMD (single instruction Multiple Data) Extensions of Intel processors. */ + /* Correlation computation is based on a dot product which is realized thank to SIMS extensions */ + int64_t peak_value = 0; + int peak_position = 0; + int64_t result = 0; + int64_t avg=0; + int start = 2*(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples) + frame_parms->nb_prefix_samples0 - 200; + int length = 2*frame_parms->ofdm_symbol_size + 200; + memset(pss_corr_ue[Nid2],0,(start+length)*sizeof(int64_t)); + for (int n=start; n < start+length; n+=4) { // + for (int ar=0; arnb_antennas_rx; ar++) { + result = dot_product64((short*)primary_synchro_time_nr[Nid2], + (short*) &(rxdata[ar][n]), + frame_parms->ofdm_symbol_size, + shift); + pss_corr_ue[Nid2][n] += abs64(result); + } + avg+=pss_corr_ue[Nid2][n]; + if (pss_corr_ue[Nid2][n] > peak_value) { + peak_value = pss_corr_ue[Nid2][n]; + peak_position = n; + } + } + + avg/=(length/4); + if (peak_value < 5*avg) { + return 0; + } + + int peak_position_diff = peak_position - ( ((frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)<<1) + frame_parms->nb_prefix_samples0); + + // Fractional frequency offset computation according to Cross-correlation Synchronization Algorithm Using PSS + // Shoujun Huang, Yongtao Su, Ying He and Shan Tang, "Joint time and frequency offset estimation in LTE downlink," + // 7th International Conference on Communications and Networking in China, 2012. + + // Computing cross-correlation at peak on half the symbol size for first half of data + int64_t result1 = dot_product64((short*)primary_synchro_time_nr[Nid2], + (short*) &(rxdata[0][peak_position]), + frame_parms->ofdm_symbol_size>>1, + shift); + + // Computing cross-correlation at peak on half the symbol size for data shifted by half symbol size + // as it is real and complex it is necessary to shift by a value equal to symbol size to obtain such shift + int64_t result2 = dot_product64((short*)primary_synchro_time_nr[Nid2]+(frame_parms->ofdm_symbol_size), + (short*) &(rxdata[0][peak_position])+frame_parms->ofdm_symbol_size, + frame_parms->ofdm_symbol_size>>1, + shift); + + int64_t re1 = ((int*) &result1)[0]; + int64_t re2 = ((int*) &result2)[0]; + int64_t im1 = ((int*) &result1)[1]; + int64_t im2 = ((int*) &result2)[1]; + + // Estimation of fractional frequency offset: angle[(result1)'*(result2)]/pi + double ffo_est = atan2(re1*im2-re2*im1,re1*re2+im1*im2)/M_PI; + + // Computing absolute value of frequency offset + *f_off = ffo_est*frame_parms->subcarrier_spacing; + + /*nr_rf_card_config_freq(&openair0_cfg[ue->rf_map.card], openair0_cfg->tx_freq[0], openair0_cfg->rx_freq[0], ue->common_vars.freq_offset); + + if (ue->mode != loop_through_memory) { + ue->rfdevice.trx_set_freq_func(&ue->rfdevice,&openair0_cfg[0],0); + }*/ + + LOG_I(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB, ffo %lf\n", + peak_position, peak_position_diff, dB_fixed64(peak_value),dB_fixed64(avg),ffo_est); + + return peak_position_diff; +} diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index bb911195c7..fb36b3ee86 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -39,6 +39,7 @@ #include "PHY/phy_extern_nr_ue.h" #include "PHY/MODULATION/modulation_UE.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" +#include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "SCHED_NR_UE/defs.h" @@ -1647,10 +1648,12 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { + int peak_position_diff = nr_adjust_pss_synch(ue, (int *)&ue->common_vars.freq_offset); + LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); nr_ue_pbch_procedures(gNB_id, ue, proc, 0); - if (ue->no_timing_correction==0) { + /* if (ue->no_timing_correction==0) { LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction); nr_adjust_synch_ue(fp, ue, @@ -1659,7 +1662,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, nr_slot_rx, 0, 16384); - } + }*/ + + //ue->rx_offset = peak_position_diff; + + ue->rx_offset_diff = -peak_position_diff; LOG_D(PHY, "Doing N0 measurements in %s\n", __FUNCTION__); nr_ue_rrc_measurements(ue, proc, nr_slot_rx); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index abc64b6e46..c4b06c1139 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; + min_rxtxtime_pdsch = 6; ul_prbblacklist = "51,52,53,54" pdcch_ConfigSIB1 = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 83b39b85ec..c7531f39ba 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime_pdsch = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( From 29268d0a66c1a88a0058de066ce5968e9d8bfe3d Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Fri, 24 Dec 2021 13:12:30 +0000 Subject: [PATCH 075/196] Revert "Merge remote-tracking branch 'origin/develop' into ue-phy-sync-improvements" This reverts commit 96554bef5148f2610e2d0f4d72fe151a69b46d96 --- ci-scripts/Jenkinsfile-trig-nsa | 11 +- ci-scripts/checkCodingFormattingRules.sh | 4 +- ci-scripts/conf_files/benetel-5g.conf | 22 + .../enb.band38.lte_2x2.100PRB.usrpn310.conf | 2 +- .../enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- .../gNB_SA_n78_106PRB.2x2_usrpn310.conf | 29 + .../gNB_SA_n78_133PRB.2x2_usrpn310.conf | 29 + .../gnb.band261.tm1.32PRB.usrpn300.conf | 26 +- .../gnb.band66.tm1.106PRB.usrpn300.conf | 22 +- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 21 + ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 29 + .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 659 +++++++++--------- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 316 --------- .../gnb.band78.tm1.106PRB.usrpn300.conf | 24 +- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 21 + .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 28 + ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 +- .../fr1_nsa_2x2_quectel_attach_detach.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 6 +- ci-scripts/xml_files/fr1_sa_oaiue_x300.xml | 123 ---- .../xml_files/fr1_sa_quectel_162prb.xml | 129 ---- .../fr1_sa_quectel_stages_162prb.xml | 166 ----- cmake_targets/CMakeLists.txt | 10 +- common/utils/nr/nr_common.c | 54 +- common/utils/nr/nr_common.h | 11 +- common/utils/threadPool/Makefile | 14 +- common/utils/threadPool/thread-pool.c | 45 +- common/utils/threadPool/thread-pool.h | 5 +- doc/testing_gnb_w_cots_ue_resources/gnb.conf | 37 + executables/nr-gnb.c | 10 +- executables/nr-ue.c | 2 +- openair1/PHY/CODING/crc.h | 543 --------------- openair1/PHY/CODING/crc_byte.c | 86 +-- openair1/PHY/CODING/crcext.h | 89 --- openair1/PHY/CODING/nrLDPC_defs.h | 37 +- .../nrLDPC_encoder/ldpc_encode_parity_check.c | 15 +- .../PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c | 2 + .../nrLDPC_encoder/ldpc_encoder_optim.c | 25 +- .../nrLDPC_encoder/ldpc_encoder_optim8seg.c | 18 +- .../ldpc_encoder_optim8segmulti.c | 94 +-- openair1/PHY/CODING/types.h | 98 --- openair1/PHY/INIT/nr_init_ue.c | 2 +- openair1/PHY/INIT/nr_parms.c | 1 + openair1/PHY/LTE_REFSIG/lte_refsig.h | 3 +- openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c | 75 ++ openair1/PHY/LTE_TRANSPORT/lte_mcs.c | 22 +- openair1/PHY/LTE_TRANSPORT/pcfich.c | 2 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 2 +- .../LTE_TRANSPORT/transport_common_proto.h | 2 +- openair1/PHY/LTE_TRANSPORT/transport_proto.h | 46 +- openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c | 2 +- .../PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 54 +- .../LTE_UE_TRANSPORT/dlsch_llr_computation.c | 6 +- openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c | 4 +- .../PHY/LTE_UE_TRANSPORT/transport_proto_ue.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 209 ++---- openair1/PHY/NR_TRANSPORT/nr_dlsch.h | 3 +- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 393 ++++++----- openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c | 5 + .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 46 +- .../nr_dlsch_llr_computation.c | 2 +- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 39 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 5 +- openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c | 4 +- openair1/PHY/defs_gNB.h | 17 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 5 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 27 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 29 +- openair1/SIMULATION/NR_PHY/dlsim.c | 45 +- openair1/SIMULATION/NR_PHY/nr_unitary_defs.h | 162 ++++- openair1/SIMULATION/NR_PHY/ulsim.c | 8 +- openair2/COMMON/rrc_messages_types.h | 2 +- openair2/GNB_APP/RRC_nr_paramsvalues.h | 194 ++++++ openair2/GNB_APP/gnb_config.c | 127 +--- openair2/GNB_APP/gnb_paramdef.h | 6 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 39 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 10 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 54 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 42 +- openair2/LAYER2/NR_MAC_gNB/main.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 6 +- openair2/RRC/NR/nr_rrc_config.c | 159 +++-- openair2/RRC/NR/nr_rrc_config.h | 25 +- openair2/RRC/NR/nr_rrc_defs.h | 2 +- openair2/RRC/NR/rrc_gNB.c | 77 +- openair2/RRC/NR/rrc_gNB_nsa.c | 4 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 16 +- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 22 + .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 23 + .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 21 + .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 22 + .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 21 + .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 21 + .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 21 + .../gnb.band78.106PRB.30kHz,usrpb2x0.conf | 21 + .../CONF/gnb.band78.106PRB.slave.conf | 21 + .../CONF/gnb.band78.slave.conf | 21 + .../gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 23 + .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 21 + .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 22 + .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 23 + .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 21 + .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 21 + .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 23 + .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 23 + .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 23 + .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 21 + .../CONF/rcc.band78.tm1.106PRB.nfapi.conf | 39 ++ .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 21 + .../CONF/testing_gnb_24PRB.conf | 36 + .../CONF/testing_gnb_n310.conf | 21 + .../CONF/testing_gnb_nsa_n310.conf | 21 + .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 39 ++ ...b.band78.tm1.106PRB.usrpn300.gtp-itti.conf | 38 + .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 22 + ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 22 + .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 22 + ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 39 ++ 120 files changed, 2798 insertions(+), 2816 deletions(-) delete mode 100644 ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf delete mode 100644 ci-scripts/xml_files/fr1_sa_oaiue_x300.xml delete mode 100644 ci-scripts/xml_files/fr1_sa_quectel_162prb.xml delete mode 100644 ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml delete mode 100644 openair1/PHY/CODING/crc.h delete mode 100644 openair1/PHY/CODING/crcext.h delete mode 100644 openair1/PHY/CODING/types.h create mode 100644 openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index 7b4238d678..4a56270e90 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -88,15 +88,7 @@ pipeline { // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) //] //calling OAIUE N310 - //build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ - // string(name: 'eNB_MR', value: String.valueOf(MR)), - // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - //] - //calling OAIUE N310-X300 - build job: "RAN-SA-OAIUE-N310-X300-CN5G", wait : true, propagate : false, parameters: [ + build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), @@ -104,6 +96,7 @@ pipeline { booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) ] + } } } diff --git a/ci-scripts/checkCodingFormattingRules.sh b/ci-scripts/checkCodingFormattingRules.sh index a805f765df..45cf08aa9a 100755 --- a/ci-scripts/checkCodingFormattingRules.sh +++ b/ci-scripts/checkCodingFormattingRules.sh @@ -77,7 +77,7 @@ then IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE || true` IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FILE || true` - IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc|openair1/PHY/CODING/types.h" || true` + IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h" || true` if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] then if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ] @@ -198,7 +198,7 @@ do IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE || true` IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FULLFILE || true` - IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc|openair1/PHY/CODING/types.h" || true` + IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h" || true` if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] then if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ] diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 79b2f7f877..47898aad15 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -110,6 +119,19 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; #p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index 758bb44879..d2e91fb872 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index d1d32e2b58..6c8d5ba6f0 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 77693d5f72..9bf3136690 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -89,6 +89,19 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -143,6 +156,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index c9b369eaff..dfbbdf659d 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -86,6 +86,19 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 10; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -140,6 +153,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index 4338c00b36..e93177e7cc 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime = 6; + min_rxtxtime_pdsch = 6; servingCellConfigCommon = ( { @@ -55,6 +55,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -109,6 +118,21 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 14; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 1c2133bebe..850cf9a60c 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -24,7 +24,6 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime = 6; servingCellConfigCommon = ( { @@ -55,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -110,6 +118,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b0a757c9d0..c8dc1477b0 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -55,6 +55,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -109,6 +118,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 16456f939c..e8be5a6ef0 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -90,6 +90,19 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -144,6 +157,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..f00a343089 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -1,316 +1,343 @@ -Active_gNBs = ( "gNB-OAI"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -gNBs = -( - { - ////////// Identification parameters: - gNB_CU_ID = 0xe00; - -# cell_type = "CELL_MACRO_GNB"; - - gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; - - plmn_list = ({ - mcc = 208; - mnc = 97; - mnc_length = 2; - snssaiList = ( - { - sst = 1; - sd = 0x010203; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true - } - ); - }); - - nr_cellid = 12345678L - -# tr_s_preference = "local_mac" - - ////////// Physical parameters: - - ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - #pusch_TargetSNRx10 = 200; - #pucch_TargetSNRx10 = 200; - ul_prbblacklist = "51,52,53,54" - - pdcch_ConfigSIB1 = ( - { - controlResourceSetZero = 11; - searchSpaceZero = 0; - } - ); - - servingCellConfigCommon = ( - { - #spCellConfigCommon - - physCellId = 0; - -# downlinkConfigCommon - #frequencyInfoDL - # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 - #absoluteFrequencySSB = 620640; - # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 - absoluteFrequencySSB = 621312; - # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 - #absoluteFrequencySSB = 634080; - # this is 3600.48 MHz - #absoluteFrequencySSB = 640032; - #dl_frequencyBand = 78; - # this is 3301.68 MHz - #dl_absoluteFrequencyPointA = 620112; - # this is 3300.60 MHz - dl_absoluteFrequencyPointA = 620040; - # this is 3502.56 MHz - #dl_absoluteFrequencyPointA = 633552; - # this is 3600.48 MHz - #dl_absoluteFrequencyPointA = 640032; - #scs-SpecificCarrierList - dl_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_subcarrierSpacing = 1; - dl_carrierBandwidth = 106; - #initialDownlinkBWP - #genericParameters - # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialDLBWPsubcarrierSpacing = 1; - #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 11; - initialDLBWPsearchSpaceZero = 0; - - - - #uplinkConfigCommon - #frequencyInfoUL - ul_frequencyBand = 78; - #scs-SpecificCarrierList - ul_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 106; - pMax = 20; - #initialUplinkBWP - #genericParameters - initialULBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialULBWPsubcarrierSpacing = 1; - #rach-ConfigCommon - #rach-ConfigGeneric - prach_ConfigurationIndex = 98; -#prach_msg1_FDM -#0 = one, 1=two, 2=four, 3=eight - prach_msg1_FDM = 0; - prach_msg1_FrequencyStart = 0; - zeroCorrelationZoneConfig = 12; - preambleReceivedTargetPower = -104; -#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) - preambleTransMax = 6; -#powerRampingStep -# 0=dB0,1=dB2,2=dB4,3=dB6 - powerRampingStep = 1; -#ra_ReponseWindow -#1,2,4,8,10,20,40,80 - ra_ResponseWindow = 4; -#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR -#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen - ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; -#oneHalf (0..15) 4,8,12,16,...60,64 - ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; -#ra_ContentionResolutionTimer -#(0..7) 8,16,24,32,40,48,56,64 - ra_ContentionResolutionTimer = 7; - rsrp_ThresholdSSB = 19; -#prach-RootSequenceIndex_PR -#1 = 839, 2 = 139 - prach_RootSequenceIndex_PR = 2; - prach_RootSequenceIndex = 1; - # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex - # - msg1_SubcarrierSpacing = 1, -# restrictedSetConfig -# 0=unrestricted, 1=restricted type A, 2=restricted type B - restrictedSetConfig = 0, - - msg3_DeltaPreamble = 1; - p0_NominalWithGrant =-90; - -# pucch-ConfigCommon setup : -# pucchGroupHopping -# 0 = neither, 1= group hopping, 2=sequence hopping - pucchGroupHopping = 0; - hoppingId = 40; - p0_nominal = -90; -# ssb_PositionsInBurs_BitmapPR -# 1=short, 2=medium, 3=long - ssb_PositionsInBurst_PR = 2; - ssb_PositionsInBurst_Bitmap = 1; - -# ssb_periodicityServingCell -# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 - ssb_periodicityServingCell = 2; - -# dmrs_TypeA_position -# 0 = pos2, 1 = pos3 - dmrs_TypeA_Position = 0; - -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - subcarrierSpacing = 1; - - - #tdd-UL-DL-ConfigurationCommon -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - referenceSubcarrierSpacing = 1; - # pattern1 - # dl_UL_TransmissionPeriodicity - # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 - dl_UL_TransmissionPeriodicity = 6; - nrofDownlinkSlots = 7; - nrofDownlinkSymbols = 6; - nrofUplinkSlots = 2; - nrofUplinkSymbols = 4; - - ssPBCH_BlockPower = -25; - } - - ); - - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; - GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - } -); - -MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } -); - -L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 4; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 75; - eNB_instances = [0]; - ##beamforming 1x2 matrix: 1 layer x 2 antennas - bf_weights = [0x00007fff, 0x0000]; - ##beamforming 1x4 matrix: 1 layer x 4 antennas - #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; - ## beamforming 2x2 matrix: - # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; - ## beamforming 4x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" - } -); - -THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } -); - -security = { - # preferred ciphering algorithms - # the first one of the list that an UE supports in chosen - # valid values: nea0, nea1, nea2, nea3 - ciphering_algorithms = ( "nea0" ); - - # preferred integrity algorithms - # the first one of the list that an UE supports in chosen - # valid values: nia0, nia1, nia2, nia3 - integrity_algorithms = ( "nia2", "nia0" ); - - # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter - # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' - drb_ciphering = "yes"; - drb_integrity = "no"; -}; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + min_rxtxtime_pdsch = 6; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 2; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf deleted file mode 100644 index ff05aa6e65..0000000000 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ /dev/null @@ -1,316 +0,0 @@ -Active_gNBs = ( "gNB-OAI"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -gNBs = -( - { - ////////// Identification parameters: - gNB_CU_ID = 0xe00; - -# cell_type = "CELL_MACRO_GNB"; - - gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; - - plmn_list = ({ - mcc = 208; - mnc = 97; - mnc_length = 2; - snssaiList = ( - { - sst = 1; - sd = 0x010203; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true - } - ); - }); - - nr_cellid = 12345678L - -# tr_s_preference = "local_mac" - - ////////// Physical parameters: - - ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - #pusch_TargetSNRx10 = 200; - #pucch_TargetSNRx10 = 200; - ul_prbblacklist = "51,52,53,54" - - pdcch_ConfigSIB1 = ( - { - controlResourceSetZero = 11; - searchSpaceZero = 0; - } - ); - - servingCellConfigCommon = ( - { - #spCellConfigCommon - - physCellId = 0; - -# downlinkConfigCommon - #frequencyInfoDL - # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 - #absoluteFrequencySSB = 620640; - # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 - absoluteFrequencySSB = 621312; - # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 - #absoluteFrequencySSB = 634080; - # this is 3600.48 MHz - #absoluteFrequencySSB = 640032; - #dl_frequencyBand = 78; - # this is 3301.68 MHz - #dl_absoluteFrequencyPointA = 620112; - # this is 3300.60 MHz - dl_absoluteFrequencyPointA = 620040; - # this is 3502.56 MHz - #dl_absoluteFrequencyPointA = 633552; - # this is 3600.48 MHz - #dl_absoluteFrequencyPointA = 640032; - #scs-SpecificCarrierList - dl_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_subcarrierSpacing = 1; - dl_carrierBandwidth = 106; - #initialDownlinkBWP - #genericParameters - # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialDLBWPsubcarrierSpacing = 1; - #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 11; - initialDLBWPsearchSpaceZero = 0; - - - - #uplinkConfigCommon - #frequencyInfoUL - ul_frequencyBand = 78; - #scs-SpecificCarrierList - ul_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 106; - pMax = 20; - #initialUplinkBWP - #genericParameters - initialULBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialULBWPsubcarrierSpacing = 1; - #rach-ConfigCommon - #rach-ConfigGeneric - prach_ConfigurationIndex = 98; -#prach_msg1_FDM -#0 = one, 1=two, 2=four, 3=eight - prach_msg1_FDM = 0; - prach_msg1_FrequencyStart = 0; - zeroCorrelationZoneConfig = 12; - preambleReceivedTargetPower = -104; -#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) - preambleTransMax = 6; -#powerRampingStep -# 0=dB0,1=dB2,2=dB4,3=dB6 - powerRampingStep = 1; -#ra_ReponseWindow -#1,2,4,8,10,20,40,80 - ra_ResponseWindow = 4; -#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR -#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen - ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; -#oneHalf (0..15) 4,8,12,16,...60,64 - ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; -#ra_ContentionResolutionTimer -#(0..7) 8,16,24,32,40,48,56,64 - ra_ContentionResolutionTimer = 7; - rsrp_ThresholdSSB = 19; -#prach-RootSequenceIndex_PR -#1 = 839, 2 = 139 - prach_RootSequenceIndex_PR = 2; - prach_RootSequenceIndex = 1; - # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex - # - msg1_SubcarrierSpacing = 1, -# restrictedSetConfig -# 0=unrestricted, 1=restricted type A, 2=restricted type B - restrictedSetConfig = 0, - - msg3_DeltaPreamble = 1; - p0_NominalWithGrant =-90; - -# pucch-ConfigCommon setup : -# pucchGroupHopping -# 0 = neither, 1= group hopping, 2=sequence hopping - pucchGroupHopping = 0; - hoppingId = 40; - p0_nominal = -90; -# ssb_PositionsInBurs_BitmapPR -# 1=short, 2=medium, 3=long - ssb_PositionsInBurst_PR = 2; - ssb_PositionsInBurst_Bitmap = 1; - -# ssb_periodicityServingCell -# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 - ssb_periodicityServingCell = 2; - -# dmrs_TypeA_position -# 0 = pos2, 1 = pos3 - dmrs_TypeA_Position = 0; - -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - subcarrierSpacing = 1; - - - #tdd-UL-DL-ConfigurationCommon -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - referenceSubcarrierSpacing = 1; - # pattern1 - # dl_UL_TransmissionPeriodicity - # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 - dl_UL_TransmissionPeriodicity = 6; - nrofDownlinkSlots = 7; - nrofDownlinkSymbols = 6; - nrofUplinkSlots = 2; - nrofUplinkSymbols = 4; - - ssPBCH_BlockPower = -25; - } - - ); - - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; - GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - } -); - -MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } -); - -L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 4; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 75; - eNB_instances = [0]; - ##beamforming 1x2 matrix: 1 layer x 2 antennas - bf_weights = [0x00007fff, 0x0000]; - ##beamforming 1x4 matrix: 1 layer x 4 antennas - #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; - ## beamforming 2x2 matrix: - # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; - ## beamforming 4x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" - } -); - -THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } -); - -security = { - # preferred ciphering algorithms - # the first one of the list that an UE supports in chosen - # valid values: nea0, nea1, nea2, nea3 - ciphering_algorithms = ( "nea0" ); - - # preferred integrity algorithms - # the first one of the list that an UE supports in chosen - # valid values: nia0, nia1, nia2, nia3 - integrity_algorithms = ( "nia2", "nia0" ); - - # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter - # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' - drb_ciphering = "yes"; - drb_integrity = "no"; -}; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 6ade355053..4200300c50 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime = 6; + min_rxtxtime_pdsch = 6; servingCellConfigCommon = ( { @@ -55,6 +55,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -109,6 +118,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 38; # this is SS=10 L=3 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index b7a04b1f36..015d9ee0d0 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -52,6 +52,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -106,6 +115,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index 299a19cc4e..e6bbbf2d41 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -53,6 +53,19 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0;#for DL slot + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0;#for mixed slot + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -107,6 +120,21 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 2516af9429..86af12b53e 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -24,7 +24,7 @@ TEST-NSA-FR1-TM2-Tab1 NSA 2x2 Ping DL UL with QUECTEL tasks - 1 + 5 030000 040000 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index 52cf1ec6e8..2d17ff38e2 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -24,7 +24,7 @@ TEST-NSA-FR1-TM2-Tab2 NSA 2x2 Attach-Detach with QUECTEL tasks - 1 + 5 031000 041000 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index cd79e49f2c..28eee1e224 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -22,7 +22,7 @@ --> TEST-SA-FR1-Tab1 - SA Ping DL UL with OAI NR UE (N310) + SA Ping DL UL with OAI NR UE tasks 1 @@ -40,9 +40,9 @@ Initialize_OAI_UE - Initialize OAI UE (N310) + Initialize OAI UE nr - --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation + --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml deleted file mode 100644 index d527737b3c..0000000000 --- a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - TEST-SA-FR1-Tab2 - SA Ping DL UL with OAI NR UE (X300) - tasks - 1 - - 040000 - 000002 - 010000 - 000002 - 050000 - 050001 - 000001 - 010002 - 080000 - - - - - Initialize_OAI_UE - Initialize OAI UE (X300) - nr - --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "addr=192.168.60.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation - - - - Terminate_OAI_UE - Terminate OAI UE - - - - - Initialize_eNB - Initialize gNB - -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1 - 0 - 0 - nr - yes - yes - 192.168.18.240 - - - - IdleSleep - Sleep - 5 - - - - IdleSleep - Sleep - 20 - - - - - Ping - Ping from CN to UE: 20pings in 20sec - -c 20 - 5 - - - - Ping - Ping from CN to UE: 100pings in 20sec - -c 100 -i 0.2 - 5 - - - - Iperf - iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) - -u -b 60M -t 60 - DL - nrmodule2_quectel - 5 - single-ue - - - - Iperf - iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 - UL - nrmodule2_quectel - 5 - single-ue - - - - - Terminate_eNB - Terminate gNB - 0 - 0 - nr - - - - diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml deleted file mode 100644 index 2088678707..0000000000 --- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - TEST-SA-FR1-Tab3 - SA Ping DL UL with QUECTEL - tasks - 1 - - 040000 - 000002 - 010000 - 000001 - 050000 - 050001 - 070000 - 070001 - 000001 - 010002 - 080000 - - - - - Initialize_UE - Initialize Quectel - nrmodule2_quectel - yes - - - - - Terminate_UE - Terminate Quectel - nrmodule2_quectel - - - - - Initialize_eNB - Initialize gNB - -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 - 0 - 0 - nr - yes - yes - 192.168.18.240 - - - - IdleSleep - Sleep - 5 - - - - IdleSleep - Sleep - 20 - - - - - Ping - Ping: 20pings in 20sec - nrmodule2_quectel - -c 20 - 5 - - - - Ping - Ping: 100pings in 20sec - nrmodule2_quectel - -c 100 -i 0,2 - 5 - - - - Iperf - iperf (DL/140Mbps/UDP)(60 sec)(single-ue profile) - -u -b 140M -t 60 - DL - nrmodule2_quectel - 5 - single-ue - - - - Iperf - iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 - UL - nrmodule2_quectel - 5 - single-ue - - - - - Terminate_eNB - Terminate gNB - 0 - 0 - nr - - - - diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml deleted file mode 100644 index 4b2400a4ac..0000000000 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - TEST-SA-FR1-Tab4 - SA Staged DL with QUECTEL - tasks - 1 - - 040000 - 000002 - 010000 - 000001 - 050000 - 000001 - 070000 - 000001 - 070001 - 000001 - 070002 - 000001 - 070003 - 000001 - 070004 - 000001 - 070005 - 000001 - 010002 - 080000 - - - - - Initialize_UE - Initialize Quectel - nrmodule2_quectel - yes - - - - - Terminate_UE - Terminate Quectel - nrmodule2_quectel - - - - - Initialize_eNB - Initialize gNB - -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 - 0 - 0 - nr - yes - yes - 192.168.18.240 - - - - IdleSleep - Sleep - 5 - - - - IdleSleep - Sleep - 20 - - - - - Ping - Ping: 20pings in 20sec - nrmodule2_quectel - -c 20 - 5 - - - - - Iperf - iperf (DL/10Mbps/UDP)(30 sec)(single-ue profile) - -u -b 10M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - Iperf - iperf (DL/20Mbps/UDP)(30 sec)(single-ue profile) - -u -b 20M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - Iperf - iperf (DL/40Mbps/UDP)(30 sec)(single-ue profile) - -u -b 40M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - Iperf - iperf (DL/60Mbps/UDP)(30 sec)(single-ue profile) - -u -b 60M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - Iperf - iperf (DL/90Mbps/UDP)(30 sec)(single-ue profile) - -u -b 90M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - Iperf - iperf (DL/140Mbps/UDP)(30 sec)(single-ue profile) - -u -b 140M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - - - Terminate_eNB - Terminate gNB - 0 - 0 - nr - - - - diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f513ac0563..329ed7bb3d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1,4 +1,4 @@ -#/* +#/* # * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more # * contributor license agreements. See the NOTICE file distributed with # * this work for additional information regarding copyright ownership. @@ -308,7 +308,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") set(COMPILATION_AVX2 "False") endif() if (CPUINFO MATCHES "sse4_1") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1 -mpclmul") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1") endif() if (CPUINFO MATCHES "ssse3") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3") @@ -889,7 +889,7 @@ set(HWLIB_BENETEL_4G_SOURCE ) add_library(benetel_4g MODULE ${HWLIB_BENETEL_4G_SOURCE} ) -set_target_properties(benetel_4g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") +set_target_properties(benetel_4g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") TARGET_LINK_LIBRARIES(benetel_4g ${DPDK_LIBS}) @@ -907,7 +907,7 @@ set(HWLIB_BENETEL_5G_SOURCE ) add_library(benetel_5g MODULE ${HWLIB_BENETEL_5G_SOURCE} ) -set_target_properties(benetel_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") +set_target_properties(benetel_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") TARGET_LINK_LIBRARIES(benetel_5g ${DPDK_LIBS}) @@ -993,6 +993,7 @@ add_boolean_option(TRACE_RLC_AM_HOLE False "TRACE for RLC AM, TO BE CHANGE add_boolean_option(TRACE_RLC_AM_PDU False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_RESEGMENT False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_RX False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") +add_boolean_option(TRACE_RLC_AM_RX_DECODE False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_TX False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_TX_STATUS False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_STATUS_CREATION False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") @@ -1571,6 +1572,7 @@ set(PHY_SRC_COMMON ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_scrambling.c + ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_gold_generic.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/srs_modulation.c ${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 0de24bcf6d..a704a66c76 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -257,48 +257,6 @@ void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) { *n_rb = 6*count; } -int get_nb_periods_per_frame(uint8_t tdd_period) { - - int nb_periods_per_frame; - switch(tdd_period) { - case 0: - nb_periods_per_frame = 20; // 10ms/0p5ms - break; - - case 1: - nb_periods_per_frame = 16; // 10ms/0p625ms - break; - - case 2: - nb_periods_per_frame = 10; // 10ms/1ms - break; - - case 3: - nb_periods_per_frame = 8; // 10ms/1p25ms - break; - - case 4: - nb_periods_per_frame = 5; // 10ms/2ms - break; - - case 5: - nb_periods_per_frame = 4; // 10ms/2p5ms - break; - - case 6: - nb_periods_per_frame = 2; // 10ms/5ms - break; - - case 7: - nb_periods_per_frame = 1; // 10ms/10ms - break; - - default: - AssertFatal(1==0,"Undefined tdd period %d\n", tdd_period); - } - return nb_periods_per_frame; -} - int get_dmrs_port(int nl, uint16_t dmrs_ports) { @@ -318,6 +276,14 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports) { return p; } +int get_num_dmrs(uint16_t dmrs_mask ) { + + int num_dmrs=0; + + for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); + return(num_dmrs); +} + lte_frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index) { lte_frame_type_t current_type; @@ -506,10 +472,6 @@ int get_subband_size(int NPRB,int size) { } -int get_SLIV(uint8_t S, uint8_t L) { - return ( (uint16_t)(((L-1)<=7)? (14*(L-1)+S) : (14*(15-L)+(13-S))) ); -} - void SLIV2SL(int SLIV,int *S,int *L) { int SLIVdiv14 = SLIV/14; diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 44a6e05577..d9f2b0c03a 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -50,17 +50,9 @@ typedef struct nr_bandentry_s { extern const size_t nr_bandtable_size; extern nr_bandentry_t nr_bandtable[]; -static inline int get_num_dmrs(uint16_t dmrs_mask ) { - int num_dmrs=0; - - for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); - return(num_dmrs); -} - - -int get_SLIV(uint8_t S, uint8_t L); void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset); +int get_num_dmrs(uint16_t dmrs_mask); uint16_t config_bandwidth(int mu, int nb_rb, int nr_band); int get_nr_table_idx(int nr_bandP, uint8_t scs_index); int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index); @@ -79,7 +71,6 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); int get_subband_size(int NPRB,int size); void SLIV2SL(int SLIV,int *S,int *L); int get_dmrs_port(int nl, uint16_t dmrs_ports); -int get_nb_periods_per_frame(uint8_t tdd_period); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) diff --git a/common/utils/threadPool/Makefile b/common/utils/threadPool/Makefile index 729f9dd0e2..6b28eb2ba8 100644 --- a/common/utils/threadPool/Makefile +++ b/common/utils/threadPool/Makefile @@ -1,3 +1,13 @@ -thread-pool-test: thread-pool.c thread-pool.h - gcc -g -O3 thread-pool.c -I ${OPENAIR_DIR}/nfapi/open-nFAPI/nfapi/public_inc -I ${OPENAIR_DIR}/ -I ${OPENAIR_DIR}/common/utils/ -I. ${OPENAIR_DIR}/common/utils/backtrace.c -I ${OPENAIR_DIR}/openair2/COMMON ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/LOG/log.c ${OPENAIR_DIR}/common/config/config_userapi.c ${OPENAIR_DIR}/common/config/config_load_configmodule.c ${OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -DMAX_NUM_CCs=1 -I../LOG -I../../utils/T -o thread-pool-test +all: +measurement_display thread-pool-test + +measurement_display: +measurement_display.c thread-pool.h +gcc measurement_display.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o +measurement_display + +thread-pool-test: +thread-pool.c thread-pool.h +gcc -g thread-pool.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -I $ {OPENAIR_DIR}/openair2/COMMON $ {OPENAIR_DIR}/common/utils/LOG/log.c $ {OPENAIR_DIR}/common/config/config_userapi.c +$ {OPENAIR_DIR}/common/config/config_load_configmodule.c $ {OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o thread-pool-test diff --git a/common/utils/threadPool/thread-pool.c b/common/utils/threadPool/thread-pool.c index fff09528a8..77729ae7a7 100644 --- a/common/utils/threadPool/thread-pool.c +++ b/common/utils/threadPool/thread-pool.c @@ -155,24 +155,21 @@ void initNamedTpool(char *params,tpool_t *pool, bool performanceMeas, char *name } #ifdef TEST_THREAD_POOL -volatile int oai_exit=0; void exit_function(const char *file, const char *function, const int line, const char *s) { } struct testData { int id; - int sleepTime; char txt[30]; }; void processing(void *arg) { struct testData *in=(struct testData *)arg; - //printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); + printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); sprintf(in->txt,"Done by %ld, job %d", pthread_self(), in->id); - in->sleepTime=rand()%1000; - usleep(in->sleepTime); - //printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); + usleep(rand()%100); + printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); } int main() { @@ -211,43 +208,11 @@ int main() { } while(tmp); tpool_t pool; - char params[]="1,2,3,4,5"; + char params[]="1,2,3,u"; initTpool(params,&pool, true); notifiedFIFO_t worker_back; initNotifiedFIFO(&worker_back); - sleep(1); - int cumulProcessTime=0, cumulTime=0; - struct timespec st,end; - clock_gettime(CLOCK_MONOTONIC, &st); - int nb_jobs=4; - for (int i=0; i <1000 ; i++) { - int parall=nb_jobs; - for (int j=0; j id=i; - pushTpool(&pool, work); - } - int sleepmax=0; - while (parall) { - tmp=pullTpool(&worker_back,&pool); - if (tmp) { - parall--; - struct testData *dd=NotifiedFifoData(tmp); - if (dd->sleepTime > sleepmax) - sleepmax=dd->sleepTime; - delNotifiedFIFO_elt(tmp); - } - } - cumulProcessTime+=sleepmax; - } - clock_gettime(CLOCK_MONOTONIC, &end); - long long dur=(end.tv_sec-st.tv_sec)*1000*1000+(end.tv_nsec-st.tv_nsec)/1000; - printf("In µs, Total time per group of %d job:%lld, work time per job %d, overhead per job %lld\n", - nb_jobs, dur/1000, cumulProcessTime/1000, (dur-cumulProcessTime)/(1000*nb_jobs)); - - /* for (int i=0; i <1000 ; i++) { notifiedFIFO_elt_t *work=newNotifiedFIFO_elt(sizeof(struct testData), i, &worker_back, processing); struct testData *x=(struct testData *)NotifiedFifoData(work); @@ -267,7 +232,7 @@ int main() { abortTpool(&pool,510); } while(tmp); - */ + return 0; } #endif diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index 1839b42f39..a32b7c3859 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -31,7 +31,6 @@ #include #include #include -//#include #ifdef DEBUG #define THREADINIT PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP @@ -51,7 +50,7 @@ AssertFatal(ret==0,"ret=%d\n",ret);} #define condbroadcast(signal) {int ret=pthread_cond_broadcast(&signal); \ AssertFatal(ret==0,"ret=%d\n",ret);} -#define condsignal(signal) {int ret=pthread_cond_signal(&signal); \ +#define condsignal(signal) {int ret=pthread_cond_broadcast(&signal); \ AssertFatal(ret==0,"ret=%d\n",ret);} #define tpool_nbthreads(tpool) (tpool.nbThreads) typedef struct notifiedFIFO_elt_s { @@ -131,7 +130,7 @@ static inline void pushNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf, notifiedFIF static inline void pushNotifiedFIFO(notifiedFIFO_t *nf, notifiedFIFO_elt_t *msg) { mutexlock(nf->lockF); pushNotifiedFIFO_nothreadSafe(nf,msg); - condsignal(nf->notifF); + condbroadcast(nf->notifF); mutexunlock(nf->lockF); } diff --git a/doc/testing_gnb_w_cots_ue_resources/gnb.conf b/doc/testing_gnb_w_cots_ue_resources/gnb.conf index aae22a92ba..97935f92ee 100755 --- a/doc/testing_gnb_w_cots_ue_resources/gnb.conf +++ b/doc/testing_gnb_w_cots_ue_resources/gnb.conf @@ -53,7 +53,29 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57) + initialDLBWPstartSymbolAndLength_3 = 57; //43; //57; #uplinkConfigCommon #frequencyInfoUL ul_frequencyBand = 78; @@ -107,6 +129,21 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 55; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index dc8960846f..e9fc06ce4a 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -401,15 +401,15 @@ void init_gNB_Tpool(int inst) { LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU); int threadCnt = min(numCPU, gNB->pusch_proc_threads); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); - char pool[80]; - sprintf(pool,"-1"); + char ul_pool[80]; + sprintf(ul_pool,"-1"); int s_offset = 0; for (int icpu=1; icputhreadPool, false); + if (getenv("noThreads")) strcpy(ul_pool, "n"); + initTpool(ul_pool, gNB->threadPool, false); // ULSCH decoder result FIFO gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->respDecode); diff --git a/executables/nr-ue.c b/executables/nr-ue.c index c4d8145c44..c90a5119cd 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -786,7 +786,7 @@ void init_NR_UE_threads(int nb_inst) { /* HACK: this function is needed to compile the UE * fix it somehow */ -int find_dlsch(uint16_t rnti, +int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB, find_type_t type) { diff --git a/openair1/PHY/CODING/crc.h b/openair1/PHY/CODING/crc.h deleted file mode 100644 index d6474eae9b..0000000000 --- a/openair1/PHY/CODING/crc.h +++ /dev/null @@ -1,543 +0,0 @@ -/******************************************************************************* - Copyright (c) 2009-2018, Intel Corporation - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*******************************************************************************/ - -/** - * Header file for module with CRC computation methods - * - * PCLMULQDQ implementation is based on work by: - * Erdinc Ozturk - * Vinodh Gopal - * James Guilford - * - * "Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction" - * URL: http://download.intel.com/design/intarch/papers/323102.pdf - */ - -#ifndef __CRC_H__ -#define __CRC_H__ - -#include - -#include "crcext.h" -#include "types.h" -#include -#include - -/** - * PCLMULQDQ CRC computation context structure - */ -struct crc_pclmulqdq_ctx { - /** - * K1 = reminder X^128 / P(X) : 0-63 - * K2 = reminder X^192 / P(X) : 64-127 - */ - uint64_t k1; - uint64_t k2; - - /** - * K3 = reminder X^64 / P(X) : 0-63 - * q = quotient X^64 / P(X) : 64-127 - */ - uint64_t k3; - uint64_t q; - - /** - * p = polynomial / P(X) : 0-63 - * res = reserved : 64-127 - */ - uint64_t p; - uint64_t res; -}; - -/** - * Functions and prototypes - */ - -/** - * @brief Initializes look-up-table (LUT) for given 8 bit polynomial - * - * @param poly CRC polynomial - * @param lut pointer to look-up-table to be initialized - */ -void crc8_init_lut(const uint8_t poly, uint8_t *lut); - -/** - * @brief Calculates 8 bit CRC using LUT method. - * - * @param crc CRC initial value - * @param data pointer to data block to calculate CRC for - * @param data_len size of data block - * @param lut 256x8bits look-up-table pointer - * - * @return New CRC value - */ -__forceinline -uint8_t crc8_calc_lut(const uint8_t *data, - uint32_t data_len, - uint8_t crc, - const uint8_t *lut) -{ - if (unlikely(data == NULL || lut == NULL)) - return crc; - - while (data_len--) - crc = lut[*data++ ^ crc]; - - return crc; -} - -/** - * @brief Initializes look-up-table (LUT) for given 16 bit polynomial - * - * @param poly CRC polynomial - * @param lut pointer to 256x16bits look-up-table to be initialized - */ -void crc16_init_lut(const uint16_t poly, uint16_t *lut); - -/** - * @brief Calculates 16 bit CRC using LUT method. - * - * @param crc CRC initial value - * @param data pointer to data block to calculate CRC for - * @param data_len size of data block - * @param lut 256x16bits look-up-table pointer - * - * @return New CRC value - */ -__forceinline -uint16_t crc16_calc_lut(const uint8_t *data, - uint32_t data_len, - uint16_t crc, - const uint16_t *lut) -{ - if (unlikely(data == NULL || lut == NULL)) - return crc; - - while (data_len--) - crc = lut[(crc >> 8) ^ *data++] ^ (crc << 8); - - return crc; -} - -/** - * @brief Initializes look-up-table (LUT) for given 32 bit polynomial - * - * @param poly CRC polynomial - * @param lut pointer to 256x32bits look-up-table to be initialized - */ -void crc32_init_lut(const uint32_t poly, uint32_t *lut); - -/** - * @brief Calculates 32 bit CRC using LUT method. - * - * @param crc CRC initial value - * @param data pointer to data block to calculate CRC for - * @param data_len size of data block - * @param lut 256x32bits look-up-table pointer - * - * @return New CRC value - */ -__forceinline -uint32_t crc32_calc_lut(const uint8_t *data, - uint32_t data_len, - uint32_t crc, - const uint32_t *lut) -{ - if (unlikely(data == NULL || lut == NULL)) - return crc; - - while (data_len--) - crc = lut[(crc >> 24) ^ *data++] ^ (crc << 8); - - return crc; -} - -/** - * @brief Initializes look up tables for slice-By-2 method. - * - * @param poly CRC polynomial - * @param slice1 slice-by-2 look-up-table 1 - * @param slice2 slice-by-2 look-up-table 2 - * - * @return New CRC value - */ -void crc16_init_slice2(const uint16_t poly, - uint16_t *slice1, - uint16_t *slice2); - -/** - * @brief Calculates 16 bit CRC using Slice-By-2 method. - * - * @param crc CRC initial value - * @param data pointer to data block to calculate CRC for - * @param data_len size of data block - * @param slice1 256x16bits slice look-up-table 1 - * @param slice2 256x16bits slice look-up-table 2 - * - * @return New CRC value - */ -__forceinline -uint16_t crc16_calc_slice2(const uint8_t *data, - uint32_t data_len, - uint16_t crc, - const uint16_t *slice1, - const uint16_t *slice2) -{ - uint_fast32_t i; - - if (unlikely(data == NULL)) - return crc; - - if (unlikely(slice1 == NULL || slice2 == NULL)) - return crc; - - crc = bswap2(crc); - for (i = (data_len & (~1)), data += (data_len & (~1)); i != 0; - i -= sizeof(uint16_t)) { - crc ^= (*((const uint16_t *)(data - i))); - crc = slice2[(uint8_t)crc] ^ slice1[(uint8_t)(crc >> 8)]; - } - crc = bswap2(crc); - if (data_len & 1) - crc = (crc << 8) ^ bswap2(slice1[(crc >> 8) ^ *data]); - - return crc; -} - -/** - * @brief Initializes look up tables for slice-By-4 method. - * - * @param poly CRC polynomial - * @param slice1 256x32bits slice look-up-table 1 - * @param slice2 256x32bits slice look-up-table 2 - * @param slice3 256x32bits slice look-up-table 3 - * @param slice4 256x32bits slice look-up-table 4 - * - * @return New CRC value - */ -void crc32_init_slice4(const uint32_t poly, - uint32_t *slice1, uint32_t *slice2, - uint32_t *slice3, uint32_t *slice4); - -/** - * @brief Calculates 32 bit CRC using Slice-By-4 method. - * - * @param data pointer to data block to calculate CRC for - * @param data_len size of data block - * @param crc CRC initial value - * @param slice1 256x32bits slice look-up-table 1 - * @param slice2 256x32bits slice look-up-table 2 - * @param slice3 256x32bits slice look-up-table 3 - * @param slice4 256x32bits slice look-up-table 4 - * - * @return New CRC value - */ -__forceinline -uint32_t crc32_calc_slice4(const uint8_t *data, - uint32_t data_len, uint32_t crc, - const uint32_t *slice1, const uint32_t *slice2, - const uint32_t *slice3, const uint32_t *slice4) -{ - uint_fast32_t i; - - if (unlikely(data == NULL)) - return crc; - - if (unlikely(slice1 == NULL || slice2 == NULL || - slice3 == NULL || slice4 == NULL)) - return crc; - - crc = bswap4(crc); - for (i = data_len & (~3), data += (data_len & (~3)); i != 0; - i -= sizeof(uint32_t)) { - crc ^= (*((const uint32_t *)(data - i))); - crc = slice4[(uint8_t)(crc)] ^ - slice3[(uint8_t)(crc >> 8)] ^ - slice2[(uint8_t)(crc >> 16)] ^ - slice1[(uint8_t)(crc >> 24)]; - } - crc = bswap4(crc); - for (i = data_len & 3, data += (data_len & 3); i != 0; i--) - crc = (crc << 8) ^ - bswap4(slice1[(crc >> 24) ^ *(data - i)]); - - return crc; -} - -/** - * @brief Performs one folding round - * - * Logically function operates as follows: - * DATA = READ_NEXT_16BYTES(); - * F1 = LSB8(FOLD) - * F2 = MSB8(FOLD) - * T1 = CLMUL( F1, K1 ) - * T2 = CLMUL( F2, K2 ) - * FOLD = XOR( T1, T2, DATA ) - * - * @param data_block 16 byte data block - * @param k1_k2 k1 and k2 constanst enclosed in XMM register - * @param fold running 16 byte folded data - * - * @return New 16 byte folded data - */ -__forceinline -__m128i crc32_folding_round(const __m128i data_block, - const __m128i k1_k2, - const __m128i fold) -{ - __m128i tmp = _mm_clmulepi64_si128(fold, k1_k2, 0x11); - - return _mm_xor_si128(_mm_clmulepi64_si128(fold, k1_k2, 0x00), - _mm_xor_si128(data_block, tmp)); -} - -/** - * @brief Performs Barret's reduction from 128 bits to 64 bits - * - * @param data128 128 bits data to be reduced - * @param k3_q k3 and Q constants enclosed in XMM register - * - * @return data reduced to 64 bits - */ -__forceinline -__m128i crc32_reduce_128_to_64(__m128i data128, const __m128i k3_q) -{ - __m128i tmp; - - tmp = _mm_xor_si128(_mm_clmulepi64_si128(data128, k3_q, 0x01 /* k3 */), - data128); - - data128 = _mm_xor_si128(_mm_clmulepi64_si128(tmp, k3_q, 0x01 /* k3 */), - data128); - - return _mm_srli_si128(_mm_slli_si128(data128, 8), 8); -} - -/** - * @brief Performs Barret's reduction from 64 bits to 32 bits - * - * @param data64 64 bits data to be reduced - * @param k3_q k3 and Q constants enclosed in XMM register - * @param p_res P constant enclosed in XMM register - * - * @return data reduced to 32 bits - */ -__forceinline -uint32_t -crc32_reduce_64_to_32(__m128i fold, const __m128i k3_q, const __m128i p_res) -{ - __m128i temp; - - temp = _mm_clmulepi64_si128(_mm_srli_si128(fold, 4), - k3_q, 0x10 /* Q */); - temp = _mm_srli_si128(_mm_xor_si128(temp, fold), 4); - temp = _mm_clmulepi64_si128(temp, p_res, 0 /* P */); - return _mm_extract_epi32(_mm_xor_si128(temp, fold), 0); -} - -/** - * @brief Calculates 32 bit CRC for given \a data block by applying folding and - * reduction methods. - * - * Algorithm operates on 32 bit CRCs so polynomials and initial values may - * need to be promoted to 32 bits where required. - * - * @param crc initial CRC value (32 bit value) - * @param data pointer to data block - * @param data_len length of \a data block in bytes - * @param params pointer to PCLMULQDQ CRC calculation context - * - * @return CRC for given \a data block (32 bits wide). - */ -__forceinline -uint32_t -crc32_calc_pclmulqdq(const uint8_t *data, - uint32_t data_len, uint32_t crc, - const struct crc_pclmulqdq_ctx *params) -{ - __m128i temp, fold, k, swap; - uint32_t n; - - if (unlikely(data == NULL || data_len == 0 || params == NULL)) - return crc; - -#ifdef __KERNEL__ - /** - * Preserve FPU context - */ - kernel_fpu_begin(); -#endif - - /** - * Add 4 bytes to data block size - * This is to secure the following: - * CRC32 = M(X)^32 mod P(X) - * M(X) - message to compute CRC on - * P(X) - CRC polynomial - */ - data_len += 4; - - /** - * Load first 16 data bytes in \a fold and - * set \a swap BE<->LE 16 byte conversion variable - */ - fold = _mm_loadu_si128((__m128i *)data); - swap = crc_xmm_be_le_swap128; - - /** - * ------------------------------------------------- - * Folding all data into single 16 byte data block - * Assumes: \a fold holds first 16 bytes of data - */ - - if (unlikely(data_len <= 16)) { - /** - * Data block fits into 16 byte block - * - adjust data block - * - 4 least significant bytes need to be zero - */ - fold = _mm_shuffle_epi8(fold, swap); - fold = _mm_slli_si128(xmm_shift_right(fold, 20 - data_len), 4); - - /** - * Apply CRC init value - */ - temp = _mm_insert_epi32(_mm_setzero_si128(), bswap4(crc), 0); - temp = xmm_shift_left(temp, data_len - 4); - fold = _mm_xor_si128(fold, temp); - } else { - /** - * There are 2x16 data blocks or more - */ - __m128i next_data; - - /** - * n = number of bytes required to align \a data_len - * to multiple of 16 - */ - n = ((~data_len) + 1) & 15; - - /** - * Apply CRC initial value and - * get \a fold to BE format - */ - fold = _mm_xor_si128(fold, - _mm_insert_epi32(_mm_setzero_si128(), - crc, 0)); - fold = _mm_shuffle_epi8(fold, swap); - - /** - * Load next 16 bytes of data and - * adjust \a fold & \a next_data as follows: - * - * CONCAT(fold,next_data) >> (n*8) - */ - next_data = _mm_loadu_si128((__m128i *)&data[16]); - next_data = _mm_shuffle_epi8(next_data, swap); - next_data = _mm_or_si128(xmm_shift_right(next_data, n), - xmm_shift_left(fold, 16 - n)); - fold = xmm_shift_right(fold, n); - - if (unlikely(data_len <= 32)) - /** - * In such unlikely case clear 4 least significant bytes - */ - next_data = - _mm_slli_si128(_mm_srli_si128(next_data, 4), 4); - - /** - * Do the initial folding round on 2 first 16 byte chunks - */ - k = _mm_load_si128((__m128i *)(¶ms->k1)); - fold = crc32_folding_round(next_data, k, fold); - - if (likely(data_len > 32)) { - /** - * \a data_block needs to be at least 48 bytes long - * in order to get here - */ - __m128i new_data; - - /** - * Main folding loop - * - n is adjusted to point to next 16 data block - * to read - * (16+16) = 2x16; represents 2 first data blocks - * processed above - * (- n) is the number of zero bytes padded to - * the message in order to align it to 16 bytes - * - the last 16 bytes is processed separately - */ - for (n = 16 + 16 - n; n < (data_len - 16); n += 16) { - new_data = _mm_loadu_si128((__m128i *)&data[n]); - new_data = _mm_shuffle_epi8(new_data, swap); - fold = crc32_folding_round(new_data, k, fold); - } - - /** - * The last folding round works always on 12 bytes - * (12 bytes of data and 4 zero bytes) - * Read from offset -4 is to avoid one - * shift right operation. - */ - new_data = _mm_loadu_si128((__m128i *)&data[n - 4]); - new_data = _mm_shuffle_epi8(new_data, swap); - new_data = _mm_slli_si128(new_data, 4); - fold = crc32_folding_round(new_data, k, fold); - } /* if (data_len > 32) */ - } - - /** - * ------------------------------------------------- - * Reduction 128 -> 32 - * Assumes: \a fold holds 128bit folded data - */ - - /** - * REDUCTION 128 -> 64 - */ - k = _mm_load_si128((__m128i *)(¶ms->k3)); - fold = crc32_reduce_128_to_64(fold, k); - - /** - * REDUCTION 64 -> 32 - */ - n = crc32_reduce_64_to_32(fold, k, - _mm_load_si128((__m128i *)(¶ms->p))); - -#ifdef __KERNEL__ - /** - * - restore FPU context - */ - kernel_fpu_end(); -#endif - - return n; -} - -#endif /* __CRC_H__ */ diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index d1c3917c2c..287cbcd1f4 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -30,17 +30,10 @@ Modified in June, 2001, to include the length non multiple of 8 */ -#ifndef __SSE4_1__ -#define USE_INTEL_CRC 0 -#else -#define USE_INTEL_CRC __SSE4_1__ -#endif #include "coding_defs.h" #include "assertions.h" -#if USE_INTEL_CRC -#include "crc.h" -#endif + /*ref 36-212 v8.6.0 , pp 8-9 */ /* the highest degree is set by default */ @@ -101,28 +94,6 @@ static unsigned short crc11Table[256]; static unsigned char crc8Table[256]; static unsigned char crc6Table[256]; -#if USE_INTEL_CRC -static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24a_pclmulqdq, 16) = { - 0x64e4d700, /**< k1 */ - 0x2c8c9d00, /**< k2 */ - 0xd9fe8c00, /**< k3 */ - 0xf845fe24, /**< q */ - 0x864cfb00, /**< p */ - 0ULL /**< res */ -}; -__m128i crc_xmm_be_le_swap128; - -DECLARE_ALIGNED(const uint8_t crc_xmm_shift_tab[48], 16) = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -}; - -#endif - void crcTableInit (void) { unsigned char c = 0; @@ -137,29 +108,23 @@ void crcTableInit (void) crc8Table[c] = (unsigned char) (crcbit (&c, 1, poly8) >> 24); crc6Table[c] = (unsigned char) (crcbit (&c, 1, poly6) >> 24); } while (++c); -#if USE_INTEL_CRC - crc_xmm_be_le_swap128 = _mm_setr_epi32(0x0c0d0e0f, 0x08090a0b, - 0x04050607, 0x00010203); - -#endif } /********************************************************* -Byte by byte LUT implementations, +Byte by byte implementations, assuming initial byte is 0 padded (in MSB) if necessary -can use SIMD optimized Intel CRC for LTE/NR 24a/24b variants -*********************************************************/ +*********************************************************/ unsigned int crc24a (unsigned char * inptr, int bitlen) { - int octetlen = bitlen / 8; /* Change in octets */ - if ( bitlen % 8 || !USE_INTEL_CRC ) { - unsigned int crc = 0; - int resbit= (bitlen % 8); - + int octetlen, resbit; + unsigned int crc = 0; + octetlen = bitlen / 8; /* Change in octets */ + resbit = (bitlen % 8); + while (octetlen-- > 0) { // printf("crc24a: in %x => crc %x\n",crc,*inptr); crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; @@ -167,35 +132,17 @@ unsigned int crc24a (unsigned char * inptr, if (resbit > 0) crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; - return crc; - } - #if USE_INTEL_CRC - else { - return crc32_calc_pclmulqdq(inptr, octetlen, 0, - <e_crc24a_pclmulqdq); - } - #endif + return crc; } -#if USE_INTEL_CRC -static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = { - 0x80140500, /**< k1 */ - 0x42000100, /**< k2 */ - 0x90042100, /**< k3 */ - 0xffff83ff, /**< q */ - 0x80006300, /**< p */ - 0ULL /**< res */ -}; -#endif unsigned int crc24b (unsigned char * inptr, - int bitlen) + int bitlen) { - int octetlen = bitlen / 8; /* Change in octets */ - - if ( bitlen % 8 || !USE_INTEL_CRC ) { + int octetlen, resbit; unsigned int crc = 0; - int resbit = (bitlen % 8); + octetlen = bitlen / 8; /* Change in octets */ + resbit = (bitlen % 8); while (octetlen-- > 0) { // printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]); @@ -206,13 +153,6 @@ unsigned int crc24b (unsigned char * inptr, crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; return crc; - } -#if USE_INTEL_CRC - else { - return crc32_calc_pclmulqdq(inptr, octetlen, 0, - <e_crc24b_pclmulqdq); - } -#endif } unsigned int crc24c (unsigned char * inptr, diff --git a/openair1/PHY/CODING/crcext.h b/openair1/PHY/CODING/crcext.h deleted file mode 100644 index f441f25e50..0000000000 --- a/openair1/PHY/CODING/crcext.h +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - Copyright (c) 2009-2018, Intel Corporation - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*******************************************************************************/ - -/** - * Header file with CRC external definitions - * - */ - -#ifndef __CRCEXT_H__ -#define __CRCEXT_H__ - -#include -#include "types.h" -/** - * Flag indicating availability of PCLMULQDQ instruction - * Only valid after running CRCInit() function. - */ -extern int pclmulqdq_available; - -/** - * Flag indicating availability of PCLMULQDQ instruction - * Only valid after running CRCInit() function. - */ -extern __m128i crc_xmm_be_le_swap128; -extern const uint8_t crc_xmm_shift_tab[48]; - -/** - * @brief Shifts right 128 bit register by specified number of bytes - * - * @param reg 128 bit value - * @param num number of bytes to shift right \a reg by (0-16) - * - * @return \a reg >> (\a num * 8) - */ -__forceinline -__m128i xmm_shift_right(__m128i reg, const unsigned int num) -{ - const __m128i *p = (const __m128i *)(crc_xmm_shift_tab + 16 + num); - - return _mm_shuffle_epi8(reg, _mm_loadu_si128(p)); -} - -/** - * @brief Shifts left 128 bit register by specified number of bytes - * - * @param reg 128 bit value - * @param num number of bytes to shift left \a reg by (0-16) - * - * @return \a reg << (\a num * 8) - */ -__forceinline -__m128i xmm_shift_left(__m128i reg, const unsigned int num) -{ - const __m128i *p = (const __m128i *)(crc_xmm_shift_tab + 16 - num); - - return _mm_shuffle_epi8(reg, _mm_loadu_si128(p)); -} - -/** - * @brief Initializes CRC module. - * @note It is mandatory to run it before using any of CRC API's. - */ -extern void CRCInit(void); - -#endif /* __CRCEXT_H__ */ diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h index 0d7ff9ef9f..321ecaab7d 100644 --- a/openair1/PHY/CODING/nrLDPC_defs.h +++ b/openair1/PHY/CODING/nrLDPC_defs.h @@ -22,7 +22,6 @@ // encoder interface #ifndef __NRLDPC_DEFS__H__ #define __NRLDPC_DEFS__H__ -#include #include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" /** \brief LDPC encoder @@ -37,31 +36,17 @@ \param 9-12 time_stats_t *tinput,*tprep, *tparity,*toutput */ typedef struct { - unsigned int n_segments; // optim8seg - unsigned int macro_num; // optim8segmulti - unsigned char gen_code; //orig - time_stats_t *tinput; - time_stats_t *tprep; - time_stats_t *tparity; - time_stats_t *toutput; - int Kr; - uint32_t Kb; - uint32_t *Zc; - void *harq; - /// Encoder BG - uint8_t BG; - /// Interleaver outputs - unsigned char *output; - /// Number of bits in "small" code segments - uint32_t K; - /// Number of "Filler" bits - uint32_t F; - /// LDPC-code outputs - uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; -} encoder_implemparams_t; + int n_segments; // optim8seg + unsigned int macro_num; // optim8segmulti + unsigned char gen_code; //orig + time_stats_t *tinput; + time_stats_t *tprep; + time_stats_t *tparity; + time_stats_t *toutput; +}encoder_implemparams_t; #define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL} -typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params *p_decParams, int8_t *p_llr, int8_t *p_out); -typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t *); +typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out); +typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t*); //============================================================================================================================ // decoder interface /** @@ -71,5 +56,5 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho \param p_llrOut Output vector \param p_profiler LDPC profiler statistics */ -typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params *, int8_t *, int8_t *, t_nrLDPC_procBuf *, t_nrLDPC_time_stats * ); +typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* ); #endif diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c index 69d2ac4972..738fd49b7d 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c @@ -38,6 +38,8 @@ #include "common/utils/LOG/log.h" +//#define DEBUG_LDPC + #include "ldpc384_byte.c" #include "ldpc352_byte.c" #include "ldpc320_byte.c" @@ -71,18 +73,9 @@ -static void encode_parity_check_part_optim(uint8_t *cc,uint8_t *d, short BG,short Zc,short Kb, int simd_size, int ncols) +static inline void encode_parity_check_part_optim(uint8_t *c,uint8_t *d, short BG,short Zc,short Kb) { - unsigned char c[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c - - for (int i1=0; i1 < ncols; i1++) { - memcpy(&c[2*i1*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char)); - memcpy(&c[(2*i1+1)*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char)); - } - for (int i1=1;i1tinput != NULL) start_meas(impp->tinput); - for (int i=0; i>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); } @@ -103,10 +108,24 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); + for (i1=0; i1 < ncols; i1++) + { + memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + } + for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(c, d, BG, Zc, Kb,simd_size, ncols); + encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c index 6fa9c5ff53..a974e86e27 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c @@ -38,6 +38,7 @@ #include "common/utils/LOG/log.h" #include "PHY/TOOLS/time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" +//#define DEBUG_LDPC #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" @@ -101,6 +102,7 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc unsigned char c[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size unsigned char d[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size + unsigned char c_extension[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c // calculate number of punctured bits no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*rate)/Zc; @@ -149,10 +151,24 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); + for (i1=0; i1 < ncols; i1++) + { + memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + } + for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(c, d, BG, Zc, Kb, simd_size, ncols); + encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c index 15d4481eb6..b21f875b32 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c @@ -39,17 +39,17 @@ #include "PHY/TOOLS/time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" +//#define DEBUG_LDPC + #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" -int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp) +int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp) { - //set_log(PHY, 4); - - int nrows=0,ncols=0; - int rate=3; + short nrows=0,ncols=0; + int i,i1,j,rate=3; int no_punctured_columns,removed_bit; //Table of possible lifting sizes char temp; @@ -95,8 +95,8 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor } #ifdef DEBUG_LDPC - LOG_D(PHY,"ldpc_encoder_optim_8seg: BG %d, Zc %d, Kb %d, block_length %d, segments %d\n",BG,Zc,Kb,block_length,impp->n_segments); - LOG_D(PHY,"ldpc_encoder_optim_8seg: PDU (seg 0) %x %x %x %x\n",input[0][0],input[0][1],input[0][2],input[0][3]); + LOG_D(PHY,"ldpc_encoder_optim_8seg: BG %d, Zc %d, Kb %d, block_length %d, segments %d\n",BG,Zc,Kb,block_length,n_segments); + LOG_D(PHY,"ldpc_encoder_optim_8seg: PDU (seg 0) %x %x %x %x\n",test_input[0][0],test_input[0][1],test_input[0][2],test_input[0][3]); #endif AssertFatal(Zc>0,"no valid Zc found for block length %d\n",block_length); @@ -104,8 +104,10 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor if ((Zc&31) > 0) simd_size = 16; else simd_size = 32; - unsigned char cc[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size - unsigned char dd[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size + unsigned char c[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size + unsigned char d[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size + + unsigned char c_extension[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c // calculate number of punctured bits no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*rate)/Zc; @@ -113,8 +115,8 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor //printf("%d\n",no_punctured_columns); //printf("%d\n",removed_bit); // unpack input - memset(cc,0,sizeof(unsigned char) * ncols * Zc); - memset(dd,0,sizeof(unsigned char) * nrows * Zc); + memset(c,0,sizeof(unsigned char) * ncols * Zc); + memset(d,0,sizeof(unsigned char) * nrows * Zc); if(impp->tinput != NULL) start_meas(impp->tinput); #if 0 @@ -122,29 +124,29 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor //for (j=0; j>(i&7); + temp = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); //printf("c(%d,%d)=%d\n",j,i,temp); c[i] |= (temp << (j-macro_segment)); } } #else #ifdef __AVX2__ - for (int i=0; i>5; i++) { - c256 = _mm256_and_si256(_mm256_cmpeq_epi8(_mm256_andnot_si256(_mm256_shuffle_epi8(_mm256_set1_epi32(((uint32_t*)input[macro_segment])[i]), shufmask),andmask),zero256),masks[0]); + for (i=0; i>5; i++) { + c256 = _mm256_and_si256(_mm256_cmpeq_epi8(_mm256_andnot_si256(_mm256_shuffle_epi8(_mm256_set1_epi32(((uint32_t*)test_input[macro_segment])[i]), shufmask),andmask),zero256),masks[0]); //for (j=1; j>5)<<5;i>5)<<5;i>(i&7)))>>(7-(i&7)); + temp = (test_input[j][i/8]&(128>>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); - cc[i] |= (temp << (j-macro_segment)); + c[i] |= (temp << (j-macro_segment)); } } #else @@ -157,14 +159,28 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); + for (i1=0; i1 < ncols; i1++) + { + memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + } + for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(cc, dd, BG, Zc, Kb, simd_size, ncols); + encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { - if (encode_parity_check_part_orig(cc, dd, BG, Zc, Kb, block_length)!=0) { + if (encode_parity_check_part_orig(c, d, BG, Zc, Kb, block_length)!=0) { printf("Problem with encoder\n"); return(-1); } @@ -172,8 +188,8 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor if(impp->toutput != NULL) start_meas(impp->toutput); // information part and puncture columns /* - memcpy(&output[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char)); - memcpy(&output[block_length-2*Zc], &d[0], ((nrows-no_punctured_columns) * Zc-removed_bit)*sizeof(unsigned char)); + memcpy(&channel_input[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char)); + memcpy(&channel_input[block_length-2*Zc], &d[0], ((nrows-no_punctured_columns) * Zc-removed_bit)*sizeof(unsigned char)); */ #ifdef __AVX2__ if ((((2*Zc)&31) == 0) && (((block_length-(2*Zc))&31) == 0)) { @@ -181,34 +197,34 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor //AssertFatal(((block_length-(2*Zc))&31) == 0,"block_length-(2*Zc) needs to be a multiple of 32 for now\n"); uint32_t l1 = (block_length-(2*Zc))>>5; uint32_t l2 = ((nrows-no_punctured_columns) * Zc-removed_bit)>>5; - __m256i *c256p = (__m256i *)&cc[2*Zc]; - __m256i *d256p = (__m256i *)&dd[0]; + __m256i *c256p = (__m256i *)&c[2*Zc]; + __m256i *d256p = (__m256i *)&d[0]; // if (((block_length-(2*Zc))&31)>0) l1++; - for (int i=0;i0) l2++; - for (int i1=0, i=l1;i1>(j-macro_segment))&1; - for (int i=0;i<((nrows-no_punctured_columns) * Zc-removed_bit);i++) + for (j=macro_segment; j < macro_segment_end; j++) + channel_input[j][i] = (c[2*Zc+i]>>(j-macro_segment))&1; + for (i=0;i<((nrows-no_punctured_columns) * Zc-removed_bit);i++) //for (j=0; j>(j-macro_segment))&1; + for (j=macro_segment; j < macro_segment_end; j++) + channel_input[j][block_length-2*Zc+i] = (d[i]>>(j-macro_segment))&1; } #else diff --git a/openair1/PHY/CODING/types.h b/openair1/PHY/CODING/types.h deleted file mode 100644 index 2bc7739e36..0000000000 --- a/openair1/PHY/CODING/types.h +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - Copyright (c) 2009-2018, Intel Corporation - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*******************************************************************************/ - -/* Common data types, macros and functions used across the CRC library */ - -#ifndef CRC_TYPES_H_ -#define CRC_TYPES_H_ - -#ifdef __KERNEL__ -#include -#include -typedef uint32_t uint_fast32_t; -typedef uint16_t uint_fast16_t; -typedef uint8_t uint_fast8_t; -#else -#include -#include -#endif - -/* Declare variable at address aligned to a boundary */ -#define DECLARE_ALIGNED(_declaration, _boundary) \ - _declaration __attribute__((aligned(_boundary))) - -/* Macro to make function to be always inlined */ -#ifndef DEBUG -#define __forceinline \ - static inline __attribute__((always_inline)) -#else -#define __forceinline \ - static -#endif - -/* Likely & unliekly hints for the compiler */ -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) - -/* Macro to get dimension of an array */ -#ifndef DIM -#define DIM(x) (sizeof(x)/sizeof(x[0])) -#endif - -/** - * Common functions - */ - -/** - * @brief Swaps bytes in 16 bit word - * - * @param val 16 bit data value - * - * @return byte swapped value - */ -__forceinline uint16_t bswap2(const uint16_t val) -{ - return (uint16_t) ((val >> 8) | (val << 8)); -} - -/** - * @brief Swaps bytes in 32 bit word - * ABCD -> DCBA - * - * @param val 32 bit data value - * - * @return byte swapped value - */ -__forceinline uint32_t bswap4(const uint32_t val) -{ - return ((val >> 24) | /**< A*/ - ((val & 0xff0000) >> 8) | /**< B*/ - ((val & 0xff00) << 8) | /**< C*/ - (val << 24)); /**< D*/ -} - -#endif /* CRC_TYPES_H_ */ diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index f664a03ba0..b60e77e814 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -458,7 +458,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->decode_SIB = 1; init_nr_prach_tables(839); - init_symbol_rotation(fp); + return 0; } diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 347155ed3b..42d4a30e3b 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -209,6 +209,7 @@ uint32_t get_samples_per_slot(int slot, NR_DL_FRAME_PARMS* fp) return samp_count; } + uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, NR_DL_FRAME_PARMS* fp) { uint32_t slot_idx = 0; diff --git a/openair1/PHY/LTE_REFSIG/lte_refsig.h b/openair1/PHY/LTE_REFSIG/lte_refsig.h index 9d3bae503b..84a2676082 100644 --- a/openair1/PHY/LTE_REFSIG/lte_refsig.h +++ b/openair1/PHY/LTE_REFSIG/lte_refsig.h @@ -36,7 +36,8 @@ \param reset resets the generator \return 32 bits of the gold sequence */ -#include +uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); + /*!\brief This function generates the LTE Gold sequence (36-211, Sec 7.2), specifically for DL reference signals. @param frame_parms LTE DL Frame parameters diff --git a/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c b/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c new file mode 100644 index 0000000000..a23f8db4f2 --- /dev/null +++ b/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c @@ -0,0 +1,75 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +#include "PHY/types.h" + +/** + \brief Gold Sequence Generation defined in 3x.211 + \param x1 x1 shift register + \param x2 x2 shift register / cinit if reset is set + \param reset Reset flag / reinitialize the generator + \return c 32 bits of gold output +*/ +extern inline uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset) +{ + int32_t n; + + // 3GPP 3x.211 + // Nc = 1600 + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + // x1(n+31) = [x1(n+3) + x1(n)]mod2 + // x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2 + if (reset) + { + // Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30 + // x1(31) = [x1(3) + x1(0)]mod2 = 1 + *x1 = 1 + (1U<<31); + // Init value for x2: cinit = sum_{i=0}^30 x2*2^i + // x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2 + // = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2 + *x2 = *x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31); + + // x1 and x2 contain bits n = 0,1,...,31 + + // Nc = 1600 bits are skipped at the beginning + // i.e., 1600 / 32 = 50 32bit words + + for (n = 1; n < 50; n++) + { + // Compute x1(0),...,x1(27) + *x1 = (*x1>>1) ^ (*x1>>4); + // Compute x1(28),..,x1(31) and xor + *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); + // Compute x2(0),...,x2(27) + *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); + // Compute x2(28),..,x2(31) and xor + *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); + } + } + + *x1 = (*x1>>1) ^ (*x1>>4); + *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); + *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); + *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); + + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + return(*x1^*x2); +} diff --git a/openair1/PHY/LTE_TRANSPORT/lte_mcs.c b/openair1/PHY/LTE_TRANSPORT/lte_mcs.c index 38914506ee..6144b978bf 100644 --- a/openair1/PHY/LTE_TRANSPORT/lte_mcs.c +++ b/openair1/PHY/LTE_TRANSPORT/lte_mcs.c @@ -147,10 +147,10 @@ uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb) { } } -int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc, uint8_t mod_order, uint8_t subframe, uint8_t symbol) { +int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_order, uint8_t subframe, uint8_t symbol) { int rb,re_pbch_sss=0; int rb_alloc_ind,nsymb; - nsymb = (Ncp==NORMAL) ? 14 : 12; + nsymb = (frame_parms->Ncp==NORMAL) ? 14 : 12; // printf("adjust_G2 : symbol %d, subframe %d\n",symbol,subframe); if ((subframe!=0) && (subframe!=5) && (subframe!=6)) // if not PBCH/SSS or SSS @@ -158,12 +158,12 @@ int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc, uint8_t //first half of slot and TDD (no adjustments in first slot except for subframe 6 - PSS) if ((symbol<(nsymb>>1))&& - (frame_type == TDD)&& + (frame_parms->frame_type == TDD)&& (subframe!=6)) return(0); // after PBCH - if (frame_type==TDD) { //TDD + if (frame_parms->frame_type==TDD) { //TDD if ((symbol>((nsymb>>1)+3)) && (symbol!=(nsymb-1))) ///SSS return(0); @@ -185,9 +185,9 @@ int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc, uint8_t return(0); } - if ((N_RB_DL&1) == 1) { // ODD N_RB_DL - for (rb=((N_RB_DL>>1)-3); - rb<=((N_RB_DL>>1)+3); + if ((frame_parms->N_RB_DL&1) == 1) { // ODD N_RB_DL + for (rb=((frame_parms->N_RB_DL>>1)-3); + rb<=((frame_parms->N_RB_DL>>1)+3); rb++) { if (rb < 32) rb_alloc_ind = (rb_alloc[0]>>rb) & 1; @@ -201,16 +201,16 @@ int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc, uint8_t rb_alloc_ind = 0; if (rb_alloc_ind==1) { - if ((rb==(N_RB_DL>>1)-3) || - (rb==((N_RB_DL>>1)+3))) { + if ((rb==(frame_parms->N_RB_DL>>1)-3) || + (rb==((frame_parms->N_RB_DL>>1)+3))) { re_pbch_sss += 6; } else re_pbch_sss += 12; } } } else { - for (rb=((N_RB_DL>>1)-3); - rb<((N_RB_DL>>1)+3); + for (rb=((frame_parms->N_RB_DL>>1)-3); + rb<((frame_parms->N_RB_DL>>1)+3); rb++) { if (rb < 32) rb_alloc_ind = (rb_alloc[0]>>rb) & 1; diff --git a/openair1/PHY/LTE_TRANSPORT/pcfich.c b/openair1/PHY/LTE_TRANSPORT/pcfich.c index 0ba63019a1..3646732ce3 100644 --- a/openair1/PHY/LTE_TRANSPORT/pcfich.c +++ b/openair1/PHY/LTE_TRANSPORT/pcfich.c @@ -44,7 +44,7 @@ void pcfich_scrambling(LTE_DL_FRAME_PARMS *frame_parms, { uint32_t i; uint8_t reset; - uint32_t x1=0, x2, s=0; + uint32_t x1, x2, s=0; reset = 1; // x1 is set in lte_gold_generic diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 998edf235f..3270066448 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -895,7 +895,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint8_t pucch1_thres, - int br_flag + uint8_t br_flag ) //----------------------------------------------------------------------------- { diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h index af8e63c3ed..622f37b3bc 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h @@ -101,7 +101,7 @@ int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint int get_G_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe, uint8_t beamforming_mode); int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); -int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); +int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); #ifndef modOrder diff --git a/openair1/PHY/LTE_TRANSPORT/transport_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_proto.h index 1fbd1266d7..19af50056c 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_proto.h @@ -700,51 +700,7 @@ int find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type); int find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type); -static inline uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset) -{ - int32_t n; - - // 3GPP 3x.211 - // Nc = 1600 - // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 - // x1(n+31) = [x1(n+3) + x1(n)]mod2 - // x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2 - if (reset) - { - // Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30 - // x1(31) = [x1(3) + x1(0)]mod2 = 1 - *x1 = 1 + (1U<<31); - // Init value for x2: cinit = sum_{i=0}^30 x2*2^i - // x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2 - // = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2 - *x2 = *x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31); - - // x1 and x2 contain bits n = 0,1,...,31 - - // Nc = 1600 bits are skipped at the beginning - // i.e., 1600 / 32 = 50 32bit words - - for (n = 1; n < 50; n++) - { - // Compute x1(0),...,x1(27) - *x1 = (*x1>>1) ^ (*x1>>4); - // Compute x1(28),..,x1(31) and xor - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - // Compute x2(0),...,x2(27) - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - // Compute x2(28),..,x2(31) and xor - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - } - } - - *x1 = (*x1>>1) ^ (*x1>>4); - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - - // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 - return(*x1^*x2); -} +uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); /**@}*/ diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index efde277203..4f65edd6d5 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -1293,7 +1293,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, } granted_re = nb_rb_alloc * (12-crs_re); - pbch_pss_sss_re = adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,dlsch0_harq->Qm,subframe,symbol); + pbch_pss_sss_re = adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,dlsch0_harq->Qm,subframe,symbol); pbch_pss_sss_re = (double)pbch_pss_sss_re * ((double)(12-crs_re)/12); data_re = granted_re - pbch_pss_sss_re; llr_offset = data_re * dlsch0_harq->Qm * 2; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index 6afd028099..91de5386ae 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -837,7 +837,7 @@ int rx_pdsch(PHY_VARS_UE *ue, symbol, first_symbol_flag, nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } else if (codeword_TB0 == -1) { dlsch_qpsk_llr(frame_parms, @@ -846,7 +846,7 @@ int rx_pdsch(PHY_VARS_UE *ue, symbol, first_symbol_flag, nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { if (dlsch1_harq->Qm == 2) { @@ -856,7 +856,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -866,7 +866,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -877,7 +877,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -888,7 +888,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -899,7 +899,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -910,7 +910,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } @@ -925,7 +925,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[0], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); } else if (codeword_TB0 == -1) { @@ -934,7 +934,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[1], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream, beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { @@ -946,7 +946,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -957,7 +957,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -969,7 +969,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -981,7 +981,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -993,7 +993,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1005,7 +1005,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } @@ -1021,7 +1021,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } else if (codeword_TB0 == -1) { @@ -1031,7 +1031,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { @@ -1043,7 +1043,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1054,7 +1054,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -1066,7 +1066,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1078,7 +1078,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -1090,7 +1090,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, (int16_t *)pllr_symbol_cw0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol]); if (rx_type==rx_IC_dual_stream) { @@ -1102,7 +1102,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], (int16_t *)pllr_symbol_cw1, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol]); } } @@ -1124,7 +1124,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->rxdataF_comp0, (int16_t *)pllr_symbol_cw0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } @@ -1137,7 +1137,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[0], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); } @@ -1152,7 +1152,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c index 43f3b5451f..4c74377ef6 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c @@ -746,7 +746,7 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation - pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL ,&rb_alloc,2,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,2,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { if (frame_parms->nb_antenna_ports_eNB!=1) @@ -981,7 +981,7 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,&rb_alloc,4,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,4,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { amp_tmp=0x1fff;//dlsch0->sqrt_rho_b; already taken into account @@ -1281,7 +1281,7 @@ void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,&rb_alloc,6,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,6,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { amp_tmp = 0x1fff;//dlsch0->sqrt_rho_b; already taken into account diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c index 9427ec3a5b..1f9fb86f80 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c @@ -336,8 +336,8 @@ void generate_pucch1x(int32_t **txdataF, -static inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) __attribute__((always_inline)); -static inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) { +inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) __attribute__((always_inline)); +inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) { uint32_t x1, x2, s=0; int i; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index c5d096ceb7..7ab795cae9 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -1303,7 +1303,7 @@ uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL); int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe, uint8_t beamforming_mode); int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); - +int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); #ifndef modOrder diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 9bbc61d4b6..fa1b6c955b 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -180,15 +180,13 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, /// CRC, coding, interleaving and rate matching AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n"); - unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); - bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); start_meas(dlsch_encoding_stats); - nr_dlsch_encoding(gNB, - harq->pdu, frame, slot, dlsch, frame_parms, output, - tinput,tprep,tparity,toutput, - dlsch_rate_matching_stats, - dlsch_interleaving_stats, - dlsch_segmentation_stats); + if (nr_dlsch_encoding(gNB, + harq->pdu, frame, slot, dlsch, frame_parms,tinput,tprep,tparity,toutput, + dlsch_rate_matching_stats, + dlsch_interleaving_stats, + dlsch_segmentation_stats) == -1) + return; stop_meas(dlsch_encoding_stats); #ifdef DEBUG_DLSCH printf("PDSCH encoding:\nPayload:\n"); @@ -200,7 +198,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, printf("\nEncoded payload:\n"); for (int i=0; i>3; i++) { for (int j=0; j<8; j++) - printf("%d", output[(i<<3)+j]); + printf("%d", harq->f[(i<<3)+j]); printf("\t"); } printf("\n"); @@ -213,7 +211,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, for (int q=0; qNrOfCodewords; q++) memset((void*)scrambled_output[q], 0, (encoded_length>>5)*sizeof(uint32_t)); for (int q=0; qNrOfCodewords; q++) - nr_pdsch_codeword_scrambling_optim(output, + nr_pdsch_codeword_scrambling_optim(harq->f, encoded_length, q, rel15->dataScramblingId, @@ -250,7 +248,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } #endif - start_meas(&gNB->dlsch_layer_mapping_stats); + /// Layer mapping nr_layer_mapping(mod_symbs, rel15->nrOfLayers, @@ -268,7 +266,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } #endif - stop_meas(&gNB->dlsch_layer_mapping_stats); /// Resource mapping // Non interleaved VRB to PRB mapping @@ -282,7 +279,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers); #endif - start_meas(&gNB->dlsch_resource_mapping_stats); + for (int ap=0; apnrOfLayers; ap++) { // DMRS params for this ap @@ -324,13 +321,20 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, dmrs_idx = (rel15->rbStart+rel15->BWPStart)*4; } } + } + + // Update l_prime in the case of double DMRS config + if ((dmrs_symbol_map & (1 << l))){ //DMRS time occasion if (l==(l_overline+1)) //take into account the double DMRS symbols l_prime = 1; else if (l>(l_overline+1)) {//new DMRS pair l_overline = l; l_prime = 0; } - /// DMRS QPSK modulation + } + + /// DMRS QPSK modulation + if (rel15->dlDmrsSymbPos & (1 << l)) { nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated #ifdef DEBUG_DLSCH @@ -351,143 +355,73 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, ptrs_symbol = is_ptrs_symbol(l,dlPtrsSymPos); if(ptrs_symbol) { /* PTRS QPSK Modulation for each OFDM symbol in a slot */ - printf("Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs); nr_modulation(pdsch_dmrs[l][0], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs); } } uint16_t k = start_sc; - if (ptrs_symbol || dmrs_symbol_map & (1 << l)) { + // Loop Over SCs: + for (int i=0; irbSize*NR_NB_SC_PER_RB; i++) { + /* check if cuurent RE is PTRS RE*/ + is_ptrs_re=0; + /* check for PTRS symbol and set flag for PTRS RE */ + if(ptrs_symbol){ + is_ptrs_re = is_ptrs_subcarrier(k, + rel15->rnti, + ap, + rel15->dmrsConfigType, + rel15->PTRSFreqDensity, + rel15->rbSize, + rel15->PTRSReOffset, + start_sc, + frame_parms->ofdm_symbol_size); + } - // Loop Over SCs: - for (int i=0; irbSize*NR_NB_SC_PER_RB; i++) { - /* check if cuurent RE is PTRS RE*/ - is_ptrs_re = 0; - if (ptrs_symbol) - is_ptrs_re = is_ptrs_subcarrier(k, - rel15->rnti, - ap, - rel15->dmrsConfigType, - rel15->PTRSFreqDensity, - rel15->rbSize, - rel15->PTRSReOffset, - start_sc, - frame_parms->ofdm_symbol_size); - /* Map DMRS Symbol */ - if ( (dmrs_symbol_map & (1 << l)) && - (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + /* Map DMRS Symbol */ + if ( ( dmrs_symbol_map & (1 << l) ) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", + dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif - dmrs_idx++; - k_prime++; - k_prime&=1; - n+=(k_prime)?0:1; - } - else if(is_ptrs_re){ - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; + dmrs_idx++; + k_prime++; + k_prime&=1; + n+=(k_prime)?0:1; + } + /* Map PTRS Symbol */ + else if(is_ptrs_re){ + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d, mod_ptrs: %d %d\n", - ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)],mod_ptrs[ptrs_idx<<1],mod_ptrs[(ptrs_idx<<1)+1]); + printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", + ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif - ptrs_idx++; - } + ptrs_idx++; + } /* Map DATA Symbol */ - else if( ptrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + else if( (!(dmrs_symbol_map & (1 << l))) || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", + m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif - m++; - } - /* mute RE */ - else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; - } - if (++k >= frame_parms->ofdm_symbol_size) - k -= frame_parms->ofdm_symbol_size; - } //RE loop - } - else { // no PTRS or DMRS in this symbol - // Loop Over SCs: - int upper_limit=rel15->rbSize*NR_NB_SC_PER_RB; - int remaining_re = 0; - if (start_sc + upper_limit > frame_parms->ofdm_symbol_size) { - remaining_re = upper_limit + start_sc - frame_parms->ofdm_symbol_size; - upper_limit = frame_parms->ofdm_symbol_size - start_sc; - } - // fix the alignment issues later, use 64-bit SIMD below instead of 128. - if (0/*(frame_parms->N_RB_DL&1)==0*/) { - __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; - - __m128i *txl = (__m128i*)&tx_layers[ap][m<<1]; - __m128i amp128=_mm_set1_epi16(amp); - for (int i=0; i<(upper_limit>>2); i++) { - txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); - } //RE loop, first part - m+=upper_limit; - if (remaining_re > 0) { - txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; - txl = (__m128i*)&tx_layers[ap][m<<1]; - for (int i=0; i<(remaining_re>>2); i++) { - txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); - } - } + m++; } + /* mute RE */ else { - __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; - - __m64 *txl = (__m64*)&tx_layers[ap][m<<1]; - __m64 amp64=_mm_set1_pi16(amp); - for (int i=0; i<(upper_limit>>1); i++) { - - txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); -#ifdef DEBUG_DLSCH_MAPPING - if ((i&1) > 0) - printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1 + (2*txdataF_offset)]); -#endif - /* handle this, mute RE */ - /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; - }*/ - } //RE loop, first part - m+=upper_limit; - if (remaining_re > 0) { - txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; - txl = (__m64*)&tx_layers[ap][m<<1]; - for (int i=0; i<(remaining_re>>1); i++) { - txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); -#ifdef DEBUG_DLSCH_MAPPING - if ((i&1) > 0) - printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1 + (2*txdataF_offset)]); -#endif - /* handle this, mute RE */ - /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; - }*/ - } //RE loop, second part - } // - m+=remaining_re; - } // N_RB_DL even - } // no DMRS/PTRS in symbol + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + } + if (++k >= frame_parms->ofdm_symbol_size) + k -= frame_parms->ofdm_symbol_size; + } //RE loop } // symbol loop }// layer loop - stop_meas(&gNB->dlsch_resource_mapping_stats); ///Layer Precoding and Antenna port mapping // tx_layers 1-8 are mapped on antenna ports 1000-1007 @@ -496,9 +430,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, // pmi = prgs_list[rbidx/prg_size].pm_idx, rbidx =0,...,rbSize-1 // The Precoding matrix: // The Codebook Type I and Type II are not supported yet. - // We`adopt the precoding matrices of PUSCH for 4 layers. - start_meas(&gNB->dlsch_precoding_stats); - + // We adopt the precoding matrices of PUSCH for 4 layers. for (int ap=0; apnb_antennas_tx; ap++) { for (int l=rel15->StartSymbolIndex; lStartSymbolIndex+rel15->NrOfSymbols; l++) { @@ -573,7 +505,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } // symbol loop }// port loop - stop_meas(&gNB->dlsch_precoding_stats); dlsch->slot_tx[slot]=0; // TODO: handle precoding diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h index 77db12672f..181c2ab273 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h @@ -43,6 +43,8 @@ void nr_check_time_alloc(uint8_t S, uint8_t L,nfapi_nr_dl_tti_pdsch_pdu_rel15_t uint16_t get_RIV(uint16_t rb_start, uint16_t L, uint16_t N_RB); +uint16_t get_SLIV(uint8_t S, uint8_t L); + uint8_t nr_get_S(uint8_t row_idx, uint8_t CP, uint8_t time_alloc_type, uint8_t dmrs_typeA_position); void nr_get_rbg_parms(NR_BWP_PARMS* bwp, uint8_t config_type); @@ -83,7 +85,6 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, uint8_t slot, NR_gNB_DLSCH_t *dlsch, NR_DL_FRAME_PARMS* frame_parms, - unsigned char * output, time_stats_t *tinput, time_stats_t *tprep, time_stats_t *tparity, diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 5620018b73..0bcd1e3e51 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -50,47 +50,70 @@ //#define DEBUG_DLSCH_FREE 1 -void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) { +void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) +{ int r; - NR_gNB_DLSCH_t *dlsch = *dlschptr; - uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated + NR_gNB_DLSCH_t *dlsch = *dlschptr; + + uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated if (dlsch) { + if (N_RB != 273) { a_segments = a_segments*N_RB; a_segments = a_segments/273 +1; } - + #ifdef DEBUG_DLSCH_FREE LOG_D(PHY,"Freeing dlsch %p\n",dlsch); #endif NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; - if (harq->b) { free16(harq->b, a_segments * 1056); harq->b = NULL; #ifdef DEBUG_DLSCH_FREE LOG_D(PHY, "Freeing harq->b (%p)\n", harq->b); #endif - } - + + if (harq->e) { + free16(harq->e, 14 * N_RB * 12 * 8); + harq->e = NULL; #ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); + printf("Freeing dlsch process %d e (%p)\n", i, harq->e); #endif - - for (r = 0; r < a_segments; r++) { + } + + if (harq->f) { + free16(harq->f, 14 * N_RB * 12 * 8); + harq->f = NULL; #ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); + printf("Freeing dlsch process %d f (%p)\n", i, harq->f); #endif - - if (harq->c[r]) { - free16(harq->c[r], 1056); - harq->c[r] = NULL; + } + +#ifdef DEBUG_DLSCH_FREE + LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); +#endif + + for (r = 0; r < a_segments; r++) { +#ifdef DEBUG_DLSCH_FREE + LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); +#endif + + if (harq->c[r]) { + free16(harq->c[r], 1056); + harq->c[r] = NULL; + } + if (harq->d[r]) { + free16(harq->d[r], 3 * 8448); + harq->d[r] = NULL; + } } } - free16(dlsch, sizeof(NR_gNB_DLSCH_t)); - *dlschptr = NULL; } + + free16(dlsch, sizeof(NR_gNB_DLSCH_t)); + *dlschptr = NULL; } NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, @@ -98,7 +121,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, unsigned char Mdlharq, uint32_t Nsoft, uint8_t abstraction_flag, - uint16_t N_RB) { + uint16_t N_RB) +{ unsigned char i,r,aa,layer; int re; uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated @@ -109,8 +133,10 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, } uint16_t dlsch_bytes = a_segments*1056; // allocated bytes per segment + NR_gNB_DLSCH_t *dlsch = malloc16(sizeof(NR_gNB_DLSCH_t)); AssertFatal(dlsch, "cannot allocate dlsch\n"); + bzero(dlsch,sizeof(NR_gNB_DLSCH_t)); dlsch->Kmimo = Kmimo; dlsch->Mdlharq = Mdlharq; @@ -118,12 +144,11 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, dlsch->Nsoft = Nsoft; for (layer=0; layerue_spec_bf_weights[layer] = (int32_t **)malloc16(64*sizeof(int32_t *)); + dlsch->ue_spec_bf_weights[layer] = (int32_t**)malloc16(64*sizeof(int32_t*)); for (aa=0; aa<64; aa++) { dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); - - for (re=0; reue_spec_bf_weights[layer][aa][re] = 0x00007fff; } } @@ -135,8 +160,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, for (int q=0; qmod_symbs[q] = (int32_t *)malloc16(NR_MAX_PDSCH_ENCODED_LENGTH*sizeof(int32_t)); - dlsch->calib_dl_ch_estimates = (int32_t **)malloc16(64*sizeof(int32_t *)); - + dlsch->calib_dl_ch_estimates = (int32_t**)malloc16(64*sizeof(int32_t*)); for (aa=0; aa<64; aa++) { dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); } @@ -148,6 +172,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; bzero(harq, sizeof(NR_DL_gNB_HARQ_t)); + harq->b = malloc16(dlsch_bytes); AssertFatal(harq->b, "cannot allocate memory for harq->b\n"); harq->pdu = malloc16(dlsch_bytes); @@ -163,33 +188,71 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, // In section 5.3.2 in 38.212, the for loop is up to N + 2*Zc (maximum size of N is 66*Zc, therefore 68*Zc) harq->c[r] = malloc16(8448); AssertFatal(harq->c[r], "cannot allocate harq->c[%d]\n", r); + harq->d[r] = malloc16(68 * 384); + AssertFatal(harq->d[r], "cannot allocate harq->d[%d]\n", r); // max size for coded output bzero(harq->c[r], 8448); + bzero(harq->d[r], (3 * 8448)); } + harq->e = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + AssertFatal(harq->e, "cannot allocate harq->e\n"); + bzero(harq->e, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + harq->f = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + AssertFatal(harq->f, "cannot allocate harq->f\n"); + bzero(harq->f, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + return(dlsch); } -void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) { +void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) +{ + + unsigned char Mdlharq; + unsigned char i,j,r; + AssertFatal(dlsch!=NULL,"dlsch is null\n"); - unsigned char Mdlharq = dlsch->Mdlharq; + Mdlharq = dlsch->Mdlharq; dlsch->rnti = 0; dlsch->active = 0; - for (int i=0; i<10; i++) { + NR_DL_gNB_HARQ_t *harq=&dlsch->harq_process; + + for (i=0; i<10; i++) { dlsch->harq_ids[0][i] = Mdlharq; dlsch->harq_ids[1][i] = Mdlharq; } + for (i=0; id[r]) + harq->d[r][j] = NR_NULL; + } } -void ldpc8blocks( void *p) { - encoder_implemparams_t *impp=(encoder_implemparams_t *) p; - NR_DL_gNB_HARQ_t *harq = (NR_DL_gNB_HARQ_t *)impp->harq; - uint16_t Kr= impp->K; +int nr_dlsch_encoding(PHY_VARS_gNB *gNB, + unsigned char *a, + int frame, + uint8_t slot, + NR_gNB_DLSCH_t *dlsch, + NR_DL_FRAME_PARMS* frame_parms, + time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput, + time_stats_t *dlsch_rate_matching_stats,time_stats_t *dlsch_interleaving_stats, + time_stats_t *dlsch_segmentation_stats) +{ + + unsigned int G; + unsigned int crc=1; + NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; - uint8_t mod_order = rel15->qamModOrder[0]; uint16_t nb_rb = rel15->rbSize; uint8_t nb_symb_sch = rel15->NrOfSymbols; - uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); - uint32_t A = rel15->TBSize[0]<<3; + uint32_t A, Kb, F=0; + uint32_t *Zc = &dlsch->harq_process.Z; + uint8_t mod_order = rel15->qamModOrder[0]; + uint16_t Kr=0,r; + uint32_t r_offset=0; + uint32_t E; + uint8_t Ilbrm = 1; + uint32_t Tbslbrm = 950984; //max tbs uint8_t nb_re_dmrs; if (rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1) @@ -197,115 +260,24 @@ void ldpc8blocks( void *p) { else nb_re_dmrs = 4*rel15->numDmrsCdmGrpsNoData; - unsigned int G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers); - LOG_D(PHY,"dlsch coding A %d Kr %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", - A,impp->K,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order); - // nrLDPC_encoder output is in "d" - // let's make this interface happy! - uint8_t tmp[8][68 * 384]__attribute__((aligned(32))); - for (int rr=impp->macro_num*8, i=0; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++,i++ ) - impp->d[rr]=tmp[i]; - nrLDPC_encoder(harq->c,impp->d,*impp->Zc, impp->Kb,Kr,impp->BG,impp); - // Compute where to place in output buffer that is concatenation of all segments - uint32_t r_offset=0; - for (int i=0; i < impp->macro_num*8; i++ ) - r_offset+=nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, i); - for (int rr=impp->macro_num*8; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++ ) { - if (impp->F>0) { - // writing into positions d[r][k-2Zc] as in clause 5.3.2 step 2) in 38.212 - memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], impp->F, NR_NULL); - } - -#ifdef DEBUG_DLSCH_CODING - LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]); -#endif - uint32_t E = nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, rr); - //#ifdef DEBUG_DLSCH_CODING - LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", - rr, - impp->n_segments, - G, - E, - impp->F, - Kr-impp->F-2*(*impp->Zc), - mod_order,nb_rb); - // for tbslbrm calculation according to 5.4.2.1 of 38.212 - uint8_t Nl = 4; - - if (rel15->nrOfLayers < Nl) - Nl = rel15->nrOfLayers; - - uint32_t Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl); - uint8_t Ilbrm = 1; - - uint8_t e[E]; - bzero (e, E); - nr_rate_matching_ldpc(Ilbrm, - Tbslbrm, - impp->BG, - *impp->Zc, - impp->d[rr], - e, - impp->n_segments, - impp->F, - Kr-impp->F-2*(*impp->Zc), - rel15->rvIndex[0], - E); -#ifdef DEBUG_DLSCH_CODING - - for (int i =0; i<16; i++) - printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset); - -#endif - nr_interleaving_ldpc(E, - mod_order, - e, - impp->output+r_offset); -#ifdef DEBUG_DLSCH_CODING - - for (int i =0; i<16; i++) - printf("output interleaving f[%d]= %d r_offset %u\n", i,impp->output[i+r_offset], r_offset); - - if (r==impp->n_segments-1) - write_output("enc_output.m","enc",impp->output,G,1,4); - -#endif - r_offset += E; - } -} - -int nr_dlsch_encoding(PHY_VARS_gNB *gNB, - unsigned char *a, - int frame, - uint8_t slot, - NR_gNB_DLSCH_t *dlsch, - NR_DL_FRAME_PARMS *frame_parms, - unsigned char * output, - time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput, - time_stats_t *dlsch_rate_matching_stats,time_stats_t *dlsch_interleaving_stats, - time_stats_t *dlsch_segmentation_stats) { - encoder_implemparams_t impp; - impp.output=output; - unsigned int crc=1; - NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; - nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; - impp.Zc = &dlsch->harq_process.Z; + uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); + uint16_t R=rel15->targetCodeRate[0]; float Coderate = 0.0; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN); - uint32_t A = rel15->TBSize[0]<<3; + uint8_t Nl = 4; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN); + + A = rel15->TBSize[0]<<3; if ( dlsch->rnti != SI_RNTI ) - trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0); + trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0); NR_gNB_SCH_STATS_t *stats=NULL; int first_free=-1; - - for (int i=0; idlsch_stats[i].rnti == 0 && first_free == -1) { first_free = i; stats=&gNB->dlsch_stats[i]; } - if (gNB->dlsch_stats[i].rnti == dlsch->rnti) { stats=&gNB->dlsch_stats[i]; break; @@ -318,94 +290,181 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, stats->current_RI = rel15->nrOfLayers; stats->current_Qm = rel15->qamModOrder[0]; } + G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers); + + LOG_D(PHY,"dlsch coding A %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", + A,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order); if (A > 3824) { // Add 24-bit crc (polynomial A) to payload crc = crc24a(a,A)>>8; - a[A>>3] = ((uint8_t *)&crc)[2]; - a[1+(A>>3)] = ((uint8_t *)&crc)[1]; - a[2+(A>>3)] = ((uint8_t *)&crc)[0]; + a[A>>3] = ((uint8_t*)&crc)[2]; + a[1+(A>>3)] = ((uint8_t*)&crc)[1]; + a[2+(A>>3)] = ((uint8_t*)&crc)[0]; //printf("CRC %x (A %d)\n",crc,A); //printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]); + harq->B = A+24; // harq->b = a; + AssertFatal((A / 8) + 4 <= MAX_NR_DLSCH_PAYLOAD_BYTES, "A %d is too big (A/8+4 = %d > %d)\n", A, (A / 8) + 4, MAX_NR_DLSCH_PAYLOAD_BYTES); + memcpy(harq->b, a, (A / 8) + 4); // why is this +4 if the CRC is only 3 bytes? - } else { + } + else { // Add 16-bit crc (polynomial A) to payload crc = crc16(a,A)>>16; - a[A>>3] = ((uint8_t *)&crc)[1]; - a[1+(A>>3)] = ((uint8_t *)&crc)[0]; + a[A>>3] = ((uint8_t*)&crc)[1]; + a[1+(A>>3)] = ((uint8_t*)&crc)[0]; //printf("CRC %x (A %d)\n",crc,A); //printf("a0 %d a1 %d \n", a[A>>3], a[1+(A>>3)]); + harq->B = A+16; // harq->b = a; + AssertFatal((A / 8) + 3 <= MAX_NR_DLSCH_PAYLOAD_BYTES, "A %d is too big (A/8+3 = %d > %d)\n", A, (A / 8) + 3, MAX_NR_DLSCH_PAYLOAD_BYTES); + memcpy(harq->b, a, (A / 8) + 3); // using 3 bytes to mimic the case of 24 bit crc } - - if (rel15->targetCodeRate[0]<1000) - Coderate = (float)rel15->targetCodeRate[0] /(float) 1024; + if (R<1000) + Coderate = (float) R /(float) 1024; else // to scale for mcs 20 and 26 in table 5.1.3.1-2 which are decimal and input 2* in nr_tbs_tools - Coderate = (float)rel15->targetCodeRate[0] /(float) 2048; + Coderate = (float) R /(float) 2048; if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25) - impp.BG = 2; + harq->BG = 2; else - impp.BG = 1; + harq->BG = 1; start_meas(dlsch_segmentation_stats); - impp.Kb = nr_segmentation(harq->b, harq->c, harq->B, &impp.n_segments, &impp.K, impp.Zc, &impp.F, impp.BG); + Kb = nr_segmentation(harq->b, harq->c, harq->B, &harq->C, &harq->K, Zc, &harq->F, harq->BG); stop_meas(dlsch_segmentation_stats); + F = harq->F; - for (int r=0; rK; +#ifdef DEBUG_DLSCH_CODING + uint16_t Kr_bytes; + Kr_bytes = Kr>>3; +#endif + + //printf("segment Z %d k %d Kr %d BG %d C %d\n", *Zc,harq->K,Kr,BG,harq->C); + + for (r=0; rC; r++) { //d_tmp[r] = &harq->d[r][0]; //channel_input[r] = &harq->d[r][0]; #ifdef DEBUG_DLSCH_CODING - LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp->F); - LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,impp.n_segments); + LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, harq->F); + LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,harq->C); LOG_D(PHY,"input %d %d %d %d %d \n", harq->c[r][0], harq->c[r][1], harq->c[r][2],harq->c[r][3], harq->c[r][4]); - - for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++) { + for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++){ LOG_D(PHY,"%d ", harq->c[r][cnt]); } - LOG_D(PHY,"\n"); + #endif //ldpc_encoder_orig((unsigned char*)harq->c[r],harq->d[r],*Zc,Kb,Kr,BG,0); //ldpc_encoder_optim((unsigned char*)harq->c[r],(unsigned char*)&harq->d[r][0],*Zc,Kb,Kr,BG,NULL,NULL,NULL,NULL); } - + encoder_implemparams_t impp; + impp.n_segments=harq->C; impp.tprep = tprep; impp.tinput = tinput; impp.tparity = tparity; impp.toutput = toutput; - impp.harq=harq; - notifiedFIFO_t nf; - initNotifiedFIFO(&nf); - int nbJobs=0; - for(int j=0; j<(impp.n_segments/8+((impp.n_segments&7)==0 ? 0 : 1)); j++) { - notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(impp), j, &nf, ldpc8blocks); - encoder_implemparams_t* perJobImpp=(encoder_implemparams_t*)NotifiedFifoData(req); - *perJobImpp=impp; - perJobImpp->macro_num=j; - pushTpool(gNB->threadPool,req); - nbJobs++; + for(int j=0;j<(harq->C/8+1);j++) { + impp.macro_num=j; + nrLDPC_encoder(harq->c,harq->d,*Zc,Kb,Kr,harq->BG,&impp); } - while(nbJobs) { - notifiedFIFO_elt_t *req=pullTpool(&nf, gNB->threadPool); - delNotifiedFIFO_elt(req); - nbJobs--; + +#ifdef DEBUG_DLSCH_CODING + write_output("enc_input0.m","enc_in0",&harq->c[0][0],Kr_bytes,1,4); + write_output("enc_output0.m","enc0",&harq->d[0][0],(3*8*Kr_bytes)+12,1,4); +#endif + + F = harq->F; + + Kr = harq->K; + for (r=0; rC; r++) { + + if (F>0) { + for (int k=(Kr-F-2*(*Zc)); kd[r][k] = NR_NULL; + //if (k<(Kr-F+8)) + //printf("r %d filler bits [%d] = %d \n", r,k, harq->d[r][k]); + } + } + +#ifdef DEBUG_DLSCH_CODING + LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]); +#endif + + E = nr_get_E(G, harq->C, mod_order, rel15->nrOfLayers, r); + + //#ifdef DEBUG_DLSCH_CODING + LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", + r, + harq->C, + G, + E, + F, + Kr-F-2*(*Zc), + mod_order,nb_rb); + + // for tbslbrm calculation according to 5.4.2.1 of 38.212 + if (rel15->nrOfLayers < Nl) + Nl = rel15->nrOfLayers; + + Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl); + + start_meas(dlsch_rate_matching_stats); + if (nr_rate_matching_ldpc(Ilbrm, + Tbslbrm, + harq->BG, + *Zc, + harq->d[r], + harq->e+r_offset, + harq->C, + F, + Kr-F-2*(*Zc), + rel15->rvIndex[0], + E) == -1) + return -1; + + stop_meas(dlsch_rate_matching_stats); +#ifdef DEBUG_DLSCH_CODING + for (int i =0; i<16; i++) + printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset); +#endif + + start_meas(dlsch_interleaving_stats); + nr_interleaving_ldpc(E, + mod_order, + harq->e+r_offset, + harq->f+r_offset); + stop_meas(dlsch_interleaving_stats); + +#ifdef DEBUG_DLSCH_CODING + for (int i =0; i<16; i++) + printf("output interleaving f[%d]= %d r_offset %u\n", i,harq->f[i+r_offset], r_offset); + + if (r==harq->C-1) + write_output("enc_output.m","enc",harq->f,G,1,4); +#endif + + r_offset += E; } + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_OUT); + return 0; } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c index 26b45eb9f7..3ba13d2f44 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c @@ -96,6 +96,11 @@ void nr_get_time_domain_allocation_type(nfapi_nr_config_request_t config, } } + +uint16_t get_SLIV(uint8_t S, uint8_t L) { + return ( (uint16_t)(((L-1)<=7)? (14*(L-1)+S) : (14*(15-L)+(13-S))) ); +} + static inline uint8_t get_K0(uint8_t row_idx, uint8_t time_alloc_type) { return ( (time_alloc_type == NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_A)|| (time_alloc_type == NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_C)? 0 : diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index c4b40ec4cc..1ce8c238cb 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -376,11 +376,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", - frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif @@ -399,11 +397,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, nb_rb_pdsch); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (first_symbol_flag==1) { if (beamforming_mode==0){ @@ -460,10 +458,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, #endif stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); @@ -512,11 +509,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { @@ -571,11 +568,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; @@ -654,10 +651,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif // Please keep it: useful for debugging diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c index 7c75884fa6..a064a91d87 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c @@ -947,7 +947,7 @@ void nr_dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms, symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,&rb_alloc,6,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,6,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { amp_tmp = 0x1fff;//dlsch0->sqrt_rho_b; already taken into account diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index 3cb002f9e1..0ab17c11e6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1286,8 +1286,8 @@ uint8_t get_transmission_mode(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti); */ uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL); -//int adjust_G(NR_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); -//int adjust_G2(NR_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); +int adjust_G(NR_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); +int adjust_G2(NR_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); #ifndef modOrder @@ -1313,6 +1313,16 @@ uint8_t I_TBS2I_MCS(uint8_t I_TBS); uint8_t SE2I_TBS(float SE, uint8_t N_PRB, uint8_t symbPerRB); +/** \brief This function generates the sounding reference symbol (SRS) for the uplink according to 36.211 v8.6.0. If IFFT_FPGA is defined, the SRS is quantized to a QPSK sequence. + @param frame_parms LTE DL Frame Parameters + @param soundingrs_ul_config_dedicated Dynamic configuration from RRC during Connection Establishment + @param txdataF pointer to the frequency domain TX signal + @returns 0 on success*/ +int generate_srs(NR_DL_FRAME_PARMS *frame_parms, + SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, + int *txdataF, + int16_t amp, + uint32_t subframe); /*! @@ -1342,6 +1352,12 @@ int32_t generate_drs_pusch(PHY_VARS_NR_UE *phy_vars_ue, uint32_t nb_rb, uint8_t ant); +/*! + \brief This function initializes the Group Hopping, Sequence Hopping and nPRS sequences for PUCCH/PUSCH according to 36.211 v8.6.0. It should be called after configuration of UE (reception of SIB2/3) and initial configuration of eNB (or after reconfiguration of cell-specific parameters). + @param frame_parms Pointer to a NR_DL_FRAME_PARMS structure (eNB or UE)*/ +void init_ul_hopping(NR_DL_FRAME_PARMS *frame_parms); + + /*! \brief This function implements the initialization of paging parameters for UE (See Section 7, 36.304).It must be called after setting IMSImod1024 during UE startup and after receiving SIB2 @param ue Pointer to UE context @@ -1406,6 +1422,8 @@ double sinr_eff_cqi_calc(PHY_VARS_NR_UE *phy_vars_ue, uint8_t sinr2cqi(double sinr,uint8_t trans_mode); +int dump_dci(NR_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci); + int dump_ue_stats(PHY_VARS_NR_UE *phy_vars_ue, UE_nr_rxtx_proc_t *proc, char* buffer, int length, runmode_t mode, int input_level_dBm); void init_transport_channels(uint8_t); @@ -1495,11 +1513,18 @@ int get_nCCE_offset_l1(int *CCE_table, const unsigned short rnti, const unsigned char subframe); +uint16_t get_nCCE(uint8_t num_pdcch_symbols,NR_DL_FRAME_PARMS *frame_parms,uint8_t mi); -//uint8_t get_mi(NR_DL_FRAME_PARMS *frame,uint8_t subframe); +uint16_t get_nquad(uint8_t num_pdcch_symbols,NR_DL_FRAME_PARMS *frame_parms,uint8_t mi); + +uint8_t get_mi(NR_DL_FRAME_PARMS *frame,uint8_t subframe); uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe); +uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe); + +void pdcch_interleaving(NR_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi); + void nr_pdcch_unscrambling(int16_t *z, uint16_t scrambling_RNTI, uint32_t length, @@ -1514,6 +1539,7 @@ void dlsch_unscrambling(NR_DL_FRAME_PARMS *frame_parms, uint8_t q, uint8_t Ns); +void init_ncs_cell(NR_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]); void generate_pucch1x(int32_t **txdataF, NR_DL_FRAME_PARMS *frame_parms, @@ -1561,7 +1587,7 @@ void init_ulsch_power_LUT(void); @param subframe subframe index to check @returns 0 on success */ -//int is_prach_subframe(NR_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe); +int is_prach_subframe(NR_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe); /*! \brief Generate PRACH waveform @@ -1627,6 +1653,8 @@ void init_scrambling_lut(void); @param frame_parms Pointer to frame parameters @returns 1 if subframe is for MBSFN */ +int is_pmch_subframe(frame_t frame, int subframe, NR_DL_FRAME_PARMS *frame_parms); + uint8_t is_not_pilot(uint8_t pilots, uint8_t re, uint8_t nushift, uint8_t use2ndpilots); uint8_t is_not_UEspecRS(int8_t lprime, uint8_t re, uint8_t nushift, uint8_t Ncp, uint8_t beamforming_mode); @@ -1663,7 +1691,8 @@ uint8_t get_prach_prb_offset(NR_DL_FRAME_PARMS *frame_parms, uint8_t n_ra_prboffset, uint8_t tdd_mapindex, uint16_t Nf); -#include + +uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 914523bc70..99dc2b658e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -105,8 +105,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5]; int16_t **tx_layers; int32_t **txdataF; - int8_t Wf[2], Wt[2]; - int l_prime[2], delta; + int8_t Wf[2], Wt[2], l_prime[2], delta; uint8_t nb_dmrs_re_per_rb; int ap, i; int sample_offsetF, N_RE_prime; @@ -412,7 +411,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if (is_dmrs == 1) { // if transform precoding is enabled if (pusch_pdu->transform_precoding == 0) { - + ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[2*dmrs_idx]) >> 15; ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[(2*dmrs_idx) + 1]) >> 15; diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index ddec605253..cb929f1642 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -805,8 +805,8 @@ void nr_generate_pucch1_old(PHY_VARS_NR_UE *ue, } #endif //0 -static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) __attribute__((always_inline)); -static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) { +inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) __attribute__((always_inline)); +inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) { uint32_t x1, x2, s=0; int i; uint8_t c; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index fb4f9a0092..11b5112a6c 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -96,6 +96,20 @@ typedef struct { uint32_t subframe; /// MIMO mode for this DLSCH MIMO_mode_t mimo_mode; + /// Concatenated sequences + uint8_t *e; + /// LDPC-code outputs + uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; + /// Interleaver outputs + uint8_t *f; + /// Number of code segments + uint32_t C; + /// Number of bits in "small" code segments + uint32_t K; + /// Number of "Filler" bits + uint32_t F; + /// Encoder BG + uint8_t BG; /// LDPC lifting size uint32_t Z; } NR_DL_gNB_HARQ_t; @@ -854,9 +868,6 @@ typedef struct PHY_VARS_gNB_s { time_stats_t dlsch_encoding_stats; time_stats_t dlsch_modulation_stats; time_stats_t dlsch_scrambling_stats; - time_stats_t dlsch_resource_mapping_stats; - time_stats_t dlsch_layer_mapping_stats; - time_stats_t dlsch_precoding_stats; time_stats_t tinput; time_stats_t tprep; time_stats_t tparity; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 792667d510..1685e206ae 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -263,7 +263,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0,0); //dumpsig=1; } else { - LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n", + LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n", gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot, rdata->harq_pid, pusch_pdu->pusch_data.new_data_indicator, ulsch_harq->status, ulsch_harq->round, @@ -358,11 +358,10 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs pusch_pdu->qam_mod_order, pusch_pdu->nrOfLayers); - LOG_D(PHY,"rb_size %d, number_symbols %d, nb_re_dmrs %d, dmrs symbol positions %d, number_dmrs_symbols %d, qam_mod_order %d, nrOfLayer %d\n", + LOG_D(PHY,"rb_size %d, number_symbols %d, nb_re_dmrs %d, number_dmrs_symbols %d, qam_mod_order %d, nrOfLayer %d\n", pusch_pdu->rb_size, number_symbols, nb_re_dmrs, - pusch_pdu->ul_dmrs_symb_pos, number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs pusch_pdu->qam_mod_order, pusch_pdu->nrOfLayers); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 5007f19063..fb36b3ee86 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1022,14 +1022,14 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "In %s DL PDU length in bits: %d, in bytes: %d \n", __FUNCTION__, dlsch0->harq_processes[harq_pid]->TBS, dlsch0->harq_processes[harq_pid]->TBS / 8); - - - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", + +#ifdef NR_PDSCH_DEBUG + LOG_I(PHY, " --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", + LOG_I(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#endif if(is_cw1_active) { // start ldpc decode for CW 1 @@ -1081,13 +1081,21 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - +#if PHYSIM + printf(" --> Unscrambling for CW1 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + printf("AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", + frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#else LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#endif + + LOG_D(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); @@ -1396,6 +1404,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); + LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); @@ -1486,6 +1495,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { //printf("Set available LLR slot1 to 1 AbsSubframe %d.%d \n",frame_rx,nr_slot_rx); stop_meas(&ue->pdsch_procedures_per_slot_stat[proc->thread_id][1]); + LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { @@ -1861,6 +1871,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); + LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); @@ -1938,6 +1949,7 @@ if (nr_slot_rx==9) { } stop_meas(&ue->generic_stat); + LOG_D(PHY,"after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); #ifdef EMOS phy_procedures_emos_UE_RX(ue,slot,gNB_id); @@ -1947,6 +1959,7 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_rx[proc->thread_id]); + LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); //#endif //pdsch diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index ff07422c6b..1d9584b30b 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -118,8 +118,7 @@ int main(int argc, char **argv) uint8_t mcs_table = 0; double DS_TDL = .03; cpuf = get_cpu_freq_GHz(); - char gNBthreads[128]="n"; - + if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) { exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n"); } @@ -127,7 +126,7 @@ int main(int argc, char **argv) //logInit(); randominit(0); - while ((c = getopt(argc, argv, "df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:X:")) != -1) { + while ((c = getopt(argc, argv, "df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:")) != -1) { switch (c) { /*case 'f': write_output_file = 1; @@ -293,11 +292,6 @@ int main(int argc, char **argv) nb_rb = atoi(optarg); break; - case 'X': - strncpy(gNBthreads, optarg, sizeof(gNBthreads)); - gNBthreads[sizeof(gNBthreads)-1]=0; - break; - /*case 'x': transmission_mode = atoi(optarg); break;*/ @@ -358,8 +352,6 @@ int main(int argc, char **argv) RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *)); RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; - gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); - initTpool(gNBthreads, gNB->threadPool, true); //gNB_config = &gNB->gNB_config; frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH) frame_parms->nb_antennas_tx = n_tx; @@ -476,6 +468,7 @@ int main(int argc, char **argv) double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384); short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384); + double errors_bit_uncoded = 0; //unsigned char *estimated_output; unsigned char *estimated_output_bit; unsigned char *test_input_bit; @@ -513,10 +506,8 @@ int main(int argc, char **argv) //printf("crc32: [0]->0x%08x\n",crc24c(test_input, 32)); // generate signal - unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); - bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); if (input_fd == NULL) { - nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL); + nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,NULL,NULL,NULL,NULL,NULL,NULL,NULL); } for (SNR = snr0; SNR < snr1; SNR += snr_step) { @@ -524,6 +515,7 @@ int main(int argc, char **argv) n_false_positive = 0; for (trial = 0; trial < n_trials; trial++) { + errors_bit_uncoded = 0; for (i = 0; i < available_bits; i++) { #ifdef DEBUG_CODER if ((i&0xf)==0) @@ -532,12 +524,11 @@ int main(int argc, char **argv) //if (i<16) // printf("encoder output f[%d] = %d\n",i,dlsch->harq_processes[0]->f[i]); - - if (output[i] == 0) + if (dlsch->harq_process.f[i] == 0) modulated_input[i] = 1.0; ///sqrt(2); //QPSK else modulated_input[i] = -1.0; ///sqrt(2); - + //if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]); //SNR =10; SNR_lin = pow(10, SNR / 10.0); @@ -555,14 +546,18 @@ int main(int argc, char **argv) i,modulated_input[i], i,channel_output_fixed[i]); */ - //Uncoded BER if (channel_output_fixed[i] < 0) channel_output_uncoded[i] = 1; //QPSK demod else channel_output_uncoded[i] = 0; + + if (channel_output_uncoded[i] != dlsch->harq_process.f[i]) + errors_bit_uncoded = errors_bit_uncoded + 1; } + //if (errors_bit_uncoded>10) + //printf("errors bits uncoded %f\n", errors_bit_uncoded); #ifdef DEBUG_CODER printf("\n"); exit(-1); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index fa868a6896..50e21ac02b 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -277,7 +277,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, UE_info->CellGroup[0], sched_ctrl->active_bwp, NULL, - /* tda = */ 0, + /* tda = */ 2, dci_format, ps); @@ -369,7 +369,6 @@ int main(int argc, char **argv) uint8_t n_tx=1,n_rx=1; uint8_t round; uint8_t num_rounds = 4; - char gNBthreads[128]="n"; channel_desc_t *gNB2UE; //uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0; @@ -431,7 +430,9 @@ int main(int argc, char **argv) FILE *scg_fd=NULL; - while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:d:e:m:w:T:U:qX:")) != -1) { + + while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:D:e:m:w:T:U:q")) != -1) { + switch (c) { case 'f': scg_fd = fopen(optarg,"r"); @@ -634,12 +635,7 @@ int main(int argc, char **argv) dmrs_arg[i] = atoi(argv[optind++]); } break; - - case 'X': - strncpy(gNBthreads, optarg, sizeof(gNBthreads)); - gNBthreads[sizeof(gNBthreads)-1]=0; - break; - + default: case 'h': printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", @@ -675,8 +671,7 @@ int main(int argc, char **argv) printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n"); printf("-P Print DLSCH performances\n"); printf("-w Write txdata to binary file (one frame)\n"); - printf("-d number of dlsch threads, 0: no dlsch parallelization\n"); - printf("-X gNB thread pool configuration, n => no threads"); + printf("-D number of dlsch threads, 0: no dlsch parallelization\n"); exit (-1); break; } @@ -767,7 +762,7 @@ int main(int argc, char **argv) NR_CellGroupConfig_t *secondaryCellGroup=calloc(1,sizeof(*secondaryCellGroup)); prepare_scc(rrc.carrier.servingcellconfigcommon); uint64_t ssb_bitmap = 1; - fill_scc_sim(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); + fill_scc(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); ssb_bitmap = 1;// Enable only first SSB with index ssb_indx=0 fix_scc(scc,ssb_bitmap); @@ -832,14 +827,6 @@ int main(int argc, char **argv) fs = 61.44e6; bw = 40e6; } - else if (mu == 1 && N_RB_DL == 133) { - fs = 61.44e6; - bw = 50e6; - } - else if (mu == 1 && N_RB_DL == 162) { - fs = 61.44e6; - bw = 60e6; - } else if (mu == 3 && N_RB_DL == 66) { fs = 122.88e6; bw = 100e6; @@ -979,7 +966,8 @@ int main(int argc, char **argv) snrRun = 0; gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); - initTpool(gNBthreads, gNB->threadPool, true); + char tp_param[] = "n"; + initTpool(tp_param, gNB->threadPool, true); gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->resp_L1_tx); // we create 2 threads for L1 tx processing @@ -1229,8 +1217,8 @@ int main(int argc, char **argv) UE->dlsch[UE_proc.thread_id][0][0]->max_ldpc_iterations+1) n_errors++; - //NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id]; - //int16_t *UE_llr = pdsch_vars[0]->llr[0]; + NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id]; + int16_t *UE_llr = pdsch_vars[0]->llr[0]; TBS = UE_harq_process->TBS;//rel15->TBSize[0]; uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); @@ -1245,7 +1233,6 @@ int main(int argc, char **argv) printf("[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) ); } - /* for (i = 0; i < available_bits; i++) { if(((gNB_dlsch->harq_process.f[i] == 0) && (UE_llr[i] <= 0)) || @@ -1259,7 +1246,6 @@ int main(int argc, char **argv) } } - */ for (i = 0; i < TBS; i++) { estimated_output_bit[i] = (UE_harq_process->b[i/8] & (1 << (i & 7))) >> (i & 7); @@ -1303,9 +1289,11 @@ int main(int argc, char **argv) printf("\n"); if (print_perf==1) { - printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d)\n", + printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d, Kr %d (Zc %d))\n", 1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex, - msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3); + msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3, + msgDataTx->dlsch[0][0]->harq_process.K, + msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10)); printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx"); printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time"); printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time"); @@ -1317,9 +1305,6 @@ int main(int argc, char **argv) printStatIndent3(&gNB->dlsch_interleaving_stats, "DLSCH Interleaving time"); printStatIndent2(&gNB->dlsch_modulation_stats,"DLSCH modulation time"); printStatIndent2(&gNB->dlsch_scrambling_stats, "DLSCH scrambling time"); - printStatIndent2(&gNB->dlsch_layer_mapping_stats, "DLSCH Layer Mapping time"); - printStatIndent2(&gNB->dlsch_resource_mapping_stats, "DLSCH Resource Mapping time"); - printStatIndent2(&gNB->dlsch_precoding_stats,"DLSCH Layer Precoding time"); printf("\nUE RX function statistics (per %d us slot)\n",1000>>*scc->ssbSubcarrierSpacing); diff --git a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h index 805913d055..8d4acd1af1 100644 --- a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h +++ b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h @@ -59,7 +59,167 @@ int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {return(0);} //NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);} int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); } -void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul); + +void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul) { + + *scc->physCellId=0; \ + // *scc->n_TimingAdvanceOffset=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0; + *scc->ssb_periodicityServingCell=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20; + scc->dmrs_TypeA_Position=NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2; + *scc->ssbSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; + *scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB=641032; + *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]=78; + scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA=640000; + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; + + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_DL; + scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth=13036; + scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing=mu_dl;//NR_SubcarrierSpacing_kHz30; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero=12; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero=0; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->k0=0; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength=40; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->k0=0; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength=53; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->k0=0; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength=54; + *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]=78; + *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA=-1; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_UL; + *scc->uplinkConfigCommon->frequencyInfoUL->p_Max=20; + scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth=13036; + scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing=mu_ul;//NR_SubcarrierSpacing_kHz30; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex=98; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM=NR_RACH_ConfigGeneric__msg1_FDM_one; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart=0; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig=13; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower=-118; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax=NR_RACH_ConfigGeneric__preambleTransMax_n10; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep=NR_RACH_ConfigGeneric__powerRampingStep_dB2; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow=NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer=NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; + *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB=19; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present=NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139=0; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2=6; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2=6; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength=69; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2=6; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble=1; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant=-90; + scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither; + *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId=40; + *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal=-90; + scc->ssb_PositionsInBurst->present=NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap; + *ssb_bitmap=0xff; + scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity=NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots=7; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols=6; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots=2; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols=4; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity=321; + + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSlots=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols=-1; + scc->ss_PBCH_BlockPower=20; + *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing=-1; +} + void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap); void prepare_scc(NR_ServingCellConfigCommon_t *scc); void prepare_scd(NR_ServingCellConfig_t *scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 97c753d455..a7075eb218 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -707,7 +707,7 @@ int main(int argc, char **argv) NR_CellGroupConfig_t *secondaryCellGroup=calloc(1,sizeof(*secondaryCellGroup)); prepare_scc(rrc.carrier.servingcellconfigcommon); uint64_t ssb_bitmap; - fill_scc_sim(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); + fill_scc(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); fix_scc(scc,ssb_bitmap); @@ -732,13 +732,17 @@ int main(int argc, char **argv) nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; cfg->carrier_config.num_tx_ant.value = n_tx; cfg->carrier_config.num_rx_ant.value = n_rx; -// nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01); + nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01); phy_init_nr_gNB(gNB,0,1); N_RB_DL = gNB->frame_parms.N_RB_DL; NR_BWP_Uplink_t *ubwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]; + //crcTableInit(); + + //nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_UL, mu, Nid_cell, SSB_positions); + //configure UE UE = malloc(sizeof(PHY_VARS_NR_UE)); diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index e1886b57ff..f61648d8b4 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -412,7 +412,7 @@ typedef struct NRRrcConfigurationReq_s { int sib1_tda; int pdsch_AntennaPorts; int pusch_AntennaPorts; - int minRXTXTIME; + int minRXTXTIMEpdsch; int do_CSIRS; int pusch_TargetSNRx10; int pucch_TargetSNRx10; diff --git a/openair2/GNB_APP/RRC_nr_paramsvalues.h b/openair2/GNB_APP/RRC_nr_paramsvalues.h index 8a7ce64d91..70295b1c31 100644 --- a/openair2/GNB_APP/RRC_nr_paramsvalues.h +++ b/openair2/GNB_APP/RRC_nr_paramsvalues.h @@ -58,6 +58,56 @@ #define GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO "initialDLBWPcontrolResourceSetZero" #define GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO "initialDLBWPsearchSpaceZero" + +#define GNB_CONFIG_STRING_INITIALDLBWPK0_0 "initialDLBWPk0_0" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_0 "initialDLBWPmappingType_0" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0 "initialDLBWPstartSymbolAndLength_0" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_1 "initialDLBWPk0_1" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1 "initialDLBWPmappingType_1" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_1 "initialDLBWPstartSymbolAndLength_1" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_2 "initialDLBWPk0_2" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2 "initialDLBWPmappingType_2" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2 "initialDLBWPstartSymbolAndLength_2" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_3 "initialDLBWPk0_3" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_3 "initialDLBWPmappingType_3" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_3 "initialDLBWPstartSymbolAndLength_3" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_4 "initialDLBWPk0_4" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_4 "initialDLBWPmappingType_4" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_4 "initialDLBWPstartSymbolAndLength_4" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_5 "initialDLBWPk0_5" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_5 "initialDLBWPmappingType_5" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_5 "initialDLBWPstartSymbolAndLength_5" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_6 "initialDLBWPk0_6" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_6 "initialDLBWPmappingType_6" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_6 "initialDLBWPstartSymbolAndLength_6" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_7 "initialDLBWPk0_7" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_7 "initialDLBWPmappingType_7" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_7 "initialDLBWPstartSymbolAndLength_7" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_8 "initialDLBWPk0_8" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_8 "initialDLBWPmappingType_8" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_8 "initialDLBWPstartSymbolAndLength_8" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_9 "initialDLBWPk0_9" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_9 "initialDLBWPmappingType_9" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_9 "initialDLBWPstartSymbolAndLength_9" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_10 "initialDLBWPk0_10" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_10 "initialDLBWPmappingType_10" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_10 "initialDLBWPstartSymbolAndLength_10" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_11 "initialDLBWPk0_11" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_11 "initialDLBWPmappingType_11" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_11 "initialDLBWPstartSymbolAndLength_11" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_12 "initialDLBWPk0_12" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_12 "initialDLBWPmappingType_12" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_12 "initialDLBWPstartSymbolAndLength_12" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_13 "initialDLBWPk0_13" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_13 "initialDLBWPmappingType_13" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_13 "initialDLBWPstartSymbolAndLength_13" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_14 "initialDLBWPk0_14" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_14 "initialDLBWPmappingType_14" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_14 "initialDLBWPstartSymbolAndLength_14" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_15 "initialDLBWPk0_15" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_15 "initialDLBWPmappingType_15" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_15 "initialDLBWPstartSymbolAndLength_15" + #define GNB_CONFIG_STRING_ULFREQUENCYBAND "ul_frequencyBand" #define GNB_CONFIG_STRING_ULABSOLUEFREQUENCYPOINTA "ul_absoluteFrequencyPointA" #define GNB_CONFIG_STRING_ULOFFSETTOCARRIER "ul_offstToCarrier" @@ -92,6 +142,54 @@ #define GNB_CONFIG_STRING_HOPPINGID "hoppingId" #define GNB_CONFIG_STRING_P0NOMINAL "p0_nominal" #define GNB_CONFIG_STRING_PUCCHRES "pucch_ResourceCommon" +#define GNB_CONFIG_STRING_INITIALULBWPK2_0 "initialULBWPk2_0" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0 "initialULBWPmappingType_0" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0 "initialULBWPstartSymbolAndLength_0" +#define GNB_CONFIG_STRING_INITIALULBWPK2_1 "initialULBWPk2_1" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1 "initialULBWPmappingType_1" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1 "initialULBWPstartSymbolAndLength_1" +#define GNB_CONFIG_STRING_INITIALULBWPK2_2 "initialULBWPk2_2" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_2 "initialULBWPmappingType_2" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_2 "initialULBWPstartSymbolAndLength_2" +#define GNB_CONFIG_STRING_INITIALULBWPK2_3 "initialULBWPk2_3" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3 "initialULBWPmappingType_3" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3 "initialULBWPstartSymbolAndLength_3" +#define GNB_CONFIG_STRING_INITIALULBWPK2_4 "initialULBWPk2_4" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4 "initialULBWPmappingType_4" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4 "initialULBWPstartSymbolAndLength_4" +#define GNB_CONFIG_STRING_INITIALULBWPK2_5 "initialULBWPk2_5" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5 "initialULBWPmappingType_5" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_5 "initialULBWPstartSymbolAndLength_5" +#define GNB_CONFIG_STRING_INITIALULBWPK2_6 "initialULBWPk2_6" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_6 "initialULBWPmappingType_6" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6 "initialULBWPstartSymbolAndLength_6" +#define GNB_CONFIG_STRING_INITIALULBWPK2_7 "initialULBWPk2_7" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7 "initialULBWPmappingType_7" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7 "initialULBWPstartSymbolAndLength_7" +#define GNB_CONFIG_STRING_INITIALULBWPK2_8 "initialULBWPk2_8" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8 "initialULBWPmappingType_8" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8 "initialULBWPstartSymbolAndLength_8" +#define GNB_CONFIG_STRING_INITIALULBWPK2_9 "initialULBWPk2_9" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_9 "initialULBWPmappingType_9" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_9 "initialULBWPstartSymbolAndLength_9" +#define GNB_CONFIG_STRING_INITIALULBWPK2_10 "initialULBWPk2_10" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10 "initialULBWPmappingType_10" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10 "initialULBWPstartSymbolAndLength_10" +#define GNB_CONFIG_STRING_INITIALULBWPK2_11 "initialULBWPk2_11" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11 "initialULBWPmappingType_11" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11 "initialULBWPstartSymbolAndLength_11" +#define GNB_CONFIG_STRING_INITIALULBWPK2_12 "initialULBWPk2_12" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_12 "initialULBWPmappingType_12" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_12 "initialULBWPstartSymbolAndLength_12" +#define GNB_CONFIG_STRING_INITIALULBWPK2_13 "initialULBWPk2_13" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13 "initialULBWPmappingType_13" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13 "initialULBWPstartSymbolAndLength_13" +#define GNB_CONFIG_STRING_INITIALULBWPK2_14 "initialULBWPk2_14" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14 "initialULBWPmappingType_14" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14 "initialULBWPstartSymbolAndLength_14" +#define GNB_CONFIG_STRING_INITIALULBWPK2_15 "initialULBWPk2_15" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15 "initialULBWPmappingType_15" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_15 "initialULBWPstartSymbolAndLength_15" #define GNB_CONFIG_STRING_SSBPOSITIONSINBURSTPR "ssb_PositionsInBurst_PR" @@ -175,6 +273,54 @@ {GNB_CONFIG_STRING_INITIALDLBWPSUBCARRIERSPACING,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0/*12*/},\ {GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero,defint64val:12,TYPE_INT64,0/*13*/},\ {GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero,defint64val:0,TYPE_INT64,0/*14*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_0,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->k0,defint64val:-1,TYPE_INT64,0/*15*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:-1,TYPE_INT64,0/*16*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:-1,TYPE_INT64,0/*17*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_1,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->k0,defint64val:-1,TYPE_INT64,0/*18*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*19*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*20*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPK0_2,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->k0,defint64val:-1,TYPE_INT64,0/*21*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*22*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*23*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_3,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->k0,defint64val:-1,TYPE_INT64,0/*24*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*25*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*26*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_4,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->k0,defint64val:-1,TYPE_INT64,0/*27*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*28*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*29*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_5,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->k0,defint64val:-1,TYPE_INT64,0/*30*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*31*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_5,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*32*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_6,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->k0,defint64val:-1,TYPE_INT64,0/*33*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_6,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*34*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*35*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_7,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->k0,defint64val:-1,TYPE_INT64,0/*36*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*37*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*38*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_8,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->k0,defint64val:-1,TYPE_INT64,0/*39*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*40*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*41*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_9,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->k0,defint64val:-1,TYPE_INT64,0/*42*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_9,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*43*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_9,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*44*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_10,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->k0,defint64val:-1,TYPE_INT64,0/*45*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*46*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*47*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_11,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->k0,defint64val:-1,TYPE_INT64,0/*48*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*49*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*50*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPK0_12,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->k0,defint64val:-1,TYPE_INT64,0/*51*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_12,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*52*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_12,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*53*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_13,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->k0,defint64val:-1,TYPE_INT64,0/*54*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*55*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*56*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_14,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->k0,defint64val:-1,TYPE_INT64,0/*57*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*58*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*59*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_15,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->k0,defint64val:-1,TYPE_INT64,0/*60*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*61*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_15,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*62*/},\ {GNB_CONFIG_STRING_ULFREQUENCYBAND,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0],defint64val:-1,TYPE_INT64,0/*63*/},\ {GNB_CONFIG_STRING_ULABSOLUEFREQUENCYPOINTA,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA,defint64val:-1,TYPE_INT64,0/*64*/},\ {GNB_CONFIG_STRING_ULOFFSETTOCARRIER,NULL,0,i64ptr:&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier,defint64val:0,TYPE_INT64,0/*65*/},\ @@ -199,6 +345,54 @@ {GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139,defint64val:0,TYPE_INT64,0/*84*/},\ {GNB_CONFIG_STRING_RESTRICTEDSETCONFIG,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig,defintval:NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet,TYPE_INT64,0/*85*/}, \ {GNB_CONFIG_STRING_MSG3TRANSFPREC,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder,defintval:1,TYPE_INT64,0/*86*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPK2_0,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2,defint64val:-1,TYPE_INT64,0/*87*/},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,/*88*/},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:55,TYPE_INT64,0/*89*/},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_1,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2,defint64val:-1,TYPE_INT64,0/*90*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_2,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_3,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_4,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*100*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_5,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_6,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_7,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*110*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPK2_8,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_9,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_9,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_9,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_10,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_11,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2,defint64val:-1,TYPE_INT64,0/*120*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_12,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_12,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_12,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_13,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_14,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*130*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_15,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ {GNB_CONFIG_STRING_MSG3DELTAPREABMLE, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble,defint64val:1,TYPE_INT64,0},\ {GNB_CONFIG_STRING_P0NOMINALWITHGRANT, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant,defint64val:1,TYPE_INT64,0},\ {GNB_CONFIG_STRING_PUCCHGROUPHOPPING, NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping,defint64val:NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither,TYPE_INT64,0},\ diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index d069bfe2f4..9851d14b91 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -94,6 +94,8 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { NR_FreqBandIndicatorNR_t *dl_frequencyBandList,*ul_frequencyBandList; struct NR_SCS_SpecificCarrier *dl_scs_SpecificCarrierList,*ul_scs_SpecificCarrierList; + struct NR_PDSCH_TimeDomainResourceAllocation *bwp_dl_timedomainresourceallocation; + struct NR_PUSCH_TimeDomainResourceAllocation *pusch_configcommontimedomainresourceallocation; // struct NR_RateMatchPattern *ratematchpattern; // NR_RateMatchPatternId_t *ratematchpatternid; // NR_TCI_StateId_t *TCI_StateId; @@ -141,6 +143,14 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->present = NR_SetupRelease_PDSCH_ConfigCommon_PR_setup; scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDSCH_ConfigCommon)); scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList = CALLOC(1,sizeof(struct NR_PDSCH_TimeDomainResourceAllocationList)); + // + for (int i=0;ik0 = CALLOC(1,sizeof(long)); + *bwp_dl_timedomainresourceallocation->k0=0; + ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + bwp_dl_timedomainresourceallocation); + } ul_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(struct NR_MultiFrequencyBandListNR)); @@ -189,6 +199,12 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier)); ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list,ul_scs_SpecificCarrierList); + for (int i=0;ik2 = CALLOC(1,sizeof(long)); + *pusch_configcommontimedomainresourceallocation->k2=0; + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_configcommontimedomainresourceallocation); + } //ratematchpattern = CALLOC(1,sizeof(struct NR_RateMatchPattern)); //ratematchpattern->patternType.choice.bitmaps = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps)); //ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf = MALLOC(35); @@ -207,92 +223,6 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { } -void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul) { - - *scc->physCellId=0; \ - // *scc->n_TimingAdvanceOffset=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0; - *scc->ssb_periodicityServingCell=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20; - scc->dmrs_TypeA_Position=NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2; - *scc->ssbSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; - *scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB=641032; - *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]=78; - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA=640000; - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; - - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_DL; - scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth=13036; - scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing=mu_dl;//NR_SubcarrierSpacing_kHz30; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero=12; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero=0; - struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation0 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); - timedomainresourceallocation0->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - timedomainresourceallocation0->startSymbolAndLength=54; - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, - timedomainresourceallocation0); - struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation1 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); - timedomainresourceallocation1->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - timedomainresourceallocation1->startSymbolAndLength=57; - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, - timedomainresourceallocation1); - *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]=78; - *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA=-1; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_UL; - *scc->uplinkConfigCommon->frequencyInfoUL->p_Max=20; - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth=13036; - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing=mu_ul;//NR_SubcarrierSpacing_kHz30; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex=98; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM=NR_RACH_ConfigGeneric__msg1_FDM_one; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart=0; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig=13; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower=-118; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax=NR_RACH_ConfigGeneric__preambleTransMax_n10; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep=NR_RACH_ConfigGeneric__powerRampingStep_dB2; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow=NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer=NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; - *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB=19; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present=NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139=0; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet; - struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation0 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation0->k2 = CALLOC(1,sizeof(long)); - *pusch_timedomainresourceallocation0->k2=6; - pusch_timedomainresourceallocation0->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation0->startSymbolAndLength=55; - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation0); - struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation1 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation1->k2 = CALLOC(1,sizeof(long)); - *pusch_timedomainresourceallocation1->k2=6; - pusch_timedomainresourceallocation1->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation1->startSymbolAndLength=38; - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1); - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble=1; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant=-90; - scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither; - *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId=40; - *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal=-90; - scc->ssb_PositionsInBurst->present=NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap; - *ssb_bitmap=0xff; - scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity=NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots=7; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols=6; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots=2; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols=4; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity=321; - - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSlots=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols=-1; - scc->ss_PBCH_BlockPower=20; - *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing=-1; -} - void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { @@ -343,9 +273,24 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { if (*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder!=0) scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder = NULL; - // prepare DL Allocation lists - nr_rrc_config_dl_tda(scc); + // fix DL and UL Allocation lists + + for (int i=scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count-1;i>=0;i--) { + printf("Checking element %d : %ld\n",i,*scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0); + if (*scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0>32) { + printf("removing pdsch_TimeDomainAllocationList element %d\n",i); + free(scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0); + asn_sequence_del(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,i,1); + printf("List size now %d\n",scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count); + } + } + for (int i=scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.count-1;i>=0;i--) { + if (*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[i]->k2>32) { + free(scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[i]->k2); + asn_sequence_del(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,i,1); + } + } if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) { free(scc->tdd_UL_DL_ConfigurationCommon->pattern2); scc->tdd_UL_DL_ConfigurationCommon->pattern2=NULL; @@ -1162,9 +1107,11 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr; printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; - printf("minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); - NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIME = *GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr; + printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; + printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 730b6b85b6..0c3d971569 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -119,7 +119,7 @@ typedef enum { #define GNB_CONFIG_STRING_SIB1TDA "sib1_tda" #define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS" #define GNB_CONFIG_STRING_NRCELLID "nr_cellid" -#define GNB_CONFIG_STRING_MINRXTXTIME "min_rxtxtime" +#define GNB_CONFIG_STRING_MINRXTXTIMEPDSCH "min_rxtxtime_pdsch" #define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist" @@ -148,7 +148,7 @@ typedef enum { {GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ -{GNB_CONFIG_STRING_MINRXTXTIME, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ } @@ -172,7 +172,7 @@ typedef enum { #define GNB_SIB1_TDA_IDX 17 #define GNB_DO_CSIRS_IDX 18 #define GNB_NRCELLID_IDX 19 -#define GNB_MINRXTXTIME_IDX 20 +#define GNB_MINRXTXTIMEPDSCH_IDX 20 #define GNB_ULPRBBLACKLIST_IDX 21 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 764c92ecb7..f67a3e1fa5 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -44,9 +44,46 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int nrofUplinkSlots, int nrofUplinkSymbols) { int slot_number = 0; - int nb_periods_per_frame = get_nb_periods_per_frame(cfg->tdd_table.tdd_period); + int nb_periods_per_frame; int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<tdd_table.tdd_period) { + case 0: + nb_periods_per_frame = 20; // 10ms/0p5ms + break; + + case 1: + nb_periods_per_frame = 16; // 10ms/0p625ms + break; + + case 2: + nb_periods_per_frame = 10; // 10ms/1ms + break; + + case 3: + nb_periods_per_frame = 8; // 10ms/1p25ms + break; + + case 4: + nb_periods_per_frame = 5; // 10ms/2ms + break; + + case 5: + nb_periods_per_frame = 4; // 10ms/2p5ms + break; + + case 6: + nb_periods_per_frame = 2; // 10ms/5ms + break; + + case 7: + nb_periods_per_frame = 1; // 10ms/10ms + break; + + default: + AssertFatal(1==0,"Undefined tdd period %d\n", cfg->tdd_table.tdd_period); + } + int nb_slots_per_period = ((1<tdd_table.tdd_period_in_slots = nb_slots_per_period; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 2f4ceb48ec..a5f6e4a7d1 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -944,10 +944,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr return -1; } - if(rnti != ra->ra_rnti && rnti != SI_RNTI) - AssertFatal(1+dci->pdsch_to_harq_feedback_timing_indicator.val>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d).\n", - 1+dci->pdsch_to_harq_feedback_timing_indicator.val,DURATION_RX_TO_TX); - // set the harq status at MAC for feedback set_harq_status(mac,dci->pucch_resource_indicator, dci->harq_pid, @@ -1236,7 +1232,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr uint8_t feedback_ti = ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0]; - AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d). Min feedback time set in config file (min_rxtxtime).\n", + AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d)\n", feedback_ti,DURATION_RX_TO_TX); // set the harq status at MAC for feedback @@ -3164,10 +3160,10 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, pos+=fsize; dci_pdu_rel15->frequency_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<time_domain_assignment.nbits; - dci_pdu_rel15->time_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<time_domain_assignment.nbits)-1); + dci_pdu_rel15->time_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&0x3; // Not supported yet - skip for now // Frequency hopping flag – 1 bit diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 3d45877979..c142af13ba 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -129,7 +129,7 @@ long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) { } AssertFatal(k2 >= DURATION_RX_TO_TX, - "Slot offset K2 (%ld) cannot be less than DURATION_RX_TO_TX (%d). K2 set according to min_rxtxtime in config file.\n", + "Slot offset K2 (%ld) cannot be less than DURATION_RX_TO_TX (%d)\n", k2,DURATION_RX_TO_TX); LOG_D(NR_MAC, "get_k2(): k2 is %ld\n", k2); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 2705b85b8c..25aeea70a6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -870,6 +870,9 @@ void nr_get_Msg3alloc(module_id_t module_id, int mu = ubwp ? ubwp->bwp_Common->genericParameters.subcarrierSpacing : scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; + int StartSymbolIndex = 0; + int NrOfSymbols = 0; + int startSymbolAndLength = 0; int temp_slot = 0; ra->Msg3_tda_id = 16; // initialization to a value above limit @@ -878,29 +881,20 @@ void nr_get_Msg3alloc(module_id_t module_id, scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; uint8_t k2 = 0; - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); - if (frame_type == TDD) { - int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); - int nb_slots_per_period = ((1<list.count; i++) { + for (int i=0; ilist.count; i++) { + startSymbolAndLength = pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; + SLIV2SL(startSymbolAndLength, &StartSymbolIndex, &NrOfSymbols); + // we want to transmit in the uplink symbols of mixed slot + if (NrOfSymbols == scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols) { k2 = *pusch_TimeDomainAllocationList->list.array[i]->k2; - // we want to transmit in the uplink symbols of mixed slot - if ((k2 + DELTA[mu])%nb_slots_per_period == 0) { - temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 - ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; - if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { - ra->Msg3_tda_id = i; - break; - } + temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 + ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; + if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { + ra->Msg3_tda_id = i; + break; } } } - else { - ra->Msg3_tda_id = 0; - k2 = *pusch_TimeDomainAllocationList->list.array[0]->k2; - temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 - ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; - } AssertFatal(ra->Msg3_tda_id<16,"Unable to find Msg3 time domain allocation in list\n"); @@ -921,7 +915,7 @@ void nr_get_Msg3alloc(module_id_t module_id, tdd_beam_association[num_tdd_period] = ra->beam_id; } - LOG_D(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id); + LOG_D(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u start symbol index %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id, StartSymbolIndex); uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[ra->Msg3_slot * MAX_BWP_SIZE]; @@ -978,7 +972,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->bwp_size = bwp_size; pusch_pdu->subcarrier_spacing = scs; pusch_pdu->cyclic_prefix = 0; - pusch_pdu->mcs_index = 1; + pusch_pdu->mcs_index = 0; pusch_pdu->mcs_table = 0; pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); @@ -1015,14 +1009,11 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->pusch_data.harq_process_id = 0; pusch_pdu->pusch_data.new_data_indicator = 1; pusch_pdu->pusch_data.num_cb = 0; - int num_dmrs_symb = 0; - for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++) - num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1; pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, pusch_pdu->target_code_rate, pusch_pdu->rb_size, pusch_pdu->nr_of_symbols, - num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol + 12, // nb dmrs set for no data in dmrs symbol 0, //nb_rb_oh 0, // to verify tb scaling pusch_pdu->nrOfLayers)>>3; @@ -1083,7 +1074,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t fh = ubwp->bwp_Dedicated->pusch_Config->choice.setup->frequencyHopping ? 1 : 0; } - LOG_D(NR_MAC, "Frame %d, Slot %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", + LOG_D(NR_MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", frameP, slotP, ra->Msg3_frame, @@ -1114,12 +1105,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra if ((ra->Msg2_frame == frameP) && (ra->Msg2_slot == slotP)) { - //TODO time domain assignment for msg2 needs to be improved - uint8_t time_domain_assignment; - if(cc->frame_type == TDD) - time_domain_assignment = 1; - else - time_domain_assignment = 0; + uint8_t time_domain_assignment = 1; uint8_t mcsIndex = 0; int rbStart = 0; int rbSize = 8; @@ -1259,8 +1245,6 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type) dmrsConfigType = 1; - NR_PDSCH_Config_t *pdsch_config = bwp && bwp->bwp_Dedicated && bwp->bwp_Dedicated->pdsch_Config ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL; - pdsch_pdu_rel15->pduBitmap = 0; pdsch_pdu_rel15->rnti = ra->RA_rnti; pdsch_pdu_rel15->pduIndex = pduindex; @@ -1289,7 +1273,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra pdsch_pdu_rel15->VRBtoPRBMapping = 0; pdsch_pdu_rel15->StartSymbolIndex = startSymbolIndex; pdsch_pdu_rel15->NrOfSymbols = nrOfSymbols; - pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, + pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 7b7b5c771b..33cb2b1b1d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -351,7 +351,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, const NR_BWP_Uplink_t *ubwp, - const NR_BWP_UplinkDedicated_t *ubwpd, + const NR_BWP_UplinkDedicated_t *ubwpd, long dci_format, int tda, uint8_t num_dmrs_cdm_grps_no_data, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index c68b16b553..313dd6236e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -104,6 +104,7 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub /* check that TDA index 1 fits into UL slot and does not overlap with PUCCH */ const struct NR_PUSCH_TimeDomainResourceAllocationList *tdaList = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + AssertFatal(tdaList->list.count >= 3, "need to have at least three TDAs for UL slots\n"); const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_UL = tdaList->list.array[0]; const int k2 = get_K2(scc, (NR_BWP_Uplink_t*)ubwp,0, mu); int start, len; @@ -116,28 +117,27 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub // get largest time domain allocation (TDA) for UL slot and UL in mixed slot int tdaMi = -1; - if(tdaList->list.count > 1) { - const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; - AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), - "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", - k2, - get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); - SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); - const uint16_t symb_tda_mi = ((1 << len) - 1) << start; - // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check - // whether TDA is entirely within mixed slot, UL. Note that here we assume - // that the PUCCH is scheduled in every slot, and on all RBs (which is - // mostly not true, this is a simplification) - if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { - tdaMi = 1; - } else { - LOG_E(NR_MAC, - "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", - symb_pucch, - symb_ulMixed, - symb_tda_mi); - } + const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; + AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), + "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", + k2, + get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); + SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); + const uint16_t symb_tda_mi = ((1 << len) - 1) << start; + // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check + // whether TDA is entirely within mixed slot, UL. Note that here we assume + // that the PUCCH is scheduled in every slot, and on all RBs (which is + // mostly not true, this is a simplification) + if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { + tdaMi = 1; + } else { + LOG_E(NR_MAC, + "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", + symb_pucch, + symb_ulMixed, + symb_tda_mi); } + const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 5e5de9a8e1..547c5da00c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -64,7 +64,7 @@ void *nrmac_stats_thread(void *arg) { fseek(fd,0,SEEK_SET); } fclose(fd); - return NULL; + return (void *)0; } void clear_mac_stats(gNB_MAC_INST *gNB) { diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index bdd1cf5261..ff6923429e 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1185,9 +1185,9 @@ void fill_initial_SpCellConfig(rnti_t rnti, long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - AssertFatal(carrier->minRXTXTIME >=2 && carrier->minRXTXTIME <7, - "check minRXTXTIME %d\n",carrier->minRXTXTIME); - *delay[i] = (i+carrier->minRXTXTIME); + AssertFatal(carrier->minRXTXTIMEpdsch >=2 && carrier->minRXTXTIMEpdsch <7, + "check minRXTXTIMEpdsch %d\n",carrier->minRXTXTIMEpdsch); + *delay[i] = (i+carrier->minRXTXTIMEpdsch); ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 6b7f9a21b9..dedd4cf839 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -29,79 +29,96 @@ */ #include "nr_rrc_config.h" -#include "common/utils/nr/nr_common.h" -void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ - - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); - - // setting default TDA for DL with - struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); - timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,13); // basic slot configuration starting in symbol 1 til the end of the slot - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, - timedomainresourceallocation); - - if(frame_type==TDD) { - // TDD - if(scc->tdd_UL_DL_ConfigurationCommon) { - int dl_symb = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols; - if(dl_symb > 1) { - timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); - timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,dl_symb-1); // mixed slot configuration starting in symbol 1 til the end of the dl allocation - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, - timedomainresourceallocation); - } - } - } +void rrc_config_rlc_bearer(uint8_t Mod_id, + int CC_id, + rlc_bearer_config_t *rlc_config + ){ + rlc_config->LogicalChannelIdentity[CC_id] = 0; + rlc_config->servedRadioBearer_present[CC_id] = 0; + rlc_config->srb_Identity[CC_id] = 0; + rlc_config->drb_Identity[CC_id] = 0; + rlc_config->reestablishRLC[CC_id] = 0; + rlc_config->rlc_Config_present[CC_id] = 0; + rlc_config->ul_AM_sn_FieldLength[CC_id] = 0; + rlc_config->t_PollRetransmit[CC_id] = 0; + rlc_config->pollPDU[CC_id] = 0; + rlc_config->pollByte[CC_id] = 0; + rlc_config->maxRetxThreshold[CC_id] = 0; + rlc_config->dl_AM_sn_FieldLength[CC_id] = 0; + rlc_config->dl_AM_t_Reassembly[CC_id] = 0; + rlc_config->t_StatusProhibit[CC_id] = 0; + rlc_config->ul_UM_sn_FieldLength[CC_id] = 0; + rlc_config->dl_UM_sn_FieldLength[CC_id] = 0; + rlc_config->dl_UM_t_Reassembly[CC_id] = 0; + rlc_config->priority[CC_id] = 0; + rlc_config->prioritisedBitRate[CC_id] = 0; + rlc_config->bucketSizeDuration[CC_id] = 0; + rlc_config->allowedServingCells[CC_id] = 0; + rlc_config->subcarrierspacing[CC_id] = 0; + rlc_config->maxPUSCH_Duration[CC_id] = 0; + rlc_config->configuredGrantType1Allowed[CC_id] = 0; + rlc_config->logicalChannelGroup[CC_id] = 0; + rlc_config->schedulingRequestID[CC_id] = 0; + rlc_config->logicalChannelSR_Mask[CC_id] = 0; + rlc_config->logicalChannelSR_DelayTimerApplied[CC_id] = 0; } - -void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ - - //TODO change to accomodate for SRS - - int temp_min_delay = 6; // k2 = 2 or 3 won'r work as well as higher values - int k2 = (min_fb_delayuplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); - - struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); - *pusch_timedomainresourceallocation->k2 = k2; - pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(0,13); // basic slot configuration starting in symbol 0 til the last but one symbol - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); - - if(frame_type==TDD) { - // TDD - if(scc->tdd_UL_DL_ConfigurationCommon) { - int ul_symb = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols; - pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); - *pusch_timedomainresourceallocation->k2 = k2; - pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); - - // for msg3 in the mixed slot - int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); - int nb_slots_per_period = ((1<k2 = CALLOC(1,sizeof(long)); - *pusch_timedomainresourceallocation_msg3->k2 = nb_slots_per_period - DELTA[mu]; - if(*pusch_timedomainresourceallocation_msg3->k2 < min_fb_delay) - *pusch_timedomainresourceallocation_msg3->k2 += nb_slots_per_period; - AssertFatal(*pusch_timedomainresourceallocation_msg3->k2<33,"Computed k2 for msg3 %ld is larger than the range allowed by RRC (0..32)\n", - *pusch_timedomainresourceallocation_msg3->k2); - pusch_timedomainresourceallocation_msg3->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3); - } - } - +void rrc_config_mac_cellgroup(uint8_t Mod_id, + int CC_id, + mac_cellgroup_t *mac_cellgroup_config + ){ + mac_cellgroup_config->DRX_Config_PR[CC_id] = 0; + mac_cellgroup_config->drx_onDurationTimer_PR[CC_id] = 0; + mac_cellgroup_config->subMilliSeconds[CC_id] = 0; + mac_cellgroup_config->milliSeconds[CC_id] = 0; + mac_cellgroup_config->drx_InactivityTimer[CC_id] = 0; + mac_cellgroup_config->drx_HARQ_RTT_TimerDL[CC_id] = 0; + mac_cellgroup_config->drx_HARQ_RTT_TimerUL[CC_id] = 0; + mac_cellgroup_config->drx_RetransmissionTimerDL[CC_id] = 0; + mac_cellgroup_config->drx_RetransmissionTimerUL[CC_id] = 0; + mac_cellgroup_config->drx_LongCycleStartOffset_PR[CC_id] = 0; + mac_cellgroup_config->drx_LongCycleStartOffset[CC_id] = 0; + mac_cellgroup_config->drx_ShortCycle[CC_id] = 0; + mac_cellgroup_config->drx_ShortCycleTimer[CC_id] = 0; + mac_cellgroup_config->drx_SlotOffset[CC_id] = 0; + mac_cellgroup_config->schedulingRequestId[CC_id] = 0; + mac_cellgroup_config->sr_ProhibitTimer[CC_id] = 0; + mac_cellgroup_config->sr_TransMax[CC_id] = 0; + mac_cellgroup_config->periodicBSR_Timer[CC_id] = 0; + mac_cellgroup_config->retxBSR_Timer[CC_id] = 0; + mac_cellgroup_config->logicalChannelSR_DelayTimer[CC_id] = 0; + mac_cellgroup_config->tag_Id[CC_id] = 0; + mac_cellgroup_config->timeAlignmentTimer[CC_id] = 0; + mac_cellgroup_config->PHR_Config_PR[CC_id] = 0; + mac_cellgroup_config->phr_PeriodicTimer[CC_id] = 0; + mac_cellgroup_config->phr_ProhibitTimer[CC_id] = 0; + mac_cellgroup_config->phr_Tx_PowerFactorChange[CC_id] = 0; + mac_cellgroup_config->multiplePHR[CC_id] = 0; + mac_cellgroup_config->phr_Type2SpCell[CC_id] = 0; + mac_cellgroup_config->phr_Type2OtherCell[CC_id] = 0; + mac_cellgroup_config->phr_ModeOtherCG[CC_id] = 0; + mac_cellgroup_config->skipUplinkTxDynamic[CC_id] = 0; } +void rrc_config_physicalcellgroup(uint8_t Mod_id, + int CC_id, + physicalcellgroup_t *physicalcellgroup_config + ){ + physicalcellgroup_config->harq_ACK_SpatialBundlingPUCCH[CC_id] = 0; + physicalcellgroup_config->harq_ACK_SpatialBundlingPUSCH[CC_id] = 0; + physicalcellgroup_config->p_NR[CC_id] = 0; + physicalcellgroup_config->pdsch_HARQ_ACK_Codebook[CC_id] = 0; + physicalcellgroup_config->tpc_SRS_RNTI[CC_id] = 0; + physicalcellgroup_config->tpc_PUCCH_RNTI[CC_id] = 0; + physicalcellgroup_config->tpc_PUSCH_RNTI[CC_id] = 0; + physicalcellgroup_config->sp_CSI_RNTI[CC_id] = 0; + physicalcellgroup_config->RNTI_Value[CC_id] = 0; +} + +void rrc_config_rachdedicated(uint8_t Mod_id, + int CC_id, + physicalcellgroup_t *physicalcellgroup_config + ){ + +} diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index 192fee754e..e19d94b341 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -111,8 +111,29 @@ typedef struct physicalcellgroup_s{ long RNTI_Value[MAX_NUM_CCs]; }physicalcellgroup_t; -void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); -void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay); +typedef struct rach_dedicated_s{ + + +}rach_dedicated_t; +void rrc_config_servingcellconfigcommon(uint8_t Mod_id, + int CC_id, + gNB_RrcConfigurationReq *common_configuration + ); + +void rrc_config_rlc_bearer(uint8_t Mod_id, + int CC_id, + rlc_bearer_config_t *rlc_config + ); + +void rrc_config_mac_cellgroup(uint8_t Mod_id, + int CC_id, + mac_cellgroup_t *mac_cellgroup_config + ); + +void rrc_config_physicalcellgroup(uint8_t Mod_id, + int CC_id, + physicalcellgroup_t *physicalcellgroup_config + ); #endif diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index d71393bc2d..ad31e8cac7 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -447,7 +447,7 @@ typedef struct { int sib1_tda; int pdsch_AntennaPorts; int pusch_AntennaPorts; - int minRXTXTIME; + int minRXTXTIMEpdsch; int do_CSIRS; NR_BCCH_DL_SCH_Message_t *siblock1; NR_ServingCellConfigCommon_t *servingcellconfigcommon; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 7f7353f9af..34e570070d 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -136,6 +136,80 @@ void openair_nr_rrc_on(const protocol_ctxt_t *const ctxt_pP) { ///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------/// +void rrc_gNB_process_SgNBAdditionRequest( + const protocol_ctxt_t *const ctxt_pP, + rrc_gNB_ue_context_t *ue_context_pP +) { + rrc_gNB_generate_SgNBAdditionRequestAcknowledge(ctxt_pP,ue_context_pP); +} + +void rrc_gNB_generate_SgNBAdditionRequestAcknowledge( + const protocol_ctxt_t *const ctxt_pP, + rrc_gNB_ue_context_t *const ue_context_pP) { + //uint8_t size; + //uint8_t buffer[100]; + //int CC_id = ue_context_pP->ue_context.primaryCC_id; + //OCTET_STRING_t *secondaryCellGroup; + NR_CellGroupConfig_t *cellGroupconfig; + struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_BearerToAddModList; + struct NR_MAC_CellGroupConfig *mac_CellGroupConfig; + struct NR_PhysicalCellGroupConfig *physicalCellGroupConfig; + struct NR_SpCellConfig *spCellConfig; + //struct NR_CellGroupConfig__sCellToAddModList *sCellToAddModList; + cellGroupconfig = CALLOC(1,sizeof(NR_CellGroupConfig_t)); + cellGroupconfig->rlc_BearerToAddModList = CALLOC(1,sizeof(struct NR_CellGroupConfig__rlc_BearerToAddModList)); + cellGroupconfig->mac_CellGroupConfig = CALLOC(1,sizeof(struct NR_MAC_CellGroupConfig)); + cellGroupconfig->physicalCellGroupConfig = CALLOC(1,sizeof(struct NR_PhysicalCellGroupConfig)); + cellGroupconfig->spCellConfig = CALLOC(1,sizeof(struct NR_SpCellConfig)); + //cellGroupconfig->sCellToAddModList = CALLOC(1,sizeof(struct NR_CellGroupConfig__sCellToAddModList)); + rlc_BearerToAddModList = cellGroupconfig->rlc_BearerToAddModList; + mac_CellGroupConfig = cellGroupconfig->mac_CellGroupConfig; + physicalCellGroupConfig = cellGroupconfig->physicalCellGroupConfig; + spCellConfig = cellGroupconfig->spCellConfig; + //sCellToAddModList = cellGroupconfig->sCellToAddModList; + rlc_bearer_config_t *rlc_config; + rlc_config = CALLOC(1,sizeof(rlc_bearer_config_t)); + //Fill rlc_bearer config value + rrc_config_rlc_bearer(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + rlc_config + ); + //Fill rlc_bearer config to structure + do_RLC_BEARER(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + rlc_BearerToAddModList, + rlc_config); + mac_cellgroup_t *mac_cellgroup_config; + mac_cellgroup_config = CALLOC(1,sizeof(mac_cellgroup_t)); + //Fill mac_cellgroup_config config value + rrc_config_mac_cellgroup(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + mac_cellgroup_config + ); + //Fill mac_cellgroup config to structure + do_MAC_CELLGROUP(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + mac_CellGroupConfig, + mac_cellgroup_config); + physicalcellgroup_t *physicalcellgroup_config; + physicalcellgroup_config = CALLOC(1,sizeof(physicalcellgroup_t)); + //Fill physicalcellgroup_config config value + rrc_config_physicalcellgroup(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + physicalcellgroup_config + ); + //Fill physicalcellgroup config to structure + do_PHYSICALCELLGROUP(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + physicalCellGroupConfig, + physicalcellgroup_config); + do_SpCellConfig(RC.nrrrc[ctxt_pP->module_id], + spCellConfig); +} + +///---------------------------------------------------------------------------------------------------------------/// +///---------------------------------------------------------------------------------------------------------------/// + static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration) { LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__); if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { @@ -256,10 +330,9 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset; rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts; rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts; - rrc->carrier.minRXTXTIME = configuration->minRXTXTIME; + rrc->carrier.minRXTXTIMEpdsch = configuration->minRXTXTIMEpdsch; rrc->carrier.sib1_tda = configuration->sib1_tda; rrc->carrier.do_CSIRS = configuration->do_CSIRS; - nr_rrc_config_ul_tda(configuration->scc,configuration->minRXTXTIME); /// System Information INIT pthread_mutex_init(&rrc->cell_info_mutex,NULL); rrc->cell_info_configured = 0; diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 3311779235..2104d5cdd7 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -241,7 +241,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, - carrier->minRXTXTIME, + carrier->minRXTXTIMEpdsch, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); @@ -251,7 +251,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, - carrier->minRXTXTIME, + carrier->minRXTXTIMEpdsch, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 30604cd015..4b8fd77dc5 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -55,7 +55,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int scg_id, int servCellIndex, int dl_antenna_ports, - int minRXTXTIME, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid) { @@ -483,10 +483,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_PDSCH_TimeDomainResourceAllocation_t *pdschi; for (int i=0;idownlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;i++) { pdschi= calloc(1,sizeof(*pdschi)); - if(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0){ - pdschi->k0 = calloc(1,sizeof(*pdschi->k0)); - *pdschi->k0 = *servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0; - } + AssertFatal(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0!=NULL,"element %d is null\n",i); + + pdschi->k0 = calloc(1,sizeof(*pdschi->k0)); + *pdschi->k0 = *servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0; pdschi->mappingType = servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->mappingType; pdschi->startSymbolAndLength = servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; ASN_SEQUENCE_ADD(&bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,pdschi); @@ -946,7 +946,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = i+minRXTXTIME; + *delay[i] = i+minRXTXTIMEpdsch; ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); @@ -1349,7 +1349,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, - int minRXTXTIME, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid) { @@ -1365,7 +1365,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon 1, 1, dl_antenna_ports, - minRXTXTIME, + minRXTXTIMEpdsch, do_csirs, initial_csi_index, uid); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index c6a4a90a14..b260eaa58d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -55,6 +55,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -111,6 +120,19 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; #p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index fd9399f89e..0306fe5d0b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,20 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 4; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 59e71a6225..c14ad17b42 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 4; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index 3fc81c0d6c..ff0fdd96bb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot (but is not used here) + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,19 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot (not used here) + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index a40a93c789..937790d4ac 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 4; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index 3860aba935..c9a95d59e8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -109,6 +118,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index 7c527e07c8..524407c4de 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -109,6 +118,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf index a171f2aae0..d191b67988 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 4f8c785baa..2dfa329346 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf index 012f46401e..7f0829e40a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot (but not used here) + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 63; # this is SS=7 L=5 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 91; # this is SS=7 L=7 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index b6b9252560..6248afab2f 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,20 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index 0817d7373e..6f28cd36c1 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index fd4c23cfdb..30194647b8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; #12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; # used for (full) DL slot + initialDLBWPmappingType_0 = 0; # 0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; # this is SS=1,L=13 + + initialDLBWPk0_1 = 0; # used for DL part mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; # this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for (full) UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for UL part mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 965408332c..fcbd3c0f02 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -54,6 +54,16 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +118,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index e36748a3a9..63123b8201 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7b2d369919..217ff76376 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index dbf4f58348..a1acfc313b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -54,6 +54,16 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 + #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +118,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6d23726a78..540dddad21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -54,6 +54,16 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 + #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +118,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index c3fa56f15e..edc5eaa0d4 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -54,6 +54,16 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 + #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +118,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index 15aa368fdf..362a280ccb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf index 1583e07ca1..e541607559 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf @@ -54,6 +54,29 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +131,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 55; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 8dfcfb2b88..b1c78bc978 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index d01b0947c0..96f2909031 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -55,7 +55,28 @@ gNBs = initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57) + initialDLBWPstartSymbolAndLength_3 = 57; //43; //57; #uplinkConfigCommon #frequencyInfoUL ul_frequencyBand = 78; @@ -109,6 +130,21 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf index 198ad8471c..f51f59ae30 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2f4839fd3b..59e507ed3e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -56,6 +56,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -110,6 +119,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 7f9e4d2d44..05e441d396 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -81,6 +81,29 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 53; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 81; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -135,6 +158,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=12 + initialULBWPstartSymbolAndLength_0 = 53; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf index ab4713f8b5..3bd884b602 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf @@ -69,6 +69,29 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -123,6 +146,21 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 55; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 9238ea1809..de6bafc9f7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -73,6 +73,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -127,6 +136,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 86318d80e2..c4b06c1139 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -74,6 +74,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -128,6 +137,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index bbdd8b9c0f..c7531f39ba 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -74,6 +74,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -128,6 +137,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index e9577ee265..a0d25053b6 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -70,6 +70,29 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -124,6 +147,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 55; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; From 799e52745f1eafeb647be826a71e7d748355d381 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 13:47:47 +0000 Subject: [PATCH 076/196] Adjust sync based on PSS improvements --- executables/nr-ue.c | 3 --- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 15 ++++++++++++--- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 6 +----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index c90a5119cd..702c214d9e 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -642,9 +642,6 @@ void *UE_thread(void *arg) { readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms); writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms); } else { - //UE->rx_offset_diff = computeSamplesShift(UE); - - readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms) - UE->rx_offset_diff; writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms)- UE->rx_offset_diff; diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 4ee5884afd..6865a636d5 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -981,6 +981,7 @@ int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { int **rxdata = ue->common_vars.rxdata; NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; uint8_t Nid2 = GET_NID2(frame_parms->Nid_cell); + int peak_position_ref = ((frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)<<1) + frame_parms->nb_prefix_samples0; int maxval=0; for (int i=0;i<2*(frame_parms->ofdm_symbol_size);i++) { @@ -996,8 +997,8 @@ int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { int peak_position = 0; int64_t result = 0; int64_t avg=0; - int start = 2*(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples) + frame_parms->nb_prefix_samples0 - 200; - int length = 2*frame_parms->ofdm_symbol_size + 200; + int start = peak_position_ref - (frame_parms->ofdm_symbol_size>>3); + int length = frame_parms->ofdm_symbol_size + (frame_parms->ofdm_symbol_size>>3); memset(pss_corr_ue[Nid2],0,(start+length)*sizeof(int64_t)); for (int n=start; n < start+length; n+=4) { // for (int ar=0; arnb_antennas_rx; ar++) { @@ -1019,7 +1020,15 @@ int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { return 0; } - int peak_position_diff = peak_position - ( ((frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)<<1) + frame_parms->nb_prefix_samples0); + int peak_position_diff = peak_position_ref - peak_position; + + ue->rx_offset_diff = 0; + if(peak_position_diff != 0) { + ue->rx_offset_diff = peak_position_diff>>3; + if (ue->rx_offset_diff == 0) { + ue->rx_offset_diff = peak_position_diff > 0 ? 1 : -1; + } + } // Fractional frequency offset computation according to Cross-correlation Synchronization Algorithm Using PSS // Shoujun Huang, Yongtao Su, Ying He and Shan Tang, "Joint time and frequency offset estimation in LTE downlink," diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index fb36b3ee86..732d975be4 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1648,7 +1648,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { - int peak_position_diff = nr_adjust_pss_synch(ue, (int *)&ue->common_vars.freq_offset); + nr_adjust_pss_synch(ue, (int *)&ue->common_vars.freq_offset); LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); nr_ue_pbch_procedures(gNB_id, ue, proc, 0); @@ -1664,10 +1664,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, 16384); }*/ - //ue->rx_offset = peak_position_diff; - - ue->rx_offset_diff = -peak_position_diff; - LOG_D(PHY, "Doing N0 measurements in %s\n", __FUNCTION__); nr_ue_rrc_measurements(ue, proc, nr_slot_rx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_OUT); From e1d88d6fc5147c0c42d2511e334a87266ccf452b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 13:49:56 +0000 Subject: [PATCH 077/196] Change log level --- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 6865a636d5..3bf12c0bab 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -1058,13 +1058,7 @@ int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { // Computing absolute value of frequency offset *f_off = ffo_est*frame_parms->subcarrier_spacing; - /*nr_rf_card_config_freq(&openair0_cfg[ue->rf_map.card], openair0_cfg->tx_freq[0], openair0_cfg->rx_freq[0], ue->common_vars.freq_offset); - - if (ue->mode != loop_through_memory) { - ue->rfdevice.trx_set_freq_func(&ue->rfdevice,&openair0_cfg[0],0); - }*/ - - LOG_I(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB, ffo %lf\n", + LOG_D(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB, ffo %lf\n", peak_position, peak_position_diff, dB_fixed64(peak_value),dB_fixed64(avg),ffo_est); return peak_position_diff; From b4c78a9c5b8439379d385cb325ab0fd5e65a2739 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 28 Dec 2021 11:05:52 +0100 Subject: [PATCH 078/196] fix compilation issues after merge --- openair2/GNB_APP/gnb_config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 -- openair2/RRC/NR/rrc_gNB.c | 8 ++++---- openair2/RRC/NR/rrc_gNB_nsa.c | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 84b3e4159a..8a1a22412f 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -2050,7 +2050,7 @@ void configure_gnb_du_mac(int inst) { rrc->configuration.pdsch_AntennaPorts, rrc->configuration.pusch_AntennaPorts, rrc->configuration.sib1_tda, - rrc->configuration.minRXTXTIMEpdsch, + rrc->configuration.minRXTXTIME, rrc->configuration.scc, NULL, 0, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 4f889910c1..25ede7a906 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -902,9 +902,7 @@ void nr_get_Msg3alloc(module_id_t module_id, const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; const int n_slots_frame = nr_slots_per_frame[mu]; - const int nrofUplinkSymbols = (frame_type==TDD) ? tdd->nrofUplinkSymbols : 11; // TODO change in favor of harmonization branch uint8_t k2 = 0; - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); if (frame_type == TDD) { int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); int nb_slots_per_period = ((1<carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIMEpdsch, + rrc->carrier.minRXTXTIME, (NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, 0, @@ -318,7 +318,7 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIMEpdsch, + rrc->carrier.minRXTXTIME, NULL, NULL, 0, @@ -512,7 +512,7 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( rrc_instance_p->carrier.pdsch_AntennaPorts, rrc_instance_p->carrier.pusch_AntennaPorts, rrc_instance_p->carrier.sib1_tda, - rrc_instance_p->carrier.minRXTXTIMEpdsch, + rrc_instance_p->carrier.minRXTXTIME, (NR_ServingCellConfigCommon_t *)rrc_instance_p->carrier.servingcellconfigcommon, &rrc_instance_p->carrier.mib, 0, @@ -1278,7 +1278,7 @@ rrc_gNB_process_RRCReconfigurationComplete( rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIMEpdsch, + rrc->carrier.minRXTXTIME, NULL, NULL, 0, diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 3b00404a21..c671ceebae 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -352,7 +352,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIMEpdsch, + rrc->carrier.minRXTXTIME, rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, 1, // add_ue flag @@ -364,7 +364,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIMEpdsch, + rrc->carrier.minRXTXTIME, NULL, NULL, 1, // add_ue flag From f76aac65829c16e0583a2d00705771e4f98c7520 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 30 Dec 2021 10:27:02 +0100 Subject: [PATCH 079/196] bugfix in setting ue tdd settings --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index c9e761202e..bcb31b7592 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -47,9 +47,8 @@ void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int nrofUplinkSlots = tdd_config->pattern1.nrofUplinkSlots; int nrofUplinkSymbols = tdd_config->pattern1.nrofUplinkSymbols; int slot_number = 0; - int nb_periods_per_frame = get_nb_periods_per_frame(cfg->tdd_table.tdd_period); + int nb_periods_per_frame = get_nb_periods_per_frame(tdd_config->pattern1.dl_UL_TransmissionPeriodicity); int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<tdd_table.tdd_period_in_slots = nb_slots_per_period; From 1be69de2e6ccde6b98cd29f5ac7d9a6917ad8308 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 3 Jan 2022 15:37:39 +0000 Subject: [PATCH 080/196] Code cleanup --- openair1/PHY/NR_REFSIG/pss_nr.h | 2 +- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 34 ++------------------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/pss_nr.h b/openair1/PHY/NR_REFSIG/pss_nr.h index e2dd0e456b..3b480d7fab 100644 --- a/openair1/PHY/NR_REFSIG/pss_nr.h +++ b/openair1/PHY/NR_REFSIG/pss_nr.h @@ -141,7 +141,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain int *eNB_id, int *f_off); -int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off); +int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue); #endif #undef EXTERN diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 3bf12c0bab..8ff0795871 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -976,7 +976,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain return(peak_position); } -int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { +int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue) { int **rxdata = ue->common_vars.rxdata; NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; @@ -1030,36 +1030,8 @@ int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { } } - // Fractional frequency offset computation according to Cross-correlation Synchronization Algorithm Using PSS - // Shoujun Huang, Yongtao Su, Ying He and Shan Tang, "Joint time and frequency offset estimation in LTE downlink," - // 7th International Conference on Communications and Networking in China, 2012. - - // Computing cross-correlation at peak on half the symbol size for first half of data - int64_t result1 = dot_product64((short*)primary_synchro_time_nr[Nid2], - (short*) &(rxdata[0][peak_position]), - frame_parms->ofdm_symbol_size>>1, - shift); - - // Computing cross-correlation at peak on half the symbol size for data shifted by half symbol size - // as it is real and complex it is necessary to shift by a value equal to symbol size to obtain such shift - int64_t result2 = dot_product64((short*)primary_synchro_time_nr[Nid2]+(frame_parms->ofdm_symbol_size), - (short*) &(rxdata[0][peak_position])+frame_parms->ofdm_symbol_size, - frame_parms->ofdm_symbol_size>>1, - shift); - - int64_t re1 = ((int*) &result1)[0]; - int64_t re2 = ((int*) &result2)[0]; - int64_t im1 = ((int*) &result1)[1]; - int64_t im2 = ((int*) &result2)[1]; - - // Estimation of fractional frequency offset: angle[(result1)'*(result2)]/pi - double ffo_est = atan2(re1*im2-re2*im1,re1*re2+im1*im2)/M_PI; - - // Computing absolute value of frequency offset - *f_off = ffo_est*frame_parms->subcarrier_spacing; - - LOG_D(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB, ffo %lf\n", - peak_position, peak_position_diff, dB_fixed64(peak_value),dB_fixed64(avg),ffo_est); + LOG_D(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB\n", + peak_position, peak_position_diff, dB_fixed64(peak_value),dB_fixed64(avg)); return peak_position_diff; } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 732d975be4..0b543da275 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1648,7 +1648,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { - nr_adjust_pss_synch(ue, (int *)&ue->common_vars.freq_offset); + nr_adjust_pss_synch(ue); LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); nr_ue_pbch_procedures(gNB_id, ue, proc, 0); From 8a428d734ebaf8dbbf4435e158b96e3557053089 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 4 Jan 2022 11:52:16 +0000 Subject: [PATCH 081/196] Fix nr_pbchsim to avoid multiple ffo compensations for each trial on input samples --- openair1/SIMULATION/NR_PHY/pbchsim.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 1169b8ecd8..a5c6222fe5 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -655,13 +655,6 @@ int main(int argc, char **argv) frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples); printf("txlev %d (%f)\n",txlev,10*log10(txlev));*/ - - for (i=0; inb_antennas_tx; aa++) { - r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]); - r_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]); - } - } for (SNR=snr0; SNRnb_antennas_tx; aa++) { + r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]); + r_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]); + } + } + // multipath channel //multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0); @@ -697,13 +698,11 @@ int main(int argc, char **argv) 0.0, // IQ imbalance (dB), 0.0); // IQ phase imbalance (rad) - for (i=0; inb_antennas_rx; aa++) { - - ((short*) UE->common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); - ((short*) UE->common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); - } + for (aa=0; aanb_antennas_rx; aa++) { + ((short*) UE->common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); + ((short*) UE->common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); + } } if (n_trials==1) { From d4f408062623901d67e02d60be3c82c5de2bb608 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 5 Jan 2022 14:00:09 +0000 Subject: [PATCH 082/196] Revert "Revert "Merge remote-tracking branch 'origin/develop' into ue-phy-sync-improvements"" This reverts commit 29268d0a66c1a88a0058de066ce5968e9d8bfe3d. --- ci-scripts/Jenkinsfile-trig-nsa | 11 +- ci-scripts/checkCodingFormattingRules.sh | 4 +- ci-scripts/conf_files/benetel-5g.conf | 22 - .../enb.band38.lte_2x2.100PRB.usrpn310.conf | 2 +- .../enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- .../gNB_SA_n78_106PRB.2x2_usrpn310.conf | 29 - .../gNB_SA_n78_133PRB.2x2_usrpn310.conf | 29 - .../gnb.band261.tm1.32PRB.usrpn300.conf | 26 +- .../gnb.band66.tm1.106PRB.usrpn300.conf | 22 +- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 21 - ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 29 - .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 659 +++++++++--------- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 316 +++++++++ .../gnb.band78.tm1.106PRB.usrpn300.conf | 24 +- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 21 - .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 28 - ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 +- .../fr1_nsa_2x2_quectel_attach_detach.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 6 +- ci-scripts/xml_files/fr1_sa_oaiue_x300.xml | 123 ++++ .../xml_files/fr1_sa_quectel_162prb.xml | 129 ++++ .../fr1_sa_quectel_stages_162prb.xml | 166 +++++ cmake_targets/CMakeLists.txt | 10 +- common/utils/nr/nr_common.c | 54 +- common/utils/nr/nr_common.h | 11 +- common/utils/threadPool/Makefile | 14 +- common/utils/threadPool/thread-pool.c | 45 +- common/utils/threadPool/thread-pool.h | 5 +- doc/testing_gnb_w_cots_ue_resources/gnb.conf | 37 - executables/nr-gnb.c | 10 +- executables/nr-ue.c | 2 +- openair1/PHY/CODING/crc.h | 543 +++++++++++++++ openair1/PHY/CODING/crc_byte.c | 86 ++- openair1/PHY/CODING/crcext.h | 89 +++ openair1/PHY/CODING/nrLDPC_defs.h | 37 +- .../nrLDPC_encoder/ldpc_encode_parity_check.c | 15 +- .../PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c | 2 - .../nrLDPC_encoder/ldpc_encoder_optim.c | 25 +- .../nrLDPC_encoder/ldpc_encoder_optim8seg.c | 18 +- .../ldpc_encoder_optim8segmulti.c | 94 ++- openair1/PHY/CODING/types.h | 98 +++ openair1/PHY/INIT/nr_init_ue.c | 2 +- openair1/PHY/INIT/nr_parms.c | 1 - openair1/PHY/LTE_REFSIG/lte_refsig.h | 3 +- openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c | 75 -- openair1/PHY/LTE_TRANSPORT/lte_mcs.c | 22 +- openair1/PHY/LTE_TRANSPORT/pcfich.c | 2 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 2 +- .../LTE_TRANSPORT/transport_common_proto.h | 2 +- openair1/PHY/LTE_TRANSPORT/transport_proto.h | 46 +- openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c | 2 +- .../PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 54 +- .../LTE_UE_TRANSPORT/dlsch_llr_computation.c | 6 +- openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c | 4 +- .../PHY/LTE_UE_TRANSPORT/transport_proto_ue.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 209 ++++-- openair1/PHY/NR_TRANSPORT/nr_dlsch.h | 3 +- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 389 +++++------ openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c | 5 - .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 46 +- .../nr_dlsch_llr_computation.c | 2 +- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 39 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 5 +- openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c | 4 +- openair1/PHY/defs_gNB.h | 17 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 5 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 27 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 29 +- openair1/SIMULATION/NR_PHY/dlsim.c | 45 +- openair1/SIMULATION/NR_PHY/nr_unitary_defs.h | 162 +---- openair1/SIMULATION/NR_PHY/ulsim.c | 8 +- openair2/COMMON/rrc_messages_types.h | 2 +- openair2/GNB_APP/RRC_nr_paramsvalues.h | 194 ------ openair2/GNB_APP/gnb_config.c | 127 +++- openair2/GNB_APP/gnb_paramdef.h | 6 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 39 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 10 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 54 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 42 +- openair2/LAYER2/NR_MAC_gNB/main.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 6 +- openair2/RRC/NR/nr_rrc_config.c | 159 ++--- openair2/RRC/NR/nr_rrc_config.h | 25 +- openair2/RRC/NR/nr_rrc_defs.h | 2 +- openair2/RRC/NR/rrc_gNB.c | 77 +- openair2/RRC/NR/rrc_gNB_nsa.c | 4 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 16 +- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 22 - .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 23 - .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 21 - .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 22 - .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 21 - .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 21 - .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 21 - .../gnb.band78.106PRB.30kHz,usrpb2x0.conf | 21 - .../CONF/gnb.band78.106PRB.slave.conf | 21 - .../CONF/gnb.band78.slave.conf | 21 - .../gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 23 - .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 21 - .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 22 - .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 23 - .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 21 - .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 21 - .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 23 - .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 23 - .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 23 - .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 21 - .../CONF/rcc.band78.tm1.106PRB.nfapi.conf | 39 -- .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 21 - .../CONF/testing_gnb_24PRB.conf | 36 - .../CONF/testing_gnb_n310.conf | 21 - .../CONF/testing_gnb_nsa_n310.conf | 21 - .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 39 -- ...b.band78.tm1.106PRB.usrpn300.gtp-itti.conf | 38 - .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 22 - ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 22 - .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 22 - ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 39 -- 120 files changed, 2814 insertions(+), 2796 deletions(-) create mode 100644 ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf create mode 100644 ci-scripts/xml_files/fr1_sa_oaiue_x300.xml create mode 100644 ci-scripts/xml_files/fr1_sa_quectel_162prb.xml create mode 100644 ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml create mode 100644 openair1/PHY/CODING/crc.h create mode 100644 openair1/PHY/CODING/crcext.h create mode 100644 openair1/PHY/CODING/types.h delete mode 100644 openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index 4a56270e90..7b4238d678 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -88,7 +88,15 @@ pipeline { // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) //] //calling OAIUE N310 - build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ + //build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ + // string(name: 'eNB_MR', value: String.valueOf(MR)), + // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + //] + //calling OAIUE N310-X300 + build job: "RAN-SA-OAIUE-N310-X300-CN5G", wait : true, propagate : false, parameters: [ string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), @@ -96,7 +104,6 @@ pipeline { booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) ] - } } } diff --git a/ci-scripts/checkCodingFormattingRules.sh b/ci-scripts/checkCodingFormattingRules.sh index 45cf08aa9a..a805f765df 100755 --- a/ci-scripts/checkCodingFormattingRules.sh +++ b/ci-scripts/checkCodingFormattingRules.sh @@ -77,7 +77,7 @@ then IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE || true` IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FILE || true` - IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h" || true` + IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc|openair1/PHY/CODING/types.h" || true` if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] then if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ] @@ -198,7 +198,7 @@ do IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE || true` IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FULLFILE || true` - IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h" || true` + IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc|openair1/PHY/CODING/types.h" || true` if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] then if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ] diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 47898aad15..79b2f7f877 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -119,19 +110,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; #p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index d2e91fb872..758bb44879 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 6c8d5ba6f0..d1d32e2b58 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 9bf3136690..77693d5f72 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -89,19 +89,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -156,22 +143,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 2; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=4 - initialULBWPstartSymbolAndLength_1 = 52; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index dfbbdf659d..c9b369eaff 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -86,19 +86,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 10; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -153,22 +140,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=4 - initialULBWPstartSymbolAndLength_1 = 52; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index e93177e7cc..4338c00b36 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; servingCellConfigCommon = ( { @@ -55,15 +55,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,21 +109,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 14; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 850cf9a60c..1c2133bebe 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -24,6 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; servingCellConfigCommon = ( { @@ -54,15 +55,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,18 +110,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index c8dc1477b0..b0a757c9d0 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -55,15 +55,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,18 +109,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index e8be5a6ef0..16456f939c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -90,19 +90,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -157,22 +144,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=4 - initialULBWPstartSymbolAndLength_1 = 52; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index f00a343089..ff05aa6e65 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -1,343 +1,316 @@ -Active_gNBs = ( "gNB-OAI"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -gNBs = -( - { - ////////// Identification parameters: - gNB_CU_ID = 0xe00; - -# cell_type = "CELL_MACRO_GNB"; - - gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; - - plmn_list = ({ - mcc = 208; - mnc = 97; - mnc_length = 2; - snssaiList = ( - { - sst = 1; - sd = 0x010203; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true - } - ); - }); - - nr_cellid = 12345678L - -# tr_s_preference = "local_mac" - - ////////// Physical parameters: - - ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - #pusch_TargetSNRx10 = 200; - #pucch_TargetSNRx10 = 200; - ul_prbblacklist = "51,52,53,54" - - pdcch_ConfigSIB1 = ( - { - controlResourceSetZero = 11; - searchSpaceZero = 0; - } - ); - - servingCellConfigCommon = ( - { - #spCellConfigCommon - - physCellId = 0; - -# downlinkConfigCommon - #frequencyInfoDL - # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 - #absoluteFrequencySSB = 620640; - # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 - absoluteFrequencySSB = 621312; - # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 - #absoluteFrequencySSB = 634080; - # this is 3600.48 MHz - #absoluteFrequencySSB = 640032; - #dl_frequencyBand = 78; - # this is 3301.68 MHz - #dl_absoluteFrequencyPointA = 620112; - # this is 3300.60 MHz - dl_absoluteFrequencyPointA = 620040; - # this is 3502.56 MHz - #dl_absoluteFrequencyPointA = 633552; - # this is 3600.48 MHz - #dl_absoluteFrequencyPointA = 640032; - #scs-SpecificCarrierList - dl_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_subcarrierSpacing = 1; - dl_carrierBandwidth = 106; - #initialDownlinkBWP - #genericParameters - # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialDLBWPsubcarrierSpacing = 1; - #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 11; - initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; - - #uplinkConfigCommon - #frequencyInfoUL - ul_frequencyBand = 78; - #scs-SpecificCarrierList - ul_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 106; - pMax = 20; - #initialUplinkBWP - #genericParameters - initialULBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialULBWPsubcarrierSpacing = 1; - #rach-ConfigCommon - #rach-ConfigGeneric - prach_ConfigurationIndex = 98; -#prach_msg1_FDM -#0 = one, 1=two, 2=four, 3=eight - prach_msg1_FDM = 0; - prach_msg1_FrequencyStart = 0; - zeroCorrelationZoneConfig = 12; - preambleReceivedTargetPower = -104; -#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) - preambleTransMax = 6; -#powerRampingStep -# 0=dB0,1=dB2,2=dB4,3=dB6 - powerRampingStep = 1; -#ra_ReponseWindow -#1,2,4,8,10,20,40,80 - ra_ResponseWindow = 4; -#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR -#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen - ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; -#oneHalf (0..15) 4,8,12,16,...60,64 - ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; -#ra_ContentionResolutionTimer -#(0..7) 8,16,24,32,40,48,56,64 - ra_ContentionResolutionTimer = 7; - rsrp_ThresholdSSB = 19; -#prach-RootSequenceIndex_PR -#1 = 839, 2 = 139 - prach_RootSequenceIndex_PR = 2; - prach_RootSequenceIndex = 1; - # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex - # - msg1_SubcarrierSpacing = 1, -# restrictedSetConfig -# 0=unrestricted, 1=restricted type A, 2=restricted type B - restrictedSetConfig = 0, - - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=4 - initialULBWPstartSymbolAndLength_1 = 52; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - - msg3_DeltaPreamble = 1; - p0_NominalWithGrant =-90; - -# pucch-ConfigCommon setup : -# pucchGroupHopping -# 0 = neither, 1= group hopping, 2=sequence hopping - pucchGroupHopping = 0; - hoppingId = 40; - p0_nominal = -90; -# ssb_PositionsInBurs_BitmapPR -# 1=short, 2=medium, 3=long - ssb_PositionsInBurst_PR = 2; - ssb_PositionsInBurst_Bitmap = 1; - -# ssb_periodicityServingCell -# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 - ssb_periodicityServingCell = 2; - -# dmrs_TypeA_position -# 0 = pos2, 1 = pos3 - dmrs_TypeA_Position = 0; - -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - subcarrierSpacing = 1; - - - #tdd-UL-DL-ConfigurationCommon -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - referenceSubcarrierSpacing = 1; - # pattern1 - # dl_UL_TransmissionPeriodicity - # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 - dl_UL_TransmissionPeriodicity = 6; - nrofDownlinkSlots = 7; - nrofDownlinkSymbols = 6; - nrofUplinkSlots = 2; - nrofUplinkSymbols = 4; - - ssPBCH_BlockPower = -25; - } - - ); - - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; - GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - } -); - -MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } -); - -L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 2; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 75; - eNB_instances = [0]; - ##beamforming 1x2 matrix: 1 layer x 2 antennas - bf_weights = [0x00007fff, 0x0000]; - ##beamforming 1x4 matrix: 1 layer x 4 antennas - #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; - ## beamforming 2x2 matrix: - # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; - ## beamforming 4x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" - } -); - -THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } -); - -security = { - # preferred ciphering algorithms - # the first one of the list that an UE supports in chosen - # valid values: nea0, nea1, nea2, nea3 - ciphering_algorithms = ( "nea0" ); - - # preferred integrity algorithms - # the first one of the list that an UE supports in chosen - # valid values: nia0, nia1, nia2, nia3 - integrity_algorithms = ( "nia2", "nia0" ); - - # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter - # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' - drb_ciphering = "yes"; - drb_integrity = "no"; -}; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + min_rxtxtime_pdsch = 6; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf new file mode 100644 index 0000000000..ff05aa6e65 --- /dev/null +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -0,0 +1,316 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + min_rxtxtime_pdsch = 6; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 4200300c50..6ade355053 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; servingCellConfigCommon = ( { @@ -55,15 +55,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,19 +109,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 38; # this is SS=10 L=3 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 015d9ee0d0..b7a04b1f36 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -52,15 +52,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -115,18 +106,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index e6bbbf2d41..299a19cc4e 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -53,19 +53,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0;#for DL slot - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0;#for mixed slot - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -120,21 +107,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 2; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 86af12b53e..2516af9429 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -24,7 +24,7 @@ TEST-NSA-FR1-TM2-Tab1 NSA 2x2 Ping DL UL with QUECTEL tasks - 5 + 1 030000 040000 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index 2d17ff38e2..52cf1ec6e8 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -24,7 +24,7 @@ TEST-NSA-FR1-TM2-Tab2 NSA 2x2 Attach-Detach with QUECTEL tasks - 5 + 1 031000 041000 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index 28eee1e224..cd79e49f2c 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -22,7 +22,7 @@ --> TEST-SA-FR1-Tab1 - SA Ping DL UL with OAI NR UE + SA Ping DL UL with OAI NR UE (N310) tasks 1 @@ -40,9 +40,9 @@ Initialize_OAI_UE - Initialize OAI UE + Initialize OAI UE (N310) nr - --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation + --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml new file mode 100644 index 0000000000..d527737b3c --- /dev/null +++ b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml @@ -0,0 +1,123 @@ + + + TEST-SA-FR1-Tab2 + SA Ping DL UL with OAI NR UE (X300) + tasks + 1 + + 040000 + 000002 + 010000 + 000002 + 050000 + 050001 + 000001 + 010002 + 080000 + + + + + Initialize_OAI_UE + Initialize OAI UE (X300) + nr + --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "addr=192.168.60.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation + + + + Terminate_OAI_UE + Terminate OAI UE + + + + + Initialize_eNB + Initialize gNB + -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1 + 0 + 0 + nr + yes + yes + 192.168.18.240 + + + + IdleSleep + Sleep + 5 + + + + IdleSleep + Sleep + 20 + + + + + Ping + Ping from CN to UE: 20pings in 20sec + -c 20 + 5 + + + + Ping + Ping from CN to UE: 100pings in 20sec + -c 100 -i 0.2 + 5 + + + + Iperf + iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) + -u -b 60M -t 60 + DL + nrmodule2_quectel + 5 + single-ue + + + + Iperf + iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) + -u -b 3M -t 60 + UL + nrmodule2_quectel + 5 + single-ue + + + + + Terminate_eNB + Terminate gNB + 0 + 0 + nr + + + + diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml new file mode 100644 index 0000000000..2088678707 --- /dev/null +++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml @@ -0,0 +1,129 @@ + + + TEST-SA-FR1-Tab3 + SA Ping DL UL with QUECTEL + tasks + 1 + + 040000 + 000002 + 010000 + 000001 + 050000 + 050001 + 070000 + 070001 + 000001 + 010002 + 080000 + + + + + Initialize_UE + Initialize Quectel + nrmodule2_quectel + yes + + + + + Terminate_UE + Terminate Quectel + nrmodule2_quectel + + + + + Initialize_eNB + Initialize gNB + -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 + 0 + 0 + nr + yes + yes + 192.168.18.240 + + + + IdleSleep + Sleep + 5 + + + + IdleSleep + Sleep + 20 + + + + + Ping + Ping: 20pings in 20sec + nrmodule2_quectel + -c 20 + 5 + + + + Ping + Ping: 100pings in 20sec + nrmodule2_quectel + -c 100 -i 0,2 + 5 + + + + Iperf + iperf (DL/140Mbps/UDP)(60 sec)(single-ue profile) + -u -b 140M -t 60 + DL + nrmodule2_quectel + 5 + single-ue + + + + Iperf + iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) + -u -b 3M -t 60 + UL + nrmodule2_quectel + 5 + single-ue + + + + + Terminate_eNB + Terminate gNB + 0 + 0 + nr + + + + diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml new file mode 100644 index 0000000000..4b2400a4ac --- /dev/null +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml @@ -0,0 +1,166 @@ + + + TEST-SA-FR1-Tab4 + SA Staged DL with QUECTEL + tasks + 1 + + 040000 + 000002 + 010000 + 000001 + 050000 + 000001 + 070000 + 000001 + 070001 + 000001 + 070002 + 000001 + 070003 + 000001 + 070004 + 000001 + 070005 + 000001 + 010002 + 080000 + + + + + Initialize_UE + Initialize Quectel + nrmodule2_quectel + yes + + + + + Terminate_UE + Terminate Quectel + nrmodule2_quectel + + + + + Initialize_eNB + Initialize gNB + -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 + 0 + 0 + nr + yes + yes + 192.168.18.240 + + + + IdleSleep + Sleep + 5 + + + + IdleSleep + Sleep + 20 + + + + + Ping + Ping: 20pings in 20sec + nrmodule2_quectel + -c 20 + 5 + + + + + Iperf + iperf (DL/10Mbps/UDP)(30 sec)(single-ue profile) + -u -b 10M -t 30 + DL + nrmodule2_quectel + 5 + single-ue + + + Iperf + iperf (DL/20Mbps/UDP)(30 sec)(single-ue profile) + -u -b 20M -t 30 + DL + nrmodule2_quectel + 5 + single-ue + + + Iperf + iperf (DL/40Mbps/UDP)(30 sec)(single-ue profile) + -u -b 40M -t 30 + DL + nrmodule2_quectel + 5 + single-ue + + + Iperf + iperf (DL/60Mbps/UDP)(30 sec)(single-ue profile) + -u -b 60M -t 30 + DL + nrmodule2_quectel + 5 + single-ue + + + Iperf + iperf (DL/90Mbps/UDP)(30 sec)(single-ue profile) + -u -b 90M -t 30 + DL + nrmodule2_quectel + 5 + single-ue + + + Iperf + iperf (DL/140Mbps/UDP)(30 sec)(single-ue profile) + -u -b 140M -t 30 + DL + nrmodule2_quectel + 5 + single-ue + + + + + Terminate_eNB + Terminate gNB + 0 + 0 + nr + + + + diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 329ed7bb3d..f513ac0563 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1,4 +1,4 @@ -#/* +#/* # * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more # * contributor license agreements. See the NOTICE file distributed with # * this work for additional information regarding copyright ownership. @@ -308,7 +308,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") set(COMPILATION_AVX2 "False") endif() if (CPUINFO MATCHES "sse4_1") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1 -mpclmul") endif() if (CPUINFO MATCHES "ssse3") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3") @@ -889,7 +889,7 @@ set(HWLIB_BENETEL_4G_SOURCE ) add_library(benetel_4g MODULE ${HWLIB_BENETEL_4G_SOURCE} ) -set_target_properties(benetel_4g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") +set_target_properties(benetel_4g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") TARGET_LINK_LIBRARIES(benetel_4g ${DPDK_LIBS}) @@ -907,7 +907,7 @@ set(HWLIB_BENETEL_5G_SOURCE ) add_library(benetel_5g MODULE ${HWLIB_BENETEL_5G_SOURCE} ) -set_target_properties(benetel_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") +set_target_properties(benetel_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") TARGET_LINK_LIBRARIES(benetel_5g ${DPDK_LIBS}) @@ -993,7 +993,6 @@ add_boolean_option(TRACE_RLC_AM_HOLE False "TRACE for RLC AM, TO BE CHANGE add_boolean_option(TRACE_RLC_AM_PDU False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_RESEGMENT False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_RX False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") -add_boolean_option(TRACE_RLC_AM_RX_DECODE False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_TX False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_TX_STATUS False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_STATUS_CREATION False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") @@ -1572,7 +1571,6 @@ set(PHY_SRC_COMMON ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_scrambling.c - ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_gold_generic.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/srs_modulation.c ${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index a704a66c76..0de24bcf6d 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -257,6 +257,48 @@ void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) { *n_rb = 6*count; } +int get_nb_periods_per_frame(uint8_t tdd_period) { + + int nb_periods_per_frame; + switch(tdd_period) { + case 0: + nb_periods_per_frame = 20; // 10ms/0p5ms + break; + + case 1: + nb_periods_per_frame = 16; // 10ms/0p625ms + break; + + case 2: + nb_periods_per_frame = 10; // 10ms/1ms + break; + + case 3: + nb_periods_per_frame = 8; // 10ms/1p25ms + break; + + case 4: + nb_periods_per_frame = 5; // 10ms/2ms + break; + + case 5: + nb_periods_per_frame = 4; // 10ms/2p5ms + break; + + case 6: + nb_periods_per_frame = 2; // 10ms/5ms + break; + + case 7: + nb_periods_per_frame = 1; // 10ms/10ms + break; + + default: + AssertFatal(1==0,"Undefined tdd period %d\n", tdd_period); + } + return nb_periods_per_frame; +} + int get_dmrs_port(int nl, uint16_t dmrs_ports) { @@ -276,14 +318,6 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports) { return p; } -int get_num_dmrs(uint16_t dmrs_mask ) { - - int num_dmrs=0; - - for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); - return(num_dmrs); -} - lte_frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index) { lte_frame_type_t current_type; @@ -472,6 +506,10 @@ int get_subband_size(int NPRB,int size) { } +int get_SLIV(uint8_t S, uint8_t L) { + return ( (uint16_t)(((L-1)<=7)? (14*(L-1)+S) : (14*(15-L)+(13-S))) ); +} + void SLIV2SL(int SLIV,int *S,int *L) { int SLIVdiv14 = SLIV/14; diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index d9f2b0c03a..44a6e05577 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -50,9 +50,17 @@ typedef struct nr_bandentry_s { extern const size_t nr_bandtable_size; extern nr_bandentry_t nr_bandtable[]; +static inline int get_num_dmrs(uint16_t dmrs_mask ) { + int num_dmrs=0; + + for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); + return(num_dmrs); +} + + +int get_SLIV(uint8_t S, uint8_t L); void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset); -int get_num_dmrs(uint16_t dmrs_mask); uint16_t config_bandwidth(int mu, int nb_rb, int nr_band); int get_nr_table_idx(int nr_bandP, uint8_t scs_index); int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index); @@ -71,6 +79,7 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); int get_subband_size(int NPRB,int size); void SLIV2SL(int SLIV,int *S,int *L); int get_dmrs_port(int nl, uint16_t dmrs_ports); +int get_nb_periods_per_frame(uint8_t tdd_period); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) diff --git a/common/utils/threadPool/Makefile b/common/utils/threadPool/Makefile index 6b28eb2ba8..729f9dd0e2 100644 --- a/common/utils/threadPool/Makefile +++ b/common/utils/threadPool/Makefile @@ -1,13 +1,3 @@ -all: -measurement_display thread-pool-test - -measurement_display: -measurement_display.c thread-pool.h -gcc measurement_display.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o -measurement_display - -thread-pool-test: -thread-pool.c thread-pool.h -gcc -g thread-pool.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -I $ {OPENAIR_DIR}/openair2/COMMON $ {OPENAIR_DIR}/common/utils/LOG/log.c $ {OPENAIR_DIR}/common/config/config_userapi.c -$ {OPENAIR_DIR}/common/config/config_load_configmodule.c $ {OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o thread-pool-test +thread-pool-test: thread-pool.c thread-pool.h + gcc -g -O3 thread-pool.c -I ${OPENAIR_DIR}/nfapi/open-nFAPI/nfapi/public_inc -I ${OPENAIR_DIR}/ -I ${OPENAIR_DIR}/common/utils/ -I. ${OPENAIR_DIR}/common/utils/backtrace.c -I ${OPENAIR_DIR}/openair2/COMMON ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/LOG/log.c ${OPENAIR_DIR}/common/config/config_userapi.c ${OPENAIR_DIR}/common/config/config_load_configmodule.c ${OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -DMAX_NUM_CCs=1 -I../LOG -I../../utils/T -o thread-pool-test diff --git a/common/utils/threadPool/thread-pool.c b/common/utils/threadPool/thread-pool.c index 77729ae7a7..fff09528a8 100644 --- a/common/utils/threadPool/thread-pool.c +++ b/common/utils/threadPool/thread-pool.c @@ -155,21 +155,24 @@ void initNamedTpool(char *params,tpool_t *pool, bool performanceMeas, char *name } #ifdef TEST_THREAD_POOL +volatile int oai_exit=0; void exit_function(const char *file, const char *function, const int line, const char *s) { } struct testData { int id; + int sleepTime; char txt[30]; }; void processing(void *arg) { struct testData *in=(struct testData *)arg; - printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); + //printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); sprintf(in->txt,"Done by %ld, job %d", pthread_self(), in->id); - usleep(rand()%100); - printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); + in->sleepTime=rand()%1000; + usleep(in->sleepTime); + //printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); } int main() { @@ -208,11 +211,43 @@ int main() { } while(tmp); tpool_t pool; - char params[]="1,2,3,u"; + char params[]="1,2,3,4,5"; initTpool(params,&pool, true); notifiedFIFO_t worker_back; initNotifiedFIFO(&worker_back); + sleep(1); + int cumulProcessTime=0, cumulTime=0; + struct timespec st,end; + clock_gettime(CLOCK_MONOTONIC, &st); + int nb_jobs=4; + for (int i=0; i <1000 ; i++) { + int parall=nb_jobs; + for (int j=0; j id=i; + pushTpool(&pool, work); + } + int sleepmax=0; + while (parall) { + tmp=pullTpool(&worker_back,&pool); + if (tmp) { + parall--; + struct testData *dd=NotifiedFifoData(tmp); + if (dd->sleepTime > sleepmax) + sleepmax=dd->sleepTime; + delNotifiedFIFO_elt(tmp); + } + } + cumulProcessTime+=sleepmax; + } + clock_gettime(CLOCK_MONOTONIC, &end); + long long dur=(end.tv_sec-st.tv_sec)*1000*1000+(end.tv_nsec-st.tv_nsec)/1000; + printf("In µs, Total time per group of %d job:%lld, work time per job %d, overhead per job %lld\n", + nb_jobs, dur/1000, cumulProcessTime/1000, (dur-cumulProcessTime)/(1000*nb_jobs)); + + /* for (int i=0; i <1000 ; i++) { notifiedFIFO_elt_t *work=newNotifiedFIFO_elt(sizeof(struct testData), i, &worker_back, processing); struct testData *x=(struct testData *)NotifiedFifoData(work); @@ -232,7 +267,7 @@ int main() { abortTpool(&pool,510); } while(tmp); - + */ return 0; } #endif diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index a32b7c3859..1839b42f39 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -31,6 +31,7 @@ #include #include #include +//#include #ifdef DEBUG #define THREADINIT PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP @@ -50,7 +51,7 @@ AssertFatal(ret==0,"ret=%d\n",ret);} #define condbroadcast(signal) {int ret=pthread_cond_broadcast(&signal); \ AssertFatal(ret==0,"ret=%d\n",ret);} -#define condsignal(signal) {int ret=pthread_cond_broadcast(&signal); \ +#define condsignal(signal) {int ret=pthread_cond_signal(&signal); \ AssertFatal(ret==0,"ret=%d\n",ret);} #define tpool_nbthreads(tpool) (tpool.nbThreads) typedef struct notifiedFIFO_elt_s { @@ -130,7 +131,7 @@ static inline void pushNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf, notifiedFIF static inline void pushNotifiedFIFO(notifiedFIFO_t *nf, notifiedFIFO_elt_t *msg) { mutexlock(nf->lockF); pushNotifiedFIFO_nothreadSafe(nf,msg); - condbroadcast(nf->notifF); + condsignal(nf->notifF); mutexunlock(nf->lockF); } diff --git a/doc/testing_gnb_w_cots_ue_resources/gnb.conf b/doc/testing_gnb_w_cots_ue_resources/gnb.conf index 97935f92ee..aae22a92ba 100755 --- a/doc/testing_gnb_w_cots_ue_resources/gnb.conf +++ b/doc/testing_gnb_w_cots_ue_resources/gnb.conf @@ -53,29 +53,7 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57) - initialDLBWPstartSymbolAndLength_3 = 57; //43; //57; #uplinkConfigCommon #frequencyInfoUL ul_frequencyBand = 78; @@ -129,21 +107,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 2; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index e9fc06ce4a..dc8960846f 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -401,15 +401,15 @@ void init_gNB_Tpool(int inst) { LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU); int threadCnt = min(numCPU, gNB->pusch_proc_threads); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); - char ul_pool[80]; - sprintf(ul_pool,"-1"); + char pool[80]; + sprintf(pool,"-1"); int s_offset = 0; for (int icpu=1; icputhreadPool, false); + if (getenv("noThreads")) strcpy(pool, "n"); + initTpool(pool, gNB->threadPool, false); // ULSCH decoder result FIFO gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->respDecode); diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 702c214d9e..6694635e26 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -783,7 +783,7 @@ void init_NR_UE_threads(int nb_inst) { /* HACK: this function is needed to compile the UE * fix it somehow */ -int8_t find_dlsch(uint16_t rnti, +int find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB, find_type_t type) { diff --git a/openair1/PHY/CODING/crc.h b/openair1/PHY/CODING/crc.h new file mode 100644 index 0000000000..d6474eae9b --- /dev/null +++ b/openair1/PHY/CODING/crc.h @@ -0,0 +1,543 @@ +/******************************************************************************* + Copyright (c) 2009-2018, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/** + * Header file for module with CRC computation methods + * + * PCLMULQDQ implementation is based on work by: + * Erdinc Ozturk + * Vinodh Gopal + * James Guilford + * + * "Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction" + * URL: http://download.intel.com/design/intarch/papers/323102.pdf + */ + +#ifndef __CRC_H__ +#define __CRC_H__ + +#include + +#include "crcext.h" +#include "types.h" +#include +#include + +/** + * PCLMULQDQ CRC computation context structure + */ +struct crc_pclmulqdq_ctx { + /** + * K1 = reminder X^128 / P(X) : 0-63 + * K2 = reminder X^192 / P(X) : 64-127 + */ + uint64_t k1; + uint64_t k2; + + /** + * K3 = reminder X^64 / P(X) : 0-63 + * q = quotient X^64 / P(X) : 64-127 + */ + uint64_t k3; + uint64_t q; + + /** + * p = polynomial / P(X) : 0-63 + * res = reserved : 64-127 + */ + uint64_t p; + uint64_t res; +}; + +/** + * Functions and prototypes + */ + +/** + * @brief Initializes look-up-table (LUT) for given 8 bit polynomial + * + * @param poly CRC polynomial + * @param lut pointer to look-up-table to be initialized + */ +void crc8_init_lut(const uint8_t poly, uint8_t *lut); + +/** + * @brief Calculates 8 bit CRC using LUT method. + * + * @param crc CRC initial value + * @param data pointer to data block to calculate CRC for + * @param data_len size of data block + * @param lut 256x8bits look-up-table pointer + * + * @return New CRC value + */ +__forceinline +uint8_t crc8_calc_lut(const uint8_t *data, + uint32_t data_len, + uint8_t crc, + const uint8_t *lut) +{ + if (unlikely(data == NULL || lut == NULL)) + return crc; + + while (data_len--) + crc = lut[*data++ ^ crc]; + + return crc; +} + +/** + * @brief Initializes look-up-table (LUT) for given 16 bit polynomial + * + * @param poly CRC polynomial + * @param lut pointer to 256x16bits look-up-table to be initialized + */ +void crc16_init_lut(const uint16_t poly, uint16_t *lut); + +/** + * @brief Calculates 16 bit CRC using LUT method. + * + * @param crc CRC initial value + * @param data pointer to data block to calculate CRC for + * @param data_len size of data block + * @param lut 256x16bits look-up-table pointer + * + * @return New CRC value + */ +__forceinline +uint16_t crc16_calc_lut(const uint8_t *data, + uint32_t data_len, + uint16_t crc, + const uint16_t *lut) +{ + if (unlikely(data == NULL || lut == NULL)) + return crc; + + while (data_len--) + crc = lut[(crc >> 8) ^ *data++] ^ (crc << 8); + + return crc; +} + +/** + * @brief Initializes look-up-table (LUT) for given 32 bit polynomial + * + * @param poly CRC polynomial + * @param lut pointer to 256x32bits look-up-table to be initialized + */ +void crc32_init_lut(const uint32_t poly, uint32_t *lut); + +/** + * @brief Calculates 32 bit CRC using LUT method. + * + * @param crc CRC initial value + * @param data pointer to data block to calculate CRC for + * @param data_len size of data block + * @param lut 256x32bits look-up-table pointer + * + * @return New CRC value + */ +__forceinline +uint32_t crc32_calc_lut(const uint8_t *data, + uint32_t data_len, + uint32_t crc, + const uint32_t *lut) +{ + if (unlikely(data == NULL || lut == NULL)) + return crc; + + while (data_len--) + crc = lut[(crc >> 24) ^ *data++] ^ (crc << 8); + + return crc; +} + +/** + * @brief Initializes look up tables for slice-By-2 method. + * + * @param poly CRC polynomial + * @param slice1 slice-by-2 look-up-table 1 + * @param slice2 slice-by-2 look-up-table 2 + * + * @return New CRC value + */ +void crc16_init_slice2(const uint16_t poly, + uint16_t *slice1, + uint16_t *slice2); + +/** + * @brief Calculates 16 bit CRC using Slice-By-2 method. + * + * @param crc CRC initial value + * @param data pointer to data block to calculate CRC for + * @param data_len size of data block + * @param slice1 256x16bits slice look-up-table 1 + * @param slice2 256x16bits slice look-up-table 2 + * + * @return New CRC value + */ +__forceinline +uint16_t crc16_calc_slice2(const uint8_t *data, + uint32_t data_len, + uint16_t crc, + const uint16_t *slice1, + const uint16_t *slice2) +{ + uint_fast32_t i; + + if (unlikely(data == NULL)) + return crc; + + if (unlikely(slice1 == NULL || slice2 == NULL)) + return crc; + + crc = bswap2(crc); + for (i = (data_len & (~1)), data += (data_len & (~1)); i != 0; + i -= sizeof(uint16_t)) { + crc ^= (*((const uint16_t *)(data - i))); + crc = slice2[(uint8_t)crc] ^ slice1[(uint8_t)(crc >> 8)]; + } + crc = bswap2(crc); + if (data_len & 1) + crc = (crc << 8) ^ bswap2(slice1[(crc >> 8) ^ *data]); + + return crc; +} + +/** + * @brief Initializes look up tables for slice-By-4 method. + * + * @param poly CRC polynomial + * @param slice1 256x32bits slice look-up-table 1 + * @param slice2 256x32bits slice look-up-table 2 + * @param slice3 256x32bits slice look-up-table 3 + * @param slice4 256x32bits slice look-up-table 4 + * + * @return New CRC value + */ +void crc32_init_slice4(const uint32_t poly, + uint32_t *slice1, uint32_t *slice2, + uint32_t *slice3, uint32_t *slice4); + +/** + * @brief Calculates 32 bit CRC using Slice-By-4 method. + * + * @param data pointer to data block to calculate CRC for + * @param data_len size of data block + * @param crc CRC initial value + * @param slice1 256x32bits slice look-up-table 1 + * @param slice2 256x32bits slice look-up-table 2 + * @param slice3 256x32bits slice look-up-table 3 + * @param slice4 256x32bits slice look-up-table 4 + * + * @return New CRC value + */ +__forceinline +uint32_t crc32_calc_slice4(const uint8_t *data, + uint32_t data_len, uint32_t crc, + const uint32_t *slice1, const uint32_t *slice2, + const uint32_t *slice3, const uint32_t *slice4) +{ + uint_fast32_t i; + + if (unlikely(data == NULL)) + return crc; + + if (unlikely(slice1 == NULL || slice2 == NULL || + slice3 == NULL || slice4 == NULL)) + return crc; + + crc = bswap4(crc); + for (i = data_len & (~3), data += (data_len & (~3)); i != 0; + i -= sizeof(uint32_t)) { + crc ^= (*((const uint32_t *)(data - i))); + crc = slice4[(uint8_t)(crc)] ^ + slice3[(uint8_t)(crc >> 8)] ^ + slice2[(uint8_t)(crc >> 16)] ^ + slice1[(uint8_t)(crc >> 24)]; + } + crc = bswap4(crc); + for (i = data_len & 3, data += (data_len & 3); i != 0; i--) + crc = (crc << 8) ^ + bswap4(slice1[(crc >> 24) ^ *(data - i)]); + + return crc; +} + +/** + * @brief Performs one folding round + * + * Logically function operates as follows: + * DATA = READ_NEXT_16BYTES(); + * F1 = LSB8(FOLD) + * F2 = MSB8(FOLD) + * T1 = CLMUL( F1, K1 ) + * T2 = CLMUL( F2, K2 ) + * FOLD = XOR( T1, T2, DATA ) + * + * @param data_block 16 byte data block + * @param k1_k2 k1 and k2 constanst enclosed in XMM register + * @param fold running 16 byte folded data + * + * @return New 16 byte folded data + */ +__forceinline +__m128i crc32_folding_round(const __m128i data_block, + const __m128i k1_k2, + const __m128i fold) +{ + __m128i tmp = _mm_clmulepi64_si128(fold, k1_k2, 0x11); + + return _mm_xor_si128(_mm_clmulepi64_si128(fold, k1_k2, 0x00), + _mm_xor_si128(data_block, tmp)); +} + +/** + * @brief Performs Barret's reduction from 128 bits to 64 bits + * + * @param data128 128 bits data to be reduced + * @param k3_q k3 and Q constants enclosed in XMM register + * + * @return data reduced to 64 bits + */ +__forceinline +__m128i crc32_reduce_128_to_64(__m128i data128, const __m128i k3_q) +{ + __m128i tmp; + + tmp = _mm_xor_si128(_mm_clmulepi64_si128(data128, k3_q, 0x01 /* k3 */), + data128); + + data128 = _mm_xor_si128(_mm_clmulepi64_si128(tmp, k3_q, 0x01 /* k3 */), + data128); + + return _mm_srli_si128(_mm_slli_si128(data128, 8), 8); +} + +/** + * @brief Performs Barret's reduction from 64 bits to 32 bits + * + * @param data64 64 bits data to be reduced + * @param k3_q k3 and Q constants enclosed in XMM register + * @param p_res P constant enclosed in XMM register + * + * @return data reduced to 32 bits + */ +__forceinline +uint32_t +crc32_reduce_64_to_32(__m128i fold, const __m128i k3_q, const __m128i p_res) +{ + __m128i temp; + + temp = _mm_clmulepi64_si128(_mm_srli_si128(fold, 4), + k3_q, 0x10 /* Q */); + temp = _mm_srli_si128(_mm_xor_si128(temp, fold), 4); + temp = _mm_clmulepi64_si128(temp, p_res, 0 /* P */); + return _mm_extract_epi32(_mm_xor_si128(temp, fold), 0); +} + +/** + * @brief Calculates 32 bit CRC for given \a data block by applying folding and + * reduction methods. + * + * Algorithm operates on 32 bit CRCs so polynomials and initial values may + * need to be promoted to 32 bits where required. + * + * @param crc initial CRC value (32 bit value) + * @param data pointer to data block + * @param data_len length of \a data block in bytes + * @param params pointer to PCLMULQDQ CRC calculation context + * + * @return CRC for given \a data block (32 bits wide). + */ +__forceinline +uint32_t +crc32_calc_pclmulqdq(const uint8_t *data, + uint32_t data_len, uint32_t crc, + const struct crc_pclmulqdq_ctx *params) +{ + __m128i temp, fold, k, swap; + uint32_t n; + + if (unlikely(data == NULL || data_len == 0 || params == NULL)) + return crc; + +#ifdef __KERNEL__ + /** + * Preserve FPU context + */ + kernel_fpu_begin(); +#endif + + /** + * Add 4 bytes to data block size + * This is to secure the following: + * CRC32 = M(X)^32 mod P(X) + * M(X) - message to compute CRC on + * P(X) - CRC polynomial + */ + data_len += 4; + + /** + * Load first 16 data bytes in \a fold and + * set \a swap BE<->LE 16 byte conversion variable + */ + fold = _mm_loadu_si128((__m128i *)data); + swap = crc_xmm_be_le_swap128; + + /** + * ------------------------------------------------- + * Folding all data into single 16 byte data block + * Assumes: \a fold holds first 16 bytes of data + */ + + if (unlikely(data_len <= 16)) { + /** + * Data block fits into 16 byte block + * - adjust data block + * - 4 least significant bytes need to be zero + */ + fold = _mm_shuffle_epi8(fold, swap); + fold = _mm_slli_si128(xmm_shift_right(fold, 20 - data_len), 4); + + /** + * Apply CRC init value + */ + temp = _mm_insert_epi32(_mm_setzero_si128(), bswap4(crc), 0); + temp = xmm_shift_left(temp, data_len - 4); + fold = _mm_xor_si128(fold, temp); + } else { + /** + * There are 2x16 data blocks or more + */ + __m128i next_data; + + /** + * n = number of bytes required to align \a data_len + * to multiple of 16 + */ + n = ((~data_len) + 1) & 15; + + /** + * Apply CRC initial value and + * get \a fold to BE format + */ + fold = _mm_xor_si128(fold, + _mm_insert_epi32(_mm_setzero_si128(), + crc, 0)); + fold = _mm_shuffle_epi8(fold, swap); + + /** + * Load next 16 bytes of data and + * adjust \a fold & \a next_data as follows: + * + * CONCAT(fold,next_data) >> (n*8) + */ + next_data = _mm_loadu_si128((__m128i *)&data[16]); + next_data = _mm_shuffle_epi8(next_data, swap); + next_data = _mm_or_si128(xmm_shift_right(next_data, n), + xmm_shift_left(fold, 16 - n)); + fold = xmm_shift_right(fold, n); + + if (unlikely(data_len <= 32)) + /** + * In such unlikely case clear 4 least significant bytes + */ + next_data = + _mm_slli_si128(_mm_srli_si128(next_data, 4), 4); + + /** + * Do the initial folding round on 2 first 16 byte chunks + */ + k = _mm_load_si128((__m128i *)(¶ms->k1)); + fold = crc32_folding_round(next_data, k, fold); + + if (likely(data_len > 32)) { + /** + * \a data_block needs to be at least 48 bytes long + * in order to get here + */ + __m128i new_data; + + /** + * Main folding loop + * - n is adjusted to point to next 16 data block + * to read + * (16+16) = 2x16; represents 2 first data blocks + * processed above + * (- n) is the number of zero bytes padded to + * the message in order to align it to 16 bytes + * - the last 16 bytes is processed separately + */ + for (n = 16 + 16 - n; n < (data_len - 16); n += 16) { + new_data = _mm_loadu_si128((__m128i *)&data[n]); + new_data = _mm_shuffle_epi8(new_data, swap); + fold = crc32_folding_round(new_data, k, fold); + } + + /** + * The last folding round works always on 12 bytes + * (12 bytes of data and 4 zero bytes) + * Read from offset -4 is to avoid one + * shift right operation. + */ + new_data = _mm_loadu_si128((__m128i *)&data[n - 4]); + new_data = _mm_shuffle_epi8(new_data, swap); + new_data = _mm_slli_si128(new_data, 4); + fold = crc32_folding_round(new_data, k, fold); + } /* if (data_len > 32) */ + } + + /** + * ------------------------------------------------- + * Reduction 128 -> 32 + * Assumes: \a fold holds 128bit folded data + */ + + /** + * REDUCTION 128 -> 64 + */ + k = _mm_load_si128((__m128i *)(¶ms->k3)); + fold = crc32_reduce_128_to_64(fold, k); + + /** + * REDUCTION 64 -> 32 + */ + n = crc32_reduce_64_to_32(fold, k, + _mm_load_si128((__m128i *)(¶ms->p))); + +#ifdef __KERNEL__ + /** + * - restore FPU context + */ + kernel_fpu_end(); +#endif + + return n; +} + +#endif /* __CRC_H__ */ diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index 287cbcd1f4..d1c3917c2c 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -30,10 +30,17 @@ Modified in June, 2001, to include the length non multiple of 8 */ +#ifndef __SSE4_1__ +#define USE_INTEL_CRC 0 +#else +#define USE_INTEL_CRC __SSE4_1__ +#endif #include "coding_defs.h" #include "assertions.h" - +#if USE_INTEL_CRC +#include "crc.h" +#endif /*ref 36-212 v8.6.0 , pp 8-9 */ /* the highest degree is set by default */ @@ -94,6 +101,28 @@ static unsigned short crc11Table[256]; static unsigned char crc8Table[256]; static unsigned char crc6Table[256]; +#if USE_INTEL_CRC +static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24a_pclmulqdq, 16) = { + 0x64e4d700, /**< k1 */ + 0x2c8c9d00, /**< k2 */ + 0xd9fe8c00, /**< k3 */ + 0xf845fe24, /**< q */ + 0x864cfb00, /**< p */ + 0ULL /**< res */ +}; +__m128i crc_xmm_be_le_swap128; + +DECLARE_ALIGNED(const uint8_t crc_xmm_shift_tab[48], 16) = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +}; + +#endif + void crcTableInit (void) { unsigned char c = 0; @@ -108,23 +137,29 @@ void crcTableInit (void) crc8Table[c] = (unsigned char) (crcbit (&c, 1, poly8) >> 24); crc6Table[c] = (unsigned char) (crcbit (&c, 1, poly6) >> 24); } while (++c); +#if USE_INTEL_CRC + crc_xmm_be_le_swap128 = _mm_setr_epi32(0x0c0d0e0f, 0x08090a0b, + 0x04050607, 0x00010203); + +#endif } /********************************************************* -Byte by byte implementations, +Byte by byte LUT implementations, assuming initial byte is 0 padded (in MSB) if necessary - +can use SIMD optimized Intel CRC for LTE/NR 24a/24b variants *********************************************************/ + unsigned int crc24a (unsigned char * inptr, int bitlen) { + int octetlen = bitlen / 8; /* Change in octets */ - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); - + if ( bitlen % 8 || !USE_INTEL_CRC ) { + unsigned int crc = 0; + int resbit= (bitlen % 8); + while (octetlen-- > 0) { // printf("crc24a: in %x => crc %x\n",crc,*inptr); crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; @@ -132,17 +167,35 @@ unsigned int crc24a (unsigned char * inptr, if (resbit > 0) crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; - return crc; + } + #if USE_INTEL_CRC + else { + return crc32_calc_pclmulqdq(inptr, octetlen, 0, + <e_crc24a_pclmulqdq); + } + #endif + } +#if USE_INTEL_CRC +static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = { + 0x80140500, /**< k1 */ + 0x42000100, /**< k2 */ + 0x90042100, /**< k3 */ + 0xffff83ff, /**< q */ + 0x80006300, /**< p */ + 0ULL /**< res */ +}; +#endif unsigned int crc24b (unsigned char * inptr, - int bitlen) + int bitlen) { - int octetlen, resbit; + int octetlen = bitlen / 8; /* Change in octets */ + + if ( bitlen % 8 || !USE_INTEL_CRC ) { unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); + int resbit = (bitlen % 8); while (octetlen-- > 0) { // printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]); @@ -153,6 +206,13 @@ unsigned int crc24b (unsigned char * inptr, crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; return crc; + } +#if USE_INTEL_CRC + else { + return crc32_calc_pclmulqdq(inptr, octetlen, 0, + <e_crc24b_pclmulqdq); + } +#endif } unsigned int crc24c (unsigned char * inptr, diff --git a/openair1/PHY/CODING/crcext.h b/openair1/PHY/CODING/crcext.h new file mode 100644 index 0000000000..f441f25e50 --- /dev/null +++ b/openair1/PHY/CODING/crcext.h @@ -0,0 +1,89 @@ +/******************************************************************************* + Copyright (c) 2009-2018, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/** + * Header file with CRC external definitions + * + */ + +#ifndef __CRCEXT_H__ +#define __CRCEXT_H__ + +#include +#include "types.h" +/** + * Flag indicating availability of PCLMULQDQ instruction + * Only valid after running CRCInit() function. + */ +extern int pclmulqdq_available; + +/** + * Flag indicating availability of PCLMULQDQ instruction + * Only valid after running CRCInit() function. + */ +extern __m128i crc_xmm_be_le_swap128; +extern const uint8_t crc_xmm_shift_tab[48]; + +/** + * @brief Shifts right 128 bit register by specified number of bytes + * + * @param reg 128 bit value + * @param num number of bytes to shift right \a reg by (0-16) + * + * @return \a reg >> (\a num * 8) + */ +__forceinline +__m128i xmm_shift_right(__m128i reg, const unsigned int num) +{ + const __m128i *p = (const __m128i *)(crc_xmm_shift_tab + 16 + num); + + return _mm_shuffle_epi8(reg, _mm_loadu_si128(p)); +} + +/** + * @brief Shifts left 128 bit register by specified number of bytes + * + * @param reg 128 bit value + * @param num number of bytes to shift left \a reg by (0-16) + * + * @return \a reg << (\a num * 8) + */ +__forceinline +__m128i xmm_shift_left(__m128i reg, const unsigned int num) +{ + const __m128i *p = (const __m128i *)(crc_xmm_shift_tab + 16 - num); + + return _mm_shuffle_epi8(reg, _mm_loadu_si128(p)); +} + +/** + * @brief Initializes CRC module. + * @note It is mandatory to run it before using any of CRC API's. + */ +extern void CRCInit(void); + +#endif /* __CRCEXT_H__ */ diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h index 321ecaab7d..0d7ff9ef9f 100644 --- a/openair1/PHY/CODING/nrLDPC_defs.h +++ b/openair1/PHY/CODING/nrLDPC_defs.h @@ -22,6 +22,7 @@ // encoder interface #ifndef __NRLDPC_DEFS__H__ #define __NRLDPC_DEFS__H__ +#include #include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" /** \brief LDPC encoder @@ -36,17 +37,31 @@ \param 9-12 time_stats_t *tinput,*tprep, *tparity,*toutput */ typedef struct { - int n_segments; // optim8seg - unsigned int macro_num; // optim8segmulti - unsigned char gen_code; //orig - time_stats_t *tinput; - time_stats_t *tprep; - time_stats_t *tparity; - time_stats_t *toutput; -}encoder_implemparams_t; + unsigned int n_segments; // optim8seg + unsigned int macro_num; // optim8segmulti + unsigned char gen_code; //orig + time_stats_t *tinput; + time_stats_t *tprep; + time_stats_t *tparity; + time_stats_t *toutput; + int Kr; + uint32_t Kb; + uint32_t *Zc; + void *harq; + /// Encoder BG + uint8_t BG; + /// Interleaver outputs + unsigned char *output; + /// Number of bits in "small" code segments + uint32_t K; + /// Number of "Filler" bits + uint32_t F; + /// LDPC-code outputs + uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; +} encoder_implemparams_t; #define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL} -typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out); -typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t*); +typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params *p_decParams, int8_t *p_llr, int8_t *p_out); +typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t *); //============================================================================================================================ // decoder interface /** @@ -56,5 +71,5 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho \param p_llrOut Output vector \param p_profiler LDPC profiler statistics */ -typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* ); +typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params *, int8_t *, int8_t *, t_nrLDPC_procBuf *, t_nrLDPC_time_stats * ); #endif diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c index 738fd49b7d..69d2ac4972 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c @@ -38,8 +38,6 @@ #include "common/utils/LOG/log.h" -//#define DEBUG_LDPC - #include "ldpc384_byte.c" #include "ldpc352_byte.c" #include "ldpc320_byte.c" @@ -73,9 +71,18 @@ -static inline void encode_parity_check_part_optim(uint8_t *c,uint8_t *d, short BG,short Zc,short Kb) +static void encode_parity_check_part_optim(uint8_t *cc,uint8_t *d, short BG,short Zc,short Kb, int simd_size, int ncols) { - + unsigned char c[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c + + for (int i1=0; i1 < ncols; i1++) { + memcpy(&c[2*i1*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char)); + memcpy(&c[(2*i1+1)*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char)); + } + for (int i1=1;i1tinput != NULL) start_meas(impp->tinput); - for (i=0; i>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); } @@ -108,24 +103,10 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); - for (i1=0; i1 < ncols; i1++) - { - memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - } - for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); + encode_parity_check_part_optim(c, d, BG, Zc, Kb,simd_size, ncols); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c index a974e86e27..6fa9c5ff53 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c @@ -38,7 +38,6 @@ #include "common/utils/LOG/log.h" #include "PHY/TOOLS/time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" -//#define DEBUG_LDPC #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" @@ -102,7 +101,6 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc unsigned char c[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size unsigned char d[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size - unsigned char c_extension[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c // calculate number of punctured bits no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*rate)/Zc; @@ -151,24 +149,10 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); - for (i1=0; i1 < ncols; i1++) - { - memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - } - for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); + encode_parity_check_part_optim(c, d, BG, Zc, Kb, simd_size, ncols); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c index b21f875b32..15d4481eb6 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c @@ -39,17 +39,17 @@ #include "PHY/TOOLS/time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" -//#define DEBUG_LDPC - #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" -int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp) +int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp) { + //set_log(PHY, 4); + - short nrows=0,ncols=0; - int i,i1,j,rate=3; + int nrows=0,ncols=0; + int rate=3; int no_punctured_columns,removed_bit; //Table of possible lifting sizes char temp; @@ -95,8 +95,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc } #ifdef DEBUG_LDPC - LOG_D(PHY,"ldpc_encoder_optim_8seg: BG %d, Zc %d, Kb %d, block_length %d, segments %d\n",BG,Zc,Kb,block_length,n_segments); - LOG_D(PHY,"ldpc_encoder_optim_8seg: PDU (seg 0) %x %x %x %x\n",test_input[0][0],test_input[0][1],test_input[0][2],test_input[0][3]); + LOG_D(PHY,"ldpc_encoder_optim_8seg: BG %d, Zc %d, Kb %d, block_length %d, segments %d\n",BG,Zc,Kb,block_length,impp->n_segments); + LOG_D(PHY,"ldpc_encoder_optim_8seg: PDU (seg 0) %x %x %x %x\n",input[0][0],input[0][1],input[0][2],input[0][3]); #endif AssertFatal(Zc>0,"no valid Zc found for block length %d\n",block_length); @@ -104,10 +104,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((Zc&31) > 0) simd_size = 16; else simd_size = 32; - unsigned char c[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size - unsigned char d[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size - - unsigned char c_extension[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c + unsigned char cc[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size + unsigned char dd[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size // calculate number of punctured bits no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*rate)/Zc; @@ -115,8 +113,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc //printf("%d\n",no_punctured_columns); //printf("%d\n",removed_bit); // unpack input - memset(c,0,sizeof(unsigned char) * ncols * Zc); - memset(d,0,sizeof(unsigned char) * nrows * Zc); + memset(cc,0,sizeof(unsigned char) * ncols * Zc); + memset(dd,0,sizeof(unsigned char) * nrows * Zc); if(impp->tinput != NULL) start_meas(impp->tinput); #if 0 @@ -124,29 +122,29 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc //for (j=0; j>(i&7); + temp = (input[j][i/8]&(1<<(i&7)))>>(i&7); //printf("c(%d,%d)=%d\n",j,i,temp); c[i] |= (temp << (j-macro_segment)); } } #else #ifdef __AVX2__ - for (i=0; i>5; i++) { - c256 = _mm256_and_si256(_mm256_cmpeq_epi8(_mm256_andnot_si256(_mm256_shuffle_epi8(_mm256_set1_epi32(((uint32_t*)test_input[macro_segment])[i]), shufmask),andmask),zero256),masks[0]); + for (int i=0; i>5; i++) { + c256 = _mm256_and_si256(_mm256_cmpeq_epi8(_mm256_andnot_si256(_mm256_shuffle_epi8(_mm256_set1_epi32(((uint32_t*)input[macro_segment])[i]), shufmask),andmask),zero256),masks[0]); //for (j=1; j>5)<<5;i>5)<<5;i>(i&7)))>>(7-(i&7)); + temp = (input[j][i/8]&(128>>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); - c[i] |= (temp << (j-macro_segment)); + cc[i] |= (temp << (j-macro_segment)); } } #else @@ -159,28 +157,14 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); - for (i1=0; i1 < ncols; i1++) - { - memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - } - for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); + encode_parity_check_part_optim(cc, dd, BG, Zc, Kb, simd_size, ncols); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { - if (encode_parity_check_part_orig(c, d, BG, Zc, Kb, block_length)!=0) { + if (encode_parity_check_part_orig(cc, dd, BG, Zc, Kb, block_length)!=0) { printf("Problem with encoder\n"); return(-1); } @@ -188,8 +172,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if(impp->toutput != NULL) start_meas(impp->toutput); // information part and puncture columns /* - memcpy(&channel_input[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char)); - memcpy(&channel_input[block_length-2*Zc], &d[0], ((nrows-no_punctured_columns) * Zc-removed_bit)*sizeof(unsigned char)); + memcpy(&output[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char)); + memcpy(&output[block_length-2*Zc], &d[0], ((nrows-no_punctured_columns) * Zc-removed_bit)*sizeof(unsigned char)); */ #ifdef __AVX2__ if ((((2*Zc)&31) == 0) && (((block_length-(2*Zc))&31) == 0)) { @@ -197,34 +181,34 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc //AssertFatal(((block_length-(2*Zc))&31) == 0,"block_length-(2*Zc) needs to be a multiple of 32 for now\n"); uint32_t l1 = (block_length-(2*Zc))>>5; uint32_t l2 = ((nrows-no_punctured_columns) * Zc-removed_bit)>>5; - __m256i *c256p = (__m256i *)&c[2*Zc]; - __m256i *d256p = (__m256i *)&d[0]; + __m256i *c256p = (__m256i *)&cc[2*Zc]; + __m256i *d256p = (__m256i *)&dd[0]; // if (((block_length-(2*Zc))&31)>0) l1++; - for (i=0;i0) l2++; - for (i1=0;i1>(j-macro_segment))&1; - for (i=0;i<((nrows-no_punctured_columns) * Zc-removed_bit);i++) + for (int j=macro_segment; j < macro_segment_end; j++) + output[j][i] = (cc[2*Zc+i]>>(j-macro_segment))&1; + for (int i=0;i<((nrows-no_punctured_columns) * Zc-removed_bit);i++) //for (j=0; j>(j-macro_segment))&1; + for (int j=macro_segment; j < macro_segment_end; j++) + output[j][block_length-2*Zc+i] = (dd[i]>>(j-macro_segment))&1; } #else diff --git a/openair1/PHY/CODING/types.h b/openair1/PHY/CODING/types.h new file mode 100644 index 0000000000..2bc7739e36 --- /dev/null +++ b/openair1/PHY/CODING/types.h @@ -0,0 +1,98 @@ +/******************************************************************************* + Copyright (c) 2009-2018, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/* Common data types, macros and functions used across the CRC library */ + +#ifndef CRC_TYPES_H_ +#define CRC_TYPES_H_ + +#ifdef __KERNEL__ +#include +#include +typedef uint32_t uint_fast32_t; +typedef uint16_t uint_fast16_t; +typedef uint8_t uint_fast8_t; +#else +#include +#include +#endif + +/* Declare variable at address aligned to a boundary */ +#define DECLARE_ALIGNED(_declaration, _boundary) \ + _declaration __attribute__((aligned(_boundary))) + +/* Macro to make function to be always inlined */ +#ifndef DEBUG +#define __forceinline \ + static inline __attribute__((always_inline)) +#else +#define __forceinline \ + static +#endif + +/* Likely & unliekly hints for the compiler */ +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + +/* Macro to get dimension of an array */ +#ifndef DIM +#define DIM(x) (sizeof(x)/sizeof(x[0])) +#endif + +/** + * Common functions + */ + +/** + * @brief Swaps bytes in 16 bit word + * + * @param val 16 bit data value + * + * @return byte swapped value + */ +__forceinline uint16_t bswap2(const uint16_t val) +{ + return (uint16_t) ((val >> 8) | (val << 8)); +} + +/** + * @brief Swaps bytes in 32 bit word + * ABCD -> DCBA + * + * @param val 32 bit data value + * + * @return byte swapped value + */ +__forceinline uint32_t bswap4(const uint32_t val) +{ + return ((val >> 24) | /**< A*/ + ((val & 0xff0000) >> 8) | /**< B*/ + ((val & 0xff00) << 8) | /**< C*/ + (val << 24)); /**< D*/ +} + +#endif /* CRC_TYPES_H_ */ diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b60e77e814..f664a03ba0 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -458,7 +458,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->decode_SIB = 1; init_nr_prach_tables(839); - + init_symbol_rotation(fp); return 0; } diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 42d4a30e3b..347155ed3b 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -209,7 +209,6 @@ uint32_t get_samples_per_slot(int slot, NR_DL_FRAME_PARMS* fp) return samp_count; } - uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, NR_DL_FRAME_PARMS* fp) { uint32_t slot_idx = 0; diff --git a/openair1/PHY/LTE_REFSIG/lte_refsig.h b/openair1/PHY/LTE_REFSIG/lte_refsig.h index 84a2676082..9d3bae503b 100644 --- a/openair1/PHY/LTE_REFSIG/lte_refsig.h +++ b/openair1/PHY/LTE_REFSIG/lte_refsig.h @@ -36,8 +36,7 @@ \param reset resets the generator \return 32 bits of the gold sequence */ -uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); - +#include /*!\brief This function generates the LTE Gold sequence (36-211, Sec 7.2), specifically for DL reference signals. @param frame_parms LTE DL Frame parameters diff --git a/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c b/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c deleted file mode 100644 index a23f8db4f2..0000000000 --- a/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -#include "PHY/types.h" - -/** - \brief Gold Sequence Generation defined in 3x.211 - \param x1 x1 shift register - \param x2 x2 shift register / cinit if reset is set - \param reset Reset flag / reinitialize the generator - \return c 32 bits of gold output -*/ -extern inline uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset) -{ - int32_t n; - - // 3GPP 3x.211 - // Nc = 1600 - // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 - // x1(n+31) = [x1(n+3) + x1(n)]mod2 - // x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2 - if (reset) - { - // Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30 - // x1(31) = [x1(3) + x1(0)]mod2 = 1 - *x1 = 1 + (1U<<31); - // Init value for x2: cinit = sum_{i=0}^30 x2*2^i - // x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2 - // = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2 - *x2 = *x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31); - - // x1 and x2 contain bits n = 0,1,...,31 - - // Nc = 1600 bits are skipped at the beginning - // i.e., 1600 / 32 = 50 32bit words - - for (n = 1; n < 50; n++) - { - // Compute x1(0),...,x1(27) - *x1 = (*x1>>1) ^ (*x1>>4); - // Compute x1(28),..,x1(31) and xor - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - // Compute x2(0),...,x2(27) - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - // Compute x2(28),..,x2(31) and xor - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - } - } - - *x1 = (*x1>>1) ^ (*x1>>4); - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - - // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 - return(*x1^*x2); -} diff --git a/openair1/PHY/LTE_TRANSPORT/lte_mcs.c b/openair1/PHY/LTE_TRANSPORT/lte_mcs.c index 6144b978bf..38914506ee 100644 --- a/openair1/PHY/LTE_TRANSPORT/lte_mcs.c +++ b/openair1/PHY/LTE_TRANSPORT/lte_mcs.c @@ -147,10 +147,10 @@ uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb) { } } -int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_order, uint8_t subframe, uint8_t symbol) { +int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc, uint8_t mod_order, uint8_t subframe, uint8_t symbol) { int rb,re_pbch_sss=0; int rb_alloc_ind,nsymb; - nsymb = (frame_parms->Ncp==NORMAL) ? 14 : 12; + nsymb = (Ncp==NORMAL) ? 14 : 12; // printf("adjust_G2 : symbol %d, subframe %d\n",symbol,subframe); if ((subframe!=0) && (subframe!=5) && (subframe!=6)) // if not PBCH/SSS or SSS @@ -158,12 +158,12 @@ int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_o //first half of slot and TDD (no adjustments in first slot except for subframe 6 - PSS) if ((symbol<(nsymb>>1))&& - (frame_parms->frame_type == TDD)&& + (frame_type == TDD)&& (subframe!=6)) return(0); // after PBCH - if (frame_parms->frame_type==TDD) { //TDD + if (frame_type==TDD) { //TDD if ((symbol>((nsymb>>1)+3)) && (symbol!=(nsymb-1))) ///SSS return(0); @@ -185,9 +185,9 @@ int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_o return(0); } - if ((frame_parms->N_RB_DL&1) == 1) { // ODD N_RB_DL - for (rb=((frame_parms->N_RB_DL>>1)-3); - rb<=((frame_parms->N_RB_DL>>1)+3); + if ((N_RB_DL&1) == 1) { // ODD N_RB_DL + for (rb=((N_RB_DL>>1)-3); + rb<=((N_RB_DL>>1)+3); rb++) { if (rb < 32) rb_alloc_ind = (rb_alloc[0]>>rb) & 1; @@ -201,16 +201,16 @@ int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_o rb_alloc_ind = 0; if (rb_alloc_ind==1) { - if ((rb==(frame_parms->N_RB_DL>>1)-3) || - (rb==((frame_parms->N_RB_DL>>1)+3))) { + if ((rb==(N_RB_DL>>1)-3) || + (rb==((N_RB_DL>>1)+3))) { re_pbch_sss += 6; } else re_pbch_sss += 12; } } } else { - for (rb=((frame_parms->N_RB_DL>>1)-3); - rb<((frame_parms->N_RB_DL>>1)+3); + for (rb=((N_RB_DL>>1)-3); + rb<((N_RB_DL>>1)+3); rb++) { if (rb < 32) rb_alloc_ind = (rb_alloc[0]>>rb) & 1; diff --git a/openair1/PHY/LTE_TRANSPORT/pcfich.c b/openair1/PHY/LTE_TRANSPORT/pcfich.c index 3646732ce3..0ba63019a1 100644 --- a/openair1/PHY/LTE_TRANSPORT/pcfich.c +++ b/openair1/PHY/LTE_TRANSPORT/pcfich.c @@ -44,7 +44,7 @@ void pcfich_scrambling(LTE_DL_FRAME_PARMS *frame_parms, { uint32_t i; uint8_t reset; - uint32_t x1, x2, s=0; + uint32_t x1=0, x2, s=0; reset = 1; // x1 is set in lte_gold_generic diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 3270066448..998edf235f 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -895,7 +895,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint8_t pucch1_thres, - uint8_t br_flag + int br_flag ) //----------------------------------------------------------------------------- { diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h index 622f37b3bc..af8e63c3ed 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h @@ -101,7 +101,7 @@ int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint int get_G_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe, uint8_t beamforming_mode); int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); -int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); +int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); #ifndef modOrder diff --git a/openair1/PHY/LTE_TRANSPORT/transport_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_proto.h index 19af50056c..1fbd1266d7 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_proto.h @@ -700,7 +700,51 @@ int find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type); int find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type); -uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); +static inline uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset) +{ + int32_t n; + + // 3GPP 3x.211 + // Nc = 1600 + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + // x1(n+31) = [x1(n+3) + x1(n)]mod2 + // x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2 + if (reset) + { + // Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30 + // x1(31) = [x1(3) + x1(0)]mod2 = 1 + *x1 = 1 + (1U<<31); + // Init value for x2: cinit = sum_{i=0}^30 x2*2^i + // x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2 + // = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2 + *x2 = *x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31); + + // x1 and x2 contain bits n = 0,1,...,31 + + // Nc = 1600 bits are skipped at the beginning + // i.e., 1600 / 32 = 50 32bit words + + for (n = 1; n < 50; n++) + { + // Compute x1(0),...,x1(27) + *x1 = (*x1>>1) ^ (*x1>>4); + // Compute x1(28),..,x1(31) and xor + *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); + // Compute x2(0),...,x2(27) + *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); + // Compute x2(28),..,x2(31) and xor + *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); + } + } + + *x1 = (*x1>>1) ^ (*x1>>4); + *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); + *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); + *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); + + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + return(*x1^*x2); +} /**@}*/ diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index 4f65edd6d5..efde277203 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -1293,7 +1293,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, } granted_re = nb_rb_alloc * (12-crs_re); - pbch_pss_sss_re = adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,dlsch0_harq->Qm,subframe,symbol); + pbch_pss_sss_re = adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,dlsch0_harq->Qm,subframe,symbol); pbch_pss_sss_re = (double)pbch_pss_sss_re * ((double)(12-crs_re)/12); data_re = granted_re - pbch_pss_sss_re; llr_offset = data_re * dlsch0_harq->Qm * 2; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index 91de5386ae..6afd028099 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -837,7 +837,7 @@ int rx_pdsch(PHY_VARS_UE *ue, symbol, first_symbol_flag, nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } else if (codeword_TB0 == -1) { dlsch_qpsk_llr(frame_parms, @@ -846,7 +846,7 @@ int rx_pdsch(PHY_VARS_UE *ue, symbol, first_symbol_flag, nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { if (dlsch1_harq->Qm == 2) { @@ -856,7 +856,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -866,7 +866,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -877,7 +877,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -888,7 +888,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -899,7 +899,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -910,7 +910,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } @@ -925,7 +925,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[0], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); } else if (codeword_TB0 == -1) { @@ -934,7 +934,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[1], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream, beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { @@ -946,7 +946,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -957,7 +957,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -969,7 +969,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -981,7 +981,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -993,7 +993,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1005,7 +1005,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } @@ -1021,7 +1021,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } else if (codeword_TB0 == -1) { @@ -1031,7 +1031,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { @@ -1043,7 +1043,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1054,7 +1054,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -1066,7 +1066,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1078,7 +1078,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -1090,7 +1090,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, (int16_t *)pllr_symbol_cw0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol]); if (rx_type==rx_IC_dual_stream) { @@ -1102,7 +1102,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], (int16_t *)pllr_symbol_cw1, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol]); } } @@ -1124,7 +1124,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->rxdataF_comp0, (int16_t *)pllr_symbol_cw0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } @@ -1137,7 +1137,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[0], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); } @@ -1152,7 +1152,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c index 4c74377ef6..43f3b5451f 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c @@ -746,7 +746,7 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation - pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,2,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL ,&rb_alloc,2,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { if (frame_parms->nb_antenna_ports_eNB!=1) @@ -981,7 +981,7 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,4,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,&rb_alloc,4,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { amp_tmp=0x1fff;//dlsch0->sqrt_rho_b; already taken into account @@ -1281,7 +1281,7 @@ void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,6,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,&rb_alloc,6,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { amp_tmp = 0x1fff;//dlsch0->sqrt_rho_b; already taken into account diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c index 1f9fb86f80..9427ec3a5b 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c @@ -336,8 +336,8 @@ void generate_pucch1x(int32_t **txdataF, -inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) __attribute__((always_inline)); -inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) { +static inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) __attribute__((always_inline)); +static inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) { uint32_t x1, x2, s=0; int i; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index 7ab795cae9..c5d096ceb7 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -1303,7 +1303,7 @@ uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL); int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe, uint8_t beamforming_mode); int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); -int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); + #ifndef modOrder diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index fa1b6c955b..9bbc61d4b6 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -180,13 +180,15 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, /// CRC, coding, interleaving and rate matching AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n"); + unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); + bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); start_meas(dlsch_encoding_stats); - if (nr_dlsch_encoding(gNB, - harq->pdu, frame, slot, dlsch, frame_parms,tinput,tprep,tparity,toutput, - dlsch_rate_matching_stats, - dlsch_interleaving_stats, - dlsch_segmentation_stats) == -1) - return; + nr_dlsch_encoding(gNB, + harq->pdu, frame, slot, dlsch, frame_parms, output, + tinput,tprep,tparity,toutput, + dlsch_rate_matching_stats, + dlsch_interleaving_stats, + dlsch_segmentation_stats); stop_meas(dlsch_encoding_stats); #ifdef DEBUG_DLSCH printf("PDSCH encoding:\nPayload:\n"); @@ -198,7 +200,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, printf("\nEncoded payload:\n"); for (int i=0; i>3; i++) { for (int j=0; j<8; j++) - printf("%d", harq->f[(i<<3)+j]); + printf("%d", output[(i<<3)+j]); printf("\t"); } printf("\n"); @@ -211,7 +213,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, for (int q=0; qNrOfCodewords; q++) memset((void*)scrambled_output[q], 0, (encoded_length>>5)*sizeof(uint32_t)); for (int q=0; qNrOfCodewords; q++) - nr_pdsch_codeword_scrambling_optim(harq->f, + nr_pdsch_codeword_scrambling_optim(output, encoded_length, q, rel15->dataScramblingId, @@ -248,7 +250,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } #endif - + start_meas(&gNB->dlsch_layer_mapping_stats); /// Layer mapping nr_layer_mapping(mod_symbs, rel15->nrOfLayers, @@ -266,6 +268,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } #endif + stop_meas(&gNB->dlsch_layer_mapping_stats); /// Resource mapping // Non interleaved VRB to PRB mapping @@ -279,7 +282,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers); #endif - + start_meas(&gNB->dlsch_resource_mapping_stats); for (int ap=0; apnrOfLayers; ap++) { // DMRS params for this ap @@ -321,20 +324,13 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, dmrs_idx = (rel15->rbStart+rel15->BWPStart)*4; } } - } - - // Update l_prime in the case of double DMRS config - if ((dmrs_symbol_map & (1 << l))){ //DMRS time occasion if (l==(l_overline+1)) //take into account the double DMRS symbols l_prime = 1; else if (l>(l_overline+1)) {//new DMRS pair l_overline = l; l_prime = 0; } - } - - /// DMRS QPSK modulation - if (rel15->dlDmrsSymbPos & (1 << l)) { + /// DMRS QPSK modulation nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated #ifdef DEBUG_DLSCH @@ -355,73 +351,143 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, ptrs_symbol = is_ptrs_symbol(l,dlPtrsSymPos); if(ptrs_symbol) { /* PTRS QPSK Modulation for each OFDM symbol in a slot */ + printf("Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs); nr_modulation(pdsch_dmrs[l][0], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs); } } uint16_t k = start_sc; - // Loop Over SCs: - for (int i=0; irbSize*NR_NB_SC_PER_RB; i++) { - /* check if cuurent RE is PTRS RE*/ - is_ptrs_re=0; - /* check for PTRS symbol and set flag for PTRS RE */ - if(ptrs_symbol){ - is_ptrs_re = is_ptrs_subcarrier(k, - rel15->rnti, - ap, - rel15->dmrsConfigType, - rel15->PTRSFreqDensity, - rel15->rbSize, - rel15->PTRSReOffset, - start_sc, - frame_parms->ofdm_symbol_size); - } + if (ptrs_symbol || dmrs_symbol_map & (1 << l)) { - /* Map DMRS Symbol */ - if ( ( dmrs_symbol_map & (1 << l) ) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + // Loop Over SCs: + for (int i=0; irbSize*NR_NB_SC_PER_RB; i++) { + /* check if cuurent RE is PTRS RE*/ + is_ptrs_re = 0; + if (ptrs_symbol) + is_ptrs_re = is_ptrs_subcarrier(k, + rel15->rnti, + ap, + rel15->dmrsConfigType, + rel15->PTRSFreqDensity, + rel15->rbSize, + rel15->PTRSReOffset, + start_sc, + frame_parms->ofdm_symbol_size); + /* Map DMRS Symbol */ + if ( (dmrs_symbol_map & (1 << l)) && + (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", + dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif - dmrs_idx++; - k_prime++; - k_prime&=1; - n+=(k_prime)?0:1; - } - /* Map PTRS Symbol */ - else if(is_ptrs_re){ - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; + dmrs_idx++; + k_prime++; + k_prime&=1; + n+=(k_prime)?0:1; + } + else if(is_ptrs_re){ + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d, mod_ptrs: %d %d\n", + ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)],mod_ptrs[ptrs_idx<<1],mod_ptrs[(ptrs_idx<<1)+1]); #endif - ptrs_idx++; - } + ptrs_idx++; + } /* Map DATA Symbol */ - else if( (!(dmrs_symbol_map & (1 << l))) || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + else if( ptrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", + m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif - m++; + m++; + } + /* mute RE */ + else { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + } + if (++k >= frame_parms->ofdm_symbol_size) + k -= frame_parms->ofdm_symbol_size; + } //RE loop + } + else { // no PTRS or DMRS in this symbol + // Loop Over SCs: + int upper_limit=rel15->rbSize*NR_NB_SC_PER_RB; + int remaining_re = 0; + if (start_sc + upper_limit > frame_parms->ofdm_symbol_size) { + remaining_re = upper_limit + start_sc - frame_parms->ofdm_symbol_size; + upper_limit = frame_parms->ofdm_symbol_size - start_sc; + } + // fix the alignment issues later, use 64-bit SIMD below instead of 128. + if (0/*(frame_parms->N_RB_DL&1)==0*/) { + __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + + __m128i *txl = (__m128i*)&tx_layers[ap][m<<1]; + __m128i amp128=_mm_set1_epi16(amp); + for (int i=0; i<(upper_limit>>2); i++) { + txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); + } //RE loop, first part + m+=upper_limit; + if (remaining_re > 0) { + txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txl = (__m128i*)&tx_layers[ap][m<<1]; + for (int i=0; i<(remaining_re>>2); i++) { + txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); + } + } } - /* mute RE */ else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; - } - if (++k >= frame_parms->ofdm_symbol_size) - k -= frame_parms->ofdm_symbol_size; - } //RE loop + __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + + __m64 *txl = (__m64*)&tx_layers[ap][m<<1]; + __m64 amp64=_mm_set1_pi16(amp); + for (int i=0; i<(upper_limit>>1); i++) { + + txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); +#ifdef DEBUG_DLSCH_MAPPING + if ((i&1) > 0) + printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", + m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1 + (2*txdataF_offset)]); +#endif + /* handle this, mute RE */ + /*else { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + }*/ + } //RE loop, first part + m+=upper_limit; + if (remaining_re > 0) { + txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txl = (__m64*)&tx_layers[ap][m<<1]; + for (int i=0; i<(remaining_re>>1); i++) { + txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); +#ifdef DEBUG_DLSCH_MAPPING + if ((i&1) > 0) + printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", + m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1 + (2*txdataF_offset)]); +#endif + /* handle this, mute RE */ + /*else { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + }*/ + } //RE loop, second part + } // + m+=remaining_re; + } // N_RB_DL even + } // no DMRS/PTRS in symbol } // symbol loop }// layer loop + stop_meas(&gNB->dlsch_resource_mapping_stats); ///Layer Precoding and Antenna port mapping // tx_layers 1-8 are mapped on antenna ports 1000-1007 @@ -430,7 +496,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, // pmi = prgs_list[rbidx/prg_size].pm_idx, rbidx =0,...,rbSize-1 // The Precoding matrix: // The Codebook Type I and Type II are not supported yet. - // We adopt the precoding matrices of PUSCH for 4 layers. + // We`adopt the precoding matrices of PUSCH for 4 layers. + start_meas(&gNB->dlsch_precoding_stats); + for (int ap=0; apnb_antennas_tx; ap++) { for (int l=rel15->StartSymbolIndex; lStartSymbolIndex+rel15->NrOfSymbols; l++) { @@ -505,6 +573,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } // symbol loop }// port loop + stop_meas(&gNB->dlsch_precoding_stats); dlsch->slot_tx[slot]=0; // TODO: handle precoding diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h index 181c2ab273..77db12672f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h @@ -43,8 +43,6 @@ void nr_check_time_alloc(uint8_t S, uint8_t L,nfapi_nr_dl_tti_pdsch_pdu_rel15_t uint16_t get_RIV(uint16_t rb_start, uint16_t L, uint16_t N_RB); -uint16_t get_SLIV(uint8_t S, uint8_t L); - uint8_t nr_get_S(uint8_t row_idx, uint8_t CP, uint8_t time_alloc_type, uint8_t dmrs_typeA_position); void nr_get_rbg_parms(NR_BWP_PARMS* bwp, uint8_t config_type); @@ -85,6 +83,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, uint8_t slot, NR_gNB_DLSCH_t *dlsch, NR_DL_FRAME_PARMS* frame_parms, + unsigned char * output, time_stats_t *tinput, time_stats_t *tprep, time_stats_t *tparity, diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 0bcd1e3e51..5620018b73 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -50,70 +50,47 @@ //#define DEBUG_DLSCH_FREE 1 -void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) -{ +void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) { int r; - NR_gNB_DLSCH_t *dlsch = *dlschptr; - uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated - if (dlsch) { + if (dlsch) { if (N_RB != 273) { a_segments = a_segments*N_RB; a_segments = a_segments/273 +1; } - + #ifdef DEBUG_DLSCH_FREE LOG_D(PHY,"Freeing dlsch %p\n",dlsch); #endif NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; + if (harq->b) { free16(harq->b, a_segments * 1056); harq->b = NULL; #ifdef DEBUG_DLSCH_FREE LOG_D(PHY, "Freeing harq->b (%p)\n", harq->b); #endif - - if (harq->e) { - free16(harq->e, 14 * N_RB * 12 * 8); - harq->e = NULL; + } + #ifdef DEBUG_DLSCH_FREE - printf("Freeing dlsch process %d e (%p)\n", i, harq->e); + LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); #endif - } - - if (harq->f) { - free16(harq->f, 14 * N_RB * 12 * 8); - harq->f = NULL; + + for (r = 0; r < a_segments; r++) { #ifdef DEBUG_DLSCH_FREE - printf("Freeing dlsch process %d f (%p)\n", i, harq->f); + LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); #endif - } - -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); -#endif - - for (r = 0; r < a_segments; r++) { -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); -#endif - - if (harq->c[r]) { - free16(harq->c[r], 1056); - harq->c[r] = NULL; - } - if (harq->d[r]) { - free16(harq->d[r], 3 * 8448); - harq->d[r] = NULL; - } + + if (harq->c[r]) { + free16(harq->c[r], 1056); + harq->c[r] = NULL; } } + free16(dlsch, sizeof(NR_gNB_DLSCH_t)); + *dlschptr = NULL; } - - free16(dlsch, sizeof(NR_gNB_DLSCH_t)); - *dlschptr = NULL; } NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, @@ -121,8 +98,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, unsigned char Mdlharq, uint32_t Nsoft, uint8_t abstraction_flag, - uint16_t N_RB) -{ + uint16_t N_RB) { unsigned char i,r,aa,layer; int re; uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated @@ -133,10 +109,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, } uint16_t dlsch_bytes = a_segments*1056; // allocated bytes per segment - NR_gNB_DLSCH_t *dlsch = malloc16(sizeof(NR_gNB_DLSCH_t)); AssertFatal(dlsch, "cannot allocate dlsch\n"); - bzero(dlsch,sizeof(NR_gNB_DLSCH_t)); dlsch->Kmimo = Kmimo; dlsch->Mdlharq = Mdlharq; @@ -144,11 +118,12 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, dlsch->Nsoft = Nsoft; for (layer=0; layerue_spec_bf_weights[layer] = (int32_t**)malloc16(64*sizeof(int32_t*)); + dlsch->ue_spec_bf_weights[layer] = (int32_t **)malloc16(64*sizeof(int32_t *)); for (aa=0; aa<64; aa++) { dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); - for (re=0;reue_spec_bf_weights[layer][aa][re] = 0x00007fff; } } @@ -160,7 +135,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, for (int q=0; qmod_symbs[q] = (int32_t *)malloc16(NR_MAX_PDSCH_ENCODED_LENGTH*sizeof(int32_t)); - dlsch->calib_dl_ch_estimates = (int32_t**)malloc16(64*sizeof(int32_t*)); + dlsch->calib_dl_ch_estimates = (int32_t **)malloc16(64*sizeof(int32_t *)); + for (aa=0; aa<64; aa++) { dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); } @@ -172,7 +148,6 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; bzero(harq, sizeof(NR_DL_gNB_HARQ_t)); - harq->b = malloc16(dlsch_bytes); AssertFatal(harq->b, "cannot allocate memory for harq->b\n"); harq->pdu = malloc16(dlsch_bytes); @@ -188,71 +163,33 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, // In section 5.3.2 in 38.212, the for loop is up to N + 2*Zc (maximum size of N is 66*Zc, therefore 68*Zc) harq->c[r] = malloc16(8448); AssertFatal(harq->c[r], "cannot allocate harq->c[%d]\n", r); - harq->d[r] = malloc16(68 * 384); - AssertFatal(harq->d[r], "cannot allocate harq->d[%d]\n", r); // max size for coded output bzero(harq->c[r], 8448); - bzero(harq->d[r], (3 * 8448)); } - harq->e = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); - AssertFatal(harq->e, "cannot allocate harq->e\n"); - bzero(harq->e, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); - harq->f = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); - AssertFatal(harq->f, "cannot allocate harq->f\n"); - bzero(harq->f, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); - return(dlsch); } -void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) -{ - - unsigned char Mdlharq; - unsigned char i,j,r; - +void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) { AssertFatal(dlsch!=NULL,"dlsch is null\n"); - Mdlharq = dlsch->Mdlharq; + unsigned char Mdlharq = dlsch->Mdlharq; dlsch->rnti = 0; dlsch->active = 0; - NR_DL_gNB_HARQ_t *harq=&dlsch->harq_process; - - for (i=0; i<10; i++) { + for (int i=0; i<10; i++) { dlsch->harq_ids[0][i] = Mdlharq; dlsch->harq_ids[1][i] = Mdlharq; } - for (i=0; id[r]) - harq->d[r][j] = NR_NULL; - } } -int nr_dlsch_encoding(PHY_VARS_gNB *gNB, - unsigned char *a, - int frame, - uint8_t slot, - NR_gNB_DLSCH_t *dlsch, - NR_DL_FRAME_PARMS* frame_parms, - time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput, - time_stats_t *dlsch_rate_matching_stats,time_stats_t *dlsch_interleaving_stats, - time_stats_t *dlsch_segmentation_stats) -{ - - unsigned int G; - unsigned int crc=1; - NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; +void ldpc8blocks( void *p) { + encoder_implemparams_t *impp=(encoder_implemparams_t *) p; + NR_DL_gNB_HARQ_t *harq = (NR_DL_gNB_HARQ_t *)impp->harq; + uint16_t Kr= impp->K; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; + uint8_t mod_order = rel15->qamModOrder[0]; uint16_t nb_rb = rel15->rbSize; uint8_t nb_symb_sch = rel15->NrOfSymbols; - uint32_t A, Kb, F=0; - uint32_t *Zc = &dlsch->harq_process.Z; - uint8_t mod_order = rel15->qamModOrder[0]; - uint16_t Kr=0,r; - uint32_t r_offset=0; - uint32_t E; - uint8_t Ilbrm = 1; - uint32_t Tbslbrm = 950984; //max tbs + uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); + uint32_t A = rel15->TBSize[0]<<3; uint8_t nb_re_dmrs; if (rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1) @@ -260,24 +197,115 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, else nb_re_dmrs = 4*rel15->numDmrsCdmGrpsNoData; - uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); - uint16_t R=rel15->targetCodeRate[0]; + unsigned int G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers); + LOG_D(PHY,"dlsch coding A %d Kr %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", + A,impp->K,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order); + // nrLDPC_encoder output is in "d" + // let's make this interface happy! + uint8_t tmp[8][68 * 384]__attribute__((aligned(32))); + for (int rr=impp->macro_num*8, i=0; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++,i++ ) + impp->d[rr]=tmp[i]; + nrLDPC_encoder(harq->c,impp->d,*impp->Zc, impp->Kb,Kr,impp->BG,impp); + // Compute where to place in output buffer that is concatenation of all segments + uint32_t r_offset=0; + for (int i=0; i < impp->macro_num*8; i++ ) + r_offset+=nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, i); + for (int rr=impp->macro_num*8; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++ ) { + if (impp->F>0) { + // writing into positions d[r][k-2Zc] as in clause 5.3.2 step 2) in 38.212 + memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], impp->F, NR_NULL); + } + +#ifdef DEBUG_DLSCH_CODING + LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]); +#endif + uint32_t E = nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, rr); + //#ifdef DEBUG_DLSCH_CODING + LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", + rr, + impp->n_segments, + G, + E, + impp->F, + Kr-impp->F-2*(*impp->Zc), + mod_order,nb_rb); + // for tbslbrm calculation according to 5.4.2.1 of 38.212 + uint8_t Nl = 4; + + if (rel15->nrOfLayers < Nl) + Nl = rel15->nrOfLayers; + + uint32_t Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl); + uint8_t Ilbrm = 1; + + uint8_t e[E]; + bzero (e, E); + nr_rate_matching_ldpc(Ilbrm, + Tbslbrm, + impp->BG, + *impp->Zc, + impp->d[rr], + e, + impp->n_segments, + impp->F, + Kr-impp->F-2*(*impp->Zc), + rel15->rvIndex[0], + E); +#ifdef DEBUG_DLSCH_CODING + + for (int i =0; i<16; i++) + printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset); + +#endif + nr_interleaving_ldpc(E, + mod_order, + e, + impp->output+r_offset); +#ifdef DEBUG_DLSCH_CODING + + for (int i =0; i<16; i++) + printf("output interleaving f[%d]= %d r_offset %u\n", i,impp->output[i+r_offset], r_offset); + + if (r==impp->n_segments-1) + write_output("enc_output.m","enc",impp->output,G,1,4); + +#endif + r_offset += E; + } +} + +int nr_dlsch_encoding(PHY_VARS_gNB *gNB, + unsigned char *a, + int frame, + uint8_t slot, + NR_gNB_DLSCH_t *dlsch, + NR_DL_FRAME_PARMS *frame_parms, + unsigned char * output, + time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput, + time_stats_t *dlsch_rate_matching_stats,time_stats_t *dlsch_interleaving_stats, + time_stats_t *dlsch_segmentation_stats) { + encoder_implemparams_t impp; + impp.output=output; + unsigned int crc=1; + NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; + nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; + impp.Zc = &dlsch->harq_process.Z; float Coderate = 0.0; - uint8_t Nl = 4; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN); + uint32_t A = rel15->TBSize[0]<<3; - A = rel15->TBSize[0]<<3; if ( dlsch->rnti != SI_RNTI ) - trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0); + trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0); NR_gNB_SCH_STATS_t *stats=NULL; int first_free=-1; - for (int i=0;idlsch_stats[i].rnti == 0 && first_free == -1) { first_free = i; stats=&gNB->dlsch_stats[i]; } + if (gNB->dlsch_stats[i].rnti == dlsch->rnti) { stats=&gNB->dlsch_stats[i]; break; @@ -290,181 +318,94 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, stats->current_RI = rel15->nrOfLayers; stats->current_Qm = rel15->qamModOrder[0]; } - G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers); - - LOG_D(PHY,"dlsch coding A %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", - A,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order); if (A > 3824) { // Add 24-bit crc (polynomial A) to payload crc = crc24a(a,A)>>8; - a[A>>3] = ((uint8_t*)&crc)[2]; - a[1+(A>>3)] = ((uint8_t*)&crc)[1]; - a[2+(A>>3)] = ((uint8_t*)&crc)[0]; + a[A>>3] = ((uint8_t *)&crc)[2]; + a[1+(A>>3)] = ((uint8_t *)&crc)[1]; + a[2+(A>>3)] = ((uint8_t *)&crc)[0]; //printf("CRC %x (A %d)\n",crc,A); //printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]); - harq->B = A+24; // harq->b = a; - AssertFatal((A / 8) + 4 <= MAX_NR_DLSCH_PAYLOAD_BYTES, "A %d is too big (A/8+4 = %d > %d)\n", A, (A / 8) + 4, MAX_NR_DLSCH_PAYLOAD_BYTES); - memcpy(harq->b, a, (A / 8) + 4); // why is this +4 if the CRC is only 3 bytes? - } - else { + } else { // Add 16-bit crc (polynomial A) to payload crc = crc16(a,A)>>16; - a[A>>3] = ((uint8_t*)&crc)[1]; - a[1+(A>>3)] = ((uint8_t*)&crc)[0]; + a[A>>3] = ((uint8_t *)&crc)[1]; + a[1+(A>>3)] = ((uint8_t *)&crc)[0]; //printf("CRC %x (A %d)\n",crc,A); //printf("a0 %d a1 %d \n", a[A>>3], a[1+(A>>3)]); - harq->B = A+16; // harq->b = a; - AssertFatal((A / 8) + 3 <= MAX_NR_DLSCH_PAYLOAD_BYTES, "A %d is too big (A/8+3 = %d > %d)\n", A, (A / 8) + 3, MAX_NR_DLSCH_PAYLOAD_BYTES); - memcpy(harq->b, a, (A / 8) + 3); // using 3 bytes to mimic the case of 24 bit crc } - if (R<1000) - Coderate = (float) R /(float) 1024; + + if (rel15->targetCodeRate[0]<1000) + Coderate = (float)rel15->targetCodeRate[0] /(float) 1024; else // to scale for mcs 20 and 26 in table 5.1.3.1-2 which are decimal and input 2* in nr_tbs_tools - Coderate = (float) R /(float) 2048; + Coderate = (float)rel15->targetCodeRate[0] /(float) 2048; if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25) - harq->BG = 2; + impp.BG = 2; else - harq->BG = 1; + impp.BG = 1; start_meas(dlsch_segmentation_stats); - Kb = nr_segmentation(harq->b, harq->c, harq->B, &harq->C, &harq->K, Zc, &harq->F, harq->BG); + impp.Kb = nr_segmentation(harq->b, harq->c, harq->B, &impp.n_segments, &impp.K, impp.Zc, &impp.F, impp.BG); stop_meas(dlsch_segmentation_stats); - F = harq->F; - Kr = harq->K; -#ifdef DEBUG_DLSCH_CODING - uint16_t Kr_bytes; - Kr_bytes = Kr>>3; -#endif - - //printf("segment Z %d k %d Kr %d BG %d C %d\n", *Zc,harq->K,Kr,BG,harq->C); - - for (r=0; rC; r++) { + for (int r=0; rd[r][0]; //channel_input[r] = &harq->d[r][0]; #ifdef DEBUG_DLSCH_CODING - LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, harq->F); - LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,harq->C); + LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp->F); + LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,impp.n_segments); LOG_D(PHY,"input %d %d %d %d %d \n", harq->c[r][0], harq->c[r][1], harq->c[r][2],harq->c[r][3], harq->c[r][4]); - for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++){ + + for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++) { LOG_D(PHY,"%d ", harq->c[r][cnt]); } - LOG_D(PHY,"\n"); + LOG_D(PHY,"\n"); #endif //ldpc_encoder_orig((unsigned char*)harq->c[r],harq->d[r],*Zc,Kb,Kr,BG,0); //ldpc_encoder_optim((unsigned char*)harq->c[r],(unsigned char*)&harq->d[r][0],*Zc,Kb,Kr,BG,NULL,NULL,NULL,NULL); } - encoder_implemparams_t impp; - impp.n_segments=harq->C; + impp.tprep = tprep; impp.tinput = tinput; impp.tparity = tparity; impp.toutput = toutput; - for(int j=0;j<(harq->C/8+1);j++) { - impp.macro_num=j; - nrLDPC_encoder(harq->c,harq->d,*Zc,Kb,Kr,harq->BG,&impp); + impp.harq=harq; + notifiedFIFO_t nf; + initNotifiedFIFO(&nf); + int nbJobs=0; + for(int j=0; j<(impp.n_segments/8+((impp.n_segments&7)==0 ? 0 : 1)); j++) { + notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(impp), j, &nf, ldpc8blocks); + encoder_implemparams_t* perJobImpp=(encoder_implemparams_t*)NotifiedFifoData(req); + *perJobImpp=impp; + perJobImpp->macro_num=j; + pushTpool(gNB->threadPool,req); + nbJobs++; } - -#ifdef DEBUG_DLSCH_CODING - write_output("enc_input0.m","enc_in0",&harq->c[0][0],Kr_bytes,1,4); - write_output("enc_output0.m","enc0",&harq->d[0][0],(3*8*Kr_bytes)+12,1,4); -#endif - - F = harq->F; - - Kr = harq->K; - for (r=0; rC; r++) { - - if (F>0) { - for (int k=(Kr-F-2*(*Zc)); kd[r][k] = NR_NULL; - //if (k<(Kr-F+8)) - //printf("r %d filler bits [%d] = %d \n", r,k, harq->d[r][k]); - } - } - -#ifdef DEBUG_DLSCH_CODING - LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]); -#endif - - E = nr_get_E(G, harq->C, mod_order, rel15->nrOfLayers, r); - - //#ifdef DEBUG_DLSCH_CODING - LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", - r, - harq->C, - G, - E, - F, - Kr-F-2*(*Zc), - mod_order,nb_rb); - - // for tbslbrm calculation according to 5.4.2.1 of 38.212 - if (rel15->nrOfLayers < Nl) - Nl = rel15->nrOfLayers; - - Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl); - - start_meas(dlsch_rate_matching_stats); - if (nr_rate_matching_ldpc(Ilbrm, - Tbslbrm, - harq->BG, - *Zc, - harq->d[r], - harq->e+r_offset, - harq->C, - F, - Kr-F-2*(*Zc), - rel15->rvIndex[0], - E) == -1) - return -1; - - stop_meas(dlsch_rate_matching_stats); -#ifdef DEBUG_DLSCH_CODING - for (int i =0; i<16; i++) - printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset); -#endif - - start_meas(dlsch_interleaving_stats); - nr_interleaving_ldpc(E, - mod_order, - harq->e+r_offset, - harq->f+r_offset); - stop_meas(dlsch_interleaving_stats); - -#ifdef DEBUG_DLSCH_CODING - for (int i =0; i<16; i++) - printf("output interleaving f[%d]= %d r_offset %u\n", i,harq->f[i+r_offset], r_offset); - - if (r==harq->C-1) - write_output("enc_output.m","enc",harq->f,G,1,4); -#endif - - r_offset += E; + while(nbJobs) { + notifiedFIFO_elt_t *req=pullTpool(&nf, gNB->threadPool); + delNotifiedFIFO_elt(req); + nbJobs--; } - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_OUT); - return 0; } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c index 3ba13d2f44..26b45eb9f7 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c @@ -96,11 +96,6 @@ void nr_get_time_domain_allocation_type(nfapi_nr_config_request_t config, } } - -uint16_t get_SLIV(uint8_t S, uint8_t L) { - return ( (uint16_t)(((L-1)<=7)? (14*(L-1)+S) : (14*(15-L)+(13-S))) ); -} - static inline uint8_t get_K0(uint8_t row_idx, uint8_t time_alloc_type) { return ( (time_alloc_type == NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_A)|| (time_alloc_type == NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_C)? 0 : diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 1ce8c238cb..c4b40ec4cc 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -376,9 +376,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", + frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif @@ -397,11 +399,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, nb_rb_pdsch); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (first_symbol_flag==1) { if (beamforming_mode==0){ @@ -458,9 +460,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, #endif stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); @@ -509,11 +512,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { @@ -568,11 +571,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; @@ -651,9 +654,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif // Please keep it: useful for debugging diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c index a064a91d87..7c75884fa6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c @@ -947,7 +947,7 @@ void nr_dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms, symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,6,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,&rb_alloc,6,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { amp_tmp = 0x1fff;//dlsch0->sqrt_rho_b; already taken into account diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index 0ab17c11e6..3cb002f9e1 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1286,8 +1286,8 @@ uint8_t get_transmission_mode(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti); */ uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL); -int adjust_G(NR_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); -int adjust_G2(NR_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); +//int adjust_G(NR_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); +//int adjust_G2(NR_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); #ifndef modOrder @@ -1313,16 +1313,6 @@ uint8_t I_TBS2I_MCS(uint8_t I_TBS); uint8_t SE2I_TBS(float SE, uint8_t N_PRB, uint8_t symbPerRB); -/** \brief This function generates the sounding reference symbol (SRS) for the uplink according to 36.211 v8.6.0. If IFFT_FPGA is defined, the SRS is quantized to a QPSK sequence. - @param frame_parms LTE DL Frame Parameters - @param soundingrs_ul_config_dedicated Dynamic configuration from RRC during Connection Establishment - @param txdataF pointer to the frequency domain TX signal - @returns 0 on success*/ -int generate_srs(NR_DL_FRAME_PARMS *frame_parms, - SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, - int *txdataF, - int16_t amp, - uint32_t subframe); /*! @@ -1352,12 +1342,6 @@ int32_t generate_drs_pusch(PHY_VARS_NR_UE *phy_vars_ue, uint32_t nb_rb, uint8_t ant); -/*! - \brief This function initializes the Group Hopping, Sequence Hopping and nPRS sequences for PUCCH/PUSCH according to 36.211 v8.6.0. It should be called after configuration of UE (reception of SIB2/3) and initial configuration of eNB (or after reconfiguration of cell-specific parameters). - @param frame_parms Pointer to a NR_DL_FRAME_PARMS structure (eNB or UE)*/ -void init_ul_hopping(NR_DL_FRAME_PARMS *frame_parms); - - /*! \brief This function implements the initialization of paging parameters for UE (See Section 7, 36.304).It must be called after setting IMSImod1024 during UE startup and after receiving SIB2 @param ue Pointer to UE context @@ -1422,8 +1406,6 @@ double sinr_eff_cqi_calc(PHY_VARS_NR_UE *phy_vars_ue, uint8_t sinr2cqi(double sinr,uint8_t trans_mode); -int dump_dci(NR_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci); - int dump_ue_stats(PHY_VARS_NR_UE *phy_vars_ue, UE_nr_rxtx_proc_t *proc, char* buffer, int length, runmode_t mode, int input_level_dBm); void init_transport_channels(uint8_t); @@ -1513,18 +1495,11 @@ int get_nCCE_offset_l1(int *CCE_table, const unsigned short rnti, const unsigned char subframe); -uint16_t get_nCCE(uint8_t num_pdcch_symbols,NR_DL_FRAME_PARMS *frame_parms,uint8_t mi); -uint16_t get_nquad(uint8_t num_pdcch_symbols,NR_DL_FRAME_PARMS *frame_parms,uint8_t mi); - -uint8_t get_mi(NR_DL_FRAME_PARMS *frame,uint8_t subframe); +//uint8_t get_mi(NR_DL_FRAME_PARMS *frame,uint8_t subframe); uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe); -uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe); - -void pdcch_interleaving(NR_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi); - void nr_pdcch_unscrambling(int16_t *z, uint16_t scrambling_RNTI, uint32_t length, @@ -1539,7 +1514,6 @@ void dlsch_unscrambling(NR_DL_FRAME_PARMS *frame_parms, uint8_t q, uint8_t Ns); -void init_ncs_cell(NR_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]); void generate_pucch1x(int32_t **txdataF, NR_DL_FRAME_PARMS *frame_parms, @@ -1587,7 +1561,7 @@ void init_ulsch_power_LUT(void); @param subframe subframe index to check @returns 0 on success */ -int is_prach_subframe(NR_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe); +//int is_prach_subframe(NR_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe); /*! \brief Generate PRACH waveform @@ -1653,8 +1627,6 @@ void init_scrambling_lut(void); @param frame_parms Pointer to frame parameters @returns 1 if subframe is for MBSFN */ -int is_pmch_subframe(frame_t frame, int subframe, NR_DL_FRAME_PARMS *frame_parms); - uint8_t is_not_pilot(uint8_t pilots, uint8_t re, uint8_t nushift, uint8_t use2ndpilots); uint8_t is_not_UEspecRS(int8_t lprime, uint8_t re, uint8_t nushift, uint8_t Ncp, uint8_t beamforming_mode); @@ -1691,8 +1663,7 @@ uint8_t get_prach_prb_offset(NR_DL_FRAME_PARMS *frame_parms, uint8_t n_ra_prboffset, uint8_t tdd_mapindex, uint16_t Nf); - -uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); +#include uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 99dc2b658e..914523bc70 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -105,7 +105,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5]; int16_t **tx_layers; int32_t **txdataF; - int8_t Wf[2], Wt[2], l_prime[2], delta; + int8_t Wf[2], Wt[2]; + int l_prime[2], delta; uint8_t nb_dmrs_re_per_rb; int ap, i; int sample_offsetF, N_RE_prime; @@ -411,7 +412,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if (is_dmrs == 1) { // if transform precoding is enabled if (pusch_pdu->transform_precoding == 0) { - + ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[2*dmrs_idx]) >> 15; ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[(2*dmrs_idx) + 1]) >> 15; diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index cb929f1642..ddec605253 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -805,8 +805,8 @@ void nr_generate_pucch1_old(PHY_VARS_NR_UE *ue, } #endif //0 -inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) __attribute__((always_inline)); -inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) { +static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) __attribute__((always_inline)); +static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) { uint32_t x1, x2, s=0; int i; uint8_t c; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 11b5112a6c..fb4f9a0092 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -96,20 +96,6 @@ typedef struct { uint32_t subframe; /// MIMO mode for this DLSCH MIMO_mode_t mimo_mode; - /// Concatenated sequences - uint8_t *e; - /// LDPC-code outputs - uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; - /// Interleaver outputs - uint8_t *f; - /// Number of code segments - uint32_t C; - /// Number of bits in "small" code segments - uint32_t K; - /// Number of "Filler" bits - uint32_t F; - /// Encoder BG - uint8_t BG; /// LDPC lifting size uint32_t Z; } NR_DL_gNB_HARQ_t; @@ -868,6 +854,9 @@ typedef struct PHY_VARS_gNB_s { time_stats_t dlsch_encoding_stats; time_stats_t dlsch_modulation_stats; time_stats_t dlsch_scrambling_stats; + time_stats_t dlsch_resource_mapping_stats; + time_stats_t dlsch_layer_mapping_stats; + time_stats_t dlsch_precoding_stats; time_stats_t tinput; time_stats_t tprep; time_stats_t tparity; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 1685e206ae..792667d510 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -263,7 +263,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0,0); //dumpsig=1; } else { - LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n", + LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n", gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot, rdata->harq_pid, pusch_pdu->pusch_data.new_data_indicator, ulsch_harq->status, ulsch_harq->round, @@ -358,10 +358,11 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs pusch_pdu->qam_mod_order, pusch_pdu->nrOfLayers); - LOG_D(PHY,"rb_size %d, number_symbols %d, nb_re_dmrs %d, number_dmrs_symbols %d, qam_mod_order %d, nrOfLayer %d\n", + LOG_D(PHY,"rb_size %d, number_symbols %d, nb_re_dmrs %d, dmrs symbol positions %d, number_dmrs_symbols %d, qam_mod_order %d, nrOfLayer %d\n", pusch_pdu->rb_size, number_symbols, nb_re_dmrs, + pusch_pdu->ul_dmrs_symb_pos, number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs pusch_pdu->qam_mod_order, pusch_pdu->nrOfLayers); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 0b543da275..20b6e67aa9 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1022,14 +1022,14 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "In %s DL PDU length in bits: %d, in bytes: %d \n", __FUNCTION__, dlsch0->harq_processes[harq_pid]->TBS, dlsch0->harq_processes[harq_pid]->TBS / 8); - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); -#ifdef NR_PDSCH_DEBUG - LOG_I(PHY, " --> Unscrambling for CW0 %5.3f\n", + + + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); + LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_I(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", + LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); -#endif if(is_cw1_active) { // start ldpc decode for CW 1 @@ -1081,21 +1081,13 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); -#if PHYSIM - printf(" --> Unscrambling for CW1 %5.3f\n", - (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - printf("AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", - frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); -#else + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); + LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); -#endif - - LOG_D(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); @@ -1404,7 +1396,6 @@ void *UE_thread_slot1_dl_processing(void *arg) { stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); - LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); @@ -1495,7 +1486,6 @@ void *UE_thread_slot1_dl_processing(void *arg) { //printf("Set available LLR slot1 to 1 AbsSubframe %d.%d \n",frame_rx,nr_slot_rx); stop_meas(&ue->pdsch_procedures_per_slot_stat[proc->thread_id][1]); - LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { @@ -1867,7 +1857,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); - LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); @@ -1945,7 +1934,6 @@ if (nr_slot_rx==9) { } stop_meas(&ue->generic_stat); - LOG_D(PHY,"after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); #ifdef EMOS phy_procedures_emos_UE_RX(ue,slot,gNB_id); @@ -1955,7 +1943,6 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_rx[proc->thread_id]); - LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); //#endif //pdsch diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 1d9584b30b..ff07422c6b 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -118,7 +118,8 @@ int main(int argc, char **argv) uint8_t mcs_table = 0; double DS_TDL = .03; cpuf = get_cpu_freq_GHz(); - + char gNBthreads[128]="n"; + if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) { exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n"); } @@ -126,7 +127,7 @@ int main(int argc, char **argv) //logInit(); randominit(0); - while ((c = getopt(argc, argv, "df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:")) != -1) { + while ((c = getopt(argc, argv, "df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:X:")) != -1) { switch (c) { /*case 'f': write_output_file = 1; @@ -292,6 +293,11 @@ int main(int argc, char **argv) nb_rb = atoi(optarg); break; + case 'X': + strncpy(gNBthreads, optarg, sizeof(gNBthreads)); + gNBthreads[sizeof(gNBthreads)-1]=0; + break; + /*case 'x': transmission_mode = atoi(optarg); break;*/ @@ -352,6 +358,8 @@ int main(int argc, char **argv) RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *)); RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; + gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); + initTpool(gNBthreads, gNB->threadPool, true); //gNB_config = &gNB->gNB_config; frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH) frame_parms->nb_antennas_tx = n_tx; @@ -468,7 +476,6 @@ int main(int argc, char **argv) double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384); short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384); - double errors_bit_uncoded = 0; //unsigned char *estimated_output; unsigned char *estimated_output_bit; unsigned char *test_input_bit; @@ -506,8 +513,10 @@ int main(int argc, char **argv) //printf("crc32: [0]->0x%08x\n",crc24c(test_input, 32)); // generate signal + unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); + bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); if (input_fd == NULL) { - nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,NULL,NULL,NULL,NULL,NULL,NULL,NULL); + nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL); } for (SNR = snr0; SNR < snr1; SNR += snr_step) { @@ -515,7 +524,6 @@ int main(int argc, char **argv) n_false_positive = 0; for (trial = 0; trial < n_trials; trial++) { - errors_bit_uncoded = 0; for (i = 0; i < available_bits; i++) { #ifdef DEBUG_CODER if ((i&0xf)==0) @@ -524,11 +532,12 @@ int main(int argc, char **argv) //if (i<16) // printf("encoder output f[%d] = %d\n",i,dlsch->harq_processes[0]->f[i]); - if (dlsch->harq_process.f[i] == 0) + + if (output[i] == 0) modulated_input[i] = 1.0; ///sqrt(2); //QPSK else modulated_input[i] = -1.0; ///sqrt(2); - + //if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]); //SNR =10; SNR_lin = pow(10, SNR / 10.0); @@ -546,18 +555,14 @@ int main(int argc, char **argv) i,modulated_input[i], i,channel_output_fixed[i]); */ + //Uncoded BER if (channel_output_fixed[i] < 0) channel_output_uncoded[i] = 1; //QPSK demod else channel_output_uncoded[i] = 0; - - if (channel_output_uncoded[i] != dlsch->harq_process.f[i]) - errors_bit_uncoded = errors_bit_uncoded + 1; } - //if (errors_bit_uncoded>10) - //printf("errors bits uncoded %f\n", errors_bit_uncoded); #ifdef DEBUG_CODER printf("\n"); exit(-1); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 50e21ac02b..fa868a6896 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -277,7 +277,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, UE_info->CellGroup[0], sched_ctrl->active_bwp, NULL, - /* tda = */ 2, + /* tda = */ 0, dci_format, ps); @@ -369,6 +369,7 @@ int main(int argc, char **argv) uint8_t n_tx=1,n_rx=1; uint8_t round; uint8_t num_rounds = 4; + char gNBthreads[128]="n"; channel_desc_t *gNB2UE; //uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0; @@ -430,9 +431,7 @@ int main(int argc, char **argv) FILE *scg_fd=NULL; - - while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:D:e:m:w:T:U:q")) != -1) { - + while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:d:e:m:w:T:U:qX:")) != -1) { switch (c) { case 'f': scg_fd = fopen(optarg,"r"); @@ -635,7 +634,12 @@ int main(int argc, char **argv) dmrs_arg[i] = atoi(argv[optind++]); } break; - + + case 'X': + strncpy(gNBthreads, optarg, sizeof(gNBthreads)); + gNBthreads[sizeof(gNBthreads)-1]=0; + break; + default: case 'h': printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", @@ -671,7 +675,8 @@ int main(int argc, char **argv) printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n"); printf("-P Print DLSCH performances\n"); printf("-w Write txdata to binary file (one frame)\n"); - printf("-D number of dlsch threads, 0: no dlsch parallelization\n"); + printf("-d number of dlsch threads, 0: no dlsch parallelization\n"); + printf("-X gNB thread pool configuration, n => no threads"); exit (-1); break; } @@ -762,7 +767,7 @@ int main(int argc, char **argv) NR_CellGroupConfig_t *secondaryCellGroup=calloc(1,sizeof(*secondaryCellGroup)); prepare_scc(rrc.carrier.servingcellconfigcommon); uint64_t ssb_bitmap = 1; - fill_scc(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); + fill_scc_sim(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); ssb_bitmap = 1;// Enable only first SSB with index ssb_indx=0 fix_scc(scc,ssb_bitmap); @@ -827,6 +832,14 @@ int main(int argc, char **argv) fs = 61.44e6; bw = 40e6; } + else if (mu == 1 && N_RB_DL == 133) { + fs = 61.44e6; + bw = 50e6; + } + else if (mu == 1 && N_RB_DL == 162) { + fs = 61.44e6; + bw = 60e6; + } else if (mu == 3 && N_RB_DL == 66) { fs = 122.88e6; bw = 100e6; @@ -966,8 +979,7 @@ int main(int argc, char **argv) snrRun = 0; gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); - char tp_param[] = "n"; - initTpool(tp_param, gNB->threadPool, true); + initTpool(gNBthreads, gNB->threadPool, true); gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->resp_L1_tx); // we create 2 threads for L1 tx processing @@ -1217,8 +1229,8 @@ int main(int argc, char **argv) UE->dlsch[UE_proc.thread_id][0][0]->max_ldpc_iterations+1) n_errors++; - NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id]; - int16_t *UE_llr = pdsch_vars[0]->llr[0]; + //NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id]; + //int16_t *UE_llr = pdsch_vars[0]->llr[0]; TBS = UE_harq_process->TBS;//rel15->TBSize[0]; uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); @@ -1233,6 +1245,7 @@ int main(int argc, char **argv) printf("[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) ); } + /* for (i = 0; i < available_bits; i++) { if(((gNB_dlsch->harq_process.f[i] == 0) && (UE_llr[i] <= 0)) || @@ -1246,6 +1259,7 @@ int main(int argc, char **argv) } } + */ for (i = 0; i < TBS; i++) { estimated_output_bit[i] = (UE_harq_process->b[i/8] & (1 << (i & 7))) >> (i & 7); @@ -1289,11 +1303,9 @@ int main(int argc, char **argv) printf("\n"); if (print_perf==1) { - printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d, Kr %d (Zc %d))\n", + printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d)\n", 1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex, - msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3, - msgDataTx->dlsch[0][0]->harq_process.K, - msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10)); + msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3); printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx"); printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time"); printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time"); @@ -1305,6 +1317,9 @@ int main(int argc, char **argv) printStatIndent3(&gNB->dlsch_interleaving_stats, "DLSCH Interleaving time"); printStatIndent2(&gNB->dlsch_modulation_stats,"DLSCH modulation time"); printStatIndent2(&gNB->dlsch_scrambling_stats, "DLSCH scrambling time"); + printStatIndent2(&gNB->dlsch_layer_mapping_stats, "DLSCH Layer Mapping time"); + printStatIndent2(&gNB->dlsch_resource_mapping_stats, "DLSCH Resource Mapping time"); + printStatIndent2(&gNB->dlsch_precoding_stats,"DLSCH Layer Precoding time"); printf("\nUE RX function statistics (per %d us slot)\n",1000>>*scc->ssbSubcarrierSpacing); diff --git a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h index 8d4acd1af1..805913d055 100644 --- a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h +++ b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h @@ -59,167 +59,7 @@ int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {return(0);} //NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);} int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); } - -void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul) { - - *scc->physCellId=0; \ - // *scc->n_TimingAdvanceOffset=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0; - *scc->ssb_periodicityServingCell=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20; - scc->dmrs_TypeA_Position=NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2; - *scc->ssbSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; - *scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB=641032; - *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]=78; - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA=640000; - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; - - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_DL; - scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth=13036; - scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing=mu_dl;//NR_SubcarrierSpacing_kHz30; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero=12; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero=0; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->k0=0; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength=40; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->k0=0; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength=53; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->k0=0; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength=54; - *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]=78; - *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA=-1; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_UL; - *scc->uplinkConfigCommon->frequencyInfoUL->p_Max=20; - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth=13036; - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing=mu_ul;//NR_SubcarrierSpacing_kHz30; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex=98; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM=NR_RACH_ConfigGeneric__msg1_FDM_one; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart=0; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig=13; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower=-118; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax=NR_RACH_ConfigGeneric__preambleTransMax_n10; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep=NR_RACH_ConfigGeneric__powerRampingStep_dB2; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow=NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer=NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; - *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB=19; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present=NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139=0; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2=6; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2=6; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength=69; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2=6; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble=1; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant=-90; - scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither; - *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId=40; - *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal=-90; - scc->ssb_PositionsInBurst->present=NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap; - *ssb_bitmap=0xff; - scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity=NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots=7; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols=6; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots=2; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols=4; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity=321; - - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSlots=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols=-1; - scc->ss_PBCH_BlockPower=20; - *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing=-1; -} - +void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul); void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap); void prepare_scc(NR_ServingCellConfigCommon_t *scc); void prepare_scd(NR_ServingCellConfig_t *scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index a7075eb218..97c753d455 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -707,7 +707,7 @@ int main(int argc, char **argv) NR_CellGroupConfig_t *secondaryCellGroup=calloc(1,sizeof(*secondaryCellGroup)); prepare_scc(rrc.carrier.servingcellconfigcommon); uint64_t ssb_bitmap; - fill_scc(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); + fill_scc_sim(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); fix_scc(scc,ssb_bitmap); @@ -732,17 +732,13 @@ int main(int argc, char **argv) nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; cfg->carrier_config.num_tx_ant.value = n_tx; cfg->carrier_config.num_rx_ant.value = n_rx; - nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01); +// nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01); phy_init_nr_gNB(gNB,0,1); N_RB_DL = gNB->frame_parms.N_RB_DL; NR_BWP_Uplink_t *ubwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]; - //crcTableInit(); - - //nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_UL, mu, Nid_cell, SSB_positions); - //configure UE UE = malloc(sizeof(PHY_VARS_NR_UE)); diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index f61648d8b4..e1886b57ff 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -412,7 +412,7 @@ typedef struct NRRrcConfigurationReq_s { int sib1_tda; int pdsch_AntennaPorts; int pusch_AntennaPorts; - int minRXTXTIMEpdsch; + int minRXTXTIME; int do_CSIRS; int pusch_TargetSNRx10; int pucch_TargetSNRx10; diff --git a/openair2/GNB_APP/RRC_nr_paramsvalues.h b/openair2/GNB_APP/RRC_nr_paramsvalues.h index 70295b1c31..8a7ce64d91 100644 --- a/openair2/GNB_APP/RRC_nr_paramsvalues.h +++ b/openair2/GNB_APP/RRC_nr_paramsvalues.h @@ -58,56 +58,6 @@ #define GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO "initialDLBWPcontrolResourceSetZero" #define GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO "initialDLBWPsearchSpaceZero" - -#define GNB_CONFIG_STRING_INITIALDLBWPK0_0 "initialDLBWPk0_0" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_0 "initialDLBWPmappingType_0" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0 "initialDLBWPstartSymbolAndLength_0" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_1 "initialDLBWPk0_1" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1 "initialDLBWPmappingType_1" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_1 "initialDLBWPstartSymbolAndLength_1" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_2 "initialDLBWPk0_2" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2 "initialDLBWPmappingType_2" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2 "initialDLBWPstartSymbolAndLength_2" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_3 "initialDLBWPk0_3" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_3 "initialDLBWPmappingType_3" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_3 "initialDLBWPstartSymbolAndLength_3" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_4 "initialDLBWPk0_4" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_4 "initialDLBWPmappingType_4" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_4 "initialDLBWPstartSymbolAndLength_4" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_5 "initialDLBWPk0_5" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_5 "initialDLBWPmappingType_5" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_5 "initialDLBWPstartSymbolAndLength_5" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_6 "initialDLBWPk0_6" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_6 "initialDLBWPmappingType_6" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_6 "initialDLBWPstartSymbolAndLength_6" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_7 "initialDLBWPk0_7" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_7 "initialDLBWPmappingType_7" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_7 "initialDLBWPstartSymbolAndLength_7" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_8 "initialDLBWPk0_8" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_8 "initialDLBWPmappingType_8" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_8 "initialDLBWPstartSymbolAndLength_8" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_9 "initialDLBWPk0_9" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_9 "initialDLBWPmappingType_9" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_9 "initialDLBWPstartSymbolAndLength_9" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_10 "initialDLBWPk0_10" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_10 "initialDLBWPmappingType_10" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_10 "initialDLBWPstartSymbolAndLength_10" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_11 "initialDLBWPk0_11" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_11 "initialDLBWPmappingType_11" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_11 "initialDLBWPstartSymbolAndLength_11" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_12 "initialDLBWPk0_12" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_12 "initialDLBWPmappingType_12" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_12 "initialDLBWPstartSymbolAndLength_12" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_13 "initialDLBWPk0_13" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_13 "initialDLBWPmappingType_13" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_13 "initialDLBWPstartSymbolAndLength_13" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_14 "initialDLBWPk0_14" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_14 "initialDLBWPmappingType_14" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_14 "initialDLBWPstartSymbolAndLength_14" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_15 "initialDLBWPk0_15" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_15 "initialDLBWPmappingType_15" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_15 "initialDLBWPstartSymbolAndLength_15" - #define GNB_CONFIG_STRING_ULFREQUENCYBAND "ul_frequencyBand" #define GNB_CONFIG_STRING_ULABSOLUEFREQUENCYPOINTA "ul_absoluteFrequencyPointA" #define GNB_CONFIG_STRING_ULOFFSETTOCARRIER "ul_offstToCarrier" @@ -142,54 +92,6 @@ #define GNB_CONFIG_STRING_HOPPINGID "hoppingId" #define GNB_CONFIG_STRING_P0NOMINAL "p0_nominal" #define GNB_CONFIG_STRING_PUCCHRES "pucch_ResourceCommon" -#define GNB_CONFIG_STRING_INITIALULBWPK2_0 "initialULBWPk2_0" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0 "initialULBWPmappingType_0" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0 "initialULBWPstartSymbolAndLength_0" -#define GNB_CONFIG_STRING_INITIALULBWPK2_1 "initialULBWPk2_1" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1 "initialULBWPmappingType_1" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1 "initialULBWPstartSymbolAndLength_1" -#define GNB_CONFIG_STRING_INITIALULBWPK2_2 "initialULBWPk2_2" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_2 "initialULBWPmappingType_2" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_2 "initialULBWPstartSymbolAndLength_2" -#define GNB_CONFIG_STRING_INITIALULBWPK2_3 "initialULBWPk2_3" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3 "initialULBWPmappingType_3" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3 "initialULBWPstartSymbolAndLength_3" -#define GNB_CONFIG_STRING_INITIALULBWPK2_4 "initialULBWPk2_4" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4 "initialULBWPmappingType_4" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4 "initialULBWPstartSymbolAndLength_4" -#define GNB_CONFIG_STRING_INITIALULBWPK2_5 "initialULBWPk2_5" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5 "initialULBWPmappingType_5" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_5 "initialULBWPstartSymbolAndLength_5" -#define GNB_CONFIG_STRING_INITIALULBWPK2_6 "initialULBWPk2_6" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_6 "initialULBWPmappingType_6" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6 "initialULBWPstartSymbolAndLength_6" -#define GNB_CONFIG_STRING_INITIALULBWPK2_7 "initialULBWPk2_7" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7 "initialULBWPmappingType_7" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7 "initialULBWPstartSymbolAndLength_7" -#define GNB_CONFIG_STRING_INITIALULBWPK2_8 "initialULBWPk2_8" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8 "initialULBWPmappingType_8" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8 "initialULBWPstartSymbolAndLength_8" -#define GNB_CONFIG_STRING_INITIALULBWPK2_9 "initialULBWPk2_9" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_9 "initialULBWPmappingType_9" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_9 "initialULBWPstartSymbolAndLength_9" -#define GNB_CONFIG_STRING_INITIALULBWPK2_10 "initialULBWPk2_10" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10 "initialULBWPmappingType_10" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10 "initialULBWPstartSymbolAndLength_10" -#define GNB_CONFIG_STRING_INITIALULBWPK2_11 "initialULBWPk2_11" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11 "initialULBWPmappingType_11" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11 "initialULBWPstartSymbolAndLength_11" -#define GNB_CONFIG_STRING_INITIALULBWPK2_12 "initialULBWPk2_12" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_12 "initialULBWPmappingType_12" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_12 "initialULBWPstartSymbolAndLength_12" -#define GNB_CONFIG_STRING_INITIALULBWPK2_13 "initialULBWPk2_13" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13 "initialULBWPmappingType_13" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13 "initialULBWPstartSymbolAndLength_13" -#define GNB_CONFIG_STRING_INITIALULBWPK2_14 "initialULBWPk2_14" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14 "initialULBWPmappingType_14" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14 "initialULBWPstartSymbolAndLength_14" -#define GNB_CONFIG_STRING_INITIALULBWPK2_15 "initialULBWPk2_15" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15 "initialULBWPmappingType_15" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_15 "initialULBWPstartSymbolAndLength_15" #define GNB_CONFIG_STRING_SSBPOSITIONSINBURSTPR "ssb_PositionsInBurst_PR" @@ -273,54 +175,6 @@ {GNB_CONFIG_STRING_INITIALDLBWPSUBCARRIERSPACING,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0/*12*/},\ {GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero,defint64val:12,TYPE_INT64,0/*13*/},\ {GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero,defint64val:0,TYPE_INT64,0/*14*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_0,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->k0,defint64val:-1,TYPE_INT64,0/*15*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:-1,TYPE_INT64,0/*16*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:-1,TYPE_INT64,0/*17*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_1,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->k0,defint64val:-1,TYPE_INT64,0/*18*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*19*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*20*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPK0_2,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->k0,defint64val:-1,TYPE_INT64,0/*21*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*22*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*23*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_3,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->k0,defint64val:-1,TYPE_INT64,0/*24*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*25*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*26*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_4,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->k0,defint64val:-1,TYPE_INT64,0/*27*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*28*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*29*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_5,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->k0,defint64val:-1,TYPE_INT64,0/*30*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*31*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_5,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*32*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_6,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->k0,defint64val:-1,TYPE_INT64,0/*33*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_6,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*34*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*35*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_7,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->k0,defint64val:-1,TYPE_INT64,0/*36*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*37*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*38*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_8,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->k0,defint64val:-1,TYPE_INT64,0/*39*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*40*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*41*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_9,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->k0,defint64val:-1,TYPE_INT64,0/*42*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_9,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*43*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_9,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*44*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_10,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->k0,defint64val:-1,TYPE_INT64,0/*45*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*46*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*47*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_11,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->k0,defint64val:-1,TYPE_INT64,0/*48*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*49*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*50*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPK0_12,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->k0,defint64val:-1,TYPE_INT64,0/*51*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_12,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*52*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_12,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*53*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_13,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->k0,defint64val:-1,TYPE_INT64,0/*54*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*55*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*56*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_14,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->k0,defint64val:-1,TYPE_INT64,0/*57*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*58*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*59*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_15,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->k0,defint64val:-1,TYPE_INT64,0/*60*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*61*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_15,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*62*/},\ {GNB_CONFIG_STRING_ULFREQUENCYBAND,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0],defint64val:-1,TYPE_INT64,0/*63*/},\ {GNB_CONFIG_STRING_ULABSOLUEFREQUENCYPOINTA,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA,defint64val:-1,TYPE_INT64,0/*64*/},\ {GNB_CONFIG_STRING_ULOFFSETTOCARRIER,NULL,0,i64ptr:&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier,defint64val:0,TYPE_INT64,0/*65*/},\ @@ -345,54 +199,6 @@ {GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139,defint64val:0,TYPE_INT64,0/*84*/},\ {GNB_CONFIG_STRING_RESTRICTEDSETCONFIG,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig,defintval:NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet,TYPE_INT64,0/*85*/}, \ {GNB_CONFIG_STRING_MSG3TRANSFPREC,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder,defintval:1,TYPE_INT64,0/*86*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPK2_0,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2,defint64val:-1,TYPE_INT64,0/*87*/},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,/*88*/},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:55,TYPE_INT64,0/*89*/},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_1,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2,defint64val:-1,TYPE_INT64,0/*90*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_2,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_3,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_4,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*100*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_5,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_6,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_7,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*110*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPK2_8,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_9,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_9,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_9,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_10,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_11,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2,defint64val:-1,TYPE_INT64,0/*120*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_12,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_12,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_12,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_13,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_14,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*130*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_15,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ {GNB_CONFIG_STRING_MSG3DELTAPREABMLE, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble,defint64val:1,TYPE_INT64,0},\ {GNB_CONFIG_STRING_P0NOMINALWITHGRANT, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant,defint64val:1,TYPE_INT64,0},\ {GNB_CONFIG_STRING_PUCCHGROUPHOPPING, NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping,defint64val:NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither,TYPE_INT64,0},\ diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 9851d14b91..d069bfe2f4 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -94,8 +94,6 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { NR_FreqBandIndicatorNR_t *dl_frequencyBandList,*ul_frequencyBandList; struct NR_SCS_SpecificCarrier *dl_scs_SpecificCarrierList,*ul_scs_SpecificCarrierList; - struct NR_PDSCH_TimeDomainResourceAllocation *bwp_dl_timedomainresourceallocation; - struct NR_PUSCH_TimeDomainResourceAllocation *pusch_configcommontimedomainresourceallocation; // struct NR_RateMatchPattern *ratematchpattern; // NR_RateMatchPatternId_t *ratematchpatternid; // NR_TCI_StateId_t *TCI_StateId; @@ -143,14 +141,6 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->present = NR_SetupRelease_PDSCH_ConfigCommon_PR_setup; scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDSCH_ConfigCommon)); scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList = CALLOC(1,sizeof(struct NR_PDSCH_TimeDomainResourceAllocationList)); - // - for (int i=0;ik0 = CALLOC(1,sizeof(long)); - *bwp_dl_timedomainresourceallocation->k0=0; - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, - bwp_dl_timedomainresourceallocation); - } ul_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(struct NR_MultiFrequencyBandListNR)); @@ -199,12 +189,6 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier)); ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list,ul_scs_SpecificCarrierList); - for (int i=0;ik2 = CALLOC(1,sizeof(long)); - *pusch_configcommontimedomainresourceallocation->k2=0; - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_configcommontimedomainresourceallocation); - } //ratematchpattern = CALLOC(1,sizeof(struct NR_RateMatchPattern)); //ratematchpattern->patternType.choice.bitmaps = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps)); //ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf = MALLOC(35); @@ -223,6 +207,92 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { } +void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul) { + + *scc->physCellId=0; \ + // *scc->n_TimingAdvanceOffset=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0; + *scc->ssb_periodicityServingCell=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20; + scc->dmrs_TypeA_Position=NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2; + *scc->ssbSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; + *scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB=641032; + *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]=78; + scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA=640000; + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; + + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_DL; + scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth=13036; + scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing=mu_dl;//NR_SubcarrierSpacing_kHz30; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero=12; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero=0; + struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation0 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); + timedomainresourceallocation0->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + timedomainresourceallocation0->startSymbolAndLength=54; + ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + timedomainresourceallocation0); + struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation1 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); + timedomainresourceallocation1->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + timedomainresourceallocation1->startSymbolAndLength=57; + ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + timedomainresourceallocation1); + *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]=78; + *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA=-1; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_UL; + *scc->uplinkConfigCommon->frequencyInfoUL->p_Max=20; + scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth=13036; + scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing=mu_ul;//NR_SubcarrierSpacing_kHz30; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex=98; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM=NR_RACH_ConfigGeneric__msg1_FDM_one; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart=0; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig=13; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower=-118; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax=NR_RACH_ConfigGeneric__preambleTransMax_n10; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep=NR_RACH_ConfigGeneric__powerRampingStep_dB2; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow=NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer=NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; + *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB=19; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present=NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139=0; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet; + struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation0 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); + pusch_timedomainresourceallocation0->k2 = CALLOC(1,sizeof(long)); + *pusch_timedomainresourceallocation0->k2=6; + pusch_timedomainresourceallocation0->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + pusch_timedomainresourceallocation0->startSymbolAndLength=55; + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation0); + struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation1 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); + pusch_timedomainresourceallocation1->k2 = CALLOC(1,sizeof(long)); + *pusch_timedomainresourceallocation1->k2=6; + pusch_timedomainresourceallocation1->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + pusch_timedomainresourceallocation1->startSymbolAndLength=38; + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1); + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble=1; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant=-90; + scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither; + *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId=40; + *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal=-90; + scc->ssb_PositionsInBurst->present=NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap; + *ssb_bitmap=0xff; + scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity=NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots=7; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols=6; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots=2; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols=4; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity=321; + + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSlots=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols=-1; + scc->ss_PBCH_BlockPower=20; + *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing=-1; +} + void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { @@ -273,24 +343,9 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { if (*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder!=0) scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder = NULL; - // fix DL and UL Allocation lists - - for (int i=scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count-1;i>=0;i--) { - printf("Checking element %d : %ld\n",i,*scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0); - if (*scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0>32) { - printf("removing pdsch_TimeDomainAllocationList element %d\n",i); - free(scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0); - asn_sequence_del(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,i,1); - printf("List size now %d\n",scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count); - } - } + // prepare DL Allocation lists + nr_rrc_config_dl_tda(scc); - for (int i=scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.count-1;i>=0;i--) { - if (*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[i]->k2>32) { - free(scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[i]->k2); - asn_sequence_del(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,i,1); - } - } if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) { free(scc->tdd_UL_DL_ConfigurationCommon->pattern2); scc->tdd_UL_DL_ConfigurationCommon->pattern2=NULL; @@ -1107,11 +1162,9 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr; printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; - printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); - NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; + printf("minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIME = *GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; - printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); - NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 0c3d971569..730b6b85b6 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -119,7 +119,7 @@ typedef enum { #define GNB_CONFIG_STRING_SIB1TDA "sib1_tda" #define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS" #define GNB_CONFIG_STRING_NRCELLID "nr_cellid" -#define GNB_CONFIG_STRING_MINRXTXTIMEPDSCH "min_rxtxtime_pdsch" +#define GNB_CONFIG_STRING_MINRXTXTIME "min_rxtxtime" #define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist" @@ -148,7 +148,7 @@ typedef enum { {GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ -{GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_MINRXTXTIME, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ } @@ -172,7 +172,7 @@ typedef enum { #define GNB_SIB1_TDA_IDX 17 #define GNB_DO_CSIRS_IDX 18 #define GNB_NRCELLID_IDX 19 -#define GNB_MINRXTXTIMEPDSCH_IDX 20 +#define GNB_MINRXTXTIME_IDX 20 #define GNB_ULPRBBLACKLIST_IDX 21 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index f67a3e1fa5..764c92ecb7 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -44,46 +44,9 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int nrofUplinkSlots, int nrofUplinkSymbols) { int slot_number = 0; - int nb_periods_per_frame; + int nb_periods_per_frame = get_nb_periods_per_frame(cfg->tdd_table.tdd_period); int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<tdd_table.tdd_period) { - case 0: - nb_periods_per_frame = 20; // 10ms/0p5ms - break; - - case 1: - nb_periods_per_frame = 16; // 10ms/0p625ms - break; - - case 2: - nb_periods_per_frame = 10; // 10ms/1ms - break; - - case 3: - nb_periods_per_frame = 8; // 10ms/1p25ms - break; - - case 4: - nb_periods_per_frame = 5; // 10ms/2ms - break; - - case 5: - nb_periods_per_frame = 4; // 10ms/2p5ms - break; - - case 6: - nb_periods_per_frame = 2; // 10ms/5ms - break; - - case 7: - nb_periods_per_frame = 1; // 10ms/10ms - break; - - default: - AssertFatal(1==0,"Undefined tdd period %d\n", cfg->tdd_table.tdd_period); - } - int nb_slots_per_period = ((1<tdd_table.tdd_period_in_slots = nb_slots_per_period; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index a5f6e4a7d1..2f4ceb48ec 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -944,6 +944,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr return -1; } + if(rnti != ra->ra_rnti && rnti != SI_RNTI) + AssertFatal(1+dci->pdsch_to_harq_feedback_timing_indicator.val>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d).\n", + 1+dci->pdsch_to_harq_feedback_timing_indicator.val,DURATION_RX_TO_TX); + // set the harq status at MAC for feedback set_harq_status(mac,dci->pucch_resource_indicator, dci->harq_pid, @@ -1232,7 +1236,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr uint8_t feedback_ti = ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0]; - AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d)\n", + AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d). Min feedback time set in config file (min_rxtxtime).\n", feedback_ti,DURATION_RX_TO_TX); // set the harq status at MAC for feedback @@ -3160,10 +3164,10 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, pos+=fsize; dci_pdu_rel15->frequency_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<time_domain_assignment.nbits; - dci_pdu_rel15->time_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&0x3; + dci_pdu_rel15->time_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<time_domain_assignment.nbits)-1); // Not supported yet - skip for now // Frequency hopping flag – 1 bit diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index c142af13ba..3d45877979 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -129,7 +129,7 @@ long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) { } AssertFatal(k2 >= DURATION_RX_TO_TX, - "Slot offset K2 (%ld) cannot be less than DURATION_RX_TO_TX (%d)\n", + "Slot offset K2 (%ld) cannot be less than DURATION_RX_TO_TX (%d). K2 set according to min_rxtxtime in config file.\n", k2,DURATION_RX_TO_TX); LOG_D(NR_MAC, "get_k2(): k2 is %ld\n", k2); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 25aeea70a6..2705b85b8c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -870,9 +870,6 @@ void nr_get_Msg3alloc(module_id_t module_id, int mu = ubwp ? ubwp->bwp_Common->genericParameters.subcarrierSpacing : scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; - int StartSymbolIndex = 0; - int NrOfSymbols = 0; - int startSymbolAndLength = 0; int temp_slot = 0; ra->Msg3_tda_id = 16; // initialization to a value above limit @@ -881,20 +878,29 @@ void nr_get_Msg3alloc(module_id_t module_id, scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; uint8_t k2 = 0; - for (int i=0; ilist.count; i++) { - startSymbolAndLength = pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; - SLIV2SL(startSymbolAndLength, &StartSymbolIndex, &NrOfSymbols); - // we want to transmit in the uplink symbols of mixed slot - if (NrOfSymbols == scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols) { + lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + if (frame_type == TDD) { + int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); + int nb_slots_per_period = ((1<list.count; i++) { k2 = *pusch_TimeDomainAllocationList->list.array[i]->k2; - temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 - ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; - if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { - ra->Msg3_tda_id = i; - break; + // we want to transmit in the uplink symbols of mixed slot + if ((k2 + DELTA[mu])%nb_slots_per_period == 0) { + temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 + ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; + if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { + ra->Msg3_tda_id = i; + break; + } } } } + else { + ra->Msg3_tda_id = 0; + k2 = *pusch_TimeDomainAllocationList->list.array[0]->k2; + temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 + ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; + } AssertFatal(ra->Msg3_tda_id<16,"Unable to find Msg3 time domain allocation in list\n"); @@ -915,7 +921,7 @@ void nr_get_Msg3alloc(module_id_t module_id, tdd_beam_association[num_tdd_period] = ra->beam_id; } - LOG_D(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u start symbol index %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id, StartSymbolIndex); + LOG_D(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id); uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[ra->Msg3_slot * MAX_BWP_SIZE]; @@ -972,7 +978,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->bwp_size = bwp_size; pusch_pdu->subcarrier_spacing = scs; pusch_pdu->cyclic_prefix = 0; - pusch_pdu->mcs_index = 0; + pusch_pdu->mcs_index = 1; pusch_pdu->mcs_table = 0; pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); @@ -1009,11 +1015,14 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->pusch_data.harq_process_id = 0; pusch_pdu->pusch_data.new_data_indicator = 1; pusch_pdu->pusch_data.num_cb = 0; + int num_dmrs_symb = 0; + for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++) + num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1; pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, pusch_pdu->target_code_rate, pusch_pdu->rb_size, pusch_pdu->nr_of_symbols, - 12, // nb dmrs set for no data in dmrs symbol + num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol 0, //nb_rb_oh 0, // to verify tb scaling pusch_pdu->nrOfLayers)>>3; @@ -1074,7 +1083,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t fh = ubwp->bwp_Dedicated->pusch_Config->choice.setup->frequencyHopping ? 1 : 0; } - LOG_D(NR_MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", + LOG_D(NR_MAC, "Frame %d, Slot %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", frameP, slotP, ra->Msg3_frame, @@ -1105,7 +1114,12 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra if ((ra->Msg2_frame == frameP) && (ra->Msg2_slot == slotP)) { - uint8_t time_domain_assignment = 1; + //TODO time domain assignment for msg2 needs to be improved + uint8_t time_domain_assignment; + if(cc->frame_type == TDD) + time_domain_assignment = 1; + else + time_domain_assignment = 0; uint8_t mcsIndex = 0; int rbStart = 0; int rbSize = 8; @@ -1245,6 +1259,8 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type) dmrsConfigType = 1; + NR_PDSCH_Config_t *pdsch_config = bwp && bwp->bwp_Dedicated && bwp->bwp_Dedicated->pdsch_Config ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL; + pdsch_pdu_rel15->pduBitmap = 0; pdsch_pdu_rel15->rnti = ra->RA_rnti; pdsch_pdu_rel15->pduIndex = pduindex; @@ -1273,7 +1289,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra pdsch_pdu_rel15->VRBtoPRBMapping = 0; pdsch_pdu_rel15->StartSymbolIndex = startSymbolIndex; pdsch_pdu_rel15->NrOfSymbols = nrOfSymbols; - pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, + pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 33cb2b1b1d..7b7b5c771b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -351,7 +351,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, const NR_BWP_Uplink_t *ubwp, - const NR_BWP_UplinkDedicated_t *ubwpd, + const NR_BWP_UplinkDedicated_t *ubwpd, long dci_format, int tda, uint8_t num_dmrs_cdm_grps_no_data, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 313dd6236e..c68b16b553 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -104,7 +104,6 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub /* check that TDA index 1 fits into UL slot and does not overlap with PUCCH */ const struct NR_PUSCH_TimeDomainResourceAllocationList *tdaList = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; - AssertFatal(tdaList->list.count >= 3, "need to have at least three TDAs for UL slots\n"); const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_UL = tdaList->list.array[0]; const int k2 = get_K2(scc, (NR_BWP_Uplink_t*)ubwp,0, mu); int start, len; @@ -117,27 +116,28 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub // get largest time domain allocation (TDA) for UL slot and UL in mixed slot int tdaMi = -1; - const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; - AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), - "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", - k2, - get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); - SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); - const uint16_t symb_tda_mi = ((1 << len) - 1) << start; - // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check - // whether TDA is entirely within mixed slot, UL. Note that here we assume - // that the PUCCH is scheduled in every slot, and on all RBs (which is - // mostly not true, this is a simplification) - if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { - tdaMi = 1; - } else { - LOG_E(NR_MAC, - "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", - symb_pucch, - symb_ulMixed, - symb_tda_mi); + if(tdaList->list.count > 1) { + const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; + AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), + "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", + k2, + get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); + SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); + const uint16_t symb_tda_mi = ((1 << len) - 1) << start; + // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check + // whether TDA is entirely within mixed slot, UL. Note that here we assume + // that the PUCCH is scheduled in every slot, and on all RBs (which is + // mostly not true, this is a simplification) + if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { + tdaMi = 1; + } else { + LOG_E(NR_MAC, + "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", + symb_pucch, + symb_ulMixed, + symb_tda_mi); + } } - const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 547c5da00c..5e5de9a8e1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -64,7 +64,7 @@ void *nrmac_stats_thread(void *arg) { fseek(fd,0,SEEK_SET); } fclose(fd); - return (void *)0; + return NULL; } void clear_mac_stats(gNB_MAC_INST *gNB) { diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index ff6923429e..bdd1cf5261 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1185,9 +1185,9 @@ void fill_initial_SpCellConfig(rnti_t rnti, long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - AssertFatal(carrier->minRXTXTIMEpdsch >=2 && carrier->minRXTXTIMEpdsch <7, - "check minRXTXTIMEpdsch %d\n",carrier->minRXTXTIMEpdsch); - *delay[i] = (i+carrier->minRXTXTIMEpdsch); + AssertFatal(carrier->minRXTXTIME >=2 && carrier->minRXTXTIME <7, + "check minRXTXTIME %d\n",carrier->minRXTXTIME); + *delay[i] = (i+carrier->minRXTXTIME); ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index dedd4cf839..6b7f9a21b9 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -29,96 +29,79 @@ */ #include "nr_rrc_config.h" +#include "common/utils/nr/nr_common.h" -void rrc_config_rlc_bearer(uint8_t Mod_id, - int CC_id, - rlc_bearer_config_t *rlc_config - ){ - rlc_config->LogicalChannelIdentity[CC_id] = 0; - rlc_config->servedRadioBearer_present[CC_id] = 0; - rlc_config->srb_Identity[CC_id] = 0; - rlc_config->drb_Identity[CC_id] = 0; - rlc_config->reestablishRLC[CC_id] = 0; - rlc_config->rlc_Config_present[CC_id] = 0; - rlc_config->ul_AM_sn_FieldLength[CC_id] = 0; - rlc_config->t_PollRetransmit[CC_id] = 0; - rlc_config->pollPDU[CC_id] = 0; - rlc_config->pollByte[CC_id] = 0; - rlc_config->maxRetxThreshold[CC_id] = 0; - rlc_config->dl_AM_sn_FieldLength[CC_id] = 0; - rlc_config->dl_AM_t_Reassembly[CC_id] = 0; - rlc_config->t_StatusProhibit[CC_id] = 0; - rlc_config->ul_UM_sn_FieldLength[CC_id] = 0; - rlc_config->dl_UM_sn_FieldLength[CC_id] = 0; - rlc_config->dl_UM_t_Reassembly[CC_id] = 0; - rlc_config->priority[CC_id] = 0; - rlc_config->prioritisedBitRate[CC_id] = 0; - rlc_config->bucketSizeDuration[CC_id] = 0; - rlc_config->allowedServingCells[CC_id] = 0; - rlc_config->subcarrierspacing[CC_id] = 0; - rlc_config->maxPUSCH_Duration[CC_id] = 0; - rlc_config->configuredGrantType1Allowed[CC_id] = 0; - rlc_config->logicalChannelGroup[CC_id] = 0; - rlc_config->schedulingRequestID[CC_id] = 0; - rlc_config->logicalChannelSR_Mask[CC_id] = 0; - rlc_config->logicalChannelSR_DelayTimerApplied[CC_id] = 0; +void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ + + lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + + // setting default TDA for DL with + struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); + timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,13); // basic slot configuration starting in symbol 1 til the end of the slot + ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + timedomainresourceallocation); + + if(frame_type==TDD) { + // TDD + if(scc->tdd_UL_DL_ConfigurationCommon) { + int dl_symb = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols; + if(dl_symb > 1) { + timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); + timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,dl_symb-1); // mixed slot configuration starting in symbol 1 til the end of the dl allocation + ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + timedomainresourceallocation); + } + } + } } -void rrc_config_mac_cellgroup(uint8_t Mod_id, - int CC_id, - mac_cellgroup_t *mac_cellgroup_config - ){ - mac_cellgroup_config->DRX_Config_PR[CC_id] = 0; - mac_cellgroup_config->drx_onDurationTimer_PR[CC_id] = 0; - mac_cellgroup_config->subMilliSeconds[CC_id] = 0; - mac_cellgroup_config->milliSeconds[CC_id] = 0; - mac_cellgroup_config->drx_InactivityTimer[CC_id] = 0; - mac_cellgroup_config->drx_HARQ_RTT_TimerDL[CC_id] = 0; - mac_cellgroup_config->drx_HARQ_RTT_TimerUL[CC_id] = 0; - mac_cellgroup_config->drx_RetransmissionTimerDL[CC_id] = 0; - mac_cellgroup_config->drx_RetransmissionTimerUL[CC_id] = 0; - mac_cellgroup_config->drx_LongCycleStartOffset_PR[CC_id] = 0; - mac_cellgroup_config->drx_LongCycleStartOffset[CC_id] = 0; - mac_cellgroup_config->drx_ShortCycle[CC_id] = 0; - mac_cellgroup_config->drx_ShortCycleTimer[CC_id] = 0; - mac_cellgroup_config->drx_SlotOffset[CC_id] = 0; - mac_cellgroup_config->schedulingRequestId[CC_id] = 0; - mac_cellgroup_config->sr_ProhibitTimer[CC_id] = 0; - mac_cellgroup_config->sr_TransMax[CC_id] = 0; - mac_cellgroup_config->periodicBSR_Timer[CC_id] = 0; - mac_cellgroup_config->retxBSR_Timer[CC_id] = 0; - mac_cellgroup_config->logicalChannelSR_DelayTimer[CC_id] = 0; - mac_cellgroup_config->tag_Id[CC_id] = 0; - mac_cellgroup_config->timeAlignmentTimer[CC_id] = 0; - mac_cellgroup_config->PHR_Config_PR[CC_id] = 0; - mac_cellgroup_config->phr_PeriodicTimer[CC_id] = 0; - mac_cellgroup_config->phr_ProhibitTimer[CC_id] = 0; - mac_cellgroup_config->phr_Tx_PowerFactorChange[CC_id] = 0; - mac_cellgroup_config->multiplePHR[CC_id] = 0; - mac_cellgroup_config->phr_Type2SpCell[CC_id] = 0; - mac_cellgroup_config->phr_Type2OtherCell[CC_id] = 0; - mac_cellgroup_config->phr_ModeOtherCG[CC_id] = 0; - mac_cellgroup_config->skipUplinkTxDynamic[CC_id] = 0; + +void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ + + //TODO change to accomodate for SRS + + int temp_min_delay = 6; // k2 = 2 or 3 won'r work as well as higher values + int k2 = (min_fb_delayuplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; + lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + + struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); + pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); + *pusch_timedomainresourceallocation->k2 = k2; + pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(0,13); // basic slot configuration starting in symbol 0 til the last but one symbol + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); + + if(frame_type==TDD) { + // TDD + if(scc->tdd_UL_DL_ConfigurationCommon) { + int ul_symb = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols; + pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); + pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); + *pusch_timedomainresourceallocation->k2 = k2; + pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); + + // for msg3 in the mixed slot + int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); + int nb_slots_per_period = ((1<k2 = CALLOC(1,sizeof(long)); + *pusch_timedomainresourceallocation_msg3->k2 = nb_slots_per_period - DELTA[mu]; + if(*pusch_timedomainresourceallocation_msg3->k2 < min_fb_delay) + *pusch_timedomainresourceallocation_msg3->k2 += nb_slots_per_period; + AssertFatal(*pusch_timedomainresourceallocation_msg3->k2<33,"Computed k2 for msg3 %ld is larger than the range allowed by RRC (0..32)\n", + *pusch_timedomainresourceallocation_msg3->k2); + pusch_timedomainresourceallocation_msg3->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3); + } + } + } -void rrc_config_physicalcellgroup(uint8_t Mod_id, - int CC_id, - physicalcellgroup_t *physicalcellgroup_config - ){ - physicalcellgroup_config->harq_ACK_SpatialBundlingPUCCH[CC_id] = 0; - physicalcellgroup_config->harq_ACK_SpatialBundlingPUSCH[CC_id] = 0; - physicalcellgroup_config->p_NR[CC_id] = 0; - physicalcellgroup_config->pdsch_HARQ_ACK_Codebook[CC_id] = 0; - physicalcellgroup_config->tpc_SRS_RNTI[CC_id] = 0; - physicalcellgroup_config->tpc_PUCCH_RNTI[CC_id] = 0; - physicalcellgroup_config->tpc_PUSCH_RNTI[CC_id] = 0; - physicalcellgroup_config->sp_CSI_RNTI[CC_id] = 0; - physicalcellgroup_config->RNTI_Value[CC_id] = 0; -} - -void rrc_config_rachdedicated(uint8_t Mod_id, - int CC_id, - physicalcellgroup_t *physicalcellgroup_config - ){ - -} diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index e19d94b341..192fee754e 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -111,29 +111,8 @@ typedef struct physicalcellgroup_s{ long RNTI_Value[MAX_NUM_CCs]; }physicalcellgroup_t; -typedef struct rach_dedicated_s{ - - -}rach_dedicated_t; +void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); +void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay); -void rrc_config_servingcellconfigcommon(uint8_t Mod_id, - int CC_id, - gNB_RrcConfigurationReq *common_configuration - ); - -void rrc_config_rlc_bearer(uint8_t Mod_id, - int CC_id, - rlc_bearer_config_t *rlc_config - ); - -void rrc_config_mac_cellgroup(uint8_t Mod_id, - int CC_id, - mac_cellgroup_t *mac_cellgroup_config - ); - -void rrc_config_physicalcellgroup(uint8_t Mod_id, - int CC_id, - physicalcellgroup_t *physicalcellgroup_config - ); #endif diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index ad31e8cac7..d71393bc2d 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -447,7 +447,7 @@ typedef struct { int sib1_tda; int pdsch_AntennaPorts; int pusch_AntennaPorts; - int minRXTXTIMEpdsch; + int minRXTXTIME; int do_CSIRS; NR_BCCH_DL_SCH_Message_t *siblock1; NR_ServingCellConfigCommon_t *servingcellconfigcommon; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 34e570070d..7f7353f9af 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -136,80 +136,6 @@ void openair_nr_rrc_on(const protocol_ctxt_t *const ctxt_pP) { ///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------/// -void rrc_gNB_process_SgNBAdditionRequest( - const protocol_ctxt_t *const ctxt_pP, - rrc_gNB_ue_context_t *ue_context_pP -) { - rrc_gNB_generate_SgNBAdditionRequestAcknowledge(ctxt_pP,ue_context_pP); -} - -void rrc_gNB_generate_SgNBAdditionRequestAcknowledge( - const protocol_ctxt_t *const ctxt_pP, - rrc_gNB_ue_context_t *const ue_context_pP) { - //uint8_t size; - //uint8_t buffer[100]; - //int CC_id = ue_context_pP->ue_context.primaryCC_id; - //OCTET_STRING_t *secondaryCellGroup; - NR_CellGroupConfig_t *cellGroupconfig; - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_BearerToAddModList; - struct NR_MAC_CellGroupConfig *mac_CellGroupConfig; - struct NR_PhysicalCellGroupConfig *physicalCellGroupConfig; - struct NR_SpCellConfig *spCellConfig; - //struct NR_CellGroupConfig__sCellToAddModList *sCellToAddModList; - cellGroupconfig = CALLOC(1,sizeof(NR_CellGroupConfig_t)); - cellGroupconfig->rlc_BearerToAddModList = CALLOC(1,sizeof(struct NR_CellGroupConfig__rlc_BearerToAddModList)); - cellGroupconfig->mac_CellGroupConfig = CALLOC(1,sizeof(struct NR_MAC_CellGroupConfig)); - cellGroupconfig->physicalCellGroupConfig = CALLOC(1,sizeof(struct NR_PhysicalCellGroupConfig)); - cellGroupconfig->spCellConfig = CALLOC(1,sizeof(struct NR_SpCellConfig)); - //cellGroupconfig->sCellToAddModList = CALLOC(1,sizeof(struct NR_CellGroupConfig__sCellToAddModList)); - rlc_BearerToAddModList = cellGroupconfig->rlc_BearerToAddModList; - mac_CellGroupConfig = cellGroupconfig->mac_CellGroupConfig; - physicalCellGroupConfig = cellGroupconfig->physicalCellGroupConfig; - spCellConfig = cellGroupconfig->spCellConfig; - //sCellToAddModList = cellGroupconfig->sCellToAddModList; - rlc_bearer_config_t *rlc_config; - rlc_config = CALLOC(1,sizeof(rlc_bearer_config_t)); - //Fill rlc_bearer config value - rrc_config_rlc_bearer(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - rlc_config - ); - //Fill rlc_bearer config to structure - do_RLC_BEARER(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - rlc_BearerToAddModList, - rlc_config); - mac_cellgroup_t *mac_cellgroup_config; - mac_cellgroup_config = CALLOC(1,sizeof(mac_cellgroup_t)); - //Fill mac_cellgroup_config config value - rrc_config_mac_cellgroup(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - mac_cellgroup_config - ); - //Fill mac_cellgroup config to structure - do_MAC_CELLGROUP(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - mac_CellGroupConfig, - mac_cellgroup_config); - physicalcellgroup_t *physicalcellgroup_config; - physicalcellgroup_config = CALLOC(1,sizeof(physicalcellgroup_t)); - //Fill physicalcellgroup_config config value - rrc_config_physicalcellgroup(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - physicalcellgroup_config - ); - //Fill physicalcellgroup config to structure - do_PHYSICALCELLGROUP(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - physicalCellGroupConfig, - physicalcellgroup_config); - do_SpCellConfig(RC.nrrrc[ctxt_pP->module_id], - spCellConfig); -} - -///---------------------------------------------------------------------------------------------------------------/// -///---------------------------------------------------------------------------------------------------------------/// - static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration) { LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__); if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { @@ -330,9 +256,10 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset; rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts; rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts; - rrc->carrier.minRXTXTIMEpdsch = configuration->minRXTXTIMEpdsch; + rrc->carrier.minRXTXTIME = configuration->minRXTXTIME; rrc->carrier.sib1_tda = configuration->sib1_tda; rrc->carrier.do_CSIRS = configuration->do_CSIRS; + nr_rrc_config_ul_tda(configuration->scc,configuration->minRXTXTIME); /// System Information INIT pthread_mutex_init(&rrc->cell_info_mutex,NULL); rrc->cell_info_configured = 0; diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 2104d5cdd7..3311779235 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -241,7 +241,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, - carrier->minRXTXTIMEpdsch, + carrier->minRXTXTIME, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); @@ -251,7 +251,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, - carrier->minRXTXTIMEpdsch, + carrier->minRXTXTIME, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 4b8fd77dc5..30604cd015 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -55,7 +55,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int scg_id, int servCellIndex, int dl_antenna_ports, - int minRXTXTIMEpdsch, + int minRXTXTIME, int do_csirs, int initial_csi_index, int uid) { @@ -483,10 +483,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_PDSCH_TimeDomainResourceAllocation_t *pdschi; for (int i=0;idownlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;i++) { pdschi= calloc(1,sizeof(*pdschi)); - AssertFatal(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0!=NULL,"element %d is null\n",i); - - pdschi->k0 = calloc(1,sizeof(*pdschi->k0)); - *pdschi->k0 = *servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0; + if(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0){ + pdschi->k0 = calloc(1,sizeof(*pdschi->k0)); + *pdschi->k0 = *servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0; + } pdschi->mappingType = servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->mappingType; pdschi->startSymbolAndLength = servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; ASN_SEQUENCE_ADD(&bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,pdschi); @@ -946,7 +946,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = i+minRXTXTIMEpdsch; + *delay[i] = i+minRXTXTIME; ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); @@ -1349,7 +1349,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, - int minRXTXTIMEpdsch, + int minRXTXTIME, int do_csirs, int initial_csi_index, int uid) { @@ -1365,7 +1365,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon 1, 1, dl_antenna_ports, - minRXTXTIMEpdsch, + minRXTXTIME, do_csirs, initial_csi_index, uid); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index b260eaa58d..c6a4a90a14 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -55,15 +55,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -120,19 +111,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; #p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index 0306fe5d0b..fd9399f89e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,20 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 4; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index c14ad17b42..59e71a6225 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 4; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index ff0fdd96bb..3fc81c0d6c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot (but is not used here) - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,19 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot (not used here) - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index 937790d4ac..a40a93c789 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 4; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index c9a95d59e8..3860aba935 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,18 +109,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index 524407c4de..7c527e07c8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,18 +109,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf index d191b67988..a171f2aae0 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 2dfa329346..4f8c785baa 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf index 7f0829e40a..012f46401e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot (but not used here) - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 63; # this is SS=7 L=5 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 91; # this is SS=7 L=7 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index 6248afab2f..b6b9252560 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,20 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index 6f28cd36c1..0817d7373e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index 30194647b8..fd4c23cfdb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; #12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; # used for (full) DL slot - initialDLBWPmappingType_0 = 0; # 0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; # this is SS=1,L=13 - - initialDLBWPk0_1 = 0; # used for DL part mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; # this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,19 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for (full) UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for UL part mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index fcbd3c0f02..965408332c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -54,16 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 - #uplinkConfigCommon #frequencyInfoUL @@ -118,19 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index 63123b8201..e36748a3a9 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 217ff76376..7b2d369919 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index a1acfc313b..dbf4f58348 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -54,16 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 - #uplinkConfigCommon #frequencyInfoUL @@ -118,19 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 540dddad21..6d23726a78 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -54,16 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 - #uplinkConfigCommon #frequencyInfoUL @@ -118,19 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index edc5eaa0d4..c3fa56f15e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -54,16 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 - #uplinkConfigCommon #frequencyInfoUL @@ -118,19 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index 362a280ccb..15aa368fdf 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf index e541607559..1583e07ca1 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf @@ -54,29 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -131,22 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index b1c78bc978..8dfcfb2b88 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index 96f2909031..d01b0947c0 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -55,28 +55,7 @@ gNBs = initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57) - initialDLBWPstartSymbolAndLength_3 = 57; //43; //57; #uplinkConfigCommon #frequencyInfoUL ul_frequencyBand = 78; @@ -130,21 +109,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 2; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf index f51f59ae30..198ad8471c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 59e507ed3e..2f4839fd3b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -56,15 +56,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -119,18 +110,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 05e441d396..7f9e4d2d44 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -81,29 +81,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 53; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 81; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -158,22 +135,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=12 - initialULBWPstartSymbolAndLength_0 = 53; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf index 3bd884b602..ab4713f8b5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf @@ -69,29 +69,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -146,21 +123,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index de6bafc9f7..9238ea1809 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -73,15 +73,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -136,19 +127,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index c4b06c1139..86318d80e2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -74,15 +74,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -137,19 +128,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index c7531f39ba..bbdd8b9c0f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -74,15 +74,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -137,19 +128,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index a0d25053b6..e9577ee265 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -70,29 +70,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -147,22 +124,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; From ddfd22d0fda91ed1e84f149e2c15510c1650e955 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 5 Jan 2022 14:10:12 +0000 Subject: [PATCH 083/196] Fix memset input parameters --- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 5620018b73..afd1fc6e0d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -213,7 +213,7 @@ void ldpc8blocks( void *p) { for (int rr=impp->macro_num*8; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++ ) { if (impp->F>0) { // writing into positions d[r][k-2Zc] as in clause 5.3.2 step 2) in 38.212 - memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], impp->F, NR_NULL); + memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], NR_NULL, impp->F); } #ifdef DEBUG_DLSCH_CODING From d1db83caabdb7d6eb8bc78779588f4e3b7b6f041 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 5 Jan 2022 14:12:20 +0000 Subject: [PATCH 084/196] Rename min_rxtxtime in config files after merge --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 86318d80e2..6cb7ca5270 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -35,7 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; ul_prbblacklist = "51,52,53,54" pdcch_ConfigSIB1 = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index bbdd8b9c0f..bf68970100 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -35,7 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( From b6b79d555eb44a7dd7df86ebff3b95d88831c3aa Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 6 Jan 2022 10:49:00 +0100 Subject: [PATCH 085/196] Clean up nr_pbchsim program options --- openair1/SIMULATION/NR_PHY/pbchsim.c | 164 +++++++++++++-------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index a5c6222fe5..60866b5089 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -211,7 +211,7 @@ int main(int argc, char **argv) randominit(0); - while ((c = getopt (argc, argv, "f:hA:pf:g:i:j:n:o:s:S:t:x:y:z:M:N:F:GR:dP:IL:m:")) != -1) { + while ((c = getopt (argc, argv, "F:g:hIL:m:M:n:N:o:P:R:s:S:x:y:z:")) != -1) { switch (c) { /*case 'f': write_output_file=1; @@ -228,6 +228,14 @@ int main(int argc, char **argv) frame_type = 1; break;*/ + case 'F': + input_fd = fopen(optarg,"r"); + if (input_fd==NULL) { + printf("Problem with filename %s. Exiting.\n", optarg); + exit(-1); + } + break; + case 'g': switch((char)*optarg) { case 'A': @@ -265,18 +273,42 @@ int main(int argc, char **argv) break; - /*case 'i': + /* + case 'i': interf1=atoi(optarg); break; + */ + case 'I': + run_initial_sync=1; + target_error_rate=0.1; + break; + + /* case 'j': interf2=atoi(optarg); break;*/ + case 'L': + loglvl = atoi(optarg); + break; + + case 'm': + mu = atoi(optarg); + break; + + case 'M': + SSB_positions = atoi(optarg); + break; + case 'n': n_trials = atoi(optarg); break; + case 'N': + Nid_cell = atoi(optarg); + break; + case 'o': cfo = atof(optarg); #ifdef DEBUG_NR_PBCHSIM @@ -284,6 +316,30 @@ int main(int argc, char **argv) #endif break; + /*case 'p': + extended_prefix_flag=1; + break;*/ + + case 'P': + pbch_phase = atoi(optarg); + if (pbch_phase>3) + printf("Illegal PBCH phase (0-3) got %d\n",pbch_phase); + break; + + /* + case 'r': + ricean_factor = pow(10,-.1*atof(optarg)); + if (ricean_factor>1) { + printf("Ricean factor must be between 0 and 1\n"); + exit(-1); + } + break; + */ + + case 'R': + N_RB_DL = atoi(optarg); + break; + case 's': snr0 = atof(optarg); #ifdef DEBUG_NR_PBCHSIM @@ -304,19 +360,7 @@ int main(int argc, char **argv) Td= atof(optarg); break; */ - /*case 'p': - extended_prefix_flag=1; - break;*/ - /* - case 'r': - ricean_factor = pow(10,-.1*atof(optarg)); - if (ricean_factor>1) { - printf("Ricean factor must be between 0 and 1\n"); - exit(-1); - } - break; - */ case 'x': transmission_mode=atoi(optarg); @@ -329,94 +373,50 @@ int main(int argc, char **argv) case 'y': n_tx=atoi(optarg); - if ((n_tx==0) || (n_tx>2)) { - printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx); + printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx); exit(-1); } - break; case 'z': n_rx=atoi(optarg); - if ((n_rx==0) || (n_rx>2)) { - printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx); + printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx); exit(-1); } - - break; - - case 'M': - SSB_positions = atoi(optarg); - break; - - case 'N': - Nid_cell = atoi(optarg); - break; - - case 'R': - N_RB_DL = atoi(optarg); - break; - - case 'F': - input_fd = fopen(optarg,"r"); - - if (input_fd==NULL) { - printf("Problem with filename %s. Exiting.\n", optarg); - exit(-1); - } - - break; - - case 'P': - pbch_phase = atoi(optarg); - - if (pbch_phase>3) - printf("Illegal PBCH phase (0-3) got %d\n",pbch_phase); - - break; - - case 'I': - run_initial_sync=1; - target_error_rate=0.1; - break; - - case 'L': - loglvl = atoi(optarg); - break; - - case 'm': - mu = atoi(optarg); break; default: case 'h': - printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", + printf("%s -F input_filename -g channel_mod -h(elp) -I(nitial sync) -L log_lvl -n n_frames -M SSBs -n frames -N cell_id -o FO -P phase -R RBs -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant\n", argv[0]); - printf("-h This message\n"); - //printf("-p Use extended prefix mode\n"); + //printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n"); + //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); //printf("-d Use TDD\n"); - printf("-n Number of frames to simulate\n"); - printf("-m Numerology index\n"); - printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n"); - printf("-S Ending SNR, runs from SNR0 to SNR1\n"); - printf("-t Delay spread for multipath channel\n"); + //printf("-f Output filename (.txt format) for Pe/SNR results\n"); + printf("-F Input filename (.txt format) for RX conformance testing\n"); printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n"); + printf("-h This message\n"); + //printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n"); + printf("-I run initial sync with target error rate 0.1\n"); + //printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); + printf("-L set the log level (-1 disable, 0 error, 1 warning, 2 info, 3 debug, 4 trace)\n"); + printf("-m Numerology index\n"); + printf("-M Multiple SSB positions in burst\n"); + printf("-n Number of frames to simulate\n"); + printf("-N Nid_cell\n"); + printf("-o Carrier frequency offset in Hz\n"); + //printf("-O oversampling factor (1,2,4,8,16)\n"); + //printf("-p Use extended prefix mode\n"); + printf("-P PBCH phase, allowed values 0-3\n"); + printf("-R N_RB_DL\n"); + printf("-s Starting SNR, runs from SNR0 to SNR0 + 10 dB if not -S given. If -n 1, then just SNR is simulated\n"); + printf("-S Ending SNR, runs from SNR0 to SNR1\n"); + //printf("-t Delay spread for multipath channel\n"); printf("-x Transmission mode (1,2,6 for the moment)\n"); printf("-y Number of TX antennas used in eNB\n"); printf("-z Number of RX antennas used in UE\n"); - //printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n"); - //printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); - printf("-o Carrier frequency offset in Hz\n"); - printf("-M Multiple SSB positions in burst\n"); - printf("-N Nid_cell\n"); - printf("-R N_RB_DL\n"); - printf("-O oversampling factor (1,2,4,8,16)\n"); - printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n"); - //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); - //printf("-f Output filename (.txt format) for Pe/SNR results\n"); - printf("-F Input filename (.txt format) for RX conformance testing\n"); exit (-1); break; } From 513eebee1e69bc0cc9c7cbba58b1cbd8a6e9a5e0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 6 Jan 2022 10:53:22 +0100 Subject: [PATCH 086/196] Add nr_pbchsim option to select random number seed --- openair1/SIMULATION/NR_PHY/pbchsim.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 60866b5089..3a769a3cfb 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -203,15 +203,15 @@ int main(int argc, char **argv) float target_error_rate = 0.01; + int seed = 0; + cpuf = get_cpu_freq_GHz(); if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) { exit_fun("[NR_PBCHSIM] Error, configuration module init failed\n"); } - randominit(0); - - while ((c = getopt (argc, argv, "F:g:hIL:m:M:n:N:o:P:R:s:S:x:y:z:")) != -1) { + while ((c = getopt (argc, argv, "F:g:hIL:m:M:n:N:o:P:r:R:s:S:x:y:z:")) != -1) { switch (c) { /*case 'f': write_output_file=1; @@ -336,6 +336,10 @@ int main(int argc, char **argv) break; */ + case 'r': + seed = atoi(optarg); + break; + case 'R': N_RB_DL = atoi(optarg); break; @@ -389,7 +393,7 @@ int main(int argc, char **argv) default: case 'h': - printf("%s -F input_filename -g channel_mod -h(elp) -I(nitial sync) -L log_lvl -n n_frames -M SSBs -n frames -N cell_id -o FO -P phase -R RBs -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant\n", + printf("%s -F input_filename -g channel_mod -h(elp) -I(nitial sync) -L log_lvl -n n_frames -M SSBs -n frames -N cell_id -o FO -P phase -r seed -R RBs -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant\n", argv[0]); //printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n"); //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); @@ -410,6 +414,7 @@ int main(int argc, char **argv) //printf("-O oversampling factor (1,2,4,8,16)\n"); //printf("-p Use extended prefix mode\n"); printf("-P PBCH phase, allowed values 0-3\n"); + printf("-r set the random number generator seed (default: 0 = current time)\n"); printf("-R N_RB_DL\n"); printf("-s Starting SNR, runs from SNR0 to SNR0 + 10 dB if not -S given. If -n 1, then just SNR is simulated\n"); printf("-S Ending SNR, runs from SNR0 to SNR1\n"); @@ -422,6 +427,8 @@ int main(int argc, char **argv) } } + randominit(seed); + logInit(); set_glog(loglvl); T_stdout = 1; From 56714b2c8224b139e25af1457e7abeb59ad72694 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 24 Dec 2021 12:24:35 +0000 Subject: [PATCH 087/196] Fix warnings after merge with develop --- openair1/PHY/INIT/nr_init_ue.c | 11 +---------- openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 11 +++++------ .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 9 ++++++--- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index f664a03ba0..fd5cc962b1 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -20,23 +20,14 @@ */ #include "phy_init.h" -#include "SCHED_UE/sched_UE.h" #include "PHY/phy_extern_nr_ue.h" -//#include "SIMULATION/TOOLS/sim.h" -/*#include "RadioResourceConfigCommonSIB.h" -#include "RadioResourceConfigDedicated.h" -#include "TDD-Config.h" -#include "MBSFN-SubframeConfigList.h"*/ #include "openair1/PHY/defs_RU.h" #include "openair1/PHY/impl_defs_nr.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "assertions.h" -#include +#include "PHY/MODULATION/nr_modulation.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" -//#include "PHY/LTE_REFSIG/lte_refsig.h" -#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h" -#include "PHY/INIT/phy_init.h" #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c index 82bb0a2659..66ed4593d8 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c @@ -44,15 +44,14 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, int16_t *d) { - uint32_t i; - uint8_t reset; - uint32_t x1, x2, s=0; + uint8_t reset = 1; + uint32_t x1 = 0; + uint32_t s = 0; - reset = 1; // x1 is set in lte_gold_generic - x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 + uint32_t x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 - for (i=0; i<32; i++) { + for (uint32_t i=0; i<32; i++) { if ((i&0x1f)==0) { s = lte_gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 9238ea1809..ef96df2995 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( @@ -66,7 +67,7 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=27,L=48 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952 + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -86,7 +87,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 12952; + initialULBWPlocationAndBandwidth = 28875; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -218,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 @@ -296,5 +297,7 @@ log_config : rrc_log_verbosity ="medium"; ngap_log_level ="debug"; ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; From b8daf747bd8d234c04c0ca0a6999057df5acbd9f Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 6 Jan 2022 14:39:31 +0000 Subject: [PATCH 088/196] Increase nr_pbchsim test requirements to pass in CI --- cmake_targets/autotests/test_case_list.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 3472b14efc..09207555ba 100755 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1069,12 +1069,13 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/targets/bin/nr_pbchsim.Rel15 - -s0 -S1 -n1000 -R106 - -s0 -S1 -n10 -I -R106 - -s0 -S1 -n1000 -R217 - -s0 -S1 -n10 -I -R217 - -s0 -S1 -n1000 -R273 - -s0 -S1 -n10 -I -R273 + -s-11 -S-8 -n10 -R106 + -s-11 -S-8 -n10 -o8000 -I -R106 + -s-11 -S-8 -n10 -R217 + -s-11 -S-8 -n10 -o8000 -I -R217 + -s-11 -S-8 -n10 -R273 + -s-11 -S-8 -n10 -o8000 -I -R273 + nr_pbchsim.test1 nr_pbchsim.test2 nr_pbchsim.test3 nr_pbchsim.test4 nr_pbchsim.test5 nr_pbchsim.test6 PBCH test OK segmentation fault|assertion|exiting|fatal From 395c211e6def48e4605653f80559754ebefc4a62 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 6 Jan 2022 16:18:55 +0000 Subject: [PATCH 089/196] Fix indentation --- cmake_targets/autotests/test_case_list.xml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 09207555ba..6450b64298 100755 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1069,13 +1069,12 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/targets/bin/nr_pbchsim.Rel15 - -s-11 -S-8 -n10 -R106 - -s-11 -S-8 -n10 -o8000 -I -R106 - -s-11 -S-8 -n10 -R217 - -s-11 -S-8 -n10 -o8000 -I -R217 - -s-11 -S-8 -n10 -R273 - -s-11 -S-8 -n10 -o8000 -I -R273 - + -s-11 -S-8 -n10 -R106 + -s-11 -S-8 -n10 -o8000 -I -R106 + -s-11 -S-8 -n10 -R217 + -s-11 -S-8 -n10 -o8000 -I -R217 + -s-11 -S-8 -n10 -R273 + -s-11 -S-8 -n10 -o8000 -I -R273 nr_pbchsim.test1 nr_pbchsim.test2 nr_pbchsim.test3 nr_pbchsim.test4 nr_pbchsim.test5 nr_pbchsim.test6 PBCH test OK segmentation fault|assertion|exiting|fatal From ef298dc36c940723ee36b12b6dec4cc50fc12247 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 7 Jan 2022 18:02:24 +0000 Subject: [PATCH 090/196] Add ffo compensation based on SSS --- openair1/PHY/NR_REFSIG/sss_nr.h | 2 +- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 29 ++++++++++++++++++- openair1/PHY/NR_UE_TRANSPORT/sss_nr.c | 16 +++++++++- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/sss_nr.h b/openair1/PHY/NR_REFSIG/sss_nr.h index e413400097..03610ae30f 100644 --- a/openair1/PHY/NR_REFSIG/sss_nr.h +++ b/openair1/PHY/NR_REFSIG/sss_nr.h @@ -96,7 +96,7 @@ int pss_ch_est_nr(PHY_VARS_NR_UE *ue, int32_t pss_ext[NB_ANTENNAS_RX][LENGTH_PSS_NR], int32_t sss_ext[NB_ANTENNAS_RX][LENGTH_SSS_NR]); -int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max); +int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max, int *freq_offset_sss); #undef INIT_VARIABLES_SSS_NR_H #undef EXTERN diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index dcb8035e8a..0bcdfa68db 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -295,7 +295,34 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, LOG_I(PHY,"Calling sss detection (normal CP)\n"); #endif - rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp); + int freq_offset_sss = 0; + rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp, &freq_offset_sss); + + accumulated_freq_offset += freq_offset_sss; + + // digital compensation of FFO for SSB symbols + if (ue->UE_fo_compensation){ + double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time + double off_angle = -2*M_PI*s_time*freq_offset_sss; // offset rotation angle compensation per sample + + // In SA we need to perform frequency offset correction until the end of buffer because we need to decode SIB1 + // and we do not know yet in which slot it goes. + + // start for offset correction + int start = sa ? is*fp->samples_per_frame : is*fp->samples_per_frame + ue->ssb_offset; + + // loop over samples + int end = sa ? n_frames*fp->samples_per_frame-1 : start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples); + + for(int n=start; nnb_antennas_rx; ar++) { + re = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n]); + im = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n+1]); + ((short *)ue->common_vars.rxdata[ar])[2*n] = (short)(round(re*cos(n*off_angle) - im*sin(n*off_angle))); + ((short *)ue->common_vars.rxdata[ar])[2*n+1] = (short)(round(re*sin(n*off_angle) + im*cos(n*off_angle))); + } + } + } nr_gold_pbch(ue); ret = nr_pbch_detection(proc, ue, 1); // start pbch detection at first symbol after pss diff --git a/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c index 9339f3974d..dc73fe0add 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c @@ -420,7 +420,7 @@ int pss_sss_extract_nr(PHY_VARS_NR_UE *phy_vars_ue, * *********************************************************************/ -int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max) +int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max, int *freq_offset_sss) { uint8_t i; int32_t pss_ext[NB_ANTENNAS_RX][LENGTH_PSS_NR]; @@ -558,5 +558,19 @@ int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, } //#endif + int re = 0; + int im = 0; + d = (int16_t *)&d_sss[Nid2][Nid1]; + for(i = 0; isubcarrier_spacing); + + double ffo_pss = ((double)ue->common_vars.freq_offset)/frame_parms->subcarrier_spacing; + LOG_I(NR_PHY, "ffo_pss %f (%i Hz), ffo_sss %f (%i Hz), ffo_pss+ffo_sss %f (%i Hz)\n", + ffo_pss, (int)(ffo_pss*frame_parms->subcarrier_spacing), ffo_sss, *freq_offset_sss, ffo_pss+ffo_sss, (int)((ffo_pss+ffo_sss)*frame_parms->subcarrier_spacing)); + return(0); } From f6c735f5605c7f913f7bb81e8877b4dc5e1a0449 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 7 Jan 2022 18:54:31 +0000 Subject: [PATCH 091/196] Revert to timing adjustment based on cyclic prefix and improves it --- executables/nr-ue.c | 25 ++------ openair1/PHY/NR_REFSIG/pss_nr.h | 2 - .../PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c | 6 -- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 59 ------------------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 6 +- 5 files changed, 7 insertions(+), 91 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 6694635e26..db3c1c9ac1 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -456,26 +456,10 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) { } int computeSamplesShift(PHY_VARS_NR_UE *UE) { - - // compute TO compensation that should be applied for this frame - if ( UE->rx_offset < UE->frame_parms.samples_per_frame/2 && - UE->rx_offset > 0 ) { - LOG_I(PHY,"!!!adjusting -1 samples!!! rx_offset == %d\n", UE->rx_offset); - UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame - UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied - return -1 ; - } - - if ( UE->rx_offset > UE->frame_parms.samples_per_frame/2 && - UE->rx_offset < UE->frame_parms.samples_per_frame ) { - int rx_offset = UE->rx_offset - UE->frame_parms.samples_per_frame; - LOG_I(PHY,"!!!adjusting +1 samples!!! rx_offset == %d\n", rx_offset); - UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame - UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied - return 1; - } - - return 0; + int samples_shift = -(UE->rx_offset>>1); + UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame + UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied + return samples_shift; } static inline int get_firstSymSamp(uint16_t slot, NR_DL_FRAME_PARMS *fp) { @@ -642,6 +626,7 @@ void *UE_thread(void *arg) { readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms); writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms); } else { + UE->rx_offset_diff = computeSamplesShift(UE); readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms) - UE->rx_offset_diff; writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms)- UE->rx_offset_diff; diff --git a/openair1/PHY/NR_REFSIG/pss_nr.h b/openair1/PHY/NR_REFSIG/pss_nr.h index 3b480d7fab..b32d48a2e9 100644 --- a/openair1/PHY/NR_REFSIG/pss_nr.h +++ b/openair1/PHY/NR_REFSIG/pss_nr.h @@ -141,8 +141,6 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain int *eNB_id, int *f_off); -int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue); - #endif #undef EXTERN diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c index 19d4bf5079..15f3abad79 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c @@ -115,12 +115,6 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, } } - if (ue->rx_offset < 0) - ue->rx_offset += frame_parms->samples_per_frame; - - if (ue->rx_offset >= frame_parms->samples_per_frame) - ue->rx_offset -= frame_parms->samples_per_frame; - #ifdef DEBUG_PHY LOG_D(PHY,"AbsSubframe %d: diff = %i, rx_offset (final) = %i : clear = %d, max_pos = %d, max_pos_fil = %d, max_val = %d, sync_pos %d\n", subframe, diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 8ff0795871..4fc11d5fc6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -976,62 +976,3 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain return(peak_position); } -int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue) { - - int **rxdata = ue->common_vars.rxdata; - NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; - uint8_t Nid2 = GET_NID2(frame_parms->Nid_cell); - int peak_position_ref = ((frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)<<1) + frame_parms->nb_prefix_samples0; - - int maxval=0; - for (int i=0;i<2*(frame_parms->ofdm_symbol_size);i++) { - maxval = max(maxval,primary_synchro_time_nr[Nid2][i]); - maxval = max(maxval,-primary_synchro_time_nr[Nid2][i]); - } - int shift = log2_approx(maxval); - - /* Search pss in the received buffer each 4 samples which ensures a memory alignment on 128 bits (32 bits x 4 ) */ - /* This is required by SIMD (single instruction Multiple Data) Extensions of Intel processors. */ - /* Correlation computation is based on a dot product which is realized thank to SIMS extensions */ - int64_t peak_value = 0; - int peak_position = 0; - int64_t result = 0; - int64_t avg=0; - int start = peak_position_ref - (frame_parms->ofdm_symbol_size>>3); - int length = frame_parms->ofdm_symbol_size + (frame_parms->ofdm_symbol_size>>3); - memset(pss_corr_ue[Nid2],0,(start+length)*sizeof(int64_t)); - for (int n=start; n < start+length; n+=4) { // - for (int ar=0; arnb_antennas_rx; ar++) { - result = dot_product64((short*)primary_synchro_time_nr[Nid2], - (short*) &(rxdata[ar][n]), - frame_parms->ofdm_symbol_size, - shift); - pss_corr_ue[Nid2][n] += abs64(result); - } - avg+=pss_corr_ue[Nid2][n]; - if (pss_corr_ue[Nid2][n] > peak_value) { - peak_value = pss_corr_ue[Nid2][n]; - peak_position = n; - } - } - - avg/=(length/4); - if (peak_value < 5*avg) { - return 0; - } - - int peak_position_diff = peak_position_ref - peak_position; - - ue->rx_offset_diff = 0; - if(peak_position_diff != 0) { - ue->rx_offset_diff = peak_position_diff>>3; - if (ue->rx_offset_diff == 0) { - ue->rx_offset_diff = peak_position_diff > 0 ? 1 : -1; - } - } - - LOG_D(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB\n", - peak_position, peak_position_diff, dB_fixed64(peak_value),dB_fixed64(avg)); - - return peak_position_diff; -} diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 20b6e67aa9..a948dffce8 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1638,12 +1638,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { - nr_adjust_pss_synch(ue); - LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); nr_ue_pbch_procedures(gNB_id, ue, proc, 0); - /* if (ue->no_timing_correction==0) { + if (ue->no_timing_correction==0) { LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction); nr_adjust_synch_ue(fp, ue, @@ -1652,7 +1650,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, nr_slot_rx, 0, 16384); - }*/ + } LOG_D(PHY, "Doing N0 measurements in %s\n", __FUNCTION__); nr_ue_rrc_measurements(ue, proc, nr_slot_rx); From 2c289c45d11eb8636ac9349f98c744d0e6c6fe7a Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 10 Jan 2022 12:18:25 +0100 Subject: [PATCH 092/196] Minor fixes after code review --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 16 ++++++++-------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 7e0609f554..24b983aba5 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -42,14 +42,14 @@ void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int mu, NR_TDD_UL_DL_ConfigCommon_t *tdd_config) { - int nrofDownlinkSlots = tdd_config->pattern1.nrofDownlinkSlots; - int nrofDownlinkSymbols = tdd_config->pattern1.nrofDownlinkSymbols; - int nrofUplinkSlots = tdd_config->pattern1.nrofUplinkSlots; - int nrofUplinkSymbols = tdd_config->pattern1.nrofUplinkSymbols; + const int nrofDownlinkSlots = tdd_config->pattern1.nrofDownlinkSlots; + const int nrofDownlinkSymbols = tdd_config->pattern1.nrofDownlinkSymbols; + const int nrofUplinkSlots = tdd_config->pattern1.nrofUplinkSlots; + const int nrofUplinkSymbols = tdd_config->pattern1.nrofUplinkSymbols; int slot_number = 0; - int nb_periods_per_frame = get_nb_periods_per_frame(tdd_config->pattern1.dl_UL_TransmissionPeriodicity); - int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<pattern1.dl_UL_TransmissionPeriodicity); + const int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<tdd_table.tdd_period_in_slots = nb_slots_per_period; if ( (nrofDownlinkSymbols + nrofUplinkSymbols) == 0 ) @@ -105,7 +105,7 @@ void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, } } - LOG_I(NR_MAC, "TDD has been properly configurated\n"); + LOG_I(NR_MAC, "TDD has been properly configured\n"); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 75b018c901..28e1fd67c5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -422,7 +422,7 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, } else{ if(frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); + AssertFatal(frame_type == FDD, "Dynamic TDD not handled yet\n"); } From 1efef96e64d4577538ca0e1a7a7548b81dd5d152 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 10 Jan 2022 14:28:17 +0100 Subject: [PATCH 093/196] Using ASN_STRUCT_FREE instead of free --- openair2/GNB_APP/gnb_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index f97b2061c6..c6eab03ebd 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -348,7 +348,7 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { lte_frame_type_t frame_type = get_frame_type((int)*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); if (frame_type == FDD) { - free(scc->tdd_UL_DL_ConfigurationCommon); + ASN_STRUCT_FREE(asn_DEF_NR_TDD_UL_DL_ConfigCommon, scc->tdd_UL_DL_ConfigurationCommon); scc->tdd_UL_DL_ConfigurationCommon = NULL; } else { // TDD if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) { From ef6c93b8425db7b527954cd3fa2fc1c4f7d303fa Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 10 Jan 2022 14:29:21 +0100 Subject: [PATCH 094/196] Updating IF configuration description in RUNMODE file --- doc/RUNMODEM.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index 057be0d6cf..7a4dbefa3d 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -179,15 +179,15 @@ With the RF simulator (on the same machine): ## IF setup with OAI -The `if_freq` and `if_freq_off` options can be used to set (via command line) custom downlink and uplink FR1 arbitrary frequencies for the IF equipment both. +OAI is also compatible with Intermediate Frequency (IF) equipment. This allows to use RF front-end that with arbitrary frequencies bands that do not comply with the standardised 3GPP NR bands. -In the same way, the following parameters must be configured in the RUs section of the gNB configuration file: +To configure the IF frequencies it is necessary to use two command-line options at UE side: +- `if_freq`, downlink frequency in Hz +- `if_freq_off`, uplink frequency offset in Hz -`if_freq` - -`if_offset` - -The values must be given in Hz. +Accordingly, the following parameters must be configured in the RUs section of the gNB configuration file: +- `if_freq` +- `if_offset` ### Run OAI with custom DL/UL arbitrary frequencies From 0e0b7a34f79966d46bc614041528fd12de42862a Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 10 Jan 2022 15:07:12 +0100 Subject: [PATCH 095/196] Restored check on pattern1.ext1 --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 24b983aba5..3b10167e03 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -105,6 +105,13 @@ void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, } } + if (tdd_config->pattern1.ext1 == NULL) { + cfg->tdd_table.tdd_period = tdd_config->pattern1.dl_UL_TransmissionPeriodicity; + } else { + AssertFatal(tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); + cfg->tdd_table.tdd_period = *tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; + } + LOG_I(NR_MAC, "TDD has been properly configured\n"); } From 52b05b8fe0860cd47806afb6a9a777b86e52b084 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 10 Jan 2022 16:20:05 +0100 Subject: [PATCH 096/196] review changes --- openair2/GNB_APP/gnb_config.c | 12 ++++++------ openair2/LAYER2/NR_MAC_gNB/config.c | 18 ++++++++---------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 7 +++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 7 +++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 7 +++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 7 +++---- 6 files changed, 26 insertions(+), 32 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index f97b2061c6..50acd69994 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1160,17 +1160,17 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { (NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l] == 3),"BAD MNC DIGIT LENGTH %d", NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l]); } - printf("SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr); + LOG_I(RRC,"SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = *GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr; - printf("pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr); + LOG_I(RRC,"pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr; - printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); + LOG_I(RRC,"pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; - printf("minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); + LOG_I(RRC,"minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIME = *GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr; - printf("SIB1 TDA %d\n",*GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr); + LOG_I(RRC,"SIB1 TDA %d\n",*GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; - printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); + LOG_I(RRC,"Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 0c397187b5..e9fdcf1647 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -445,13 +445,12 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, RC.nrmac[Mod_idP]->UL_tti_req_ahead[0] = calloc(n, sizeof(nfapi_nr_ul_tti_request_t)); AssertFatal(RC.nrmac[Mod_idP]->UL_tti_req_ahead[0], "could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n"); - /* fill in slot/frame numbers: slot is fixed, frame will be updated by - * scheduler */ - uint16_t sf_ahead = (uint16_t) ceil((float)6/(0x01<<(*scc->ssbSubcarrierSpacing))); - uint16_t sl_ahead = sf_ahead * (0x01<<(*scc->ssbSubcarrierSpacing)); + /* fill in slot/frame numbers: slot is fixed, frame will be updated by scheduler + extern sf_ahead is initialized in ru_thread but that function is not executed yet here*/ + const uint16_t sf_ahead = (uint16_t) ceil((float)6/(0x01<<(*scc->ssbSubcarrierSpacing))); + const uint16_t sl_ahead = sf_ahead * (0x01<<(*scc->ssbSubcarrierSpacing)); /* consider that scheduler runs sl_ahead: the first sl_ahead slots are - * already "in the past" and thus we put frame 1 instead of 0! Note that - * extern variable sl_ahead is not initialized yet, so computing it above */ + * already "in the past" and thus we put frame 1 instead of 0!*/ for (int i = 0; i < n; ++i) { nfapi_nr_ul_tti_request_t *req = &RC.nrmac[Mod_idP]->UL_tti_req_ahead[0][i]; req->SFN = i < (sl_ahead-1); @@ -501,10 +500,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0); nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - else{ - if(RC.nrmac[Mod_idP]->common_channels[0].frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(RC.nrmac[Mod_idP]->common_channels[0].frame_type == FDD,"Dynamic TDD not handled yet\n"); for (int slot = 0; slot < n; ++slot) { /* FIXME: it seems there is a problem with slot 0/10/slots right after UL: diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 75b018c901..39fd4671cb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -487,10 +487,9 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, // go to previous slot if the current scheduled slot is beyond the response window // and if the slot is not among the PDCCH monitored ones (38.213 10.1) - while ((*msg2_frame>frame_limit) || - ((*msg2_frame==frame_limit) && - (*msg2_slot>slot_limit)) || - ((*msg2_frame*nr_slots_per_frame[mu]+*msg2_slot-monitoring_offset)%monitoring_slot_period !=0)) { + while (*msg2_frame > frame_limit + || (*msg2_frame == frame_limit && *msg2_slot > slot_limit) + || ((*msg2_frame * nr_slots_per_frame[mu] + *msg2_slot - monitoring_offset) % monitoring_slot_period != 0)) { if(!tdd || ((*msg2_slot%tdd_period_slot) > 0)) { if (*msg2_slot==0) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 7a495865d3..f11c1bf899 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -75,10 +75,9 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - else{ - if(frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(nrmac->common_channels->frame_type == FDD,"Dynamic TDD not handled yet\n"); int target_ss; if (bwp) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 231f505564..8066e79e2f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1200,10 +1200,9 @@ int nr_acknack_scheduling(int mod_id, first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); first_ul_slot_period = tdd->nrofDownlinkSlots; } - else{ - if(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD,"Dynamic TDD not handled yet\n"); NR_sched_pucch_t *csi_pucch; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 61fa42bbd9..3c600e69c9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -74,10 +74,9 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - else{ - if(frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(nrmac->common_channels->frame_type == FDD,"Dynamic TDD not handled yet\n"); const struct NR_PUCCH_Config__resourceToAddModList *resList = ubwp->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList; // for the moment, just block any symbol that might hold a PUCCH, regardless From eb56a40d1193fb87381246831fef13abef8ef0f6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 13 Jan 2022 17:43:53 +0100 Subject: [PATCH 097/196] bugfix in msg2 frame and slot re-selection --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 1d93e8ea8d..43e5c944bc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -405,7 +405,6 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, // preferentially we schedule the msg2 in the mixed slot or in the last dl slot // if they are allowed by search space configuration - uint8_t mu = *scc->ssbSubcarrierSpacing; uint8_t response_window = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow; uint8_t slot_window; @@ -491,10 +490,16 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, || (*msg2_frame == frame_limit && *msg2_slot > slot_limit) || ((*msg2_frame * nr_slots_per_frame[mu] + *msg2_slot - monitoring_offset) % monitoring_slot_period != 0)) { - if(!tdd || ((*msg2_slot%tdd_period_slot) > 0)) { - if (*msg2_slot==0) - (*msg2_frame)--; - (*msg2_slot)--; + if((frame_type == FDD) || ((*msg2_slot%tdd_period_slot) > 0)) { + if (*msg2_slot==0) { + if(*msg2_frame != 0) + (*msg2_frame)--; + else + *msg2_frame = 1023; + *msg2_slot = nr_slots_per_frame[mu] - 1; + } + else + (*msg2_slot)--; } else AssertFatal(1==0,"No available DL slot to schedule msg2 has been found"); From 86096894a0f2943b8fc0d3dbdb7494f16cf92a29 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 20 Jan 2022 11:53:17 +0000 Subject: [PATCH 098/196] Fix build warning after merge with develop --- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index b1f2e6d9b3..b069591316 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,7 +4293,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; - asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + //asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); //measresult_cgi2->cellGlobalId= {0}; //measresult_cgi2->trackingAreaCode= {0}; struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; From 34409bacc0dc12d65e7d92b5f88e6a1e66c438ef Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 21 Jan 2022 10:52:39 +0000 Subject: [PATCH 099/196] Address review comments --- executables/nr-ue.c | 3 +++ openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 3 ++- .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index ed1a7d262d..cd78449574 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -843,6 +843,9 @@ int computeSamplesShift(PHY_VARS_NR_UE *UE) { int samples_shift = -(UE->rx_offset>>1); UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied + if (samples_shift != 0) { + LOG_I(NR_PHY,"Adjusting frame in time by %i samples\n", samples_shift); + } return samples_shift; } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index d10fe67726..6acafe4653 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -247,11 +247,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, LOG_I(PHY,"sync_pos %d ssb_offset %d \n",sync_pos,ue->ssb_offset); #endif + accumulated_freq_offset += ue->common_vars.freq_offset; + // digital compensation of FFO for SSB symbols if (ue->UE_fo_compensation){ double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample - accumulated_freq_offset += ue->common_vars.freq_offset; // In SA we need to perform frequency offset correction until the end of buffer because we need to decode SIB1 // and we do not know yet in which slot it goes. diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index ef96df2995..c8fc2ba761 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -53,7 +53,7 @@ gNBs = # downlinkConfigCommon #frequencyInfoDL - # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + # this is 2574.270 MHz + 53 PRBs@30kHz SCS (same as initial BWP) absoluteFrequencySSB = 518670; dl_frequencyBand = 41; # this is 3600 MHz @@ -66,7 +66,7 @@ gNBs = dl_carrierBandwidth = 106; #initialDownlinkBWP #genericParameters - # this is RBstart=27,L=48 (275*(L-1))+RBstart + # this is RBstart=0,L=106 (275*(L-1))+RBstart initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 From 3e7c22e7c6f7027b15a961e6e77b9e5e5ca5b359 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 26 Jan 2022 11:27:02 +0100 Subject: [PATCH 100/196] gtp-u old code delete --- cmake_targets/CMakeLists.txt | 55 +- common/ran_context.h | 10 +- common/utils/assertions.h | 18 +- common/utils/lte/ue_power.h | 34 - common/utils/ocp_itti/intertask_interface.h | 6 +- doc/SW_archi.md | 2 +- executables/nr-softmodem.c | 2 +- executables/nr-ue.c | 3 +- openair1/PHY/TOOLS/lte_enb_scope.c | 6 - openair1/SCHED_NR/vars.h | 0 openair1/SIMULATION/NR_PHY/dlsim.c | 7 +- openair1/SIMULATION/NR_PHY/prachsim.c | 7 +- openair1/SIMULATION/NR_PHY/ulsim.c | 7 +- openair2/COMMON/gtpv1_u_messages_def.h | 10 +- openair2/COMMON/gtpv1_u_messages_types.h | 8 - openair2/ENB_APP/enb_config.c | 2 +- openair2/F1AP/f1ap_cu_task.c | 2 +- openair2/F1AP/f1ap_du_task.c | 2 +- openair2/GNB_APP/gnb_config.c | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 5 +- openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 2 - openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 4 +- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 2 +- openair2/LAYER2/rlc_v2/rlc_oai_api.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 4 + openair2/RRC/LTE/rrc_eNB.c | 14 - openair2/RRC/LTE/rrc_eNB_GTPV1U.c | 4 +- openair2/RRC/LTE/rrc_eNB_S1AP.c | 1 - openair2/RRC/NR/rrc_gNB.c | 23 +- openair2/RRC/NR/rrc_gNB_NGAP.c | 13 +- openair2/UTIL/MATH/crc_byte.c | 185 -- openair2/UTIL/MATH/random_proto_extern.h | 30 - openair2/UTIL/MATH/taus.c | 116 -- openair3/GTPV1-U/Makefile.am | 58 - openair3/GTPV1-U/Makefile.eNB | 67 - openair3/GTPV1-U/gtpv1u.h | 55 - openair3/GTPV1-U/gtpv1u_eNB.c | 1600 ----------------- openair3/GTPV1-U/gtpv1u_eNB_task.h | 69 - openair3/GTPV1-U/gtpv1u_gNB.c | 1012 ----------- openair3/GTPV1-U/gtpv1u_gNB_defs.h | 108 -- openair3/GTPV1-U/gtpv1u_sgw_defs.h | 97 - openair3/GTPV1-U/gtpv1u_teid_pool.c | 47 - openair3/GTPV1-U/nw-gtpv1u/AUTHORS | 1 - openair3/GTPV1-U/nw-gtpv1u/COPYING | 26 - openair3/GTPV1-U/nw-gtpv1u/ChangeLog | 0 openair3/GTPV1-U/nw-gtpv1u/NEWS | 0 openair3/GTPV1-U/nw-gtpv1u/README | 0 .../GTPV1-U/nw-gtpv1u/include/NwGtpv1uLog.h | 83 - .../nw-gtpv1u/include/NwGtpv1uPrivate.h | 227 --- .../GTPV1-U/nw-gtpv1u/include/NwGtpv1uTrxn.h | 88 - .../include/NwGtpv1uTunnelEndPoint.h | 85 - openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1u.h | 562 ------ .../GTPV1-U/nw-gtpv1u/shared/NwGtpv1uError.h | 63 - .../GTPV1-U/nw-gtpv1u/shared/NwGtpv1uIe.h | 66 - .../GTPV1-U/nw-gtpv1u/shared/NwGtpv1uMsg.h | 317 ---- openair3/GTPV1-U/nw-gtpv1u/shared/NwLog.h | 88 - openair3/GTPV1-U/nw-gtpv1u/shared/NwTypes.h | 78 - openair3/GTPV1-U/nw-gtpv1u/shared/NwUtils.h | 68 - openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c | 1025 ----------- openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c | 558 ------ openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c | 399 ---- .../nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c | 135 -- .../GTPV1-U/nw-gtpv1u/test-app/Makefile.am | 5 - .../GTPV1-U/nw-gtpv1u/test-app/Makefile.in | 461 ----- .../test-app/nw-helloworld/Makefile.am | 17 - .../test-app/nw-helloworld/Makefile.in | 433 ----- .../nw-gtpv1u/test-app/nw-helloworld/NwEvt.h | 80 - .../nw-helloworld/NwMiniLogMgrEntity.c | 62 - .../nw-helloworld/NwMiniLogMgrEntity.h | 57 - .../nw-helloworld/NwMiniTmrMgrEntity.c | 101 -- .../nw-helloworld/NwMiniTmrMgrEntity.h | 53 - .../test-app/nw-helloworld/NwMiniUdpEntity.c | 157 -- .../test-app/nw-helloworld/NwMiniUdpEntity.h | 51 - .../test-app/nw-helloworld/NwMiniUlpEntity.c | 309 ---- .../test-app/nw-helloworld/NwMiniUlpEntity.h | 64 - .../test-app/nw-helloworld/helloworld.c | 207 --- openair3/UDP/udp_eNB_task.c | 447 ----- openair3/UDP/udp_eNB_task.h | 97 - openair3/ocp-gtpu/gtp_itf.cpp | 104 +- openair3/ocp-gtpu/gtp_itf.h | 31 +- .../gtpv1u_eNB_task.h} | 112 +- .../{GTPV1-U => ocp-gtpu}/gtpv1u_gNB_task.h | 3 + targets/COMMON/create_tasks.c | 9 +- targets/COMMON/create_tasks_mbms.c | 39 +- targets/COMMON/create_tasks_ue.c | 1 - targets/RT/USER/TOOLS/thread_ipc.h | 83 - 86 files changed, 214 insertions(+), 10339 deletions(-) delete mode 100644 common/utils/lte/ue_power.h delete mode 100644 openair1/SCHED_NR/vars.h delete mode 100644 openair2/UTIL/MATH/crc_byte.c delete mode 100644 openair2/UTIL/MATH/random_proto_extern.h delete mode 100644 openair2/UTIL/MATH/taus.c delete mode 100644 openair3/GTPV1-U/Makefile.am delete mode 100644 openair3/GTPV1-U/Makefile.eNB delete mode 100644 openair3/GTPV1-U/gtpv1u.h delete mode 100644 openair3/GTPV1-U/gtpv1u_eNB.c delete mode 100644 openair3/GTPV1-U/gtpv1u_eNB_task.h delete mode 100644 openair3/GTPV1-U/gtpv1u_gNB.c delete mode 100644 openair3/GTPV1-U/gtpv1u_gNB_defs.h delete mode 100644 openair3/GTPV1-U/gtpv1u_sgw_defs.h delete mode 100644 openair3/GTPV1-U/gtpv1u_teid_pool.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/AUTHORS delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/COPYING delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/ChangeLog delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/NEWS delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/README delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uLog.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uPrivate.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTrxn.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1u.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uError.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uIe.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uMsg.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwLog.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwTypes.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwUtils.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.am delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.in delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.am delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.in delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwEvt.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/helloworld.c delete mode 100644 openair3/UDP/udp_eNB_task.c delete mode 100644 openair3/UDP/udp_eNB_task.h rename openair3/{GTPV1-U/gtpv1u_eNB_defs.h => ocp-gtpu/gtpv1u_eNB_task.h} (61%) rename openair3/{GTPV1-U => ocp-gtpu}/gtpv1u_gNB_task.h (94%) delete mode 100644 targets/RT/USER/TOOLS/thread_ipc.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f2eda66fc0..ff6169b704 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1019,7 +1019,6 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE ########################## #add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver") #add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)") -add_definitions(-DNEW_GTPU=1) ########################## # RRC LAYER OPTIONS @@ -1097,8 +1096,7 @@ include_directories("${OPENAIR3_DIR}/S1AP") include_directories("${OPENAIR2_DIR}/X2AP") include_directories("${OPENAIR2_DIR}/M2AP") include_directories("${OPENAIR2_DIR}/F1AP") -include_directories("${OPENAIR3_DIR}/UDP") -include_directories("${OPENAIR3_DIR}/GTPV1-U") +include_directories("${OPENAIR3_DIR}/ocp-gtpu") include_directories("${OPENAIR3_DIR}/M3AP") include_directories("${OPENAIR3_DIR}/MME_APP") include_directories("${OPENAIR_DIR}/targets/COMMON") @@ -1124,8 +1122,6 @@ include_directories("${OPENAIR2_DIR}/UTIL/CLI") include_directories("${OPENAIR2_DIR}/UTIL/OPT") include_directories("${OPENAIR2_DIR}/UTIL/OMV") include_directories("${OPENAIR2_DIR}/RRC/LTE/MESSAGES") -include_directories("${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/shared") -include_directories("${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/include") include_directories("${OPENAIR_DIR}") # Utilities Library @@ -2158,7 +2154,6 @@ add_library(L2_NR ${MAC_NR_SRC} ${GNB_APP_SRC} ) -target_compile_definitions(L2_NR PUBLIC NEW_GTPU) add_library(L2_LTE_NR ${L2_RRC_SRC} @@ -2166,7 +2161,6 @@ add_library(L2_LTE_NR ${ENB_APP_SRC} ${MCE_APP_SRC} ) -target_compile_definitions(L2_LTE_NR PUBLIC NEW_GTPU) add_dependencies(L2_NR rrc_flag nr_rrc_flag s1ap_flag x2_flag) @@ -2207,32 +2201,14 @@ add_library(CN_UTILS ${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c ) -set(GTPV1U_DIR ${OPENAIR3_DIR}/GTPV1-U) - -add_library (GTPV1U_OCP +add_library (GTPV1U ${NR_RRC_DIR}/rrc_gNB_GTPV1U.c ${RRC_DIR}/rrc_eNB_GTPV1U.c ${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp ) -target_compile_definitions(GTPV1U_OCP PUBLIC NEW_GTPU) -add_dependencies(GTPV1U_OCP rrc_flag) +add_dependencies(GTPV1U rrc_flag) include_directories(${OPENAIR3_DIR}/ocp-gtp) -#NR case -set (NR_GTPV1U_SRC - ${NR_RRC_DIR}/rrc_gNB_GTPV1U.c - ${RRC_DIR}/rrc_eNB_GTPV1U.c - ${GTPV1U_DIR}/gtpv1u_eNB.c - ${GTPV1U_DIR}/gtpv1u_gNB.c - ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c - ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTrxn.c - ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uMsg.c - ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1u.c - ${GTPV1U_DIR}/gtpv1u_teid_pool.c - ) -add_library(NR_GTPV1U ${NR_GTPV1U_SRC}) -add_dependencies(NR_GTPV1U rrc_flag) - set (MME_APP_SRC ${OPENAIR3_DIR}/MME_APP/mme_app.c ${OPENAIR3_DIR}/MME_APP/mme_config.c @@ -2248,9 +2224,6 @@ set(SCTP_SRC add_library(SCTP_CLIENT ${SCTP_SRC}) add_dependencies(SCTP_CLIENT rrc_flag) -add_library(UDP ${OPENAIR3_DIR}/UDP/udp_eNB_task.c) -add_dependencies(UDP rrc_flag) - set(NAS_SRC ${OPENAIR3_DIR}/NAS/) set(libnas_api_OBJS ${NAS_SRC}COMMON/API/NETWORK/as_message.c @@ -2805,7 +2778,7 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer) target_link_libraries (lte-softmodem -Wl,--start-group - RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB + RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} -Wl,--end-group z dl) @@ -2849,7 +2822,7 @@ add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_l target_link_libraries (ocp-enb -Wl,--start-group - RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB + RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} -Wl,--end-group z dl) @@ -2943,7 +2916,7 @@ endif() target_link_libraries (lte-uesoftmodem -Wl,--start-group RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB - SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON + SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES} -Wl,--end-group z dl) @@ -2985,10 +2958,9 @@ add_executable(nr-softmodem ${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c ) -target_compile_definitions(nr-softmodem PUBLIC NEW_GTPU) target_link_libraries (nr-softmodem -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA + UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} @@ -3028,7 +3000,7 @@ add_executable(ocp-gnb target_link_libraries (ocp-gnb -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA + UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON @@ -3072,7 +3044,7 @@ add_executable(nr-uesoftmodem target_link_libraries (nr-uesoftmodem -Wl,--start-group - RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB + RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} @@ -3326,7 +3298,7 @@ add_executable(test_epc_generate_scenario ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h ) target_link_libraries (test_epc_generate_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) add_executable(test_epc_play_scenario @@ -3345,7 +3317,7 @@ add_executable(test_epc_play_scenario ) target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c) target_link_libraries (test_epc_play_scenario - -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) @@ -3391,7 +3363,7 @@ if (${T_TRACER}) NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB - CN_UTILS GTPV1U_OCP GTPV1U_OCP SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB + CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts) if (TARGET ${i}) add_dependencies(${i} generate_T) @@ -3496,11 +3468,10 @@ add_executable(nr-ittisim ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ) -target_compile_definitions(nr-ittisim PUBLIC NEW_GTPU) target_link_libraries (nr-ittisim -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA + UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} diff --git a/common/ran_context.h b/common/ran_context.h index db981e9182..055c6f783e 100644 --- a/common/ran_context.h +++ b/common/ran_context.h @@ -42,17 +42,11 @@ //#include "ENB_APP/enb_config.h" #include "flexran_agent_defs.h" -#include "gtpv1u.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uMsg.h" -#include "NwGtpv1uPrivate.h" -#include "gtpv1u_eNB_defs.h" -#include "gtpv1u_gNB_defs.h" - #include "PHY/defs_L1_NB_IoT.h" #include "RRC/LTE/defs_NB_IoT.h" #include "RRC/LTE/rrc_defs.h" #include "RRC/NR/nr_rrc_defs.h" +#include typedef struct { @@ -110,8 +104,6 @@ typedef struct { struct gNB_MAC_INST_s **nrmac; /// GTPu descriptor gtpv1u_data_t *gtpv1u_data_g; - /// NR GTPu descriptor - nr_gtpv1u_data_t *nr_gtpv1u_data_g; /// RU descriptors. These describe what each radio unit is supposed to do and contain the necessary functions for fronthaul interfaces struct RU_t_s **ru; /// Mask to indicate fronthaul setup status of RU (hard-limit to 64 RUs) diff --git a/common/utils/assertions.h b/common/utils/assertions.h index d85dab79a0..57c50a65e0 100644 --- a/common/utils/assertions.h +++ b/common/utils/assertions.h @@ -25,14 +25,22 @@ #include #include #include +#include +#include #include #include "backtrace.h" -#define _Assert_Exit_ \ - fprintf(stderr, "\nExiting execution\n"); \ - fflush(stdout); \ - fflush(stderr); \ - abort(); +#define _Assert_Exit_ \ + if (getenv("gdbStacks")) { \ + char tmp [1000]; \ + sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d > /tmp/full_stacks.%d < /dev/null", \ + getpid(), getpid()); \ + system(tmp); \ + } \ + fprintf(stderr, "\nExiting execution\n"); \ + fflush(stdout); \ + fflush(stderr); \ + abort(); #define _Assert_(cOND, aCTION, fORMAT, aRGS...) \ do { \ diff --git a/common/utils/lte/ue_power.h b/common/utils/lte/ue_power.h deleted file mode 100644 index caeebec2c8..0000000000 --- a/common/utils/lte/ue_power.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file ue_power.h -* \brief support routines used in MAC and PHY -* \author R. Knopp, F. Kaltenberger -* \date 2020 -* \version 0.1 -* \company Eurecom -* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr -* \note -* \warning -*/ - -int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs); - diff --git a/common/utils/ocp_itti/intertask_interface.h b/common/utils/ocp_itti/intertask_interface.h index 3188e5889f..5ea2e0f87a 100644 --- a/common/utils/ocp_itti/intertask_interface.h +++ b/common/utils/ocp_itti/intertask_interface.h @@ -256,8 +256,8 @@ typedef struct IttiMsgText_s { #include //#include -#include -#include +#include +#include void *rrc_enb_process_itti_msg(void *); #include #include @@ -340,8 +340,6 @@ void *rrc_enb_process_msg(void *); TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\ TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\ - TASK_DEF(OCP_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\ - TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\ TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200, NULL, NULL) \ diff --git a/doc/SW_archi.md b/doc/SW_archi.md index 0e77cfa580..7648fb2e16 100644 --- a/doc/SW_archi.md +++ b/doc/SW_archi.md @@ -369,7 +369,7 @@ gtpv1u_create_s1u_tunnel(), delete tunnel, ... functions are called inside the o # New GTP ## initialization -ocp_gtpv1uTask(): this creates only the thread, doesn't configure anything +gtpv1uTask(): this creates only the thread, doesn't configure anything gtpv1Init(): creates a listening socket to Linux for a given reception and select a local IP address ## newGtpuCreateTunnel() diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 5f57919645..184b9caa8f 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -365,7 +365,7 @@ int create_gNB_tasks(uint32_t gnb_nb) { //Use check on x2ap to consider the NSA scenario and check on AMF_MODE_ENABLED for the SA scenario if(is_x2ap_enabled() || AMF_MODE_ENABLED) { - if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) { + if (itti_create_task (TASK_GTPV1_U, >pv1uTask, NULL) < 0) { LOG_E(GTPU, "Create task for GTPV1U failed\n"); return -1; } diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2e7b2ea0e1..71f99f543d 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -18,7 +18,8 @@ * For more information about the OpenAirInterface (OAI) Software Alliance: * contact@openairinterface.org */ - +#define _GNU_SOURCE +#include #include #include "executables/nr-uesoftmodem.h" #include "PHY/phy_extern_nr_ue.h" diff --git a/openair1/PHY/TOOLS/lte_enb_scope.c b/openair1/PHY/TOOLS/lte_enb_scope.c index 7fde9f244c..0e873addbc 100644 --- a/openair1/PHY/TOOLS/lte_enb_scope.c +++ b/openair1/PHY/TOOLS/lte_enb_scope.c @@ -49,12 +49,6 @@ void reset_stats(FL_OBJECT *button, long arg) { int i,j,k; PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; - printf("XXX %d %d %d\n", - sizeofArray(phy_vars_eNB->UE_stats), - sizeofArray( phy_vars_eNB->UE_stats[i].dlsch_NAK), - sizeofArray( *phy_vars_eNB->UE_stats[i].dlsch_NAK) - ); - for (i=0; iUE_stats); i++) { for (k=0; kUE_stats[i].dlsch_NAK); k++) { //harq_processes for (j=0; jUE_stats[i].dlsch_NAK); j++) { diff --git a/openair1/SCHED_NR/vars.h b/openair1/SCHED_NR/vars.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 6a2aba5944..2a4fdf64d2 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -175,7 +175,12 @@ gtpv1u_update_ngu_tunnel( return 0; } -int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { +int gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + return 0; +} + +int gtpv1u_delete_ngu_tunnel( const instance_t instance, + gtpv1u_gnb_delete_tunnel_req_t *req) { return 0; } diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index fb0f37d7ac..d7c29e8ff3 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -143,7 +143,12 @@ gtpv1u_update_ngu_tunnel( return 0; } -int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { +int gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + return 0; +} + +int gtpv1u_delete_ngu_tunnel( const instance_t instance, + gtpv1u_gnb_delete_tunnel_req_t *req) { return 0; } diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index ac991ae940..b296b6ef36 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -139,7 +139,12 @@ gtpv1u_create_s1u_tunnel( return 0; } -int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { +int gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + return 0; +} + +int gtpv1u_delete_ngu_tunnel( const instance_t instance, + gtpv1u_gnb_delete_tunnel_req_t *req) { return 0; } diff --git a/openair2/COMMON/gtpv1_u_messages_def.h b/openair2/COMMON/gtpv1_u_messages_def.h index 2835d07e4a..44e9d4fbdf 100644 --- a/openair2/COMMON/gtpv1_u_messages_def.h +++ b/openair2/COMMON/gtpv1_u_messages_def.h @@ -19,18 +19,12 @@ * contact@openairinterface.org */ -MESSAGE_DEF(GTPV1U_ENB_UPDATE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_update_tunnel_req_t, Gtpv1uUpdateTunnelReq) -MESSAGE_DEF(GTPV1U_ENB_UPDATE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_update_tunnel_resp_t, Gtpv1uUpdateTunnelResp) -MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_req_t, Gtpv1uDeleteTunnelReq) -MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_resp_t, Gtpv1uDeleteTunnelResp) -MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_ind_t, Gtpv1uTunnelDataInd) + MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_req_t, Gtpv1uTunnelDataReq) MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_req_t,Gtpv1uDataForwardingReq) MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_ind_t,Gtpv1uDataForwardingInd) MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq) MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd) -MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq) +MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq) -MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_req_t, NRGtpv1uDeleteTunnelReq) -MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_resp_t, NRGtpv1uDeleteTunnelResp) MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq) diff --git a/openair2/COMMON/gtpv1_u_messages_types.h b/openair2/COMMON/gtpv1_u_messages_types.h index 2dd476ab68..096f0f4697 100644 --- a/openair2/COMMON/gtpv1_u_messages_types.h +++ b/openair2/COMMON/gtpv1_u_messages_types.h @@ -28,10 +28,6 @@ #define GTPV1U_MAX_BEARERS_PER_UE max_val_LTE_DRB_Identity #define NR_GTPV1U_MAX_BEARERS_PER_UE max_val_NR_DRB_Identity -#define GTPV1U_ENB_UPDATE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uUpdateTunnelReq -#define GTPV1U_ENB_UPDATE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uUpdateTunnelResp -#define GTPV1U_ENB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelReq -#define GTPV1U_ENB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelResp #define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd #define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq #define GTPV1U_ENB_DATA_FORWARDING_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingReq @@ -41,8 +37,6 @@ #define GTPV1U_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uReq -#define GTPV1U_GNB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelReq -#define GTPV1U_GNB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelResp #define GTPV1U_GNB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uTunnelDataReq #define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF @@ -200,7 +194,6 @@ typedef struct gtpv1u_gnb_create_tunnel_resp_s { pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE]; transport_layer_addr_t gnb_addr; } gtpv1u_gnb_create_tunnel_resp_t; - typedef struct gtpv1u_gnb_delete_tunnel_req_s { rnti_t rnti; uint8_t num_pdusession; @@ -212,7 +205,6 @@ typedef struct gtpv1u_gnb_delete_tunnel_resp_s { uint8_t status; ///< Status of NGU endpoint deleteion (Failed = 0xFF or Success = 0x0) teid_t gnb_NGu_teid; ///< local NGU Tunnel Endpoint Identifier to be deleted } gtpv1u_gnb_delete_tunnel_resp_t; - typedef struct gtpv1u_gnb_tunnel_data_req_s { uint8_t *buffer; uint32_t length; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index a08bcf4baf..f5493a839a 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2080,7 +2080,7 @@ int RCconfig_gtpu(void ) { GTPV1U_REQ(message).localPort = enb_port_for_S1U; strcpy(GTPV1U_REQ(message).localAddrStr,address); sprintf(GTPV1U_REQ(message).localPortStr,"%d", enb_port_for_S1U); - itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id) + itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id) } else LOG_E(GTPU,"invalid address for S1U\n"); diff --git a/openair2/F1AP/f1ap_cu_task.c b/openair2/F1AP/f1ap_cu_task.c index 13f08b9458..8d4f896250 100644 --- a/openair2/F1AP/f1ap_cu_task.c +++ b/openair2/F1AP/f1ap_cu_task.c @@ -47,7 +47,7 @@ static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) { strncpy(tmp.destinationHost, IPaddrs->remote_addr, sizeof(tmp.destinationHost)-1); sprintf(tmp.originService, "%d", IPaddrs->my_portd); sprintf(tmp.destinationService, "%d", IPaddrs->remote_portd); - return ocp_gtpv1Init(tmp); + return gtpv1Init(tmp); } static void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind, diff --git a/openair2/F1AP/f1ap_du_task.c b/openair2/F1AP/f1ap_du_task.c index 537f0060ae..1d5d24f5ca 100644 --- a/openair2/F1AP/f1ap_du_task.c +++ b/openair2/F1AP/f1ap_du_task.c @@ -103,7 +103,7 @@ static instance_t du_create_gtpu_instance_to_cu(char *CUaddr, uint16_t CUport, c strncpy(tmp.destinationHost, CUaddr, sizeof(tmp.destinationHost)-1); sprintf(tmp.originService, "%d", DUport); sprintf(tmp.destinationService, "%d", CUport); - return ocp_gtpv1Init(tmp); + return gtpv1Init(tmp); } void *F1AP_DU_task(void *arg) { diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 9710dd1814..65f2b58d8d 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1220,7 +1220,7 @@ int RCconfig_nr_gtpu(void ) { GTPV1U_REQ(message).localPort = port; strcpy(GTPV1U_REQ(message).localAddrStr,address); sprintf(GTPV1U_REQ(message).localPortStr,"%d", port); - itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id) + itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id) } else LOG_E(GTPU,"invalid address for NGU or S1U\n"); diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 4d2e157728..68bc9aedb2 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -60,7 +60,6 @@ #include # include "gtpv1u_eNB_task.h" -# include "gtpv1u.h" #include #include "ENB_APP/enb_config.h" @@ -229,7 +228,7 @@ rlc_op_status_t cu_send_to_du(const protocol_ctxt_t *const ctxt, LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n", __func__, rb_id, size); extern instance_t CUuniqInstance; - itti_send_msg_to_task(TASK_VARIABLE, CUuniqInstance, message_p); + itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p); return TRUE; } @@ -1078,7 +1077,7 @@ pdcp_data_ind( GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX; GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti; GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4; - itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p); + itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); packet_forwarded = TRUE; } } else { diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index b49b020428..c3bffc0d2a 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -85,8 +85,6 @@ extern struct msghdr nas_msg_rx; # include "gtpv1u_eNB_task.h" -# include "gtpv1u_eNB_defs.h" - extern int gtpv1u_new_data_req( uint8_t enb_module_idP, rnti_t ue_rntiP, uint8_t rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP); uint16_t ue_id_g; // Global variable to identify the ID for each UE. It is updated in main() of lte-uesoftmodem.c diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index ab8578a0e7..c75132564c 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -674,7 +674,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, sdap_gnb_ul_header_handler(buf[0]); // Handler for the UL gNB SDAP Header } LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size-offset); - itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p); + itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); } } } @@ -728,7 +728,7 @@ rb_found: LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size); extern instance_t CUuniqInstance; - itti_send_msg_to_task(TASK_VARIABLE, CUuniqInstance, message_p); + itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p); } else { memblock = get_free_mem_block(size, __FUNCTION__); diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 78e06d37e2..dcf2694d1a 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -518,7 +518,7 @@ rb_found: req->pdusession_id=rb_id; LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); extern instance_t DUuniqInstance; - itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg); + itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg); return; } } diff --git a/openair2/LAYER2/rlc_v2/rlc_oai_api.c b/openair2/LAYER2/rlc_v2/rlc_oai_api.c index 16c3db0cae..2a6f00c13c 100644 --- a/openair2/LAYER2/rlc_v2/rlc_oai_api.c +++ b/openair2/LAYER2/rlc_v2/rlc_oai_api.c @@ -440,7 +440,7 @@ rb_found: req->rnti=ue->rnti; req->rab_id=rb_id+4; LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); - itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg); + itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg); return; } } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index c7b54950d7..08807e0202 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -30,6 +30,10 @@ * \warning */ +#include +#include +#include + #include "PHY/defs_nr_UE.h" #include "NR_IF_Module.h" #include "NR_MAC_UE/mac_proto.h" diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 260b6fceaa..8d21663d51 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -9572,20 +9572,6 @@ void *rrc_enb_process_itti_msg(void *notUsed) { rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND(msg_p, msg_name_p, instance); break; - case GTPV1U_ENB_DELETE_TUNNEL_RESP: { - rrc_eNB_ue_context_t *ue = rrc_eNB_get_ue_context(RC.rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti); - - if (ue != NULL - && ue->ue_context.ue_release_timer_rrc > 0 - && (ue->ue_context.handover_info == NULL || - (ue->ue_context.handover_info->state != HO_RELEASE && - ue->ue_context.handover_info->state != HO_CANCEL))) { - ue->ue_context.ue_release_timer_rrc = ue->ue_context.ue_release_timer_thres_rrc; - } - - break; - } - case S1AP_PATH_SWITCH_REQ_ACK: LOG_I(RRC, "[eNB %ld] received path switch ack %s\n", instance, msg_name_p); rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK(msg_p, msg_name_p, instance); diff --git a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c index 3fa17bcd6b..7afec416c6 100644 --- a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c +++ b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c @@ -210,7 +210,7 @@ boolean_t gtpv_data_req_new ( GTPV1U_ENB_END_MARKER_REQ(msg).offset = GTPU_HEADER_OVERHEAD_MAX; LOG_I(GTPU, "Send End Marker to GTPV1-U at frame %d and subframe %d \n", ctxt->frame,ctxt->subframe); itti_send_msg_to_task(TASK_GTPV1_U, ENB_MODULE_ID_TO_INSTANCE(ctxt->module_id), msg); - return NW_GTPV1U_OK; + return 0; } /* target enb */ @@ -225,7 +225,7 @@ boolean_t gtpv_data_req_new ( gtpv1u_enb_delete_tunnel_req_t delete_tunnel_req; memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req)); delete_tunnel_req.rnti = ctxt->rnti; - gtpv1u_delete_x2u_tunnel(ctxt->module_id, &delete_tunnel_req, GTPV1U_TARGET_ENB); + gtpv1u_delete_x2u_tunnel(ctxt->module_id, &delete_tunnel_req); return true; } else { /* data packet */ diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index 1a5fe55c26..96b8cd0a99 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -36,7 +36,6 @@ #include "rrc_eNB_S1AP.h" #include "enb_config.h" #include "common/ran_context.h" -#include "gtpv1u.h" #include "s1ap_eNB.h" #include "s1ap_eNB_defs.h" diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2c2020412d..5b370d3614 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -30,6 +30,10 @@ #define RRC_GNB_C #define RRC_GNB_C +#include +#include +#include + #include "nr_rrc_config.h" #include "nr_rrc_defs.h" #include "nr_rrc_extern.h" @@ -2190,7 +2194,6 @@ rrc_gNB_decode_dcch( asn_dec_rval_t dec_rval; NR_UL_DCCH_Message_t *ul_dcch_msg = NULL; struct rrc_gNB_ue_context_s *ue_context_p = NULL; - MessageDef *msg_delete_tunnels_p = NULL; uint8_t xid; int i; @@ -2289,21 +2292,17 @@ rrc_gNB_decode_dcch( xid = ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier; ue_context_p->ue_context.pdu_session_release_command_flag = 0; //gtp tunnel delete - msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_GNB, 0, GTPV1U_GNB_DELETE_TUNNEL_REQ); - memset(>PV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p))); - GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti; - + gtpv1u_gnb_delete_tunnel_req_t req={0}; for(i = 0; i < NB_RB_MAX; i++) { if(xid == ue_context_p->ue_context.pduSession[i].xid) { - GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).pdusession_id[GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_pdusession++] = + req.pdusession_id[req.num_pdusession++] = ue_context_p->ue_context.gnb_gtp_psi[i]; ue_context_p->ue_context.gnb_gtp_teid[i] = 0; memset(&ue_context_p->ue_context.gnb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.gnb_gtp_addrs[i])); ue_context_p->ue_context.gnb_gtp_psi[i] = 0; } } - - itti_send_msg_to_task(TASK_GTPV1_U, ctxt_pP->instance, msg_delete_tunnels_p); + gtpv1u_delete_ngu_tunnel(ctxt_pP->instance, &req); //NGAP_PDUSESSION_RELEASE_RESPONSE rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(ctxt_pP, ue_context_p, xid); } else if (ue_context_p->ue_context.established_pdu_sessions_flag != 1) { @@ -3636,9 +3635,6 @@ void *rrc_gnb_task(void *args_p) { rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(msg_p, msg_name_p, instance); break; - case GTPV1U_GNB_DELETE_TUNNEL_RESP: - break; - /* Messages from gNB app */ case NRRRC_CONFIGURATION_REQ: LOG_I(NR_RRC, "[gNB %ld] Received %s : %p\n", instance, msg_name_p,&NRRRC_CONFIGURATION_REQ(msg_p)); @@ -3688,11 +3684,6 @@ void *rrc_gnb_task(void *args_p) { rrc_gNB_process_dc_overall_timeout(GNB_INSTANCE_TO_MODULE_ID(instance), &X2AP_ENDC_DC_OVERALL_TIMEOUT(msg_p)); break; - /* Messages from GTP */ - case GTPV1U_ENB_DELETE_TUNNEL_RESP: - /* nothing to do? */ - break; - case NGAP_UE_CONTEXT_RELEASE_REQ: rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_REQ(msg_p, msg_name_p, instance); break; diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 043d136604..a05698bd5a 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -33,7 +33,6 @@ #include "rrc_eNB_S1AP.h" #include "gnb_config.h" #include "common/ran_context.h" -#include "gtpv1u.h" #include "asn1_conversions.h" #include "intertask_interface.h" @@ -44,6 +43,7 @@ #include "gtpv1u_eNB_task.h" #include "gtpv1u_gNB_task.h" +#include #include "RRC/LTE/rrc_eNB_GTPV1U.h" #include "RRC/NR/rrc_gNB_GTPV1U.h" @@ -1395,7 +1395,6 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( protocol_ctxt_t ctxt; pdusession_release_t pdusession_release_params[NGAP_MAX_PDUSESSION]; uint8_t nb_pdusessions_torelease; - MessageDef *msg_delete_tunnels_p = NULL; uint8_t xid; int i, pdusession; uint8_t b_existed,is_existed; @@ -1473,20 +1472,18 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( } else { //gtp tunnel delete LOG_I(NR_RRC, "gtp tunnel delete \n"); - msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_GNB, 0, GTPV1U_GNB_DELETE_TUNNEL_REQ); - memset(>PV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p))); - GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti; + gtpv1u_gnb_delete_tunnel_req_t req={0}; + req.rnti = ue_context_p->ue_context.rnti; for(i = 0; i < NB_RB_MAX; i++) { if(xid == ue_context_p->ue_context.pduSession[i].xid) { - GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).pdusession_id[GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_pdusession++] = ue_context_p->ue_context.gnb_gtp_psi[i]; + req.pdusession_id[req.num_pdusession++] = ue_context_p->ue_context.gnb_gtp_psi[i]; ue_context_p->ue_context.gnb_gtp_teid[i] = 0; memset(&ue_context_p->ue_context.gnb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.gnb_gtp_addrs[i])); ue_context_p->ue_context.gnb_gtp_psi[i] = 0; } } - - itti_send_msg_to_task(TASK_GTPV1_U, instance, msg_delete_tunnels_p); + gtpv1u_delete_ngu_tunnel(instance, &req); //NGAP_PDUSESSION_RELEASE_RESPONSE rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(&ctxt, ue_context_p, xid); LOG_I(NR_RRC, "Send PDU Session Release Response \n"); diff --git a/openair2/UTIL/MATH/crc_byte.c b/openair2/UTIL/MATH/crc_byte.c deleted file mode 100644 index a3ff00fec1..0000000000 --- a/openair2/UTIL/MATH/crc_byte.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/* - May 10, 2001 - Modified in June, 2001, to include the length non multiple of 8 - crc_byte.c - Byte oriented implementation of CRC's - - */ -#include "rtos_header.h" -#include "platform_types.h" - - -/*ref 25.222 v4.0.0 , p12 */ -/* the highest degree is set by default */ -unsigned int poly24 = 0x80006100; // 1000 0000 0000 0000 0110 0001 D^24 + D^23 + D^6 + D^5 + D + 1 -unsigned int poly16 = 0x10210000; // 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1 -unsigned int poly12 = 0x80F00000; // 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1 -unsigned int poly8 = 0x9B000000; // 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1 -/********************************************************* - -For initialization && verification purposes, - bit by bit implementation with any polynomial - -The first bit is in the MSB of each byte - -*********************************************************/ -static unsigned int -crcbit (unsigned char * inputptr, int octetlen, unsigned int poly) -{ - unsigned int i, crc = 0, c; - - while (octetlen-- > 0) { - c = (*inputptr++) << 24; - - for (i = 8; i != 0; i--) { - if ((1 << 31) & (c ^ crc)) - crc = (crc << 1) ^ poly; - else - crc <<= 1; - - c <<= 1; - } - } - - return crc; -} - -/********************************************************* - -crc table initialization - -*********************************************************/ -static unsigned int crc24Table[256]; -static unsigned short crc16Table[256]; -static unsigned short crc12Table[256]; -static unsigned char crc8Table[256]; -void -crcTableInit () -{ - unsigned char c = 0; - - do { - crc24Table[c] = crcbit (&c, 1, poly24); - crc16Table[c] = (unsigned short) (crcbit (&c, 1, poly16) >> 16); - crc12Table[c] = (unsigned short) (crcbit (&c, 1, poly12) >> 16); - crc8Table[c] = (unsigned char) (crcbit (&c, 1, poly8) >> 24); - } while (++c); -} - -/********************************************************* - -Byte by byte implementations, -assuming initial byte is 0 padded (in MSB) if necessary - -*********************************************************/ -unsigned int -crc24 (unsigned char * inptr, int bitlen) -{ - - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); - - while (octetlen-- > 0) { - crc = (crc << 8) ^ crc24Table[(*inptr++) ^ (crc >> 24)]; - } - - if (resbit > 0) - crc = (crc << resbit) ^ crc24Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; - - return crc; -} - -unsigned int -crc16 (unsigned char * inptr, int bitlen) -{ - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); - - while (octetlen-- > 0) { - crc = (crc << 8) ^ (crc16Table[(*inptr++) ^ (crc >> 24)] << 16); - } - - if (resbit > 0) - crc = (crc << resbit) ^ (crc16Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 16); - - return crc; -} - -unsigned int -crc12 (unsigned char * inptr, int bitlen) -{ - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); - - while (octetlen-- > 0) { - crc = (crc << 8) ^ (crc12Table[(*inptr++) ^ (crc >> 24)] << 16); - } - - if (resbit > 0) - crc = (crc << resbit) ^ (crc12Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 16); - - return crc; -} - -unsigned int -crc8 (unsigned char * inptr, int bitlen) -{ - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); - - while (octetlen-- > 0) { - crc = crc8Table[(*inptr++) ^ (crc >> 24)] << 24; - } - - if (resbit > 0) - crc = (crc << resbit) ^ (crc8Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 24); - - return crc; -} - -/*******************************************************************/ -/** - Test code -********************************************************************/ - -/* #ifdef MAIN - #include - main() - { - unsigned char test[] = "Thebigredfox"; - crcTableInit(); - printf("%x\n", crcbit(test, sizeof(test) - 1, poly24)); - printf("%x\n", crc24(test, (sizeof(test) - 1)*8)); - printf("%x\n", crcbit(test, sizeof(test) - 1, poly8)); - printf("%x\n", crc8(test, (sizeof(test) - 1)*8)); - } - #endif */ diff --git a/openair2/UTIL/MATH/random_proto_extern.h b/openair2/UTIL/MATH/random_proto_extern.h deleted file mode 100644 index 45db565217..0000000000 --- a/openair2/UTIL/MATH/random_proto_extern.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/* - - random_proto_extern.h - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - ***************************************************************************/ -extern int uniform (void); diff --git a/openair2/UTIL/MATH/taus.c b/openair2/UTIL/MATH/taus.c deleted file mode 100644 index 6b5e03588d..0000000000 --- a/openair2/UTIL/MATH/taus.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file taus.c -* \brief random number generator per OAI component -* \author Navid Nikaein -* \date 2011 - 2014 -* \version 0.1 -* \email navid.nikaein@eurecom.fr -* \warning -* @ingroup util -*/ - -#include -#include -#include -#include -#include -#include "oml.h" - -unsigned int s0[MAX_NUM_COMPS], s1[MAX_NUM_COMPS], s2[MAX_NUM_COMPS], b[MAX_NUM_COMPS], r[MAX_NUM_COMPS]; - - - - -inline unsigned int taus(unsigned int comp) { - b[comp] = (((s0[comp] << 13) ^ s0[comp]) >> 19); - s0[comp] = (((s0[comp] & 0xFFFFFFFE) << 12)^ b[comp]); - b[comp] = (((s1[comp] << 2) ^ s1[comp]) >> 25); - s1[comp] = (((s1[comp] & 0xFFFFFFF8) << 4)^ b[comp]); - b[comp] = (((s2[comp] << 3) ^ s2[comp]) >> 11); - s2[comp] = (((s2[comp] & 0xFFFFFFF0) << 17)^ b[comp]); - r[comp] = s0[comp] ^ s1[comp] ^ s2[comp]; - return r[comp]; -} - -/*void set_taus_seed(unsigned int seed_type) { - unsigned int i; // i index of component - - for (i=MIN_NUM_COMPS; i < MAX_NUM_COMPS ; i ++) { - switch (seed_type) { - case 0: // use rand func - if (i == 0) srand(time(NULL)); - - s0[i] = ((unsigned int)rand()); - s1[i] = ((unsigned int)rand()); - s2[i] = ((unsigned int)rand()); - printf("Initial seeds use rand: s0[%u] = 0x%x, s1[%u] = 0x%x, s2[%u] = 0x%x\n", i, s0[i], i, s1[i], i, s2[i]); - break; - - case 1: // use rand with seed - if (i == 0) srand(0x1e23d851); - - s0[i] = ((unsigned int)rand()); - s1[i] = ((unsigned int)rand()); - s2[i] = ((unsigned int)rand()); - printf("Initial seeds use rand with seed : s0[%u] = 0x%x, s1[%u] = 0x%x, s2[%u] = 0x%x\n", i, s0[i], i, s1[i], i, s2[i]); - break; - - default: - break; - } - } -}*/ - -int get_rand (unsigned int comp) { - if ((comp > MIN_NUM_COMPS) && (comp < MAX_NUM_COMPS)) - return r[comp]; - else { - //LOG_E(RNG,"unknown component %d\n",comp); - return -1; - } -} - -unsigned int dtaus(unsigned int comp, unsigned int a, unsigned b) { - return (int) (((double)taus(comp)/(double)0xffffffff)* (double)(b-a) + (double)a); -} -/* -#ifdef STANDALONE -main() { - - unsigned int i,randomg, randphy; - - set_taus_seed(0); - printf("dtaus %d \n",dtaus(PHY, 1000, 1000000)); - - do {//for (i=0;i<10;i++){ - randphy = taus(PHY); - randomg = taus(OTG); - i++; - // printf("rand for OMG (%d,0x%x) PHY (%d,0x%x)\n",OMG, randomg, PHY, randphy); - } while (randphy != randomg); - printf("after %d run: get rand for (OMG 0x%x, PHY 0x%x)\n",i, get_rand(OTG), get_rand(PHY)); - -} -#endif - -*/ diff --git a/openair3/GTPV1-U/Makefile.am b/openair3/GTPV1-U/Makefile.am deleted file mode 100644 index 30ea61d6c1..0000000000 --- a/openair3/GTPV1-U/Makefile.am +++ /dev/null @@ -1,58 +0,0 @@ -#/* -# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# * contributor license agreements. See the NOTICE file distributed with -# * this work for additional information regarding copyright ownership. -# * The OpenAirInterface Software Alliance licenses this file to You under -# * the OAI Public License, Version 1.1 (the "License"); you may not use this file -# * except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.openairinterface.org/?page_id=698 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# *------------------------------------------------------------------------------- -# * For more information about the OpenAirInterface (OAI) Software Alliance: -# * contact@openairinterface.org -# */ - -AM_CFLAGS = @ADD_CFLAGS@ \ - -I$(top_srcdir)/COMMON \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/include \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/util \ - -I$(top_srcdir)/INTERTASK_INTERFACE \ - -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \ - -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \ - -I$(top_srcdir)/UTILS \ - -I$(top_srcdir)/UTILS/HASHTABLE \ - -I$(top_srcdir)/UTILS/TIMER - -noinst_LTLIBRARIES = libgtpv1u.la - -libgtpv1u_la_LDFLAGS = -all-static - -libgtpv1u_la_SOURCES = \ - gtpv1u_task.c gtpv1u.h \ - gtpv1u_teid_pool.c \ - nw-gtpv1u/shared/NwTypes.h \ - nw-gtpv1u/shared/NwUtils.h \ - nw-gtpv1u/shared/NwGtpv1uError.h \ - nw-gtpv1u/shared/NwLog.h \ - nw-gtpv1u/shared/NwGtpv1uIe.h \ - nw-gtpv1u/shared/NwGtpv1uMsg.h \ - nw-gtpv1u/shared/NwGtpv1u.h \ - nw-gtpv1u/include/NwGtpv1uPrivate.h \ - nw-gtpv1u/include/NwGtpv1uLog.h \ - nw-gtpv1u/include/NwGtpv1uTrxn.h \ - nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h \ - nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c \ - nw-gtpv1u/src/NwGtpv1uTrxn.c \ - nw-gtpv1u/src/NwGtpv1uMsg.c \ - nw-gtpv1u/src/NwGtpv1u.c diff --git a/openair3/GTPV1-U/Makefile.eNB b/openair3/GTPV1-U/Makefile.eNB deleted file mode 100644 index b469dc756d..0000000000 --- a/openair3/GTPV1-U/Makefile.eNB +++ /dev/null @@ -1,67 +0,0 @@ -#/* -# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# * contributor license agreements. See the NOTICE file distributed with -# * this work for additional information regarding copyright ownership. -# * The OpenAirInterface Software Alliance licenses this file to You under -# * the OAI Public License, Version 1.1 (the "License"); you may not use this file -# * except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.openairinterface.org/?page_id=698 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# *------------------------------------------------------------------------------- -# * For more information about the OpenAirInterface (OAI) Software Alliance: -# * contact@openairinterface.org -# */ - -OUTDIR = . - -libgtpv1u_OBJECTS = \ - nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.o \ - nw-gtpv1u/src/NwGtpv1uTrxn.o \ - nw-gtpv1u/src/NwGtpv1uMsg.o \ - nw-gtpv1u/src/NwGtpv1u.o \ - gtpv1u_eNB.o \ - gtpv1u_teid_pool.o - -# pull in dependency info for *existing* .o files --include $(OUTDIR)/*.d - -CFLAGS = \ - -Wall \ - $(GTPV1U_CFLAGS) \ - -DENB_MODE \ - -Werror=uninitialized \ - -Werror=implicit-function-declaration - -$(OUTDIR)/%.o : %.c - @echo "Compiling $<" - @if [ ! -d $(dir $@) ]; then mkdir -p $(dir $@); fi; - @$(CC) -c $(CFLAGS) -o $@ $< - @$(CC) -MM $(CFLAGS) $< > $(basename $@).d - @mv -f $(basename $@).d $(basename $@).d.tmp - @sed -e 's|.*:|$@:|' < $(basename $@).d.tmp > $(basename $@).d - @sed -e 's/.*://' -e 's/\\$$//' < $(basename $@).d.tmp | fmt -1 | \ - sed -e 's/^ *//' -e 's/$$/:/' >> $(basename $@).d - @rm -f $(basename $@).d.tmp - -objsdir: - @if [ ! -d $(OUTDIR) ]; then mkdir -p $(OUTDIR); fi; - -$(OUTDIR)/libgtpv1u.a: $(addprefix $(OUTDIR)/,$(libgtpv1u_OBJECTS)) - @echo Creating GTPV1U archive - @$(AR) rcs $@ $(addprefix $(OUTDIR)/,$(libgtpv1u_OBJECTS)) - -clean: - @$(RM_F_V) $(OUTDIR)/nw-gtpv1u/src/*.o - @$(RM_F_V) $(OUTDIR)/nw-gtpv1u/src/*.d - @$(RM_F_V) $(OUTDIR)/*.o - @$(RM_F_V) $(OUTDIR)/*.d - @$(RM_F_V) $(OUTDIR)/libgtpv1u.a - -cleanall: clean diff --git a/openair3/GTPV1-U/gtpv1u.h b/openair3/GTPV1-U/gtpv1u.h deleted file mode 100644 index 9466f024bc..0000000000 --- a/openair3/GTPV1-U/gtpv1u.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file gtpv1u.h -* \brief -* \author Sebastien ROUX, Lionel Gauthier -* \company Eurecom -* \email: lionel.gauthier@eurecom.fr -*/ - -#ifndef GTPV1_U_H_ -#define GTPV1_U_H_ - -#define GTPU_STACK_ENB 0 -#define GTPU_STACK_SGW 1 - -/* When gtpv1u is compiled for eNB use MACRO from UTILS/log.h, - * otherwise use standard fprintf as logger. - */ -#if defined(ENB_MODE) -# define GTPU_DEBUG(x, args...) LOG_D(GTPU, x, ##args) -# define GTPU_INFO(x, args...) LOG_I(GTPU, x, ##args) -# define GTPU_WARNING(x, args...) LOG_W(GTPU, x, ##args) -# define GTPU_ERROR(x, args...) LOG_E(GTPU, x, ##args) -#else -# define GTPU_DEBUG(x, args...) fprintf(stdout, "[GTPU][D]"x, ##args) -# define GTPU_INFO(x, args...) fprintf(stdout, "[GTPU][I]"x, ##args) -# define GTPU_WARNING(x, args...) fprintf(stdout, "[GTPU][W]"x, ##args) -# define GTPU_ERROR(x, args...) fprintf(stderr, "[GTPU][E]"x, ##args) -#endif - -//#warning "TO BE REFINED" -# define GTPU_HEADER_OVERHEAD_MAX 64 - -uint32_t gtpv1u_new_teid(void); - -#endif /* GTPV1_U_H_ */ diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c deleted file mode 100644 index 6f5ef004b5..0000000000 --- a/openair3/GTPV1-U/gtpv1u_eNB.c +++ /dev/null @@ -1,1600 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file gtpv1u_eNB.c - * \brief - * \author Sebastien ROUX, Lionel GAUTHIER, Navid Nikaein - * \version 1.0 - * \company Eurecom - * \email: lionel.gauthier@eurecom.fr - */ -#include -#include - -#include "mme_config.h" - -#include "assertions.h" -#include "intertask_interface.h" -#include "msc.h" - -#include "gtpv1u.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uMsg.h" -#include "NwGtpv1uPrivate.h" -#include "NwLog.h" -#include "gtpv1u_eNB_defs.h" -#include "gtpv1_u_messages_types.h" -#include "udp_eNB_task.h" -#include "common/utils/LOG/log.h" -#include "COMMON/platform_types.h" -#include "COMMON/platform_constants.h" -#include "common/utils/LOG/vcd_signal_dumper.h" -#include "common/ran_context.h" -#include "gtpv1u_eNB_defs.h" -#include "gtpv1u_eNB_task.h" -#include "rrc_eNB_GTPV1U.h" -#include - -#undef GTP_DUMP_SOCKET - -extern unsigned char NB_eNB_INST; -extern RAN_CONTEXT_t RC; - -extern struct rrc_eNB_ue_context_s * -rrc_eNB_get_ue_context( - eNB_RRC_INST *rrc_instance_pP, - rnti_t rntiP); - -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 -#include -static int gtpv1u_dump_socket_g; - -//----------------------------------------------------------------------------- -int gtpv1u_eNB_create_dump_socket(void) { - struct ifreq ifr; - int hdrincl=1; - - if ((gtpv1u_dump_socket_g = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0 ) { - LOG_E(GTPU, "Could not create dump socket %d:%s\n", errno, strerror(errno)); - return -1; - } - - if (setsockopt(gtpv1u_dump_socket_g, - IPPROTO_IP, - IP_HDRINCL, - &hdrincl, - sizeof(hdrincl))==-1) { - LOG_E(GTPU, "%s:%d set IP_HDRINCL %d:%s\n", - __FILE__, __LINE__, errno, strerror(errno)); - } - - memset(&ifr, 0, sizeof(ifr)); - snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "lo"); - - if (setsockopt(gtpv1u_dump_socket_g, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr)) < 0) { - LOG_E(GTPU, "%s:%d setsockopt SO_BINDTODEVICE %d:%s\n", - __FILE__, __LINE__, errno, strerror(errno)); - close(gtpv1u_dump_socket_g); - return -1; - } -} - -//----------------------------------------------------------------------------- -static void gtpv1u_eNB_write_dump_socket(uint8_t *buffer_pP, uint32_t buffer_lengthP) { - struct sockaddr_in sin; - memset(&sin, 0, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = INADDR_LOOPBACK; - - if (sendto(gtpv1u_dump_socket_g, buffer_pP, (size_t)buffer_lengthP, 0, (struct sockaddr *)&sin, sizeof(struct sockaddr)) < 0) { - LOG_E(GTPU, "%s:%s:%d sendto %d:%s\n", - __FILE__, __FUNCTION__, __LINE__, errno, strerror(errno)); - } -} - -#endif - -//----------------------------------------------------------------------------- -static int gtpv1u_eNB_get_msgsource(struct rrc_eNB_ue_context_s *ue_context_p, teid_t teid) { - int erab_index = 0; - - /* source enb */ - if(ue_context_p->ue_context.handover_info != NULL && ue_context_p->ue_context.handover_info->state == HO_COMPLETE) { - return GTPV1U_MSG_FROM_SPGW; - } - - /* target enb */ - for (erab_index = 0; erab_index < ue_context_p->ue_context.nb_x2u_e_rabs; erab_index++) { - if(ue_context_p->ue_context.enb_gtp_x2u_teid[erab_index] == teid) { - return GTPV1U_MSG_FROM_SOURCE_ENB; - } - } - - return GTPV1U_MSG_FROM_SPGW; -} - -//----------------------------------------------------------------------------- -static int gtpv1u_eNB_send_init_udp(const Gtpv1uS1Req *req) { - // Create and alloc new message - MessageDef *message_p; - struct in_addr addr= {0}; - message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, UDP_INIT); - - if (message_p == NULL) { - return -1; - } - - UDP_INIT(message_p).port = req->enb_port_for_S1u_S12_S4_up; - addr.s_addr = req->enb_ip_address_for_S1u_S12_S4_up; - UDP_INIT(message_p).address = inet_ntoa(addr); - LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,UDP_INIT(message_p).port); - MSC_LOG_EVENT( - MSC_GTPU_ENB, - "0 UDP bind %s:%u", - UDP_INIT(message_p).address, - UDP_INIT(message_p).port); - return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); -} - -static int gtpv1u_s1_req( - const instance_t instanceP, - const Gtpv1uS1Req *const req) { - memcpy(&RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, - &req->enb_ip_address_for_S1u_S12_S4_up, - sizeof (req->enb_ip_address_for_S1u_S12_S4_up)); - gtpv1u_eNB_send_init_udp(req); - return 0; -} - -//----------------------------------------------------------------------------- -NwGtpv1uRcT gtpv1u_eNB_log_request(NwGtpv1uLogMgrHandleT hLogMgr, - uint32_t logLevel, - NwCharT *file, - uint32_t line, - NwCharT *logStr) { - LOG_D(GTPU, "%s\n", logStr); - return NW_GTPV1U_OK; -} - -//----------------------------------------------------------------------------- -NwGtpv1uRcT gtpv1u_eNB_send_udp_msg( - NwGtpv1uUdpHandleT udpHandle, - uint8_t *buffer, - uint32_t buffer_len, - uint32_t buffer_offset, - uint32_t peerIpAddr, - uint16_t peerPort) { - // Create and alloc new message - MessageDef *message_p = NULL; - udp_data_req_t *udp_data_req_p = NULL; - message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, UDP_DATA_REQ); - - if (message_p) { -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_D(GTPU, "Sending UDP_DATA_REQ length %u offset %u", buffer_len, buffer_offset); -#endif - udp_data_req_p = &message_p->ittiMsg.udp_data_req; - udp_data_req_p->peer_address = peerIpAddr; - udp_data_req_p->peer_port = peerPort; - udp_data_req_p->buffer = buffer; - udp_data_req_p->buffer_length = buffer_len; - udp_data_req_p->buffer_offset = buffer_offset; - return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); - } else { - return NW_GTPV1U_FAILURE; - } -} - - -//----------------------------------------------------------------------------- -/* Callback called when a gtpv1u message arrived on UDP interface */ -NwGtpv1uRcT gtpv1u_eNB_process_stack_req( - NwGtpv1uUlpHandleT hUlp, - NwGtpv1uUlpApiT *pUlpApi) { - boolean_t result = FALSE; - teid_t teid = 0; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - protocol_ctxt_t ctxt; - NwGtpv1uRcT rc; - - switch(pUlpApi->apiType) { - /* Here there are two type of messages handled: - * - T-PDU - * - END-MARKER - */ - case NW_GTPV1U_ULP_API_RECV_TPDU: { - uint8_t buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - uint32_t buffer_len; - struct rrc_eNB_ue_context_s *ue_context_p; - uint16_t msgType = NW_GTP_GPDU; - NwGtpv1uMsgT *pMsg = NULL; - /* Nw-gptv1u stack has processed a PDU. we can schedule it to PDCP - * for transmission. - */ - teid = pUlpApi->apiInfo.recvMsgInfo.teid; - pMsg = (NwGtpv1uMsgT *) pUlpApi->apiInfo.recvMsgInfo.hMsg; - msgType = pMsg->msgType; - - if (NW_GTPV1U_OK != nwGtpv1uMsgGetTpdu(pUlpApi->apiInfo.recvMsgInfo.hMsg, - buffer, &buffer_len)) { - LOG_E(GTPU, "Error while retrieving T-PDU"); - } - - itti_free(TASK_UDP, ((NwGtpv1uMsgT *)pUlpApi->apiInfo.recvMsgInfo.hMsg)->msgBuf); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(buffer,buffer_len); -#endif - rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, - pUlpApi->apiInfo.recvMsgInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_get(RC.gtpv1u_data_g->teid_mapping, teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_OK) { -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_D(GTPU, "Received T-PDU from gtpv1u stack teid %u size %d -> enb module id %u ue module id %u rab id %u\n", - teid, - buffer_len, - gtpv1u_teid_data_p->enb_id, - gtpv1u_teid_data_p->ue_id, - gtpv1u_teid_data_p->eps_bearer_id); -#endif - //#warning "LG eps bearer mapping to DRB id to do (offset -4)" - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_PDCP_ENB, - NULL,0, - MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - 0,0, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - buffer_len); - ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.module_id], ctxt.rnti); - - if((ue_context_p != NULL) && - (ue_context_p->ue_context.handover_info != NULL) && - (ue_context_p->ue_context.handover_info->state < HO_FORWARDING_COMPLETE)) { - if(msgType == NW_GTP_END_MARKER) { - /* in the source enb, UE in RRC_HO_EXECUTION mode */ - if (ue_context_p->ue_context.StatusRrc == RRC_HO_EXECUTION && ue_context_p->ue_context.handover_info->state == HO_COMPLETE) { - /* set handover state */ - //ue_context_p->ue_context.handover_info->state = HO_END_MARKER; - MessageDef *msg; - // Configure end marker - msg = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_ENB_END_MARKER_REQ); - GTPV1U_ENB_END_MARKER_REQ(msg).buffer = itti_malloc(TASK_GTPV1_U, TASK_GTPV1_U, GTPU_HEADER_OVERHEAD_MAX + buffer_len); - memcpy(>PV1U_ENB_END_MARKER_REQ(msg).buffer[GTPU_HEADER_OVERHEAD_MAX], buffer, buffer_len); - GTPV1U_ENB_END_MARKER_REQ(msg).length = buffer_len; - GTPV1U_ENB_END_MARKER_REQ(msg).rnti = ctxt.rnti; - GTPV1U_ENB_END_MARKER_REQ(msg).rab_id = gtpv1u_teid_data_p->eps_bearer_id; - GTPV1U_ENB_END_MARKER_REQ(msg).offset = GTPU_HEADER_OVERHEAD_MAX; - LOG_I(GTPU, "Send End Marker to GTPV1-U at frame %d and subframe %d \n", ctxt.frame,ctxt.subframe); - itti_send_msg_to_task(TASK_GTPV1_U, ENB_MODULE_ID_TO_INSTANCE(ctxt.module_id), msg); - return NW_GTPV1U_OK; - } - } - - if (ue_context_p->ue_context.StatusRrc == RRC_HO_EXECUTION || ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED) { - int msgsrc = gtpv1u_eNB_get_msgsource(ue_context_p, teid); - LOG_D(GTPU,"UE INFO.ueStatus %d, handover state %d, forwarding state %d, from %s. message type %s\n", - ue_context_p->ue_context.StatusRrc, - ue_context_p->ue_context.handover_info->state, - ue_context_p->ue_context.handover_info->forwarding_state, - msgsrc == GTPV1U_MSG_FROM_SOURCE_ENB?"Source eNB":"EPC", - msgsrc != GTPV1U_MSG_FROM_SOURCE_ENB? "UDP DATA" : - msgType == NW_GTP_END_MARKER?"END MARKER":"DATA FORWARDING"); - - /* target enb */ - if(msgType == NW_GTP_END_MARKER) { - LOG_I(GTPU, "target end receive END MARKER\n"); - ue_context_p->ue_context.handover_info->state = HO_END_MARKER; - gtpv1u_enb_delete_tunnel_req_t delete_tunnel_req; - memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req)); - delete_tunnel_req.rnti = ctxt.rnti; - gtpv1u_delete_x2u_tunnel(ctxt.module_id, &delete_tunnel_req, GTPV1U_TARGET_ENB); - return NW_GTPV1U_OK; - } - - /* form source eNB message */ - if(msgsrc == GTPV1U_MSG_FROM_SOURCE_ENB) { - LOG_I(GTPU, "Received a message data forwarding length %d\n", buffer_len); -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_T(GTPU, "forwarding data info:\n", buffer_len); - - for(int i=1; i<=buffer_len; i++) { - LOG_T(GTPU, "%02x ", buffer[i-1]); - - if(i%20 == 0)LOG_T(GTPU, "\n"); - } - - LOG_T(GTPU, "\n"); -#endif - result = gtpv_data_req( - &ctxt, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - 0, // mui - SDU_CONFIRM_NO, // confirm - buffer_len, - buffer, - PDCP_TRANSMISSION_MODE_DATA, - TASK_DATA_FORWARDING - ); - - if ( result == FALSE ) { - LOG_W(GTPU, "DATA FORWARDING message save failed\n"); - return NW_GTPV1U_FAILURE; - } - - ue_context_p->ue_context.handover_info->forwarding_state = FORWARDING_NO_EMPTY; - return NW_GTPV1U_OK; - } - /* from epc message */ - else { - /* in the source enb, UE in RRC_HO_EXECUTION mode */ - if (ue_context_p->ue_context.handover_info->state == HO_COMPLETE) { - MessageDef *msg; - // Configure target - msg = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_ENB_DATA_FORWARDING_REQ); - GTPV1U_ENB_DATA_FORWARDING_REQ(msg).buffer = itti_malloc(TASK_GTPV1_U, TASK_GTPV1_U, GTPU_HEADER_OVERHEAD_MAX + buffer_len); - memcpy(>PV1U_ENB_DATA_FORWARDING_REQ(msg).buffer[GTPU_HEADER_OVERHEAD_MAX], buffer, buffer_len); - GTPV1U_ENB_DATA_FORWARDING_REQ(msg).length = buffer_len; - GTPV1U_ENB_DATA_FORWARDING_REQ(msg).rnti = ctxt.rnti; - GTPV1U_ENB_DATA_FORWARDING_REQ(msg).rab_id = gtpv1u_teid_data_p->eps_bearer_id; - GTPV1U_ENB_DATA_FORWARDING_REQ(msg).offset = GTPU_HEADER_OVERHEAD_MAX; -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_T(GTPU, "Send data forwarding sdu_buffer to target enb. len %d info\n", buffer); - - for(int i=1; i<=buffer_len; i++) { - LOG_T(GTPU, "%02x ", buffer[i-1]); - - if(i%20 == 0)LOG_T(GTPU, "\n"); - } - - LOG_T(GTPU, "\n"); -#endif - LOG_I(GTPU, "Send data forwarding to GTPV1-U at frame %d and subframe %d \n", ctxt.frame,ctxt.subframe); - itti_send_msg_to_task(TASK_GTPV1_U, ENB_MODULE_ID_TO_INSTANCE(ctxt.module_id), msg); - return NW_GTPV1U_OK; - } - - /* target eNB. x2ho forwarding is processing. spgw message save to TASK_END_MARKER */ - if(ue_context_p->ue_context.handover_info->state != HO_COMPLETE && - ue_context_p->ue_context.handover_info->state != HO_END_MARKER ) { - LOG_I(GTPU, "x2ho forwarding is processing. Received a spgw message. length %d\n", buffer_len); -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_T(GTPU, "spgw data info:\n", buffer_len); - - for(int i=1; i<=buffer_len; i++) { - LOG_T(GTPU, "%02x ", buffer[i-1]); - - if(i%20 == 0)LOG_T(GTPU, "\n"); - } - - LOG_T(GTPU, "\n"); -#endif - result = gtpv_data_req( - &ctxt, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - 0, // mui - SDU_CONFIRM_NO, // confirm - buffer_len, - buffer, - PDCP_TRANSMISSION_MODE_DATA, - TASK_END_MARKER - ); - - if ( result == FALSE ) { - LOG_W(GTPU, "DATA FORWARDING message save failed\n"); - return NW_GTPV1U_FAILURE; - } - - ue_context_p->ue_context.handover_info->endmark_state = ENDMARK_NO_EMPTY; - return NW_GTPV1U_OK; - } - } - } - } - - result = pdcp_data_req( - &ctxt, - SRB_FLAG_NO, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - 0, // mui - SDU_CONFIRM_NO, // confirm - buffer_len, - buffer, - PDCP_TRANSMISSION_MODE_DATA,NULL, NULL - ); - - if ( result == FALSE ) { - LOG_W(GTPU, "PDCP data request failed\n"); - return NW_GTPV1U_FAILURE; - } - } else { - LOG_W(GTPU, "Received T-PDU from gtpv1u stack teid %u unknown size %u", teid, buffer_len); - } - } - break; - - default: { - LOG_E(GTPU, "Received undefined UlpApi (%02x) from gtpv1u stack!\n", - pUlpApi->apiType); - } - } // end of switch - - return NW_GTPV1U_OK; -} - - -//----------------------------------------------------------------------------- -int data_recv_callback(uint16_t portP, - uint32_t address, - uint8_t *buffer, - uint32_t length, - void *arg_p) { - gtpv1u_data_t *gtpv1u_data_p; - - if (arg_p == NULL) { - return -1; - } - - gtpv1u_data_p = (gtpv1u_data_t *)arg_p; - return nwGtpv1uProcessUdpReq(gtpv1u_data_p->gtpv1u_stack, - buffer, - length, - portP, - address); -} - -//int -//gtpv1u_create_tunnel_endpoint( -// gtpv1u_data_t *gtpv1u_data_pP, -// uint8_t ue_idP, -// uint8_t rab_idP, -// char *sgw_ip_addr_pP, -// uint16_t portP) -//{ -// uint32_t teid; -// uint8_t max_attempt = 100; -// NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; -// NwGtpv1uUlpApiT ulp_req; -// struct gtpv1u_ue_data_s *new_ue_p = NULL; -// struct gtpv1u_bearer_s *bearer_p = NULL; -// hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS;; -// -// if (rab_idP > GTPV1U_MAX_BEARERS_PER_UE) { -// LOG_E(GTPU, "Could not use rab_id %d > max %d\n", -// rab_idP, GTPV1U_MAX_BEARERS_PER_UE); -// return -1; -// } -// -// -// if ((hash_rc = hashtable_get(gtpv1u_data_pP->ue_mapping, (uint64_t)ue_idP, (void**)&new_ue_p)) == HASH_TABLE_OK) { -// /* A context for this UE already exist in the tree, use it */ -// /* We check that the tunnel is not already configured */ -// if (new_ue_p->bearers[rab_idP].state != BEARER_DOWN) { -// LOG_E(GTPU, "Cannot create new end-point over already existing tunnel\n"); -// return -1; -// } -// } else { -// /* Context doesn't exist, create it */ -// if (rab_idP != 0) { -// /* UE should first establish Default bearer before trying to setup -// * additional bearers. -// */ -// LOG_E(GTPU, "UE context is not known and rab_id != 0\n"); -// return -1; -// } -// new_ue_p = calloc(1, sizeof(struct gtpv1u_ue_data_s)); -// new_ue_p->ue_id = ue_idP; -// -// hash_rc = hashtable_insert(gtpv1u_data_pP->ue_mapping, (uint64_t)ue_idP, new_ue_p); -// -// if ((hash_rc != HASH_TABLE_OK) && (hash_rc != HASH_TABLE_INSERT_OVERWRITTEN_DATA)) { -// LOG_E(GTPU, "Failed to insert new UE context\n"); -// free(new_ue_p); -// return -1; -// } -// } -// -// bearer_p = &new_ue_p->bearers[rab_idP]; -// -// /* Configure the bearer */ -// bearer_p->state = BEARER_IN_CONFIG; -// bearer_p->sgw_ip_addr = inet_addr(sgw_ip_addr_pP); -// bearer_p->port = portP; -// -// /* Create the new stack api request */ -// memset(&ulp_req, 0, sizeof(NwGtpv1uUlpApiT)); -// ulp_req.apiType = NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT; -// -// /* Try to create new tunnel-endpoint. -// * If teid generated is already present in the stack, just peek another random -// * teid. This could be ok for small number of tunnel but more errors could be -// * thrown if we reached high number of tunnels. -// * TODO: find a solution for teid -// */ -// do { -// /* Request for a new random TEID */ -// teid = gtpv1u_new_teid(); -// ulp_req.apiInfo.createTunnelEndPointInfo.teid = teid; -// -// rc = nwGtpv1uProcessUlpReq(gtpv1u_data_pP->gtpv1u_stack, &ulp_req); -// -// if (rc == NW_GTPV1U_OK) { -//// LOG_D(GTPU, "Successfully created new tunnel endpoint for teid 0x%x\n", -//// teid); -// bearer_p->teid_eNB = teid; -//// gtpv1u_initial_req(gtpv1u_data_pP, teid, GTPV1U_UDP_PORT, -//// inet_addr("192.168.56.101")); -// LOG_I(GTPU, "Created eNB tunnel endpoint %u for ue id %u, rab id %u\n", teid, ue_idP, rab_idP); -// return 0; -// } else { -// LOG_W(GTPU, "Teid %u already in use... %s\n", -// teid, (max_attempt > 1) ? "Trying another one" : "Last chance"); -// } -// } while(max_attempt-- && rc != NW_GTPV1U_OK); -// -// bearer_p->state = BEARER_DOWN; -// LOG_I(GTPU, "Failed to created eNB tunnel endpoint %u for ue id %u, rab id %u, bearer down\n", teid, ue_idP, rab_idP); -// -// return -1; -//} - - -//----------------------------------------------------------------------------- -static NwGtpv1uRcT gtpv1u_start_timer_wrapper( - NwGtpv1uTimerMgrHandleT tmrMgrHandle, - uint32_t timeoutSec, - uint32_t timeoutUsec, - uint32_t tmrType, - void *timeoutArg, - NwGtpv1uTimerHandleT *hTmr) { - NwGtpv1uRcT rc = NW_GTPV1U_OK; - long timer_id; - - if (tmrType == NW_GTPV1U_TMR_TYPE_ONE_SHOT) { - timer_setup(timeoutSec, - timeoutUsec, - TASK_GTPV1_U, - INSTANCE_DEFAULT, - TIMER_ONE_SHOT, - timeoutArg, - &timer_id); - } else { - timer_setup(timeoutSec, - timeoutUsec, - TASK_GTPV1_U, - INSTANCE_DEFAULT, - TIMER_PERIODIC, - timeoutArg, - &timer_id); - } - - return rc; -} - - -//----------------------------------------------------------------------------- -static NwGtpv1uRcT -gtpv1u_stop_timer_wrapper( - NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NwGtpv1uTimerHandleT hTmr) { - NwGtpv1uRcT rc = NW_GTPV1U_OK; - return rc; -} - - -//----------------------------------------------------------------------------- -int -gtpv1u_initial_req( - gtpv1u_data_t *gtpv1u_data_pP, - teid_t teidP, - tcp_udp_port_t portP, - uint32_t address) { - NwGtpv1uUlpApiT ulp_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - memset(&ulp_req, 0, sizeof(NwGtpv1uUlpApiT)); - ulp_req.apiType = NW_GTPV1U_ULP_API_INITIAL_REQ; - ulp_req.apiInfo.initialReqInfo.teid = teidP; - ulp_req.apiInfo.initialReqInfo.peerPort = portP; - ulp_req.apiInfo.initialReqInfo.peerIp = address; - rc = nwGtpv1uProcessUlpReq(gtpv1u_data_pP->gtpv1u_stack, &ulp_req); - - if (rc == NW_GTPV1U_OK) { - LOG_D(GTPU, "Successfully sent initial req for teid %u\n", teidP); - } else { - LOG_W(GTPU, "Could not send initial req for teid %u\n", teidP); - } - - return (rc == NW_GTPV1U_OK) ? 0 : -1; -} - -//----------------------------------------------------------------------------- -int -gtpv1u_new_data_req( - uint8_t enb_module_idP, - rnti_t ue_rntiP, - uint8_t rab_idP, - uint8_t *buffer_pP, - uint32_t buf_lenP, - uint32_t buf_offsetP -) { - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - struct gtpv1u_ue_data_s ue; - struct gtpv1u_ue_data_s *ue_inst_p = NULL; - struct gtpv1u_bearer_s *bearer_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS;; - gtpv1u_data_t *gtpv1u_data_p = NULL; - memset(&ue, 0, sizeof(struct gtpv1u_ue_data_s)); - ue.ue_id = ue_rntiP; - AssertFatal(enb_module_idP >=0, "Bad parameter enb module id %u\n", enb_module_idP); - AssertFatal((rab_idP - GTPV1U_BEARER_OFFSET)< GTPV1U_MAX_BEARERS_ID, "Bad parameter rab id %u\n", rab_idP); - AssertFatal((rab_idP - GTPV1U_BEARER_OFFSET) >= 0, "Bad parameter rab id %u\n", rab_idP); - gtpv1u_data_p = RC.gtpv1u_data_g; - /* Check that UE context is present in ue map. */ - hash_rc = hashtable_get(gtpv1u_data_p->ue_mapping, (uint64_t)ue_rntiP, (void **)&ue_inst_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS ) { - LOG_E(GTPU, "[UE %d] Trying to send data on non-existing UE context\n", ue_rntiP); - return -1; - } - - bearer_p = &ue_inst_p->bearers[rab_idP - GTPV1U_BEARER_OFFSET]; - - /* Ensure the bearer in ready. - * TODO: handle the cases where the bearer is in HANDOVER state. - * In such case packets should be placed in FIFO. - */ - if (bearer_p->state != BEARER_UP) { - LOG_W(GTPU, "Trying to send data over bearer with state(%u) != BEARER_UP\n", - bearer_p->state); - //#warning LG: HACK WHILE WAITING FOR NAS, normally return -1 - - if (bearer_p->state != BEARER_IN_CONFIG) - return -1; - } - - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - stack_req.apiInfo.sendtoInfo.teid = bearer_p->teid_sgw; - stack_req.apiInfo.sendtoInfo.ipAddr = bearer_p->sgw_ip_addr; - LOG_D(GTPU, "TX TO TEID %u addr 0x%x\n",bearer_p->teid_sgw, bearer_p->sgw_ip_addr); - rc = nwGtpv1uGpduMsgNew(gtpv1u_data_p->gtpv1u_stack, - bearer_p->teid_sgw, - NW_FALSE, - gtpv1u_data_p->seq_num++, - buffer_pP, - buf_lenP, - buf_offsetP, - &(stack_req.apiInfo.sendtoInfo.hMsg)); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - return -1; - } - - rc = nwGtpv1uProcessUlpReq(gtpv1u_data_p->gtpv1u_stack, - &stack_req); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - return -1; - } - - rc = nwGtpv1uMsgDelete(gtpv1u_data_p->gtpv1u_stack, - stack_req.apiInfo.sendtoInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - return -1; - } - - LOG_D(GTPU, "%s() return code OK\n", __FUNCTION__); - return 0; -} - -//----------------------------------------------------------------------------- -int -gtpv1u_create_x2u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP, - gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP -) { - /* Create a new nw-gtpv1-u stack req using API */ - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - /* Local tunnel end-point identifier */ - teid_t x2u_teid = 0; - gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int i; - ebi_t eps_bearer_id = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_X2U_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u ebid %u enb-x2u teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->eps_bearer_id[0], - create_tunnel_req_pP->tenb_X2u_teid[0]); - create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; - create_tunnel_resp_pP->status = 0; - create_tunnel_resp_pP->num_tunnels = 0; - - for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { - eps_bearer_id = create_tunnel_req_pP->eps_bearer_id[i]; - LOG_D(GTPU, "Rx GTPV1U_ENB_CREATE_X2U_TUNNEL_REQ ue rnti %x eps bearer id %u\n", - create_tunnel_req_pP->rnti, eps_bearer_id); - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT; - - do { - x2u_teid = gtpv1u_new_teid(); - LOG_D(GTPU, "gtpv1u_create_x2u_tunnel() 0x%x %u(dec)\n", x2u_teid, x2u_teid); - stack_req.apiInfo.createTunnelEndPointInfo.teid = x2u_teid; - stack_req.apiInfo.createTunnelEndPointInfo.hUlpSession = 0; - stack_req.apiInfo.createTunnelEndPointInfo.hStackSession = 0; - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - LOG_D(GTPU, ".\n"); - } while (rc != NW_GTPV1U_OK); - - memcpy(&create_tunnel_resp_pP->enb_addr.buffer, - &RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, - sizeof (in_addr_t)); - LOG_D(GTPU, "gtpv1u_create_x2u_tunnel() end addr %d.%d.%d.%d\n", - create_tunnel_resp_pP->enb_addr.buffer[0], - create_tunnel_resp_pP->enb_addr.buffer[1], - create_tunnel_resp_pP->enb_addr.buffer[2], - create_tunnel_resp_pP->enb_addr.buffer[3]); - create_tunnel_resp_pP->enb_addr.length = sizeof (in_addr_t); - create_tunnel_resp_pP->eps_bearer_id[i] = eps_bearer_id; - create_tunnel_resp_pP->num_tunnels += 1; - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - create_tunnel_resp_pP->enb_X2u_teid[i] = x2u_teid; - hash_rc = hashtable_get(RC.gtpv1u_data_g->teid_mapping, x2u_teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - gtpv1u_teid_data_p = calloc (1, sizeof(gtpv1u_teid_data_t)); - gtpv1u_teid_data_p->enb_id = 0; // TO DO - gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_teid_data_p->eps_bearer_id = eps_bearer_id; - hash_rc = hashtable_insert(RC.gtpv1u_data_g->teid_mapping, x2u_teid, gtpv1u_teid_data_p); - AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting teid mapping in GTPV1U hashtable"); - } else { - create_tunnel_resp_pP->enb_X2u_teid[i] = 0; - create_tunnel_resp_pP->status = 0xFF; - } - } - - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - x2u_teid); - LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", - create_tunnel_req_pP->rnti, - create_tunnel_resp_pP->status); - return 0; -} - -//----------------------------------------------------------------------------- -int gtpv1u_delete_x2u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_delete_tunnel_req_t *const req_pP, - int enbflag) { - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int erab_index = 0; - ebi_t eps_bearer_id = 0; - struct rrc_eNB_ue_context_s *ue_context_p = NULL; - ue_context_p = rrc_eNB_get_ue_context(RC.rrc[instanceP], req_pP->rnti); - - if(ue_context_p != NULL) { - /* in the source enb */ - if(enbflag == GTPV1U_SOURCE_ENB) { - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, req_pP->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_OK) { - for (erab_index = 0; erab_index < ue_context_p->ue_context.nb_x2u_e_rabs; erab_index++) { - eps_bearer_id = ue_context_p->ue_context.enb_gtp_x2u_ebi[erab_index]; - LOG_I(GTPU, "gtpv1u_delete_x2u_tunnel user rnti %x teNB X2U teid %u eps bearer id %ld\n", - req_pP->rnti, - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_teNB, - ue_context_p->ue_context.enb_gtp_x2u_ebi[erab_index]); - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_teNB = 0; - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].tenb_ip_addr = 0; - //gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].tenb_ip6_addr = 0; - } - - ue_context_p->ue_context.nb_x2u_e_rabs = 0; - } - } - /* in the target enb */ - else { - for (erab_index = 0; erab_index < ue_context_p->ue_context.nb_x2u_e_rabs; erab_index++) { - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_remove(RC.gtpv1u_data_g->teid_mapping, ue_context_p->ue_context.enb_gtp_x2u_teid[erab_index]); - LOG_I(GTPU, "Removed user rnti %x , enb X2U teid %u\n", req_pP->rnti, ue_context_p->ue_context.enb_gtp_x2u_teid[erab_index]); - - if (hash_rc != HASH_TABLE_OK) { - LOG_D(GTPU, "Removed user rnti %x , enb X2U teid %u not found\n", req_pP->rnti, ue_context_p->ue_context.enb_gtp_x2u_teid[erab_index]); - } - } - - ue_context_p->ue_context.nb_x2u_e_rabs = 0; - } - } - - return 0; -} - -//----------------------------------------------------------------------------- -int -gtpv1u_create_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP, - gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP -) { - /* Create a new nw-gtpv1-u stack req using API */ - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - /* Local tunnel end-point identifier */ - teid_t s1u_teid = 0; - gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - //MessageDef *message_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int i; - ebi_t eps_bearer_id = 0; - // int ipv4_addr = 0; - int ip_offset = 0; - in_addr_t in_addr; - int addrs_length_in_bytes= 0; - int loop_counter = 0; - int ret = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u ebid %u sgw-s1u teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->eps_bearer_id[0], - create_tunnel_req_pP->sgw_S1u_teid[0]); - create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; - create_tunnel_resp_pP->status = 0; - create_tunnel_resp_pP->num_tunnels = 0; - - for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { - ip_offset = 0; - loop_counter = 0; - eps_bearer_id = create_tunnel_req_pP->eps_bearer_id[i]; - LOG_D(GTPU, "Rx GTPV1U_ENB_CREATE_TUNNEL_REQ ue rnti %x eps bearer id %u\n", - create_tunnel_req_pP->rnti, eps_bearer_id); - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT; - - do { - s1u_teid = gtpv1u_new_teid(); - LOG_I(GTPU, "gtpv1u_data_g %p\n", RC.gtpv1u_data_g); - LOG_I(GTPU, "gtpv1u_create_s1u_tunnel() 0x%x %u(dec)\n", s1u_teid, s1u_teid); - stack_req.apiInfo.createTunnelEndPointInfo.teid = s1u_teid; - stack_req.apiInfo.createTunnelEndPointInfo.hUlpSession = 0; - stack_req.apiInfo.createTunnelEndPointInfo.hStackSession = 0; - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - LOG_D(GTPU, ".\n"); - loop_counter++; - } while (rc != NW_GTPV1U_OK && loop_counter < 10); - - if ( rc != NW_GTPV1U_OK && loop_counter == 10 ) { - LOG_E(GTPU,"NwGtpv1uCreateTunnelEndPoint failed 10 times,start next loop\n"); - ret = -1; - continue; - } - - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, (void **)>pv1u_ue_data_p); - - if ((hash_rc == HASH_TABLE_KEY_NOT_EXISTS) || (hash_rc == HASH_TABLE_OK)) { - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - gtpv1u_ue_data_p = calloc (1, sizeof(gtpv1u_ue_data_t)); - hash_rc = hashtable_insert(RC.gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, gtpv1u_ue_data_p); - AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable"); - } - - gtpv1u_ue_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_ue_data_p->instance_id = 0; // TO DO - memcpy(&create_tunnel_resp_pP->enb_addr.buffer, - &RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, - sizeof (in_addr_t)); - - LOG_I(GTPU,"Configured GTPu address : %x\n",RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up); - create_tunnel_resp_pP->enb_addr.length = sizeof (in_addr_t); - addrs_length_in_bytes = create_tunnel_req_pP->sgw_addr[i].length / 8; - AssertFatal((addrs_length_in_bytes == 4) || - (addrs_length_in_bytes == 16) || - (addrs_length_in_bytes == 20), - "Bad transport layer address length %d (bits) %d (bytes)", - create_tunnel_req_pP->sgw_addr[i].length, addrs_length_in_bytes); - - if ((addrs_length_in_bytes == 4) || - (addrs_length_in_bytes == 20)) { - in_addr = *((in_addr_t *)create_tunnel_req_pP->sgw_addr[i].buffer); - ip_offset = 4; - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].sgw_ip_addr = in_addr; - } - - if ((addrs_length_in_bytes == 16) || - (addrs_length_in_bytes == 20)) { - memcpy(gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].sgw_ip6_addr.s6_addr, - &create_tunnel_req_pP->sgw_addr[i].buffer[ip_offset], - 16); - } - - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].state = BEARER_IN_CONFIG; - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_eNB = s1u_teid; - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_eNB_stack_session = stack_req.apiInfo.createTunnelEndPointInfo.hStackSession; - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_sgw = create_tunnel_req_pP->sgw_S1u_teid[i]; - gtpv1u_ue_data_p->num_bearers++; - create_tunnel_resp_pP->enb_S1u_teid[i] = s1u_teid; - - LOG_I(GTPU,"Copied to create_tunnel_resp tunnel: index %d target gNB ip %d.%d.%d.%d length %d gtp teid %u\n", - i, - create_tunnel_resp_pP->enb_addr.buffer[0], - create_tunnel_resp_pP->enb_addr.buffer[1], - create_tunnel_resp_pP->enb_addr.buffer[2], - create_tunnel_resp_pP->enb_addr.buffer[3], - create_tunnel_resp_pP->enb_addr.length, - create_tunnel_resp_pP->enb_S1u_teid[i]); - } else { - create_tunnel_resp_pP->enb_S1u_teid[i] = 0; - create_tunnel_resp_pP->status = 0xFF; - } - - create_tunnel_resp_pP->eps_bearer_id[i] = eps_bearer_id; - create_tunnel_resp_pP->num_tunnels += 1; - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_get(RC.gtpv1u_data_g->teid_mapping, s1u_teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - gtpv1u_teid_data_p = calloc (1, sizeof(gtpv1u_teid_data_t)); - gtpv1u_teid_data_p->enb_id = 0; // TO DO - gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_teid_data_p->eps_bearer_id = eps_bearer_id; - hash_rc = hashtable_insert(RC.gtpv1u_data_g->teid_mapping, s1u_teid, gtpv1u_teid_data_p); - AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting teid mapping in GTPV1U hashtable"); - } else { - create_tunnel_resp_pP->enb_S1u_teid[i] = 0; - create_tunnel_resp_pP->status = 0xFF; - } - } - - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - s1u_teid); - LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", - create_tunnel_req_pP->rnti, - create_tunnel_resp_pP->status); - //return 0; - return ret; -} - -int gtpv1u_update_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP, - const rnti_t prior_rnti -) { - /* Local tunnel end-point identifier */ - teid_t s1u_teid = 0; - gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - gtpv1u_ue_data_t *gtpv1u_ue_data_new_p = NULL; - //MessageDef *message_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int i,j; - uint8_t bearers_num = 0,bearers_total = 0; - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, prior_rnti, (void **)>pv1u_ue_data_p); - - if(hash_rc != HASH_TABLE_OK) { - LOG_E(GTPU,"Error get ue_mapping(rnti=%x) from GTPV1U hashtable error\n", prior_rnti); - return -1; - } - - gtpv1u_ue_data_new_p = calloc (1, sizeof(gtpv1u_ue_data_t)); - memcpy(gtpv1u_ue_data_new_p,gtpv1u_ue_data_p,sizeof(gtpv1u_ue_data_t)); - gtpv1u_ue_data_new_p->ue_id = create_tunnel_req_pP->rnti; - hash_rc = hashtable_insert(RC.gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, gtpv1u_ue_data_new_p); - - //AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable"); - if ( hash_rc != HASH_TABLE_OK ) { - LOG_E(GTPU,"Failed to insert ue_mapping(rnti=%x) in GTPV1U hashtable\n",create_tunnel_req_pP->rnti); - return -1; - } else { - LOG_I(GTPU, "inserting ue_mapping(rnti=%x) in GTPV1U hashtable\n", - create_tunnel_req_pP->rnti); - } - - hash_rc = hashtable_remove(RC.gtpv1u_data_g->ue_mapping, prior_rnti); - LOG_I(GTPU, "hashtable_remove ue_mapping(rnti=%x) in GTPV1U hashtable\n", - prior_rnti); - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - bearers_total =gtpv1u_ue_data_new_p->num_bearers; - - for(j = 0; jbearers[j].state != BEARER_IN_CONFIG) - continue; - - bearers_num++; - - for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { - if(j == (create_tunnel_req_pP->eps_bearer_id[i]-GTPV1U_BEARER_OFFSET)) - break; - } - - if(i < create_tunnel_req_pP->num_tunnels) { - s1u_teid = gtpv1u_ue_data_new_p->bearers[j].teid_eNB; - hash_rc = hashtable_get(RC.gtpv1u_data_g->teid_mapping, s1u_teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_OK) { - gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_teid_data_p->eps_bearer_id = create_tunnel_req_pP->eps_bearer_id[i]; - LOG_I(GTPU, "updata teid_mapping te_id %u (prior_rnti %x rnti %x) in GTPV1U hashtable\n", - s1u_teid,prior_rnti,create_tunnel_req_pP->rnti); - } else { - LOG_W(GTPU, "Error get teid mapping(s1u_teid=%u) from GTPV1U hashtable", s1u_teid); - } - } else { - s1u_teid = gtpv1u_ue_data_new_p->bearers[j].teid_eNB; - hash_rc = hashtable_remove(RC.gtpv1u_data_g->teid_mapping, s1u_teid); - - if (hash_rc != HASH_TABLE_OK) { - LOG_D(GTPU, "Removed user rnti %x , enb S1U teid %u not found\n", prior_rnti, s1u_teid); - } - - gtpv1u_ue_data_new_p->bearers[j].state = BEARER_DOWN; - gtpv1u_ue_data_new_p->num_bearers--; - LOG_I(GTPU, "delete teid_mapping te_id %u (rnti%x) bearer_id %d in GTPV1U hashtable\n", - s1u_teid,prior_rnti,j+GTPV1U_BEARER_OFFSET);; - } - - if(bearers_num > bearers_total) - break; - } - - return 0; -} - -//----------------------------------------------------------------------------- -int gtpv1u_delete_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - MessageDef *message_p = NULL; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - teid_t teid_eNB = 0; - int erab_index = 0; - message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_ENB_DELETE_TUNNEL_RESP); - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti = req_pP->rnti; - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).status = 0; - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, req_pP->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_OK) { - for (erab_index = 0; erab_index < req_pP->num_erab; erab_index++) { - teid_eNB = gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].teid_eNB; - LOG_D(GTPU, "Rx GTPV1U_ENB_DELETE_TUNNEL user rnti %x eNB S1U teid %u eps bearer id %u\n", - req_pP->rnti, teid_eNB, req_pP->eps_bearer_id[erab_index]); - { - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT; - LOG_D(GTPU, "gtpv1u_delete_s1u_tunnel erab %u %u\n", - req_pP->eps_bearer_id[erab_index], - teid_eNB); - stack_req.apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle = gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].teid_eNB_stack_session; - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - LOG_D(GTPU, ".\n"); - } - - if (rc != NW_GTPV1U_OK) { - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).status |= 0xFF; - LOG_E(GTPU, "NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT failed"); - } - - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].state = BEARER_DOWN; - gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].teid_eNB = 0; - gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].teid_sgw = 0; - gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].sgw_ip_addr = 0; - gtpv1u_ue_data_p->num_bearers -= 1; - - if (gtpv1u_ue_data_p->num_bearers == 0) { - hash_rc = hashtable_remove(RC.gtpv1u_data_g->ue_mapping, req_pP->rnti); - LOG_D(GTPU, "Removed user rnti %x,no more bearers configured\n", req_pP->rnti); - } - - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_remove(RC.gtpv1u_data_g->teid_mapping, teid_eNB); - - if (hash_rc != HASH_TABLE_OK) { - LOG_D(GTPU, "Removed user rnti %x , enb S1U teid %u not found\n", req_pP->rnti, teid_eNB); - } - } - }// else silently do nothing - - LOG_D(GTPU, "Tx GTPV1U_ENB_DELETE_TUNNEL_RESP user rnti %x eNB S1U teid %u status %u\n", - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti, - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).enb_S1u_teid, - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).status); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_DELETE_TUNNEL_RESP rnti %x teid %x", - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti, - teid_eNB); - if (req_pP->from_gnb) - return itti_send_msg_to_task(TASK_RRC_GNB, instanceP, message_p); - else - return itti_send_msg_to_task(TASK_RRC_ENB, instanceP, message_p); -} - - -//----------------------------------------------------------------------------- -int gtpv1u_eNB_init(void) { - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uUlpEntityT ulp; - NwGtpv1uUdpEntityT udp; - NwGtpv1uLogMgrEntityT log; - NwGtpv1uTimerMgrEntityT tmr; - // enb_properties_p = enb_config_get()->properties[0]; - RC.gtpv1u_data_g = (gtpv1u_data_t *)calloc(sizeof(gtpv1u_data_t),1); - LOG_I(GTPU, "Initializing GTPU stack %p\n",&RC.gtpv1u_data_g); - //gtpv1u_data_g.gtpv1u_stack; - /* Initialize UE hashtable */ - RC.gtpv1u_data_g->ue_mapping = hashtable_create (32, NULL, NULL); - AssertFatal(RC.gtpv1u_data_g->ue_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create returned %p\n", RC.gtpv1u_data_g->ue_mapping); - RC.gtpv1u_data_g->teid_mapping = hashtable_create (256, NULL, NULL); - AssertFatal(RC.gtpv1u_data_g->teid_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create\n"); - // RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U; - //gtpv1u_data_g.udp_data; - RC.gtpv1u_data_g->seq_num = 0; - RC.gtpv1u_data_g->restart_counter = 0; - RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up = 0; - /* Initializing GTPv1-U stack */ - if ((rc = nwGtpv1uInitialize(&RC.gtpv1u_data_g->gtpv1u_stack, GTPU_STACK_ENB)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup nwGtpv1u stack %x\n", rc); - return -1; - } - - if ((rc = nwGtpv1uSetLogLevel(RC.gtpv1u_data_g->gtpv1u_stack, - NW_LOG_LEVEL_DEBG)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup loglevel for stack %x\n", rc); - return -1; - } - - /* Set the ULP API callback. Called once message have been processed by the - * nw-gtpv1u stack. - */ - ulp.ulpReqCallback = gtpv1u_eNB_process_stack_req; - memset((void *)&(ulp.hUlp), 0, sizeof(NwGtpv1uUlpHandleT)); - - if ((rc = nwGtpv1uSetUlpEntity(RC.gtpv1u_data_g->gtpv1u_stack, &ulp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUlpEntity: %x", rc); - return -1; - } - - /* nw-gtpv1u stack requires an udp callback to send data over UDP. - * We provide a wrapper to UDP task. - */ - udp.udpDataReqCallback = gtpv1u_eNB_send_udp_msg; - memset((void *)&(udp.hUdp), 0, sizeof(NwGtpv1uUdpHandleT)); - - if ((rc = nwGtpv1uSetUdpEntity(RC.gtpv1u_data_g->gtpv1u_stack, &udp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUdpEntity: %x", rc); - return -1; - } - - log.logReqCallback = gtpv1u_eNB_log_request; - memset((void *)&(log.logMgrHandle), 0, sizeof(NwGtpv1uLogMgrHandleT)); - - if ((rc = nwGtpv1uSetLogMgrEntity(RC.gtpv1u_data_g->gtpv1u_stack, &log)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetLogMgrEntity: %x", rc); - return -1; - } - - /* Timer interface is more complicated as both wrappers doesn't send a message - * to the timer task but call the timer API functions start/stop timer. - */ - tmr.tmrMgrHandle = 0; - tmr.tmrStartCallback = gtpv1u_start_timer_wrapper; - tmr.tmrStopCallback = gtpv1u_stop_timer_wrapper; - - if ((rc = nwGtpv1uSetTimerMgrEntity(RC.gtpv1u_data_g->gtpv1u_stack, &tmr)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetTimerMgrEntity: %x", rc); - return -1; - } - -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - - if ((ret = gtpv1u_eNB_create_dump_socket()) < 0) { - return -1; - } - -#endif - LOG_D(GTPU, "Initializing GTPV1U interface for eNB: DONE\n"); - return 0; -} - -//----------------------------------------------------------------------------- -void *gtpv1u_eNB_process_itti_msg(void *notUsed) { - /* Trying to fetch a message from the message queue. - * If the queue is empty, this function will block till a - * message is sent to the task. - */ - instance_t instance; - MessageDef *received_message_p = NULL; - int rc = 0; - itti_receive_msg(TASK_GTPV1_U, &received_message_p); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_IN); - DevAssert(received_message_p != NULL); - instance = ITTI_MSG_DESTINATION_INSTANCE(received_message_p); - //msg_name_p = ITTI_MSG_NAME(received_message_p); - - switch (ITTI_MSG_ID(received_message_p)) { - case GTPV1U_ENB_S1_REQ: - gtpv1u_s1_req(instance, &received_message_p->ittiMsg.gtpv1uS1Req); - - case GTPV1U_ENB_DELETE_TUNNEL_REQ: { - gtpv1u_delete_s1u_tunnel(instance, &received_message_p->ittiMsg.Gtpv1uDeleteTunnelReq); - } - break; - - // DATA COMING FROM UDP - case UDP_DATA_IND: { - udp_data_ind_t *udp_data_ind_p; - udp_data_ind_p = &received_message_p->ittiMsg.udp_data_ind; - nwGtpv1uProcessUdpReq(RC.gtpv1u_data_g->gtpv1u_stack, - udp_data_ind_p->buffer, - udp_data_ind_p->buffer_length, - udp_data_ind_p->peer_port, - udp_data_ind_p->peer_address); - //itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), udp_data_ind_p->buffer); - } - break; - - // DATA TO BE SENT TO UDP - case GTPV1U_ENB_TUNNEL_DATA_REQ: { - gtpv1u_enb_tunnel_data_req_t *data_req_p = NULL; - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - teid_t enb_s1u_teid = 0; - teid_t sgw_s1u_teid = 0; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_IN); - data_req_p = >PV1U_ENB_TUNNEL_DATA_REQ(received_message_p); - //ipv4_send_data(ipv4_data_p->sd, data_ind_p->buffer, data_ind_p->length); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(&data_req_p->buffer[data_req_p->offset],data_req_p->length); -#endif - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, (uint64_t)data_req_p->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti); - } else { - if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id < max_val_LTE_DRB_Identity)) { - enb_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_eNB; - sgw_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_sgw; - stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - stack_req.apiInfo.sendtoInfo.teid = sgw_s1u_teid; - stack_req.apiInfo.sendtoInfo.ipAddr = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].sgw_ip_addr; - rc = nwGtpv1uGpduMsgNew( - RC.gtpv1u_data_g->gtpv1u_stack, - sgw_s1u_teid, - NW_FALSE, - RC.gtpv1u_data_g->seq_num++, - data_req_p->buffer, - data_req_p->length, - data_req_p->offset, - &(stack_req.apiInfo.sendtoInfo.hMsg)); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,sgw_s1u_teid,data_req_p->length); - (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ - } else { - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,sgw_s1u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - sgw_s1u_teid, - data_req_p->length); - } - - rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, - stack_req.apiInfo.sendtoInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - } - } - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_OUT); - /* Buffer still needed, do not free it */ - //itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), data_req_p->buffer); - } - break; - - case GTPV1U_ENB_DATA_FORWARDING_REQ: { - gtpv1u_enb_data_forwarding_req_t *data_req_p = NULL; - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - teid_t enb_s1u_teid = 0; - teid_t tenb_x2u_teid = 0; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_IN); - data_req_p = >PV1U_ENB_DATA_FORWARDING_REQ(received_message_p); - //ipv4_send_data(ipv4_data_p->sd, data_ind_p->buffer, data_ind_p->length); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(&data_req_p->buffer[data_req_p->offset],data_req_p->length); -#endif - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, (uint64_t)data_req_p->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti); - } else { - if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id <= max_val_LTE_DRB_Identity)) { - enb_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_eNB; - tenb_x2u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_teNB; // target enb teid - stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - stack_req.apiInfo.sendtoInfo.teid = tenb_x2u_teid; - stack_req.apiInfo.sendtoInfo.ipAddr = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].tenb_ip_addr;// target enb ip - rc = nwGtpv1uGpduMsgNew( - RC.gtpv1u_data_g->gtpv1u_stack, - tenb_x2u_teid, - NW_FALSE, - RC.gtpv1u_data_g->seq_num++, - data_req_p->buffer, - data_req_p->length, - data_req_p->offset, - &(stack_req.apiInfo.sendtoInfo.hMsg)); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ - } else { - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - tenb_x2u_teid, - data_req_p->length); - } - - rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, - stack_req.apiInfo.sendtoInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - } - } - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_OUT); - /* Buffer still needed, do not free it */ - //itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), data_req_p->buffer) - } - break; - - case GTPV1U_ENB_END_MARKER_REQ: { - gtpv1u_enb_end_marker_req_t *data_req_p = NULL; - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - teid_t enb_s1u_teid = 0; - teid_t tenb_x2u_teid = 0; - NwGtpv1uMsgT *pMsg = NULL; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_IN); - data_req_p = >PV1U_ENB_END_MARKER_REQ(received_message_p); - //ipv4_send_data(ipv4_data_p->sd, data_ind_p->buffer, data_ind_p->length); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(&data_req_p->buffer[data_req_p->offset],data_req_p->length); -#endif - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, (uint64_t)data_req_p->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti); - } else { - if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id <= max_val_LTE_DRB_Identity)) { - enb_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_eNB; - tenb_x2u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_teNB; // target enb teid - stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - stack_req.apiInfo.sendtoInfo.teid = tenb_x2u_teid; - stack_req.apiInfo.sendtoInfo.ipAddr = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].tenb_ip_addr;// target enb ip - rc = nwGtpv1uGpduMsgNew( - RC.gtpv1u_data_g->gtpv1u_stack, - tenb_x2u_teid, - NW_FALSE, - RC.gtpv1u_data_g->seq_num++, - data_req_p->buffer, - data_req_p->length, - data_req_p->offset, - &(stack_req.apiInfo.sendtoInfo.hMsg)); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ - } else { - pMsg = (NwGtpv1uMsgT *) stack_req.apiInfo.sendtoInfo.hMsg; - pMsg->msgType = NW_GTP_END_MARKER; - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - tenb_x2u_teid, - data_req_p->length); - } - - rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, - stack_req.apiInfo.sendtoInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - - gtpv1u_enb_delete_tunnel_req_t delete_tunnel_req; - memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req)); - delete_tunnel_req.rnti = data_req_p->rnti; - gtpv1u_delete_x2u_tunnel(instance, &delete_tunnel_req, GTPV1U_SOURCE_ENB); - } - } - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_OUT); - } - break; - - case TERMINATE_MESSAGE: { - if (RC.gtpv1u_data_g->ue_mapping != NULL) { - hashtable_destroy (&(RC.gtpv1u_data_g->ue_mapping)); - } - - if (RC.gtpv1u_data_g->teid_mapping != NULL) { - hashtable_destroy (&(RC.gtpv1u_data_g->teid_mapping)); - } - - LOG_W(GTPU, " *** Exiting GTPU thread\n"); - itti_exit_task(); - } - break; - - case TIMER_HAS_EXPIRED: - nwGtpv1uProcessTimeout(&received_message_p->ittiMsg.timer_has_expired.arg); - break; - - default: { - LOG_E(GTPU, "Unkwnon message ID %d:%s\n", - ITTI_MSG_ID(received_message_p), - ITTI_MSG_NAME(received_message_p)); - } - break; - } - - rc = itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p); - AssertFatal(rc == EXIT_SUCCESS, "Failed to free memory (%d)!\n", rc); - received_message_p = NULL; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_OUT); - return NULL; -} - -//----------------------------------------------------------------------------- -void *gtpv1u_eNB_task(void *args) { - int rc = 0; - rc = gtpv1u_eNB_init(); - AssertFatal(rc == 0, "gtpv1u_eNB_init Failed"); - itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); - - while(1) { - (void) gtpv1u_eNB_process_itti_msg (NULL); - } - - return NULL; -} - diff --git a/openair3/GTPV1-U/gtpv1u_eNB_task.h b/openair3/GTPV1-U/gtpv1u_eNB_task.h deleted file mode 100644 index a6e2625941..0000000000 --- a/openair3/GTPV1-U/gtpv1u_eNB_task.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file gtpv1u_eNB_task.h -* \brief -* \author Lionel Gauthier -* \company Eurecom -* \email: lionel.gauthier@eurecom.fr -*/ - -#ifndef GTPV1U_ENB_TASK_H_ -#define GTPV1U_ENB_TASK_H_ - - -/* -int -gtpv1u_new_data_req( - uint8_t enb_id, - uint8_t ue_id, - uint8_t rab_id, - uint8_t *buffer, - uint32_t buf_len, - uint32_t buf_offset);*/ - -int gtpv1u_eNB_init(void); -void *gtpv1u_eNB_process_itti_msg(void*); -void *gtpv1u_eNB_task(void *args); - -int -gtpv1u_create_x2u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_x2u_tunnel_req_t * const create_tunnel_req_pP, - gtpv1u_enb_create_x2u_tunnel_resp_t * const create_tunnel_resp_pP); - -int -gtpv1u_create_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, - gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP); - -int -gtpv1u_update_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, - const rnti_t prior_rnti); - -int gtpv1u_delete_x2u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_delete_tunnel_req_t * const req_pP, - int enbflag); -#endif /* GTPV1U_ENB_TASK_H_ */ diff --git a/openair3/GTPV1-U/gtpv1u_gNB.c b/openair3/GTPV1-U/gtpv1u_gNB.c deleted file mode 100644 index ff7c8c0604..0000000000 --- a/openair3/GTPV1-U/gtpv1u_gNB.c +++ /dev/null @@ -1,1012 +0,0 @@ -/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file gtpv1u_gNB.c - * \brief - * \author Sebastien ROUX, Lionel GAUTHIER, Navid Nikaein, Panos MATZAKOS - * \version 1.0 - * \company Eurecom - * \email: lionel.gauthier@eurecom.fr - */ -#include -#include - -#include "mme_config.h" -#include "intertask_interface.h" -#include "msc.h" - -#include "gtpv1u.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uMsg.h" -#include "NwGtpv1uPrivate.h" -#include "NwLog.h" -#include "gtpv1u_eNB_defs.h" -#include "gtpv1u_gNB_defs.h" -#include "gtpv1_u_messages_types.h" -#include "udp_eNB_task.h" -#include "common/utils/LOG/log.h" -#include "COMMON/platform_types.h" -#include "COMMON/platform_constants.h" -#include "common/utils/LOG/vcd_signal_dumper.h" -#include "common/ran_context.h" -#include "gtpv1u_eNB_task.h" -#include "gtpv1u_gNB_task.h" -#include "rrc_eNB_GTPV1U.h" - -#undef GTP_DUMP_SOCKET - -#undef GTPV1U_BEARER_OFFSET -#define GTPV1U_BEARER_OFFSET 1 - -extern unsigned char NB_eNB_INST; - -extern RAN_CONTEXT_t RC; - -extern NwGtpv1uRcT gtpv1u_eNB_send_udp_msg( - NwGtpv1uUdpHandleT udpHandle, - uint8_t *buffer, - uint32_t buffer_len, - uint32_t buffer_offset, - uint32_t peerIpAddr, - uint16_t peerPort); - -extern NwGtpv1uRcT gtpv1u_eNB_log_request(NwGtpv1uLogMgrHandleT hLogMgr, - uint32_t logLevel, - NwCharT *file, - uint32_t line, - NwCharT *logStr); - -static NwGtpv1uRcT gtpv1u_start_timer_wrapper( - NwGtpv1uTimerMgrHandleT tmrMgrHandle, - uint32_t timeoutSec, - uint32_t timeoutUsec, - uint32_t tmrType, - void *timeoutArg, - NwGtpv1uTimerHandleT *hTmr) { - NwGtpv1uRcT rc = NW_GTPV1U_OK; - long timer_id; - - if (tmrType == NW_GTPV1U_TMR_TYPE_ONE_SHOT) { - timer_setup(timeoutSec, - timeoutUsec, - TASK_GTPV1_U, - INSTANCE_DEFAULT, - TIMER_ONE_SHOT, - timeoutArg, - &timer_id); - } else { - timer_setup(timeoutSec, - timeoutUsec, - TASK_GTPV1_U, - INSTANCE_DEFAULT, - TIMER_PERIODIC, - timeoutArg, - &timer_id); - } - - return rc; -} - - -static NwGtpv1uRcT -gtpv1u_stop_timer_wrapper( - NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NwGtpv1uTimerHandleT hTmr) { - NwGtpv1uRcT rc = NW_GTPV1U_OK; - return rc; -} - -/* Callback called when a gtpv1u message arrived on UDP interface */ -NwGtpv1uRcT gtpv1u_gNB_process_stack_req( - NwGtpv1uUlpHandleT hUlp, - NwGtpv1uUlpApiT *pUlpApi) { - boolean_t result = FALSE; - teid_t teid = 0; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - protocol_ctxt_t ctxt; - NwGtpv1uRcT rc; - - switch(pUlpApi->apiType) { - /* Here there are two type of messages handled: - * - T-PDU - * - END-MARKER - */ - case NW_GTPV1U_ULP_API_RECV_TPDU: { - uint8_t buffer[4096]; - uint32_t buffer_len; - //uint16_t msgType = NW_GTP_GPDU; - //NwGtpv1uMsgT *pMsg = NULL; - /* Nw-gptv1u stack has processed a PDU. we can schedule it to PDCP - * for transmission. - */ - teid = pUlpApi->apiInfo.recvMsgInfo.teid; - //pMsg = (NwGtpv1uMsgT *) pUlpApi->apiInfo.recvMsgInfo.hMsg; - //msgType = pMsg->msgType; - - if (NW_GTPV1U_OK != nwGtpv1uMsgGetTpdu(pUlpApi->apiInfo.recvMsgInfo.hMsg, - buffer, &buffer_len)) { - LOG_E(GTPU, "Error while retrieving T-PDU"); - } - - itti_free(TASK_UDP, ((NwGtpv1uMsgT *)pUlpApi->apiInfo.recvMsgInfo.hMsg)->msgBuf); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(buffer,buffer_len); -#endif - rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, - pUlpApi->apiInfo.recvMsgInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - - hash_rc = hashtable_get(RC.gtpv1u_data_g->teid_mapping, teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_OK) { -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_D(GTPU, "Received T-PDU from gtpv1u stack teid %u size %d -> enb module id %u ue module id %u rab id %u\n", - teid, - buffer_len, - gtpv1u_teid_data_p->enb_id, - gtpv1u_teid_data_p->ue_id, - gtpv1u_teid_data_p->eps_bearer_id); -#endif - //warning "LG eps bearer mapping to DRB id to do (offset -4)" - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_PDCP_ENB, - NULL,0, - MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - 0,0, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - buffer_len); - - result = pdcp_data_req( - &ctxt, - SRB_FLAG_NO, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - 0, // mui - SDU_CONFIRM_NO, // confirm - buffer_len, - buffer, - PDCP_TRANSMISSION_MODE_DATA,NULL, NULL - ); - - if ( result == FALSE ) { - LOG_W(GTPU, "PDCP data request failed\n"); - - return NW_GTPV1U_FAILURE; - } - } else { - LOG_W(GTPU, "Received T-PDU from gtpv1u stack teid %u unknown size %u", teid, buffer_len); - } - } - break; - - default: { - LOG_E(GTPU, "Received undefined UlpApi (%02x) from gtpv1u stack!\n", - pUlpApi->apiType); - } - } // end of switch - - return NW_GTPV1U_OK; -} - -int gtpv1u_gNB_init(void) { - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uUlpEntityT ulp; - NwGtpv1uUdpEntityT udp; - NwGtpv1uLogMgrEntityT log; - NwGtpv1uTimerMgrEntityT tmr; - // enb_properties_p = enb_config_get()->properties[0]; - RC.gtpv1u_data_g = (gtpv1u_data_t *)calloc(sizeof(gtpv1u_data_t),1); - LOG_I(GTPU, "Initializing GTPU stack %p\n",&RC.gtpv1u_data_g); - //gtpv1u_data_g.gtpv1u_stack; - /* Initialize UE hashtable */ - RC.gtpv1u_data_g->ue_mapping = hashtable_create (32, NULL, NULL); - AssertFatal(RC.gtpv1u_data_g->ue_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create returned %p\n", RC.gtpv1u_data_g->ue_mapping); - RC.gtpv1u_data_g->teid_mapping = hashtable_create (256, NULL, NULL); - AssertFatal(RC.gtpv1u_data_g->teid_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create\n"); - // RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U; - //gtpv1u_data_g.udp_data; - RC.gtpv1u_data_g->seq_num = 0; - RC.gtpv1u_data_g->restart_counter = 0; - - /* Initializing GTPv1-U stack */ - if ((rc = nwGtpv1uInitialize(&RC.gtpv1u_data_g->gtpv1u_stack, GTPU_STACK_ENB)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup nwGtpv1u stack %x\n", rc); - return -1; - } - - if ((rc = nwGtpv1uSetLogLevel(RC.gtpv1u_data_g->gtpv1u_stack, - NW_LOG_LEVEL_DEBG)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup loglevel for stack %x\n", rc); - return -1; - } - - /* Set the ULP API callback. Called once message have been processed by the - * nw-gtpv1u stack. - */ - ulp.ulpReqCallback = gtpv1u_gNB_process_stack_req; - memset((void *)&(ulp.hUlp), 0, sizeof(NwGtpv1uUlpHandleT)); - - if ((rc = nwGtpv1uSetUlpEntity(RC.gtpv1u_data_g->gtpv1u_stack, &ulp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUlpEntity: %x", rc); - return -1; - } - - /* nw-gtpv1u stack requires an udp callback to send data over UDP. - * We provide a wrapper to UDP task. - */ - udp.udpDataReqCallback = gtpv1u_eNB_send_udp_msg; - memset((void *)&(udp.hUdp), 0, sizeof(NwGtpv1uUdpHandleT)); - - if ((rc = nwGtpv1uSetUdpEntity(RC.gtpv1u_data_g->gtpv1u_stack, &udp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUdpEntity: %x", rc); - return -1; - } - - log.logReqCallback = gtpv1u_eNB_log_request; - memset((void *)&(log.logMgrHandle), 0, sizeof(NwGtpv1uLogMgrHandleT)); - - if ((rc = nwGtpv1uSetLogMgrEntity(RC.gtpv1u_data_g->gtpv1u_stack, &log)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetLogMgrEntity: %x", rc); - return -1; - } - - /* Timer interface is more complicated as both wrappers doesn't send a message - * to the timer task but call the timer API functions start/stop timer. - */ - tmr.tmrMgrHandle = 0; - tmr.tmrStartCallback = gtpv1u_start_timer_wrapper; - tmr.tmrStopCallback = gtpv1u_stop_timer_wrapper; - - if ((rc = nwGtpv1uSetTimerMgrEntity(RC.gtpv1u_data_g->gtpv1u_stack, &tmr)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetTimerMgrEntity: %x", rc); - return -1; - } - -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - - if ((ret = gtpv1u_eNB_create_dump_socket()) < 0) { - return -1; - } - -#endif - LOG_D(GTPU, "Initializing GTPV1U interface for eNB: DONE\n"); - return 0; -} - -void *gtpv1u_gNB_task(void *args) { - int rc = 0; - rc = gtpv1u_gNB_init(); - AssertFatal(rc == 0, "gtpv1u_eNB_init Failed"); - itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); - - while(1) { - (void) gtpv1u_eNB_process_itti_msg (NULL); - } - - return NULL; -} - -/* Callback called when a gtpv1u message arrived on UDP interface */ -NwGtpv1uRcT nr_gtpv1u_gNB_process_stack_req( - NwGtpv1uUlpHandleT hUlp, - NwGtpv1uUlpApiT *pUlpApi) { - boolean_t result = FALSE; - teid_t teid = 0; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - nr_gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - protocol_ctxt_t ctxt; - NwGtpv1uRcT rc; - - switch(pUlpApi->apiType) { - /* Here there are two type of messages handled: - * - T-PDU - * - END-MARKER - */ - case NW_GTPV1U_ULP_API_RECV_TPDU: { - uint8_t buffer[4096]; - uint32_t buffer_len; - //uint16_t msgType = NW_GTP_GPDU; - //NwGtpv1uMsgT *pMsg = NULL; - /* Nw-gptv1u stack has processed a PDU. we can schedule it to PDCP - * for transmission. - */ - teid = pUlpApi->apiInfo.recvMsgInfo.teid; - //pMsg = (NwGtpv1uMsgT *) pUlpApi->apiInfo.recvMsgInfo.hMsg; - //msgType = pMsg->msgType; - - if (NW_GTPV1U_OK != nwGtpv1uMsgGetTpdu(pUlpApi->apiInfo.recvMsgInfo.hMsg, - buffer, &buffer_len)) { - LOG_E(GTPU, "Error while retrieving T-PDU"); - } - - itti_free(TASK_UDP, ((NwGtpv1uMsgT *)pUlpApi->apiInfo.recvMsgInfo.hMsg)->msgBuf); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(buffer,buffer_len); -#endif - rc = nwGtpv1uMsgDelete(RC.nr_gtpv1u_data_g->gtpv1u_stack, - pUlpApi->apiInfo.recvMsgInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->teid_mapping, teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_OK) { -// #if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_D(GTPU, "Received T-PDU from gtpv1u stack teid %u size %d -> gnb module id %u ue module id %u pdu session id %u\n", - teid, - buffer_len, - gtpv1u_teid_data_p->gnb_id, - gtpv1u_teid_data_p->ue_id, - gtpv1u_teid_data_p->pdu_session_id); -// #endif - //warning "LG eps bearer mapping to DRB id to do (offset -4)" - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->gnb_id, GNB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->gnb_id); - // MSC_LOG_TX_MESSAGE( - // MSC_GTPU_ENB, - // MSC_PDCP_ENB, - // NULL,0, - // MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - // 0,0, - // (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - // buffer_len); - - result = pdcp_data_req( - &ctxt, - SRB_FLAG_NO, - 1, - 0, // mui - SDU_CONFIRM_NO, // confirm - buffer_len, - buffer, - PDCP_TRANSMISSION_MODE_DATA,NULL, NULL - ); - - if ( result == FALSE ) { - LOG_W(GTPU, "PDCP data request failed\n"); - - return NW_GTPV1U_FAILURE; - } - } else { - LOG_W(GTPU, "Received T-PDU from gtpv1u stack teid %u unknown size %u", teid, buffer_len); - } - } - break; - - default: { - LOG_E(GTPU, "Received undefined UlpApi (%02x) from gtpv1u stack!\n", - pUlpApi->apiType); - } - } // end of switch - - return NW_GTPV1U_OK; -} - -int nr_gtpv1u_gNB_init(void) { - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uUlpEntityT ulp; - NwGtpv1uUdpEntityT udp; - NwGtpv1uLogMgrEntityT log; - NwGtpv1uTimerMgrEntityT tmr; - // enb_properties_p = enb_config_get()->properties[0]; - RC.nr_gtpv1u_data_g = (nr_gtpv1u_data_t *)calloc(sizeof(nr_gtpv1u_data_t),1); - LOG_I(GTPU, "Initializing GTPU stack %p\n",&RC.nr_gtpv1u_data_g); - - /* Initialize UE hashtable */ - RC.nr_gtpv1u_data_g->ue_mapping = hashtable_create (32, NULL, NULL); - AssertFatal(RC.nr_gtpv1u_data_g->ue_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create returned %p\n", RC.gtpv1u_data_g->ue_mapping); - RC.nr_gtpv1u_data_g->teid_mapping = hashtable_create (256, NULL, NULL); - AssertFatal(RC.nr_gtpv1u_data_g->teid_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create\n"); - // RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U; - //gtpv1u_data_g.udp_data; - RC.nr_gtpv1u_data_g->seq_num = 0; - RC.nr_gtpv1u_data_g->restart_counter = 0; - - /* Initializing GTPv1-U stack */ - if ((rc = nwGtpv1uInitialize(&RC.nr_gtpv1u_data_g->gtpv1u_stack, GTPU_STACK_ENB)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup nwGtpv1u stack %x\n", rc); - return -1; - } - - if ((rc = nwGtpv1uSetLogLevel(RC.nr_gtpv1u_data_g->gtpv1u_stack, - NW_LOG_LEVEL_DEBG)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup loglevel for stack %x\n", rc); - return -1; - } - - /* Set the ULP API callback. Called once message have been processed by the - * nw-gtpv1u stack. - */ - ulp.ulpReqCallback = nr_gtpv1u_gNB_process_stack_req; - memset((void *)&(ulp.hUlp), 0, sizeof(NwGtpv1uUlpHandleT)); - - if ((rc = nwGtpv1uSetUlpEntity(RC.nr_gtpv1u_data_g->gtpv1u_stack, &ulp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUlpEntity: %x", rc); - return -1; - } - - /* nw-gtpv1u stack requires an udp callback to send data over UDP. - * We provide a wrapper to UDP task. - */ - udp.udpDataReqCallback = gtpv1u_eNB_send_udp_msg; - memset((void *)&(udp.hUdp), 0, sizeof(NwGtpv1uUdpHandleT)); - - if ((rc = nwGtpv1uSetUdpEntity(RC.nr_gtpv1u_data_g->gtpv1u_stack, &udp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUdpEntity: %x", rc); - return -1; - } - - log.logReqCallback = gtpv1u_eNB_log_request; - memset((void *)&(log.logMgrHandle), 0, sizeof(NwGtpv1uLogMgrHandleT)); - - if ((rc = nwGtpv1uSetLogMgrEntity(RC.nr_gtpv1u_data_g->gtpv1u_stack, &log)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetLogMgrEntity: %x", rc); - return -1; - } - - /* Timer interface is more complicated as both wrappers doesn't send a message - * to the timer task but call the timer API functions start/stop timer. - */ - tmr.tmrMgrHandle = 0; - tmr.tmrStartCallback = gtpv1u_start_timer_wrapper; - tmr.tmrStopCallback = gtpv1u_stop_timer_wrapper; - - if ((rc = nwGtpv1uSetTimerMgrEntity(RC.nr_gtpv1u_data_g->gtpv1u_stack, &tmr)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetTimerMgrEntity: %x", rc); - return -1; - } - -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - - if ((ret = gtpv1u_eNB_create_dump_socket()) < 0) { - return -1; - } - -#endif - LOG_D(GTPU, "Initializing GTPV1U interface for eNB: DONE\n"); - return 0; -} - -//----------------------------------------------------------------------------- -int -gtpv1u_create_ngu_tunnel( - const instance_t instanceP, - const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP, - gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp_pP) -{ - /* Create a new nw-gtpv1-u stack req using API */ - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - /* Local tunnel end-point identifier */ - teid_t ngu_teid = 0; - nr_gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - nr_gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - //MessageDef *message_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int i; - pdusessionid_t pdusession_id = 0; - // int ipv4_addr = 0; - int ip_offset = 0; - in_addr_t in_addr; - int addrs_length_in_bytes= 0; - int loop_counter = 0; - int ret = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u psid %u upf-ngu teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->pdusession_id[0], - create_tunnel_req_pP->outgoing_teid[0]); - create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; - create_tunnel_resp_pP->status = 0; - create_tunnel_resp_pP->num_tunnels = 0; - - for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { - ip_offset = 0; - loop_counter = 0; - pdusession_id = create_tunnel_req_pP->pdusession_id[i]; - LOG_D(GTPU, "Rx GTPV1U_GNB_CREATE_TUNNEL_REQ ue rnti %x pdu session id %u\n", - create_tunnel_req_pP->rnti, pdusession_id); - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT; - - do { - ngu_teid = gtpv1u_new_teid(); - LOG_D(GTPU, "gtpv1u_create_ngu_tunnel() 0x%x %u(dec)\n", ngu_teid, ngu_teid); - stack_req.apiInfo.createTunnelEndPointInfo.teid = ngu_teid; - stack_req.apiInfo.createTunnelEndPointInfo.hUlpSession = 0; - stack_req.apiInfo.createTunnelEndPointInfo.hStackSession = 0; - rc = nwGtpv1uProcessUlpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, &stack_req); - LOG_D(GTPU, ".\n"); - loop_counter++; - } while (rc != NW_GTPV1U_OK && loop_counter < 10); - - if ( rc != NW_GTPV1U_OK && loop_counter == 10 ) { - LOG_E(GTPU,"NwGtpv1uCreateTunnelEndPoint failed 10 times,start next loop\n"); - ret = -1; - continue; - } - - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, (void **)>pv1u_ue_data_p); - - if ((hash_rc == HASH_TABLE_KEY_NOT_EXISTS) || (hash_rc == HASH_TABLE_OK)) { - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - gtpv1u_ue_data_p = calloc (1, sizeof(gtpv1u_ue_data_t)); - hash_rc = hashtable_insert(RC.nr_gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, gtpv1u_ue_data_p); - AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable"); - } - - gtpv1u_ue_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_ue_data_p->instance_id = 0; // TO DO - memcpy(&create_tunnel_resp_pP->gnb_addr.buffer, - &RC.nr_gtpv1u_data_g->gnb_ip_address_for_NGu_up, - sizeof (in_addr_t)); - - LOG_I(GTPU,"Configured GTPu address : %x\n",RC.nr_gtpv1u_data_g->gnb_ip_address_for_NGu_up); - create_tunnel_resp_pP->gnb_addr.length = sizeof (in_addr_t); - addrs_length_in_bytes = create_tunnel_req_pP->dst_addr[i].length / 8; - AssertFatal((addrs_length_in_bytes == 4) || - (addrs_length_in_bytes == 16) || - (addrs_length_in_bytes == 20), - "Bad transport layer address length %d (bits) %d (bytes)", - create_tunnel_req_pP->dst_addr[i].length, addrs_length_in_bytes); - - if ((addrs_length_in_bytes == 4) || - (addrs_length_in_bytes == 20)) { - in_addr = *((in_addr_t *)create_tunnel_req_pP->dst_addr[i].buffer); - ip_offset = 4; - gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].upf_ip_addr = in_addr; - } - - if ((addrs_length_in_bytes == 16) || - (addrs_length_in_bytes == 20)) { - memcpy(gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].upf_ip6_addr.s6_addr, - &create_tunnel_req_pP->dst_addr[i].buffer[ip_offset], - 16); - } - - gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].state = BEARER_IN_CONFIG; - gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].teid_gNB = ngu_teid; - gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].teid_gNB_stack_session = stack_req.apiInfo.createTunnelEndPointInfo.hStackSession; - gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].teid_upf = create_tunnel_req_pP->outgoing_teid[i]; - gtpv1u_ue_data_p->num_bearers++; - create_tunnel_resp_pP->gnb_NGu_teid[i] = ngu_teid; - - LOG_I(GTPU,"Copied to create_tunnel_resp tunnel: index %d target gNB ip %d.%d.%d.%d length %d gtp teid %u\n", - i, - create_tunnel_resp_pP->gnb_addr.buffer[0], - create_tunnel_resp_pP->gnb_addr.buffer[1], - create_tunnel_resp_pP->gnb_addr.buffer[2], - create_tunnel_resp_pP->gnb_addr.buffer[3], - create_tunnel_resp_pP->gnb_addr.length, - create_tunnel_resp_pP->gnb_NGu_teid[i]); - } else { - create_tunnel_resp_pP->gnb_NGu_teid[i] = 0; - create_tunnel_resp_pP->status = 0xFF; - } - - create_tunnel_resp_pP->pdusession_id[i] = pdusession_id; - create_tunnel_resp_pP->num_tunnels += 1; - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->teid_mapping, ngu_teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - gtpv1u_teid_data_p = calloc (1, sizeof(nr_gtpv1u_teid_data_t)); - gtpv1u_teid_data_p->gnb_id = 0; // TO DO - gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_teid_data_p->pdu_session_id = pdusession_id; - hash_rc = hashtable_insert(RC.nr_gtpv1u_data_g->teid_mapping, ngu_teid, gtpv1u_teid_data_p); - AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting teid mapping in GTPV1U hashtable"); - } else { - create_tunnel_resp_pP->gnb_NGu_teid[i] = 0; - create_tunnel_resp_pP->status = 0xFF; - } - } - - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - "0 GTPV1U_GNB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - ngu_teid); - LOG_D(GTPU, "Tx GTPV1U_GNB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", - create_tunnel_req_pP->rnti, - create_tunnel_resp_pP->status); - //return 0; - return ret; -} - -int gtpv1u_update_ngu_tunnel( - const instance_t instanceP, - const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP, - const rnti_t prior_rnti -) { - /* Local tunnel end-point identifier */ - teid_t ngu_teid = 0; - nr_gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - nr_gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - nr_gtpv1u_ue_data_t *gtpv1u_ue_data_new_p = NULL; - //MessageDef *message_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int i,j; - uint8_t bearers_num = 0,bearers_total = 0; - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->ue_mapping, prior_rnti, (void **)>pv1u_ue_data_p); - - if(hash_rc != HASH_TABLE_OK) { - LOG_E(GTPU,"Error get ue_mapping(rnti=%x) from GTPV1U hashtable error\n", prior_rnti); - return -1; - } - - gtpv1u_ue_data_new_p = calloc (1, sizeof(nr_gtpv1u_ue_data_t)); - memcpy(gtpv1u_ue_data_new_p,gtpv1u_ue_data_p,sizeof(nr_gtpv1u_ue_data_t)); - gtpv1u_ue_data_new_p->ue_id = create_tunnel_req_pP->rnti; - hash_rc = hashtable_insert(RC.nr_gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, gtpv1u_ue_data_new_p); - - //AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable"); - if ( hash_rc != HASH_TABLE_OK ) { - LOG_E(GTPU,"Failed to insert ue_mapping(rnti=%x) in GTPV1U hashtable\n",create_tunnel_req_pP->rnti); - return -1; - } else { - LOG_I(GTPU, "inserting ue_mapping(rnti=%x) in GTPV1U hashtable\n", - create_tunnel_req_pP->rnti); - } - - hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->ue_mapping, prior_rnti); - LOG_I(GTPU, "hashtable_remove ue_mapping(rnti=%x) in GTPV1U hashtable\n", - prior_rnti); - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - bearers_total =gtpv1u_ue_data_new_p->num_bearers; - - for(j = 0; jbearers[j].state != BEARER_IN_CONFIG) - continue; - - bearers_num++; - - for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { - if(j == (create_tunnel_req_pP->pdusession_id[i]-GTPV1U_BEARER_OFFSET)) - break; - } - - if(i < create_tunnel_req_pP->num_tunnels) { - ngu_teid = gtpv1u_ue_data_new_p->bearers[j].teid_gNB; - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->teid_mapping, ngu_teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_OK) { - gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_teid_data_p->pdu_session_id = create_tunnel_req_pP->pdusession_id[i]; - LOG_I(GTPU, "updata teid_mapping te_id %u (prior_rnti %x rnti %x) in GTPV1U hashtable\n", - ngu_teid,prior_rnti,create_tunnel_req_pP->rnti); - } else { - LOG_W(GTPU, "Error get teid mapping(s1u_teid=%u) from GTPV1U hashtable", ngu_teid); - } - } else { - ngu_teid = gtpv1u_ue_data_new_p->bearers[j].teid_gNB; - hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->teid_mapping, ngu_teid); - - if (hash_rc != HASH_TABLE_OK) { - LOG_D(GTPU, "Removed user rnti %x , enb S1U teid %u not found\n", prior_rnti, ngu_teid); - } - - gtpv1u_ue_data_new_p->bearers[j].state = BEARER_DOWN; - gtpv1u_ue_data_new_p->num_bearers--; - LOG_I(GTPU, "delete teid_mapping te_id %u (rnti%x) bearer_id %d in GTPV1U hashtable\n", - ngu_teid,prior_rnti,j+GTPV1U_BEARER_OFFSET);; - } - - if(bearers_num > bearers_total) - break; - } - - return 0; -} - -//----------------------------------------------------------------------------- -int gtpv1u_delete_ngu_tunnel( - const instance_t instanceP, - const gtpv1u_gnb_delete_tunnel_req_t *const req_pP) { - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - MessageDef *message_p = NULL; - nr_gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - teid_t teid_gNB = 0; - int pdusession_index = 0; - message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_GNB_DELETE_TUNNEL_RESP); - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti = req_pP->rnti; - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status = 0; - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->ue_mapping, req_pP->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_OK) { - for (pdusession_index = 0; pdusession_index < req_pP->num_pdusession; pdusession_index++) { - teid_gNB = gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_gNB; - LOG_D(GTPU, "Rx GTPV1U_ENB_DELETE_TUNNEL user rnti %x eNB S1U teid %u eps bearer id %u\n", - req_pP->rnti, teid_gNB, req_pP->pdusession_id[pdusession_index]); - { - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT; - LOG_D(GTPU, "gtpv1u_delete_ngu_tunnel pdusession %u %u\n", - req_pP->pdusession_id[pdusession_index], - teid_gNB); - stack_req.apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle = - gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_gNB_stack_session; - rc = nwGtpv1uProcessUlpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, &stack_req); - LOG_D(GTPU, ".\n"); - } - - if (rc != NW_GTPV1U_OK) { - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status |= 0xFF; - LOG_E(GTPU, "NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT failed"); - } - - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].state = BEARER_DOWN; - gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_gNB = 0; - gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_upf = 0; - gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].upf_ip_addr = 0; - gtpv1u_ue_data_p->num_bearers -= 1; - - if (gtpv1u_ue_data_p->num_bearers == 0) { - hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->ue_mapping, req_pP->rnti); - LOG_D(GTPU, "Removed user rnti %x,no more bearers configured\n", req_pP->rnti); - } - - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->teid_mapping, teid_gNB); - - if (hash_rc != HASH_TABLE_OK) { - LOG_D(GTPU, "Removed user rnti %x , gNB NGU teid %u not found\n", req_pP->rnti, teid_gNB); - } - } - }// else silently do nothing - - LOG_D(GTPU, "Tx GTPV1U_GNB_DELETE_TUNNEL_RESP user rnti %x gNB NGU teid %u status %u\n", - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti, - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).gnb_NGu_teid, - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - "0 GTPV1U_GNB_DELETE_TUNNEL_RESP rnti %x teid %x", - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti, - teid_gNB); - return itti_send_msg_to_task(TASK_RRC_GNB, instanceP, message_p); -} - -//----------------------------------------------------------------------------- -static int gtpv1u_gNB_send_init_udp(const Gtpv1uNGReq *req) { - // Create and alloc new message - MessageDef *message_p; - struct in_addr addr= {0}; - message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, UDP_INIT); - - if (message_p == NULL) { - return -1; - } - - UDP_INIT(message_p).port = req->gnb_port_for_NGu_up; - addr.s_addr = req->gnb_ip_address_for_NGu_up; - UDP_INIT(message_p).address = inet_ntoa(addr); - LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,UDP_INIT(message_p).port); - MSC_LOG_EVENT( - MSC_GTPU_ENB, - "0 UDP bind %s:%u", - UDP_INIT(message_p).address, - UDP_INIT(message_p).port); - return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); -} - -static int gtpv1u_ng_req( - const instance_t instanceP, - const Gtpv1uNGReq *const req) { - memcpy(&RC.nr_gtpv1u_data_g->gnb_ip_address_for_NGu_up, - &req->gnb_ip_address_for_NGu_up, - sizeof (req->gnb_ip_address_for_NGu_up)); - gtpv1u_gNB_send_init_udp(req); - return 0; -} - -static int gtpv1u_gnb_tunnel_data_req(gtpv1u_gnb_tunnel_data_req_t *gnb_tunnel_data_req) { - gtpv1u_gnb_tunnel_data_req_t *data_req_p = NULL; - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - nr_gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - teid_t gnb_ngu_teid = 0; - teid_t outgoing_teid = 0; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_IN); - data_req_p = gnb_tunnel_data_req; - - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->ue_mapping, (uint64_t)data_req_p->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti); - } else { - if ((data_req_p->pdusession_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->pdusession_id < max_val_NR_DRB_Identity)) { - gnb_ngu_teid = gtpv1u_ue_data_p->bearers[data_req_p->pdusession_id - GTPV1U_BEARER_OFFSET].teid_gNB; - outgoing_teid = gtpv1u_ue_data_p->bearers[data_req_p->pdusession_id - GTPV1U_BEARER_OFFSET].teid_upf; - stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - stack_req.apiInfo.sendtoInfo.teid = outgoing_teid; - stack_req.apiInfo.sendtoInfo.ipAddr = gtpv1u_ue_data_p->bearers[data_req_p->pdusession_id - GTPV1U_BEARER_OFFSET].upf_ip_addr; - rc = nwGtpv1uGpduMsgNew( - RC.nr_gtpv1u_data_g->gtpv1u_stack, - outgoing_teid, - NW_FALSE, - RC.nr_gtpv1u_data_g->seq_num++, - data_req_p->buffer, - data_req_p->length, - data_req_p->offset, - &(stack_req.apiInfo.sendtoInfo.hMsg)); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_GNB,"0 Failed send G-PDU ltid %u rtid %u size %u", - gnb_ngu_teid,outgoing_teid,data_req_p->length); - (void)gnb_ngu_teid; /* avoid gcc warning "set but not used" */ - } else { - rc = nwGtpv1uProcessUlpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, &stack_req); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_GNB,"0 Failed send G-PDU ltid %u rtid %u size %u", - gnb_ngu_teid,outgoing_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - gnb_ngu_teid, - outgoing_teid, - data_req_p->length); - } - - rc = nwGtpv1uMsgDelete(RC.nr_gtpv1u_data_g->gtpv1u_stack, - stack_req.apiInfo.sendtoInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - } - } - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_OUT); - /* Buffer still needed, do not free it */ - //itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), data_req_p->buffer); - - return 0; -} - -//----------------------------------------------------------------------------- -void *gtpv1u_gNB_process_itti_msg(void *notUsed) { - /* Trying to fetch a message from the message queue. - * If the queue is empty, this function will block till a - * message is sent to the task. - */ - instance_t instance; - MessageDef *received_message_p = NULL; - int rc = 0; - itti_receive_msg(TASK_GTPV1_U, &received_message_p); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_IN); - DevAssert(received_message_p != NULL); - instance = received_message_p->ittiMsgHeader.originInstance; - - switch (ITTI_MSG_ID(received_message_p)) { - case GTPV1U_GNB_NG_REQ: - gtpv1u_ng_req(instance, &received_message_p->ittiMsg.gtpv1uNGReq); - break; - - case GTPV1U_GNB_DELETE_TUNNEL_REQ: - gtpv1u_delete_ngu_tunnel(instance, &received_message_p->ittiMsg.NRGtpv1uDeleteTunnelReq); - break; - - // DATA COMING FROM UDP - case UDP_DATA_IND: { - udp_data_ind_t *udp_data_ind_p; - udp_data_ind_p = &received_message_p->ittiMsg.udp_data_ind; - nwGtpv1uProcessUdpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, - udp_data_ind_p->buffer, - udp_data_ind_p->buffer_length, - udp_data_ind_p->peer_port, - udp_data_ind_p->peer_address); - } - break; - - // DATA TO BE SENT TO UDP - case GTPV1U_GNB_TUNNEL_DATA_REQ: - LOG_I(GTPU, "Received message %s\n", ITTI_MSG_NAME(received_message_p)); - gtpv1u_gnb_tunnel_data_req(>PV1U_GNB_TUNNEL_DATA_REQ(received_message_p)); - break; - - case TERMINATE_MESSAGE: { - if (RC.nr_gtpv1u_data_g->ue_mapping != NULL) { - hashtable_destroy (&(RC.nr_gtpv1u_data_g->ue_mapping)); - } - - if (RC.nr_gtpv1u_data_g->teid_mapping != NULL) { - hashtable_destroy (&(RC.nr_gtpv1u_data_g->teid_mapping)); - } - - LOG_W(GTPU, " *** Exiting GTPU thread\n"); - itti_exit_task(); - } - break; - - case TIMER_HAS_EXPIRED: - nwGtpv1uProcessTimeout(&received_message_p->ittiMsg.timer_has_expired.arg); - break; - - default: { - LOG_E(GTPU, "Unkwnon message ID %d:%s\n", - ITTI_MSG_ID(received_message_p), - ITTI_MSG_NAME(received_message_p)); - } - break; - } - - rc = itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p); - AssertFatal(rc == EXIT_SUCCESS, "Failed to free memory (%d)!\n", rc); - received_message_p = NULL; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_OUT); - return NULL; -} - -void *nr_gtpv1u_gNB_task(void *args) { - int rc = 0; - rc = nr_gtpv1u_gNB_init(); - AssertFatal(rc == 0, "gtpv1u_gNB_init Failed"); - itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); - - while(1) { - (void) gtpv1u_gNB_process_itti_msg (NULL); - } - - return NULL; -} diff --git a/openair3/GTPV1-U/gtpv1u_gNB_defs.h b/openair3/GTPV1-U/gtpv1u_gNB_defs.h deleted file mode 100644 index d4356aa3cf..0000000000 --- a/openair3/GTPV1-U/gtpv1u_gNB_defs.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file gtpv1u_gNB_defs.h - * \brief - * \author Yoshio INOUE, Masayuki HARADA - * \date 2020 - * \version 0.1 - * \email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com - * (yoshio.inoue%40fujitsu.com%2cmasayuki.harada%40fujitsu.com) - */ - -#include "hashtable.h" -#include "NR_asn_constant.h" - -#ifndef GTPV1U_GNB_DEFS_H_ -#define GTPV1U_GNB_DEFS_H_ - -#include "NwGtpv1u.h" - -#define GTPV1U_UDP_PORT (2152) - -#define NR_GTPV1U_MAX_BEARERS_ID (max_val_NR_DRB_Identity - 3) - -#define GTPV1U_SOURCE_GNB (0) -#define GTPV1U_TARGET_GNB (1) -#define GTPV1U_MSG_FROM_SOURCE_GNB (0) -#define GTPV1U_MSG_FROM_UPF (1) - - -typedef struct nr_gtpv1u_teid_data_s { - /* UE identifier for oaisim stack */ - module_id_t gnb_id; - rnti_t ue_id; - pdusessionid_t pdu_session_id; -} nr_gtpv1u_teid_data_t; - - -typedef struct nr_gtpv1u_bearer_s { - /* TEID used in dl and ul */ - teid_t teid_gNB; ///< gNB TEID - uintptr_t teid_gNB_stack_session; ///< gNB TEID - teid_t teid_upf; ///< Remote TEID - in_addr_t upf_ip_addr; - struct in6_addr upf_ip6_addr; - teid_t teid_tgNB; - in_addr_t tgnb_ip_addr; ///< target gNB ipv4 - struct in6_addr tgnb_ip6_addr; ///< target gNB ipv6 - tcp_udp_port_t port; - //NwGtpv1uStackSessionHandleT stack_session; - bearer_state_t state; -} nr_gtpv1u_bearer_t; - -typedef struct nr_gtpv1u_ue_data_s { - /* UE identifier for oaisim stack */ - rnti_t ue_id; - - /* Unique identifier used between PDCP and GTP-U to distinguish UEs */ - uint32_t instance_id; - int num_bearers; - /* Bearer related data. - * Note that the first LCID available for data is 3 and we fixed the maximum - * number of e-rab per UE to be (32 [id range]), max RB is 11. The real rb id will 3 + rab_id (3..32). - */ - nr_gtpv1u_bearer_t bearers[NR_GTPV1U_MAX_BEARERS_ID]; - - //RB_ENTRY(gtpv1u_ue_data_s) gtpv1u_ue_node; -} nr_gtpv1u_ue_data_t; - -typedef struct nr_gtpv1u_data_s { - /* nwgtpv1u stack internal data */ - NwGtpv1uStackHandleT gtpv1u_stack; - - /* RB tree of UEs */ - hash_table_t *ue_mapping; // PDCP->GTPV1U - hash_table_t *teid_mapping; // GTPV1U -> PDCP - - //RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head; - /* Local IP address to use */ - in_addr_t gnb_ip_address_for_NGu_up; - /* UDP internal data */ - //udp_data_t udp_data; - - uint16_t seq_num; - uint8_t restart_counter; - -} nr_gtpv1u_data_t; - - -#endif /* GTPV1U_GNB_DEFS_H_ */ diff --git a/openair3/GTPV1-U/gtpv1u_sgw_defs.h b/openair3/GTPV1-U/gtpv1u_sgw_defs.h deleted file mode 100644 index 1d62c18bf6..0000000000 --- a/openair3/GTPV1-U/gtpv1u_sgw_defs.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -#ifndef GTPV1U_SGW_DEFS_H_ -#define GTPV1U_SGW_DEFS_H_ - -#include "mme_config.h" -#include "NwGtpv1u.h" -#include "gtpv1u.h" -#include "hashtable.h" -#include "common_types.h" - -#define GTPV1U_UDP_PORT (2152) - -#define MAX_BEARERS_PER_UE (11) - -typedef enum { - BEARER_DOWN = 0, - BEARER_IN_CONFIG, - BEARER_UP, - BEARER_DL_HANDOVER, - BEARER_UL_HANDOVER, - BEARER_MAX, -} bearer_state_t; - -#define BUFFER_TO_uint32_t(buf, x) \ -do { \ - x = ((uint32_t)((buf)[0]) ) | \ - ((uint32_t)((buf)[1]) << 8) | \ - ((uint32_t)((buf)[2]) << 16) | \ - ((uint32_t)((buf)[3]) << 24); \ -} while(0) - - - -typedef struct gtpv1u_teid2enb_info_s { - /* TEID used in dl and ul */ - uint32_t teid_enb; ///< Remote eNB TEID - ip_address_t enb_ip_addr; - bearer_state_t state; - uint16_t port; /// LG ??? -} gtpv1u_teid2enb_info_t; - -/*struct gtpv1u_ue_data_s { - // UE identifier for oaisim stack - uint8_t ue_id; - - // Unique identifier used between PDCP and GTP-U to distinguish UEs - uint32_t instance_id; - - // Bearer related data. - // Note that the first LCID available for data is 3 and we fixed the maximum - // number of e-rab per UE to be 11. The real rb id will 3 + rab_id (0..10). - // - struct gtpv1u_bearer_s bearers[MAX_BEARERS_PER_UE]; - - RB_ENTRY(gtpv1u_ue_data_s) gtpv1u_ue_node; -};*/ - -typedef struct { - /* nwgtpv1u stack internal data */ - NwGtpv1uStackHandleT gtpv1u_stack; - /* RB tree of UEs */ - //RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head; - /* Local IP address to use */ - uint32_t sgw_ip_address_for_S1u_S12_S4_up; - char *ip_addr; - - uint16_t seq_num; - uint8_t restart_counter; - //gtpv1u_teid2enb_info_t* teid2enb_mapping[]; - hash_table_t *S1U_mapping; - -} gtpv1u_data_t; - - -int gtpv1u_init(const mme_config_t *mme_config); - -#endif /* GTPV1U_SGW_DEFS_H_ */ diff --git a/openair3/GTPV1-U/gtpv1u_teid_pool.c b/openair3/GTPV1-U/gtpv1u_teid_pool.c deleted file mode 100644 index ff0ac6f183..0000000000 --- a/openair3/GTPV1-U/gtpv1u_teid_pool.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file gtpv1u_task.c -* \brief -* \author Lionel Gauthier -* \company Eurecom -* \email: lionel.gauthier@eurecom.fr -*/ -#include -#include - -#include "gtpv1u.h" - -//#define GTPV1U_LINEAR_TEID_ALLOCATION 1 - -#ifdef GTPV1U_LINEAR_TEID_ALLOCATION -static uint32_t g_gtpv1u_teid = 0; -#endif - -uint32_t gtpv1u_new_teid(void) -{ -#ifdef GTPV1U_LINEAR_TEID_ALLOCATION - g_gtpv1u_teid = g_gtpv1u_teid + 1; - return g_gtpv1u_teid; -#else - return random() + random() % (RAND_MAX - 1) + 1; -#endif -} diff --git a/openair3/GTPV1-U/nw-gtpv1u/AUTHORS b/openair3/GTPV1-U/nw-gtpv1u/AUTHORS deleted file mode 100644 index b068a40fdd..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Amit Chawre diff --git a/openair3/GTPV1-U/nw-gtpv1u/COPYING b/openair3/GTPV1-U/nw-gtpv1u/COPYING deleted file mode 100644 index d27832d6c1..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/COPYING +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2010-2011 Amit Chawre -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products -derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/openair3/GTPV1-U/nw-gtpv1u/ChangeLog b/openair3/GTPV1-U/nw-gtpv1u/ChangeLog deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair3/GTPV1-U/nw-gtpv1u/NEWS b/openair3/GTPV1-U/nw-gtpv1u/NEWS deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair3/GTPV1-U/nw-gtpv1u/README b/openair3/GTPV1-U/nw-gtpv1u/README deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uLog.h b/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uLog.h deleted file mode 100644 index 3fb5c8dd05..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uLog.h +++ /dev/null @@ -1,83 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#ifndef __NW_GTPV1U_LOG_H__ -#define __NW_GTPV1U_LOG_H__ - -#include -#include "NwLog.h" - -/** - * @file NwGtpv1uLog.h - * @brief This header contains logging related definitions. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Log Macro Definition - *--------------------------------------------------------------------------*/ - -#define NW_LOG(_gtpv1uHandle, _logLevel, ...) \ - do { \ - if(((NwGtpv1uStackT*)(_gtpv1uHandle))->logLevel >= _logLevel) \ - { \ - char _logBuf[1024]; \ - snprintf(_logBuf, 1024, __VA_ARGS__); \ - ((NwGtpv1uStackT*)(_gtpv1uHandle))->logMgr.logReqCallback(((NwGtpv1uStackT*)_gtpv1uHandle)->logMgr.logMgrHandle, _logLevel, __FILE__, __LINE__, _logBuf);\ - } \ - } while(0) - -#define NW_ENTER(_gtpv1uHandle) \ - do { \ - NW_LOG(_gtpv1uHandle, NW_LOG_LEVEL_DEBG, "Entering '%s'", __func__);\ - } while(0) - -#define NW_LEAVE(_gtpv1uHandle) \ - do { \ - NW_LOG(_gtpv1uHandle, NW_LOG_LEVEL_DEBG, "Leaving '%s'", __func__);\ - } while(0) - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_TYPES_H__ */ - - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uPrivate.h b/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uPrivate.h deleted file mode 100644 index 59ffb1e174..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uPrivate.h +++ /dev/null @@ -1,227 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#ifndef __NW_GTPV1U_PRIVATE_H__ -#define __NW_GTPV1U_PRIVATE_H__ - -#include "tree.h" -#include "queue.h" - -#include "NwTypes.h" -#include "NwGtpv1uError.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uMsg.h" - - -/** - * @file NwGtpv1uPrivate.h - * @brief This header file contains nw-gtpv1u private definitions not to be - * exposed to user application. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#define NW_GTPV1U_MALLOC(_stack, _size, _mem, _type) \ - do { \ - if(((NwGtpv1uStackT*)(_stack))->memMgr.memAlloc && ((NwGtpv1uStackT*)(_stack))->memMgr.memFree )\ - { \ - _mem = (_type) ((NwGtpv1uStackT*) (_stack))->memMgr.memAlloc(((NwGtpv1uStackT*) (_stack))->memMgr.hMemMgr, _size, __FILE__, __LINE__);\ - } \ - else \ - { \ - _mem = (_type) malloc (_size); \ - } \ - } while (0) - -/*--------------------------------------------------------------------------* - * G T P U S T A C K O B J E C T T Y P E D E F I N I T I O N * - *--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------* - * GRPS Tunneling Protocol Stack Class Definition - *--------------------------------------------------------------------------*/ - -/** - * gtpv1u stack class definition - */ - -typedef struct NwGtpv1uStack { - uint32_t stackType;/**< GTPU_STACK_ENB or GTPU_STACK_SGW */ - NwPtrT id; - uint32_t seq; - NwGtpv1uUlpEntityT ulp; - NwGtpv1uUdpEntityT udp; - NwGtpv1uMemMgrEntityT memMgr; - NwGtpv1uTimerMgrEntityT tmrMgr; - NwGtpv1uLogMgrEntityT logMgr; - uint32_t logLevel; - RB_HEAD( NwGtpv1uOutstandingTxSeqNumTrxnMap, NwGtpv1uTrxn) outstandingTxSeqNumMap; - RB_HEAD( NwGtpv1uOutstandingRxSeqNumTrxnMap, NwGtpv1uTrxn) outstandingRxSeqNumMap; - RB_HEAD(NwGtpv1uTunnelEndPointTMap, NwGtpv1uTunnelEndPoint) sessionMap; - RB_HEAD(NwGtpv1uTunnelEndPointIdentifierMap, NwGtpv1uTunnelEndPoint) teidMap; -} NwGtpv1uStackT; - -/** - * GTP Tunnel End Point class definition - */ - -typedef struct NwGtpv1uTunnelEndPoint { - uint32_t teid; /**< Gtpu Tunnel End Point Identifier */ - uint32_t peerAddr; /**< Peer IP address for the session */ - NwGtpv1uStackT* pStack; /**< Pointer to the parent stack */ - NwGtpv1uUlpSessionHandleT hUlpSession; /**< ULP session handle for the session */ - RB_ENTRY (NwGtpv1uTunnelEndPoint) sessionMapRbtNode; /**< RB Tree Data Structure Node */ - struct NwGtpv1uTunnelEndPoint *next; -} NwGtpv1uTunnelEndPointT; - - -/*--------------------------------------------------------------------------* - * Timeout Info Type Definition - *--------------------------------------------------------------------------*/ - -/** - * gtpv1u timeout info - */ - -typedef struct NwGtpv1uTimeoutInfo { - NwGtpv1uStackHandleT hStack; - void* timeoutArg; - NwGtpv1uRcT (*timeoutCallbackFunc)(void*); -} NwGtpv1uTimeoutInfoT; - -/** - * Start a transaction response timer - * - * @param[in] thiz Pointer to stack instance - * @param[in] timeoutArg Arg to timeout function. - * @param[out] phTmr Pointer to timer handle. - * @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpStartTrxnPeerRspTimer(NwGtpv1uStackT* thiz, NwGtpv1uTimeoutInfoT* timeoutInfo, NwGtpv1uTimerHandleT* phTmr); - -/** - * Stop a transaction response timer - * - * @param[in] thiz Pointer to stack instance - * @param[out] phTmr Pointer to timer handle. - * @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpStopTrxnPeerRspTimer(NwGtpv1uStackT* thiz, NwGtpv1uTimerHandleT* phTmr); - - -#define NW_GTPV1U_MAX_MSG_LEN (4096) /**< Maximum supported gtpv1u packet length including header */ - -/** - * NwGtpv1uMsgT holds gtpv1u messages to/from the peer. - */ -typedef struct NwGtpv1uMsg { - uint8_t version; - uint8_t protocolType; - uint8_t extHdrFlag; - uint8_t seqNumFlag; - uint16_t npduNumFlag; - uint32_t msgType; - uint16_t msgLen; - uint32_t teid; - uint16_t seqNum; - uint8_t npduNum; - uint8_t nextExtHdrType; - uint8_t* msgBuf; - uint32_t msgBufLen; - uint32_t msgBufOffset; - struct NwGtpv1uMsg* next; -} NwGtpv1uMsgT; - - -/*--------------------------------------------------------------------------* - * R6/R4 Transaction Context Type Definition - *--------------------------------------------------------------------------*/ - -/** - * Transaction structure - */ - -typedef struct NwGtpv1uTrxn { - uint32_t seqNum; - uint32_t peerIp; - uint32_t peerPort; - uint8_t maxRetries; - uint8_t t3Timer; - NwGtpv1uTimerHandleT hRspTmr; - NwGtpv1uTimeoutInfoT peerRspTimeoutInfo; - NwGtpv1uStackT* pStack; - NwGtpv1uTunnelEndPointT* pSession; - uint32_t hUlpTrxn; - NwGtpv1uMsgT* pMsg; - RB_ENTRY (NwGtpv1uTrxn) outstandingTxSeqNumMapRbtNode; /**< RB Tree Data Structure Node */ - RB_ENTRY (NwGtpv1uTrxn) outstandingRxSeqNumMapRbtNode; /**< RB Tree Data Structure Node */ - struct NwGtpv1uTrxn* next; -} NwGtpv1uTrxnT; - - -/** - * GTPv2 message header structure - */ - -#pragma pack(1) - -typedef struct NwGtpv1uMsgHeader { - uint8_t PN:1; - uint8_t S:1; - uint8_t E:1; - uint8_t spare:1; - uint8_t PT:1; - uint8_t version:3; - uint8_t msgType; - uint16_t msgLength; - uint32_t teid; -} NwGtpv1uMsgHeaderT; - -#pragma pack() - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_GTPV1U_PRIVATE_H__ */ -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTrxn.h b/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTrxn.h deleted file mode 100644 index 76228416a9..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTrxn.h +++ /dev/null @@ -1,88 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -/** - * @file NwGtpv1uTrxn.h - * @author Amit Chawre - * @brief - * - * This header file contains required definitions and functions - * prototypes used by gtpv1u transactions. - * - **/ - - -#ifndef __NW_GTPV1U_TRXN_H__ -#define __NW_GTPV1U_TRXN_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -NwGtpv1uRcT -nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT* thiz, - NW_OUT NwGtpv1uTrxnT **ppTrxn); - - -NwGtpv1uRcT -nwGtpv1uTrxnWithSeqNew( NW_IN NwGtpv1uStackT* thiz, - NW_IN uint32_t seqNum, - NW_OUT NwGtpv1uTrxnT **ppTrxn); - -NwGtpv1uRcT -nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **ppTrxn); - -NwGtpv1uRcT -nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT* thiz, - NW_OUT NwGtpv1uTrxnT **ppTrxn); - -NwGtpv1uRcT -nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **pthiz); - -NwGtpv1uRcT -nwGtpv1uTrxnCreateAndSendMsg( NW_IN NwGtpv1uStackT* thiz, - NW_IN NwGtpv1uTrxnT *pTrxn, - NW_IN uint32_t peerIp, - NW_IN uint32_t peerPort, - NW_IN NwGtpv1uMsgT *pMsg); - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_GTPV1U_TRXN_H__ */ - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h b/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h deleted file mode 100644 index dc4fbab264..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h +++ /dev/null @@ -1,85 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "NwTypes.h" -#include "NwUtils.h" -#include "NwGtpv1uError.h" -#include "NwGtpv1uPrivate.h" -#include "NwGtpv1uMsg.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uLog.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifndef __NW_GTPV1U_CONNECTION_H__ -#define __NW_GTPV1U_CONNECTION_H__ - -/** - Constructor - - @return Pointer to session on success, NULL n failure. - */ - -NwGtpv1uTunnelEndPointT* -nwGtpTunnelEndPointNew(struct NwGtpv1uStack* pStack); - -/** - Destructor - - @param[in] thiz: Pointer to session - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpTunnelEndPointDestroy(struct NwGtpv1uStack* pStack, NwGtpv1uTunnelEndPointT* thiz); - -NwGtpv1uRcT -nwGtpSessionSendMsgApiToUlpEntity(NwGtpv1uTunnelEndPointT* thiz, - NwGtpv1uMsgT *pMsg); - -#ifdef __cplusplus -} -#endif - -#endif -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1u.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1u.h deleted file mode 100644 index c6f7c3d6fa..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1u.h +++ /dev/null @@ -1,562 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#ifndef __NW_GTPV1U_H__ -#define __NW_GTPV1U_H__ - -#include -#include -#include -#include "NwTypes.h" -#include "NwGtpv1uError.h" - - -/** - * @file NwGtpv1u.h - * @author Amit Chawre - * @brief - * - * This header file contains all required definitions and functions - * prototypes for using nw-gtpv1u library. - * - **/ - -#define NW_GTPU_VERSION (0x01) -#define NW_GTP_PROTOCOL_TYPE_GTP (0x01) -#define NW_GTP_PROTOCOL_TYPE_GTP_PRIME (0x00) - -/*--------------------------------------------------------------------------* - * S H A R E D A P I M A C R O S * - *--------------------------------------------------------------------------*/ - -#define NW_GTP_ECHO_REQ (1) -#define NW_GTP_ECHO_RSP (2) -#define NW_GTP_ERROR_INDICATION (26) -#define NW_GTP_SUPPORTED_EXTENSION_HEADER_INDICATION (31) -#define NW_GTP_END_MARKER (254) -#define NW_GTP_GPDU (255) - -/*--------------------------------------------------------------------------- - * Opaque Gtpv2 Stack Handles - *--------------------------------------------------------------------------*/ - -typedef NwPtrT NwGtpv1uStackHandleT; /**< Gtpv2 Stack Handle */ -typedef NwPtrT NwGtpv1uUlpHandleT; /**< Gtpv2 Stack Ulp Entity Handle */ -typedef NwPtrT NwGtpv1uUdpHandleT; /**< Gtpv2 Stack Udp Entity Handle */ -typedef NwPtrT NwGtpv1uMemMgrHandleT; /**< Gtpv2 Stack Mem Manager Handle */ -typedef NwPtrT NwGtpv1uTimerMgrHandleT; /**< Gtpv2 Stack Timer Manager Handle */ -typedef NwPtrT NwGtpv1uLogMgrHandleT; /**< Gtpv2 Stack Log Mnagaer Handle */ -typedef NwPtrT NwGtpv1uTimerHandleT; /**< Gtpv2 Stack Timer Handle */ -typedef NwPtrT NwGtpv1uMsgHandleT; /**< Gtpv2 Msg Handle */ - -typedef struct NwGtpv1uStackConfig { - uint16_t udpSrcPort; -} NwGtpv1uStackConfigT; - -/*--------------------------------------------------------------------------* - * S T A C K A P I D E F I N I T I O N S * - *--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------- - * Gtpv2 Stack ULP API type definitions - *--------------------------------------------------------------------------*/ - -/** - * APIs types between ULP and Stack - */ - -typedef enum { - /* APIs from ULP to stack */ - - NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT = 0x00000000, /**< Create a local teid context on stack */ - NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT, /**< Delete a local teid context on stack */ - NW_GTPV1U_ULP_API_INITIAL_REQ, /**< Send a Initial Request over a session */ - NW_GTPV1U_ULP_API_TRIGGERED_REQ, /**< Send a Initial Request over a session */ - NW_GTPV1U_ULP_API_TRIGGERED_RSP, /**< Send a Trigger Response over a session */ - NW_GTPV1U_ULP_API_SEND_TPDU, /**< Send a T-PDU message over teid context */ - - /* APIs from stack to ULP */ - - NW_GTPV1U_ULP_API_RECV_TPDU, /**< Receive a gtpv1u T-PDU from stack */ - NW_GTPV1U_ULP_API_RECV_MSG, /**< Receive a gtpv1u message from stack */ - NW_GTPV1U_ULP_API_RSP_FAILURE, /**< Rsp failure for gtpv2 message from stack */ - - /* Do not add below this */ - - NW_GTPV1U_ULP_API_END = 0xFFFFFFFF, -} NwGtpv1uUlpApiTypeT; - -/*--------------------------------------------------------------------------- - * Gtpv2 Stack API information elements definitions - *--------------------------------------------------------------------------*/ - -typedef NwPtrT NwGtpv1uStackSessionHandleT;/**< Gtpv2 Stack session Handle */ -typedef uint8_t NwGtpv1uMsgTypeT; /**< Gtpv2 Msg Type */ -typedef NwPtrT NwGtpv1uTrxnHandleT; /**< Gtpv2 Transaction Handle */ -typedef NwPtrT NwGtpv1uUlpTrxnHandleT; /**< Gtpv2 Ulp Transaction Handle */ -typedef NwPtrT NwGtpv1uUlpSessionHandleT; /**< Gtpv2 Ulp session Handle */ - -/** - * API information elements between ULP and Stack for - * creating a session. - */ - -typedef struct { - NW_IN uint32_t teid; - NW_IN NwGtpv1uUlpSessionHandleT hUlpSession; - NW_OUT NwGtpv1uStackSessionHandleT hStackSession; -} NwGtpv1uCreateTunnelEndPointT; - -/** - * API information elements between ULP and Stack for - * destroying a session. - */ - -typedef struct { - NW_IN NwGtpv1uStackSessionHandleT hStackSessionHandle; -} NwGtpv1uDestroyTunnelEndPointT; - -/** - * API information elements between ULP and Stack for - * sending a Gtpv1u initial message. - */ - -typedef struct { - NW_IN NwGtpv1uUlpTrxnHandleT hUlpTrxn; - NW_IN uint32_t peerIp; - NW_IN uint32_t peerPort; - NW_IN uint8_t flags; - NW_IN uint32_t teid; -} NwGtpv1uInitialReqInfoT; - -/** - * API information elements between ULP and Stack for - * sending a Gtpv1u triggered response message. - */ - -typedef struct { - NW_IN NwGtpv1uUlpTrxnHandleT hUlpTrxn; - NW_IN uint32_t peerIp; - NW_IN uint32_t peerPort; - NW_IN uint8_t flags; - NW_IN uint32_t teid; - NW_IN uint32_t seqNum; - NW_IN NwGtpv1uMsgHandleT hMsg; -} NwGtpv1uTriggeredRspInfoT; - -/** - * API information elements between ULP and Stack for - * sending a Gtpv1u triggered request message. - */ - -typedef struct { - NW_IN NwGtpv1uUlpTrxnHandleT hUlpTrxn; - NW_IN uint32_t peerIp; - NW_IN uint32_t peerPort; - NW_IN uint8_t flags; - NW_IN uint32_t teid; - NW_IN uint32_t seqNum; - NW_IN NwGtpv1uMsgHandleT hMsg; -} NwGtpv1uTriggeredReqInfoT; - - -/** - * API information elements between ULP and Stack for - * sending a Gtpv2 message over a session. - */ - -typedef struct { - NW_IN uint32_t teid; - NW_IN uint32_t ipAddr; - NW_IN uint8_t flags; - NW_IN NwGtpv1uMsgHandleT hMsg; -} NwGtpv1uSendtoInfoT; - - -/** - * API information elements between ULP and Stack for - * sending a Gtpv2 message over a session. - */ - -typedef struct { - NW_OUT NwGtpv1uStackSessionHandleT hStackSessionHandle; - NW_INOUT NwGtpv1uTrxnHandleT hTrxn; - NW_IN NwGtpv1uUlpTrxnHandleT hUlpTrxn; - NW_IN NwGtpv1uMsgTypeT msgType; - NW_IN uint8_t flags; - NW_IN NwGtpv1uMsgHandleT hMsg; -} NwGtpv1uSendMsgInfoT; - -/** - * API information elements between ULP and Stack for - * receiving a Gtpv2 message over a session from stack. - */ - -typedef struct { - NW_IN NwGtpv1uUlpSessionHandleT hUlpSession; - NW_IN NwGtpv1uUlpTrxnHandleT hUlpTrxn; - NW_IN uint32_t teid; - NW_IN uint32_t peerIp; - NW_IN uint32_t peerPort; - NW_IN uint32_t msgType; /**< Message type */ - NW_IN NwGtpv1uMsgHandleT hMsg; /**< Gtp Message handle */ -} NwGtpv1uRecvMsgInfoT; - -/** - * API information elements between ULP and Stack for - * receiving a Gtpv2 message over a session from stack. - */ - -typedef struct { - NW_IN NwGtpv1uUlpSessionHandleT hUlpSession; - NW_IN NwGtpv1uTrxnHandleT hTrxn; -} NwGtpv1uNackInfoT; - -/*--------------------------------------------------------------------------- - * Gtpv2 Stack API structure definition - *--------------------------------------------------------------------------*/ - -/** - * API structure between ULP and Stack - */ - -typedef struct { - NwGtpv1uUlpApiTypeT apiType; - NwGtpv1uMsgHandleT hMsg; - union { - NwGtpv1uCreateTunnelEndPointT createTunnelEndPointInfo; - NwGtpv1uDestroyTunnelEndPointT destroyTunnelEndPointInfo; - NwGtpv1uInitialReqInfoT initialReqInfo; - NwGtpv1uTriggeredRspInfoT triggeredRspInfo; - NwGtpv1uTriggeredReqInfoT triggeredReqInfo; - NwGtpv1uSendtoInfoT sendtoInfo; - NwGtpv1uSendMsgInfoT sendMsgInfo; - NwGtpv1uRecvMsgInfoT recvMsgInfo; - NwGtpv1uNackInfoT nackMsgInfo; - } apiInfo; -} NwGtpv1uUlpApiT; - - -/*--------------------------------------------------------------------------* - * S T A C K E N T I T I E S D E F I N I T I O N S * - *--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------- - * ULP Entity Definitions - *--------------------------------------------------------------------------*/ - -/** - * Gtpv2 ULP entity definition - */ - -typedef struct { - NwGtpv1uUlpHandleT hUlp; - NwGtpv1uRcT (*ulpReqCallback) ( NW_IN NwGtpv1uUlpHandleT hUlp, - NW_IN NwGtpv1uUlpApiT *pUlpApi); -} NwGtpv1uUlpEntityT; - - -/*--------------------------------------------------------------------------- - * UDP Entity Definitions - *--------------------------------------------------------------------------*/ - -/** - * Gtpv2 UDP entity definition - */ - -typedef struct { - NwGtpv1uUdpHandleT hUdp; - NwGtpv1uRcT (*udpDataReqCallback) ( NW_IN NwGtpv1uUdpHandleT udpHandle, - NW_IN uint8_t* dataBuf, - NW_IN uint32_t dataSize, - NW_IN uint32_t dataOffset, - NW_IN uint32_t peerIP, - NW_IN uint16_t peerPort); -} NwGtpv1uUdpEntityT; - -/** - * Gtpv1u Memory Manager entity definition - */ - -typedef struct { - NwGtpv1uMemMgrHandleT hMemMgr; - void* (*memAlloc)( NW_IN NwGtpv1uMemMgrHandleT hMemMgr, - NW_IN uint32_t memSize, - NW_IN NwCharT* fileName, - NW_IN uint32_t lineNumber); - - void (*memFree) ( NW_IN NwGtpv1uMemMgrHandleT hMemMgr, - NW_IN void* hMem, - NW_IN NwCharT* fileName, - NW_IN uint32_t lineNumber); -} NwGtpv1uMemMgrEntityT; - - -/*--------------------------------------------------------------------------- - * Timer Entity Definitions - *--------------------------------------------------------------------------*/ - -#define NW_GTPV1U_TMR_TYPE_ONE_SHOT (0) -#define NW_GTPV1U_TMR_TYPE_REPETITIVE (1) - -/** - * Gtpv2 Timer Manager entity definition - */ - -typedef struct { - NwGtpv1uTimerMgrHandleT tmrMgrHandle; - NwGtpv1uRcT (*tmrStartCallback)( NW_IN NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NW_IN uint32_t timeoutSecs, - NW_IN uint32_t timeoutUsec, - NW_IN uint32_t tmrType, - NW_IN void* tmrArg, - NW_OUT NwGtpv1uTimerHandleT* tmrHandle); - - NwGtpv1uRcT (*tmrStopCallback) ( NW_IN NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NW_IN NwGtpv1uTimerHandleT tmrHandle); -} NwGtpv1uTimerMgrEntityT; - - -/*--------------------------------------------------------------------------- - * Log Entity Definitions - *--------------------------------------------------------------------------*/ - -/** - * Gtpv2 Log manager entity definition - */ - -typedef struct { - NwGtpv1uLogMgrHandleT logMgrHandle; - NwGtpv1uRcT (*logReqCallback) (NW_IN NwGtpv1uLogMgrHandleT logMgrHandle, - NW_IN uint32_t logLevel, - NW_IN NwCharT* file, - NW_IN uint32_t line, - NW_IN NwCharT* logStr); -} NwGtpv1uLogMgrEntityT; - - -/*--------------------------------------------------------------------------* - * P U B L I C F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Constructor - *--------------------------------------------------------------------------*/ - -/** - Initialize the nw-gtpv1u stack. - - @param[in,out] phGtpv1uStackHandle : Pointer to stack handle - @param[in] stackType : GTPU_STACK_ENB or GTPU_STACK_SGW - */ - -NwGtpv1uRcT -nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT* phGtpv1uStackHandle, uint32_t stackType); - -/*--------------------------------------------------------------------------- - * Destructor - *--------------------------------------------------------------------------*/ - -/** - Destroy the nw-gtpv1u stack. - - @param[in] hGtpv1uStackHandle : Stack handle - */ - -NwGtpv1uRcT -nwGtpv1uFinalize( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle); - -/*--------------------------------------------------------------------------- - * Configuration Get/Set Operations - *--------------------------------------------------------------------------*/ - -/** - Set Configuration for the nw-gtpv1u stack. - - @param[in,out] phGtpv1uStackHandle : Pointer to stack handle - */ - -NwGtpv1uRcT -NwGtpv1uConfigSet( NW_IN NwGtpv1uStackHandleT* phGtpv1uStackHandle, NW_IN NwGtpv1uStackConfigT* pConfig); - -/** - Get Configuration for the nw-gtpv1u stack. - - @param[in,out] phGtpv1uStackHandle : Pointer to stack handle - */ - -NwGtpv1uRcT -NwGtpv1uConfigGet( NW_IN NwGtpv1uStackHandleT* phGtpv1uStackHandle, NW_OUT NwGtpv1uStackConfigT* pConfig); - -/** - Set ULP entity for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pUlpEntity : Pointer to ULP entity. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetUlpEntity( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uUlpEntityT* pUlpEntity); - -/** - Set UDP entity for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pUdpEntity : Pointer to UDP entity. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetUdpEntity( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uUdpEntityT* pUdpEntity); - -/** - Set MemMgr entity for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pMemMgr : Pointer to Memory Manager. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetMemMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uMemMgrEntityT* pMemMgr); - - -/** - Set TmrMgr entity for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pTmrMgr : Pointer to Timer Manager. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetTimerMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uTimerMgrEntityT* pTmrMgr); - -/** - Set LogMgr entity for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pLogMgr : Pointer to Log Manager. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetLogMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uLogMgrEntityT* pLogMgr); - -/** - Set log level for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] logLevel : Log level. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetLogLevel( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint32_t logLevel); -/*--------------------------------------------------------------------------- - * Process Request from Udp Layer - *--------------------------------------------------------------------------*/ - -/** - Process Data Request from UDP entity. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] udpData : Pointer to received UDP data. - @param[in] udpDataLen : Received data length. - @param[in] dstPort : Received on port. - @param[in] from : Received from peer information. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uProcessUdpReq( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN uint8_t* udpData, - NW_IN uint32_t udpDataLen, - NW_IN uint16_t peerPort, - NW_IN uint32_t peerIP); - -/*--------------------------------------------------------------------------- - * Process Request from Upper Layer - *--------------------------------------------------------------------------*/ - -/** - Process Request from ULP entity. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pLogMgr : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uProcessUlpReq( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uUlpApiT *ulpReq); - - -/*--------------------------------------------------------------------------- - * Process Timer timeout Request from Timer Manager - *--------------------------------------------------------------------------*/ - -/** - Process Timer timeout Request from Timer Manager - - @param[in] pLogMgr : Pointer timeout arguments. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uProcessTimeout( NW_IN void* timeoutArg); - -NwGtpv1uRcT -nwGtpv1uPeerRspTimeout(void* arg); - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_GTPV1U_H__ */ - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uError.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uError.h deleted file mode 100644 index 6da3b80dfa..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uError.h +++ /dev/null @@ -1,63 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 c * - * G P R S T u n n e l i n g P r o t o c o l v 2 c S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - - -#ifndef __NW_GTPV1U_ERROR_H__ -#define __NW_GTPV1U_ERROR_H__ - -/** - * @file NwGtpv1uError.h - * @brief This header file contains return error code type definitions. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - - NW_GTPV1U_OK = 0x00000000, - NW_GTPV1U_MANDATORY_IE_DUPLICATE, - NW_GTPV1U_MANDATORY_IE_MISSING, - NW_GTPV1U_MSG_MALFORMED, - NW_GTPV1U_FAILURE = 0xFFFFFFFE -} -NwGtpv1uRcT; - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_GTPV1U_ERROR_H__*/ - - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uIe.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uIe.h deleted file mode 100644 index 7bb51dcda0..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uIe.h +++ /dev/null @@ -1,66 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -/** - * @file NwGtpv1uIe.h - * @brief This header file contains Information Element definitions for GTPv1u - * as per 3GPP TS 29281-930. -*/ - -#ifndef __NW_GTPV1U_IE_H__ -#define __NW_GTPV1U_IE_H__ - -/*--------------------------------------------------------------------------* - * G T P V 2 U I E T Y P E M A C R O D E F I N I T I O N S * - *--------------------------------------------------------------------------*/ - -#define NW_GTPV1U_IE_RECOVERY (14) -#define NW_GTPV1U_IE_TEID_DATA_I (15) -#define NW_GTPV1U_IE_GSN_ADDRESS (133) -#define NW_GTPV1U_IE_EXT_HDR_TYPE_LIST (141) -#define NW_GTPV1U_IE_PRIVATE_EXTENSION (255) - - -/*--------------------------------------------------------------------------* - * G T P V 2 U C A U S E V A L U E D E F I N I T I O N S * - *--------------------------------------------------------------------------*/ - -#define NW_GTPV1U_CAUSE_REQUEST_ACCEPTED (16) -#define NW_GTPV1U_CAUSE_MANDATORY_IE_MISSING (70) - -#endif /* __NW_GTPV1U_IE_H__ */ - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uMsg.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uMsg.h deleted file mode 100644 index f6bc0415f2..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uMsg.h +++ /dev/null @@ -1,317 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#ifndef __NW_GTPV1U_MSG_H__ -#define __NW_GTPV1U_MSG_H__ - -#include "NwTypes.h" -#include "NwGtpv1u.h" - -/** - * @file NwGtpv1uMsg.h - * @brief This file defines APIs for to build new outgoing gtpv1u messages and to parse incoming messages. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------* - * G T P V 2 C I E D A T A - T Y P E D E F I N I T I O N S * - *--------------------------------------------------------------------------*/ - -#pragma pack(1) - -typedef struct NwGtpv1uIeTv1 { - uint8_t t; - uint8_t v; -} NwGtpv1uIeTv1T; - -typedef struct NwGtpv1uIeTv2 { - uint8_t t; - uint8_t v; -} NwGtpv1uIeTv2T; - -typedef struct NwGtpv1uIeTv4 { - uint8_t t; - uint32_t v; -} NwGtpv1uIeTv4T; - -typedef struct NwGtpv1uIeTlv { - uint8_t t; - uint16_t l; -} NwGtpv1uIeTlvT; - -#pragma pack() - - -/** - * Allocate a GPDU gtpv1u message. - * - * @param[in] hGtpuStackHandle : gtpv1u stack handle. - * @param[in] teidPresent : TEID is present flag. - * @param[in] teid : TEID for this message. - * @param[in] seqNum : Sequence number for this message. - * @param[out] phMsg : Pointer to message handle. - */ - -NwGtpv1uRcT -nwGtpv1uMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint8_t seqNumFlag, - NW_IN uint8_t npduNumFlag, - NW_IN uint8_t extHdrFlag, - NW_IN uint8_t msgType, - NW_IN uint8_t teid, - NW_IN uint16_t seqNum, - NW_IN uint8_t npduNum, - NW_IN uint8_t nextExtHeader, - NW_OUT NwGtpv1uMsgHandleT *phMsg); - - -/** - * Allocate a gtpv1u message. - * - * @param[in] hGtpuStackHandle : gtpv1u stack handle. - * @param[in] teid : TEID for this message. - * @param[in] seqNumFlag : Sequence number flag for this message. - * @param[in] seqNum : Sequence number for this message. - * @param[in] pTpdu: T-PDU for this message. - * @param[in] tpduLength: T-PDU length for this message. - * @param[out] phMsg : Pointer to message handle. - */ - -NwGtpv1uRcT -nwGtpv1uGpduMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint32_t teid, - NW_IN uint8_t seqNumFlag, - NW_IN uint16_t seqNum, - NW_IN uint8_t* tpdu, - NW_IN uint16_t tpduLength, - NW_IN uint32_t tpduOffset, - NW_OUT NwGtpv1uMsgHandleT *phMsg); - -/** - * Allocate a gtpv1u message from another gtpv1u message. - * - * @param[in] hGtpuStackHandle : gtpv1u stack handle. - * @param[out] hMsg : Handle to input message. - * @param[out] phMsg : Pointer to message handle. - */ - -NwGtpv1uRcT -nwGtpv1uMsgFromMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uMsgHandleT hMsg, - NW_OUT NwGtpv1uMsgHandleT *phMsg); -/** - * Allocate a gtpv1u message from data buffer. - * - * @param[in] hGtpuStackHandle : gtpv1u stack handle. - * @param[in] pBuf: Buffer to be copied in this message. - * @param[in] bufLen: Buffer length to be copied in this message. - * @param[out] phMsg : Pointer to message handle. - */ - -NwGtpv1uRcT -nwGtpv1uMsgFromBufferNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint8_t* pBuf, - NW_IN uint32_t bufLen, - NW_OUT NwGtpv1uMsgHandleT *phMsg); - -/** - * Free a gtpv1u message. - * - * @param[in] hGtpuStackHandle : gtpv1u stack handle. - * @param[in] hMsg : Message handle. - */ - -NwGtpv1uRcT -nwGtpv1uMsgDelete( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uMsgHandleT hMsg); - -/** - * Set TEID for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[in] teid: TEID value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgSetTeid(NW_IN NwGtpv1uMsgHandleT hMsg, uint32_t teid); - -/** - * Set TEID present flag for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[in] teidPesent: Flag boolean value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgSetTeidPresent(NW_IN NwGtpv1uMsgHandleT hMsg, NwBoolT teidPresent); - -/** - * Set sequence for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[in] seqNum: Flag boolean value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgSetSeqNumber(NW_IN NwGtpv1uMsgHandleT hMsg, uint32_t seqNum); - -/** - * Get TEID present for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -uint32_t -nwGtpv1uMsgGetTeid(NW_IN NwGtpv1uMsgHandleT hMsg); - -/** - * Get TEID present for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -NwBoolT -nwGtpv1uMsgGetTeidPresent(NW_IN NwGtpv1uMsgHandleT hMsg); - -/** - * Get sequence number for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -uint32_t -nwGtpv1uMsgGetSeqNumber(NW_IN NwGtpv1uMsgHandleT hMsg); - -/** - * Get tpdu for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[inout] pTpduBuf : Buffer to copy the T-PDU. - * @param[out] hMsg : T-PDU length. - */ - -uint32_t -nwGtpv1uMsgGetTpdu(NW_IN NwGtpv1uMsgHandleT hMsg, uint8_t* pTpduBuf, uint32_t* pTpduLength); - -uint8_t* -nwGtpv1uMsgGetTpduHandle(NW_IN NwGtpv1uMsgHandleT hMsg); - -uint32_t -nwGtpv1uMsgGetTpduLength(NW_IN NwGtpv1uMsgHandleT hMsg); - -/** - * Add a gtpv1u information element of length 1 to gtpv1u mesasge. - * - * @param[in] hMsg : Handle to gtpv1u message. - * @param[in] type : IE type. - * @param[in] value : IE value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV1(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint8_t value); - - -/** - * Add a gtpv1u information element of length 2 to gtpv1u mesasge. - * - * @param[in] hMsg : Handle to gtpv1u message. - * @param[in] type : IE type. - * @param[in] value : IE value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV2(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint16_t value); - - -/** - * Add a gtpv1u information element of length 4 to gtpv1u mesasge. - * - * @param[in] hMsg : Handle to gtpv1u message. - * @param[in] type : IE type. - * @param[in] value : IE value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV4(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint32_t value); - - -/** - * Add a gtpv1u information element of variable length to gtpv1u mesasge. - * - * @param[in] hMsg : Handle to gtpv1u message. - * @param[in] type : IE type. - * @param[in] length : IE length. - * @param[in] value : IE value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgAddIe(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint8_t* pVal); - -/** - * Dump the contents of gtpv1u mesasge. - * - * @param[in] hMsg : Handle to gtpv1u message. - * @param[in] fp: Pointer to output file. - */ - -NwGtpv1uRcT -nwGtpv1uMsgHexDump(NwGtpv1uMsgHandleT hMsg, FILE* fp); - -uint32_t -nwGtpv1uMsgGetMsgType(NW_IN NwGtpv1uMsgHandleT hMsg); - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_TYPES_H__ */ - - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwLog.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwLog.h deleted file mode 100644 index 7215216e68..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwLog.h +++ /dev/null @@ -1,88 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 c * - * G P R S T u n n e l i n g P r o t o c o l v 2 c S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - - -#ifndef __NW_LOG_H__ -#define __NW_LOG_H__ - -#include - -#include "NwTypes.h" - -/** - * @file NwLog.h - * @brief This header file contains global shared logging definitions. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Log Level Definitions - *--------------------------------------------------------------------------*/ - -#define NW_LOG_LEVEL_EMER (0) /**< system is unusable */ -#define NW_LOG_LEVEL_ALER (1) /**< action must be taken immediately*/ -#define NW_LOG_LEVEL_CRIT (2) /**< critical conditions */ -#define NW_LOG_LEVEL_ERRO (3) /**< error conditions */ -#define NW_LOG_LEVEL_WARN (4) /**< warning conditions */ -#define NW_LOG_LEVEL_NOTI (5) /**< normal but signification condition */ -#define NW_LOG_LEVEL_INFO (6) /**< informational */ -#define NW_LOG_LEVEL_DEBG (7) /**< debug-level messages */ - -// static -// NwCharT* gLogLevelStr[] = {"EMER", "ALER", "CRIT", "ERRO", "WARN", "NOTI", "INFO", "DEBG"}; - -/*--------------------------------------------------------------------------- - * IPv4 logging macros - *--------------------------------------------------------------------------*/ -#define NW_IPV4_ADDR "%u.%u.%u.%u" -#define NW_IPV4_ADDR_FORMAT(__addr) (uint8_t)((__addr) & 0x000000ff), \ - (uint8_t)(((__addr) & 0x0000ff00) >> 8 ), \ - (uint8_t)(((__addr) & 0x00ff0000) >> 16), \ - (uint8_t)(((__addr) & 0xff000000) >> 24) - -#define NW_IPV4_ADDR_FORMATP(__paddr) (uint8_t)(*((uint8_t*)(__paddr)) & 0x000000ff), \ - (uint8_t)(*((uint8_t*)(__paddr + 1)) & 0x000000ff), \ - (uint8_t)(*((uint8_t*)(__paddr + 2)) & 0x000000ff), \ - (uint8_t)(*((uint8_t*)(__paddr + 3)) & 0x000000ff) - - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_LOG_H__ */ - - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwTypes.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwTypes.h deleted file mode 100644 index aae5c8a95b..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwTypes.h +++ /dev/null @@ -1,78 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 c * - * G P R S T u n n e l i n g P r o t o c o l v 2 c S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - - -#include -#include - -#ifndef __NW_TYPES_H__ -#define __NW_TYPES_H__ - -/** - * @file NwTypes.h - * @brief This header file contains basic type definitions. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#define NW_IN /**< An input argument */ -#define NW_OUT /**< An output argumnet */ -#define NW_INOUT /**< An input and output argument */ - -#define NW_TRUE (1) /**< Truth value */ -#define NW_FALSE (0) /**< False value */ - -typedef signed char NwS8T; /**< Signed 1 byte */ -typedef signed short NwS16T; /**< Signed 2 byte */ -typedef signed int NwS32T; /**< Signed 4 byte */ -typedef signed long long NwS64T; /**< Signed 8 byte */ - -typedef uintptr_t NwPtrT; /**< Use this for generic pointers */ -typedef unsigned int NwHandleT; /**< Use this for generic handles */ - -typedef char NwBoolT; /**< Use this for booleans */ - -typedef char NwCharT; /**< Use this for strings */ - -typedef signed int NwFdT; /**< Use this for file descriptor */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_TYPES_H__ */ - - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwUtils.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwUtils.h deleted file mode 100644 index c197ab323e..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwUtils.h +++ /dev/null @@ -1,68 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 c * - * G P R S T u n n e l i n g P r o t o c o l v 2 c S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include - -#ifndef __NW_UTILS_H__ -#define __NW_UTILS_H__ - - -/** - * @file NwUtils.h - * @brief This header file contains utility macro and function definitions. -*/ - -#define NW_ASSERT assert /**< Assertion */ - -#define NW_CHK_NULL_PTR(_ptr) NW_ASSERT(_ptr != NULL) /**< Null pointer check */ - -#define NW_HTONS(x) ( ( ((x) & 0xff00) >> 8 ) | ( ((x) & 0x00ff) << 8 ) ) - -#define NW_HTONL(x) ( ( ((x) & 0xff000000) >> 24 ) | ( ( (x) & 0x00ff0000 ) >> 8 ) | \ - ( ( (x) & 0x0000ff00 ) << 8 ) | ( ( (x) & 0x000000ff) << 24 ) ) - -#define NW_HTONLL(x) ( \ - ( ( ((uint64_t)x) & 0xff00000000000000ULL ) >> 56 ) | ( ( ((uint64_t)x) & 0x00ff000000000000ULL ) >> 40 ) | \ - ( ( ((uint64_t)x) & 0x0000ff0000000000ULL ) >> 24 ) | ( ( ((uint64_t)x) & 0x000000ff00000000ULL ) >> 8 ) | \ - ( ( ((uint64_t)x) & 0x000000000000ff00ULL ) << 40 ) | ( ( ((uint64_t)x) & 0x00000000000000ffULL ) << 56 ) | \ - ( ( ((uint64_t)x) & 0x0000000000ff0000ULL ) << 24 ) | ( ( ((uint64_t)x) & 0x00000000ff000000ULL ) << 8 ) \ - ) - -#define NW_NTOHS NW_HTONS -#define NW_NTOHL NW_HTONL -#define NW_NTOHLL NW_HTONLL - - -#endif /* __NW_UTILS_H__ */ - - diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c deleted file mode 100644 index 0d962cad7d..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c +++ /dev/null @@ -1,1025 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "NwTypes.h" -#include "NwUtils.h" -#include "NwGtpv1uError.h" -#include "NwGtpv1uPrivate.h" -#include "NwGtpv1uTunnelEndPoint.h" -#include "NwGtpv1uTrxn.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uIe.h" -#include "NwGtpv1uLog.h" - -#include "assertions.h" -#include "intertask_interface.h" -#include "msc.h" - -#include "gtpv1u.h" -#if defined(ENB_MODE) -#include "common/utils/LOG/log.h" -#include "common/utils/LOG/vcd_signal_dumper.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -//#define LOG_GTPU 1 -/*--------------------------------------------------------------------------* - * P R I V A T E F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -#define NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE (12) /**< Size of GTPv1u EPC specific header */ -#define NW_GTPV1U_EPC_MIN_HEADER_SIZE (8) - - -void -nwGtpv1uDisplayBanner(void) -{ - printf(" *----------------------------------------------------------------------------*\n"); - printf(" * *\n"); - printf(" * n w - g t p v 2 u *\n"); - printf(" * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k *\n"); - printf(" * *\n"); - printf(" * *\n"); - printf(" * Copyright (c) 2010-2011 Amit Chawre *\n"); - printf(" * All rights reserved. *\n"); - printf(" * *\n"); - printf(" * Redistribution and use in source and binary forms, with or without *\n"); - printf(" * modification, are permitted provided that the following conditions *\n"); - printf(" * are met: *\n"); - printf(" * *\n"); - printf(" * 1. Redistributions of source code must retain the above copyright *\n"); - printf(" * notice, this list of conditions and the following disclaimer. *\n"); - printf(" * 2. Redistributions in binary form must reproduce the above copyright *\n"); - printf(" * notice, this list of conditions and the following disclaimer in the *\n"); - printf(" * documentation and/or other materials provided with the distribution. *\n"); - printf(" * 3. The name of the author may not be used to endorse or promote products *\n"); - printf(" * derived from this software without specific prior written permission. *\n"); - printf(" * *\n"); - printf(" * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR *\n"); - printf(" * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *\n"); - printf(" * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. *\n"); - printf(" * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, *\n"); - printf(" * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT *\n"); - printf(" * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *\n"); - printf(" * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *\n"); - printf(" * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *\n"); - printf(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF *\n"); - printf(" * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *\n"); - printf(" *----------------------------------------------------------------------------*\n\n"); - -} -/*--------------------------------------------------------------------------- - * RBTree Search Functions - *--------------------------------------------------------------------------*/ - -static inline NwS32T -nwGtpv1uCompareTeid(struct NwGtpv1uTunnelEndPoint *a, - struct NwGtpv1uTunnelEndPoint *b); - -static inline NwS32T -nwGtpv1uCompareSeqNum(struct NwGtpv1uTrxn *a, struct NwGtpv1uTrxn *b); - -RB_PROTOTYPE(NwGtpv1uOutstandingTxSeqNumTrxnMap, NwGtpv1uTrxn, - outstandingTxSeqNumMapRbtNode, nwGtpv1uCompareSeqNum) -RB_PROTOTYPE(NwGtpv1uOutstandingRxSeqNumTrxnMap, NwGtpv1uTrxn, - outstandingRxSeqNumMapRbtNode, nwGtpv1uCompareSeqNum) -RB_PROTOTYPE(NwGtpv1uTunnelEndPointTMap, NwGtpv1uTunnelEndPoint, - sessionMapRbtNode, nwGtpv1uCompareTeid) -RB_PROTOTYPE(NwGtpv1uTunnelEndPointIdentifierMap, NwGtpv1uTunnelEndPoint, - sessionMapRbtNode, nwGtpv1uCompareTeid) - -RB_GENERATE(NwGtpv1uOutstandingTxSeqNumTrxnMap, NwGtpv1uTrxn, - outstandingTxSeqNumMapRbtNode, nwGtpv1uCompareSeqNum) -RB_GENERATE(NwGtpv1uOutstandingRxSeqNumTrxnMap, NwGtpv1uTrxn, - outstandingRxSeqNumMapRbtNode, nwGtpv1uCompareSeqNum) -RB_GENERATE(NwGtpv1uTunnelEndPointTMap, NwGtpv1uTunnelEndPoint, - sessionMapRbtNode, nwGtpv1uCompareTeid) -RB_GENERATE(NwGtpv1uTunnelEndPointIdentifierMap, NwGtpv1uTunnelEndPoint, - sessionMapRbtNode, nwGtpv1uCompareTeid) - -/** - Comparator funtion for comparing two sessions. - - @param[in] a: Pointer to session a. - @param[in] b: Pointer to session b. - @return An integer greater than, equal to or less than zero according to whether the - object pointed to by a is greater than, equal to or less than the object pointed to by b. - */ - -static inline NwS32T -nwGtpv1uCompareTeid(struct NwGtpv1uTunnelEndPoint *a, - struct NwGtpv1uTunnelEndPoint *b) -{ - if(a->teid > b->teid) { - return 1; - } - - if(a->teid < b->teid) { - return -1; - } - - return 0; -} - -/** - Comparator funtion for comparing two sequence number transactions. - - @param[in] a: Pointer to session a. - @param[in] b: Pointer to session b. - @return An integer greater than, equal to or less than zero according to whether the - object pointed to by a is greater than, equal to or less than the object pointed to by b. - */ - -static inline NwS32T -nwGtpv1uCompareSeqNum(struct NwGtpv1uTrxn *a, struct NwGtpv1uTrxn *b) -{ - if(a->seqNum > b->seqNum) { - return 1; - } - - if(a->seqNum < b->seqNum) { - return -1; - } - - if(a->peerIp > b->peerIp) { - return 1; - } - - if(a->peerIp < b->peerIp) { - return -1; - } - - return 0; -} - -/** - Create and Send GTPU message. - - @param[in] thiz: Stack handle - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uCreateAndSendMsg( NwGtpv1uStackT *thiz, uint32_t peerIp, uint16_t peerPort, - NwGtpv1uMsgT *pMsg) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - uint8_t *msgHdr; - - NW_ASSERT(thiz); - NW_ASSERT(pMsg); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - - msgHdr = &pMsg->msgBuf[pMsg->msgBufOffset]; - NW_ASSERT(msgHdr != NULL); - - *(msgHdr++) = (pMsg->version << 5) | - (pMsg->protocolType << 4) | - (pMsg->extHdrFlag << 2) | - (pMsg->seqNumFlag << 1) | - (pMsg->npduNumFlag); - - *(msgHdr++) = (pMsg->msgType); - *((uint16_t *) msgHdr) = htons(pMsg->msgLen); - msgHdr += 2; - - *((uint32_t *) msgHdr) = htonl(pMsg->teid); - msgHdr += 4; -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("nwGtpv1uCreateAndSendMsg to teid %u length %d offset %d\n", - pMsg->teid, - pMsg->msgLen, - pMsg->msgBufOffset); -#endif - - if(pMsg->seqNumFlag || pMsg->extHdrFlag || pMsg->npduNumFlag) { - *((uint16_t *) msgHdr) = (pMsg->seqNumFlag ? htons(pMsg->seqNum) : 0x0000); - msgHdr += 2; - - *((uint8_t *) msgHdr) = (pMsg->npduNumFlag ? htons(pMsg->npduNum) : 0x00); - msgHdr++; - - *((uint8_t *) msgHdr) = (pMsg->extHdrFlag ? htons(pMsg->nextExtHdrType) : 0x00); - msgHdr++; - } - - rc = thiz->udp.udpDataReqCallback(thiz->udp.hUdp, - pMsg->msgBuf, - pMsg->msgBufLen, - pMsg->msgBufOffset, - peerIp, - peerPort); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/** - * Send GTPv1u Message Indication to ULP entity. - * - * @param[in] hGtpuStackHandle : Stack handle - * @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uSendUlpMessageIndication( NW_IN NwGtpv1uStackT *thiz, - NW_IN uint32_t hUlpTrxn, - NW_IN uint32_t apiType, - NW_IN uint32_t msgType, - NW_IN uint32_t peerIp, - NW_IN uint16_t peerPort, - NW_IN uint8_t *pMsgBuf, - NW_IN uint16_t msgLength) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uUlpApiT ulpApi; - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - - ulpApi.apiType = apiType; - ulpApi.apiInfo.recvMsgInfo.msgType = msgType; - ulpApi.apiInfo.recvMsgInfo.hUlpTrxn = hUlpTrxn; - ulpApi.apiInfo.recvMsgInfo.peerIp = peerIp; - ulpApi.apiInfo.recvMsgInfo.peerPort = peerPort; - - if(pMsgBuf && msgLength) { - rc = nwGtpv1uMsgFromBufferNew((NwGtpv1uStackHandleT)thiz, pMsgBuf, msgLength, - &(ulpApi.apiInfo.recvMsgInfo.hMsg)); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - - rc = thiz->ulp.ulpReqCallback(thiz->ulp.hUlp, &ulpApi); - NW_ASSERT(rc == NW_GTPV1U_OK); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - - return rc; -} - -NwGtpv1uRcT -nwGtpv1uPeerRspTimeout(void *arg) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTrxnT *thiz; - NwGtpv1uTimeoutInfoT *timeoutInfo = arg; - - GTPU_WARNING( "Retransmission timer expired\n"); - - thiz = ((NwGtpv1uTrxnT *)timeoutInfo->timeoutArg); - rc = thiz->pStack->udp.udpDataReqCallback(thiz->pStack->udp.hUdp, - thiz->pMsg->msgBuf, - thiz->pMsg->msgLen, - thiz->pMsg->msgBufOffset, - thiz->peerIp, - thiz->peerPort); - - if(thiz->maxRetries) { - rc = thiz->pStack->tmrMgr.tmrStartCallback(thiz->pStack->tmrMgr.tmrMgrHandle, - 5, 0, NW_GTPV1U_TMR_TYPE_ONE_SHOT, (void *)timeoutInfo, &thiz->hRspTmr); - thiz->maxRetries--; - } else { - /* Inform session layer about path fialure */ - GTPU_WARNING("Max retries over!\n"); - } - - return rc; -} - -/*--------------------------------------------------------------------------- - * ULP API Processing Functions - *--------------------------------------------------------------------------*/ - -/** - Process NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT Request from ULP entity. - - @param[in] hGtpuStackHandle : Stack handle - @param[in] pUlpReq : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -NwGtpv1uCreateTunnelEndPoint( NW_IN NwGtpv1uStackT *thiz, - NW_IN uint32_t teid, - NW_IN NwGtpv1uUlpSessionHandleT hUlpSession, - NW_OUT NwGtpv1uStackSessionHandleT *phStackSession ) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTunnelEndPointT *pTunnelEndPoint; - NwGtpv1uTunnelEndPointT *pCollision; - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - pTunnelEndPoint = nwGtpTunnelEndPointNew(thiz); - - if(pTunnelEndPoint) { - - pTunnelEndPoint->teid = teid; - pTunnelEndPoint->pStack = thiz; - pTunnelEndPoint->hUlpSession = hUlpSession; - - pCollision = RB_INSERT(NwGtpv1uTunnelEndPointIdentifierMap, &(thiz->teidMap), - pTunnelEndPoint); - - if(pCollision) { - GTPU_ERROR("Tunnel end-point cannot be created for teid 0x%x. " - "Tunnel already exists", teid); - rc = nwGtpTunnelEndPointDestroy(thiz, pTunnelEndPoint); - NW_ASSERT(rc == NW_GTPV1U_OK); - *phStackSession = (NwGtpv1uStackSessionHandleT) NULL; - NW_ASSERT(0); - rc = NW_GTPV1U_FAILURE; - } else { - *phStackSession = (NwGtpv1uStackSessionHandleT) pTunnelEndPoint; - pTunnelEndPoint = RB_FIND(NwGtpv1uTunnelEndPointIdentifierMap, - &(thiz->teidMap), pTunnelEndPoint); - //NW_ASSERT(pTunnelEndPoint); - if (!pTunnelEndPoint) { - GTPU_ERROR("Tunnel end-point cannot be NULL"); - rc = NW_GTPV1U_FAILURE; - } else { - GTPU_DEBUG("Tunnel end-point 0x%p creation successful for teid 0x%x %u(dec)", - pTunnelEndPoint, (unsigned int)teid, (unsigned int)teid); - } - } - - } else { - *phStackSession = (NwGtpv1uStackSessionHandleT) NULL; - rc = NW_GTPV1U_FAILURE; - } - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/** - Process NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT Request from ULP entity. - - @param[in] hGtpuStackHandle : Stack handle - @param[in] pUlpReq : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uDestroyTunnelEndPoint( NwGtpv1uStackT *thiz, - NW_IN NwGtpv1uUlpApiT *pUlpReq) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTunnelEndPointT *pRemovedTeid; - - if(pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle) { - GTPU_DEBUG( "Destroying Tunnel end-point '%lx'", - pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle); - pRemovedTeid = RB_REMOVE(NwGtpv1uTunnelEndPointIdentifierMap, &(thiz->teidMap), - (NwGtpv1uTunnelEndPointT *)( - pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle)); - - NW_ASSERT(pRemovedTeid == (NwGtpv1uTunnelEndPointT *)( - pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle)); - - rc = nwGtpTunnelEndPointDestroy(thiz, - (NwGtpv1uTunnelEndPointT *) - pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle); - } else { - GTPU_WARNING("Non-existent Tunnel end-point handle '%lx'", - pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle); - } - - return rc; -} - -/** - Process NW_GTPV1U_ULP_API_INITIAL_REQ Request from ULP entity. - - @param[in] hGtpuStackHandle : Stack handle - @param[in] pUlpReq : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uInitialReq( NW_IN NwGtpv1uStackT *thiz, NW_IN NwGtpv1uUlpApiT *pUlpReq) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uTrxnT *pTrxn; - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - /* Create New Transaction */ - rc = nwGtpv1uTrxnNew(thiz, &pTrxn); - - if(pTrxn) { - rc = nwGtpv1uTrxnCreateAndSendMsg(thiz, - pTrxn, - pUlpReq->apiInfo.initialReqInfo.peerIp, - pUlpReq->apiInfo.initialReqInfo.peerPort, - (NwGtpv1uMsgT *) pUlpReq->hMsg); - - if(rc == NW_GTPV1U_OK) { - /* Insert into search tree */ - RB_INSERT(NwGtpv1uOutstandingTxSeqNumTrxnMap, &(thiz->outstandingTxSeqNumMap), - pTrxn); - } else { - rc = nwGtpv1uTrxnDelete(&pTrxn); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - } - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/** - Process NW_GTPV1U_ULP_API_SEND_TPDU Request from ULP entity. - - @param[in] thiz: Stack handle - @param[in] pUlpReq : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uSendto( NwGtpv1uStackT *thiz, NW_IN NwGtpv1uUlpApiT *pUlpReq) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - - NW_ASSERT(thiz); -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - - (void) nwGtpv1uMsgSetTeid(pUlpReq->apiInfo.sendtoInfo.hMsg, - pUlpReq->apiInfo.sendtoInfo.teid); - - rc = nwGtpv1uCreateAndSendMsg(thiz, - pUlpReq->apiInfo.sendtoInfo.ipAddr, - 2152, - (NwGtpv1uMsgT *) (NwGtpv1uMsgT *) pUlpReq->apiInfo.sendtoInfo.hMsg); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/** - Process GPDU from UDP entity. - - @param[in] thiz: Stack handle - @param[in] pUlpReq : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz, - NW_IN uint8_t *gpdu, - NW_IN uint32_t gpduLen, - NW_IN uint32_t peerIp) - -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uMsgHeaderT *msgHdr = NULL; - NwGtpv1uTunnelEndPointT *pTunnelEndPoint = NULL; - NwGtpv1uTunnelEndPointT tunnelEndPointKey; - // uint16_t hdr_len = 0; - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - - // no buffer offset - msgHdr = (NwGtpv1uMsgHeaderT *) gpdu; - - tunnelEndPointKey.teid = ntohl(msgHdr->teid); - - pTunnelEndPoint = RB_FIND(NwGtpv1uTunnelEndPointIdentifierMap, - &(thiz->teidMap), &tunnelEndPointKey); - - if(pTunnelEndPoint) { - NwGtpv1uMsgHandleT hMsg; - - rc = nwGtpv1uMsgFromBufferNew( (NwGtpv1uStackHandleT)thiz, - (uint8_t *)gpdu, - gpduLen, - &hMsg); - - /* - uint8_t* msgBuf; - uint32_t msgBufLen; - uint32_t msgBufOffset; - */ - if(NW_GTPV1U_OK == rc) { - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("Received T-PDU over tunnel end-point '%x' of size %u (%u) (decapsulated %u)from "NW_IPV4_ADDR"\n", - ntohl(msgHdr->teid), gpduLen, pMsg->msgLen, pMsg->msgBufLen, NW_IPV4_ADDR_FORMAT((peerIp))); -#endif - MSC_LOG_RX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - " G-PDU ltid %u size %u", - tunnelEndPointKey.teid, - gpduLen); - - rc = nwGtpSessionSendMsgApiToUlpEntity(pTunnelEndPoint, pMsg); - } - } else { - MSC_LOG_RX_DISCARDED_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - " G-PDU ltid %u size %u", - tunnelEndPointKey.teid, - gpduLen); - GTPU_DEBUG("Received T-PDU over non-existent tunnel end-point '%x' from "NW_IPV4_ADDR"\n", - ntohl(msgHdr->teid), NW_IPV4_ADDR_FORMAT((peerIp))); - } - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/** - Handle Echo Request from Peer Entity. - - @param[in] thiz : Stack context - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz, - NW_IN uint8_t *msgBuf, - NW_IN uint32_t msgBufLen, - NW_IN uint16_t peerPort, - NW_IN uint32_t peerIp) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - uint16_t seqNum = 0; - NwGtpv1uMsgHandleT hMsg = 0; - int bufLen = 0; - - seqNum = ntohs(*(uint16_t *) (msgBuf + (((*msgBuf) & 0x02) ? 8 : 4))); - - MSC_LOG_RX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" ECHO-REQ seq %u size %u", - 0,0,seqNum, msgBufLen); - /* Send Echo Response */ - - rc = nwGtpv1uMsgNew( (NwGtpv1uStackHandleT)thiz, - NW_TRUE, /* SeqNum flag */ - NW_FALSE, - NW_FALSE, - NW_GTP_ECHO_RSP, /* Msg Type */ - 0x00000000U, /* TEID */ - seqNum, /* Seq Number */ - 0, - 0, - (&hMsg)); - - bufLen = sizeof(NwGtpv1uIeTv1T)+ ((NwGtpv1uMsgT*)hMsg)->msgLen; - -//#warning CROUX DIRTY +16, TO BE FIXED!!! - /* the +16 is there because by analyzing memory allocation with some external - * tool, I saw that there were 6 bytes accessed after bufLen in nwGtpv1uCreateAndSendMsg - * the value "16" has been chosen arbitrarily, just bigger than 6 - */ - ((NwGtpv1uMsgT*)hMsg)->msgBuf = itti_malloc( - TASK_GTPV1_U, - TASK_UDP, - bufLen + 16 /* CROUX - dirty +16, to be fixed! */); - ((NwGtpv1uMsgT*)hMsg)->msgBufLen = bufLen; - NW_ASSERT(NW_GTPV1U_OK == rc); - - /* - * The Restart Counter value in the Recovery information element shall - * not be used, i.e. it shall be set to zero by the sender and shall be - * ignored by the receiver. - */ - rc = nwGtpv1uMsgAddIeTV1(hMsg, NW_GTPV1U_IE_RECOVERY, 0x00); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_INFO("Sending NW_GTP_ECHO_RSP message to %x:%x with seq %u\n", - peerIp, - peerPort, - seqNum); -#endif - MSC_LOG_TX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" ECHO-RSP seq %u", - 0,0,seqNum); - rc = nwGtpv1uCreateAndSendMsg( - thiz, - peerIp, - peerPort, - (NwGtpv1uMsgT *) hMsg); - - rc = nwGtpv1uMsgDelete((NwGtpv1uStackHandleT)thiz, hMsg); - NW_ASSERT(NW_GTPV1U_OK == rc); - - return rc; -} - -/*--------------------------------------------------------------------------* - * P U B L I C F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------- - * Constructor - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, uint32_t stackType) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz; - - thiz = (NwGtpv1uStackT *) malloc( sizeof(NwGtpv1uStackT)); - - if(thiz) { - memset(thiz, 0, sizeof(NwGtpv1uStackT)); - thiz->id = (NwPtrT)thiz; - thiz->stackType = stackType; - thiz->seq = (uint16_t) ((uintptr_t)thiz) ; // FIXME interesting casts... don't know what this is good for... - RB_INIT(&(thiz->outstandingTxSeqNumMap)); - RB_INIT(&(thiz->outstandingRxSeqNumMap)); - RB_INIT(&(thiz->sessionMap)); - RB_INIT(&(thiz->teidMap)); - - if (0 == 1) { - nwGtpv1uDisplayBanner(); - } - - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - - *hGtpuStackHandle = (NwGtpv1uStackHandleT) thiz; - return rc; -} - - -/*--------------------------------------------------------------------------- - * Destructor - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uFinalize( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - - if(hGtpuStackHandle) { - free((void *)hGtpuStackHandle); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - - -/*--------------------------------------------------------------------------- - * Configuration Get/Set - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uSetUlpEntity( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uUlpEntityT *pUlpEntity) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - if(pUlpEntity) { - thiz->ulp = *(pUlpEntity); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - - -NwGtpv1uRcT -nwGtpv1uSetUdpEntity( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uUdpEntityT *pUdpEntity) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - if(pUdpEntity) { - thiz->udp = *(pUdpEntity); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - -NwGtpv1uRcT -nwGtpv1uSetMemMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uMemMgrEntityT *pMemMgrEntity) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - if(pMemMgrEntity) { - thiz->memMgr = *(pMemMgrEntity); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - - -NwGtpv1uRcT -nwGtpv1uSetTimerMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uTimerMgrEntityT *pTmrMgrEntity) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - if(pTmrMgrEntity) { - thiz->tmrMgr = *(pTmrMgrEntity); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - - -NwGtpv1uRcT -nwGtpv1uSetLogMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uLogMgrEntityT *pLogMgrEntity) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - if(pLogMgrEntity) { - thiz->logMgr = *(pLogMgrEntity); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - -NwGtpv1uRcT -nwGtpv1uSetLogLevel( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint32_t logLevel) -{ - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - thiz->logLevel = logLevel; - return NW_GTPV1U_OK; -} - -/*--------------------------------------------------------------------------- - * Process Request from Udp Layer - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uProcessUdpReq( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint8_t *udpData, - NW_IN uint32_t udpDataLen, - NW_IN uint16_t peerPort, - NW_IN uint32_t peerIp) -{ - NwGtpv1uRcT ret = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz; - uint16_t msgType; - -#if defined(ENB_MODE) - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_UDP_REQ, VCD_FUNCTION_IN); -#endif - thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - NW_ASSERT(thiz); - - msgType = *((uint8_t *)(udpData + 1)); - - switch(msgType) { - case NW_GTP_ECHO_REQ: - GTPU_DEBUG("NW_GTP_ECHO_REQ\n"); - ret = nwGtpv1uHandleEchoReq( thiz, udpData, udpDataLen, peerPort, peerIp); - break; - - case NW_GTP_ERROR_INDICATION: - GTPU_DEBUG("NW_GTP_ERROR_INDICATION\n"); - ret = nwGtpv1uSendUlpMessageIndication( thiz, - 0, - NW_GTPV1U_ULP_API_RECV_MSG, - msgType, - peerIp, - peerPort, - udpData, - udpDataLen); - - NW_ASSERT(ret == NW_GTPV1U_OK); - break; - - case NW_GTP_ECHO_RSP: - GTPU_DEBUG("NW_GTP_ECHO_RSP\n"); - ret = NW_GTPV1U_OK; - break; - - case NW_GTP_GPDU: -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("NW_GTP_GPDU: DATA COMING FROM UDP\n"); -#endif - ret = nwGtpv1uProcessGpdu(thiz, udpData, udpDataLen, peerIp); - break; - - case NW_GTP_END_MARKER: -#if defined(LOG_GTPU) && LOG_GTPU > 0 - for(int i =1; i<= udpDataLen; i++){ - printf("%02x ", (uint8_t)udpData[i-1]); - if(i % 20 == 0)printf("\n"); - } -#endif - GTPU_INFO("NW_GTP_END_MARKER\n"); - ret = nwGtpv1uProcessGpdu(thiz, udpData, udpDataLen, peerIp); - break; - - default: - ret = NW_GTPV1U_FAILURE; - NW_ASSERT(0); - break; - } - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif -#if defined(ENB_MODE) - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_UDP_REQ, VCD_FUNCTION_OUT); -#endif - return ret; -} - - -/*--------------------------------------------------------------------------- - * Process Request from Upper Layer - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uProcessUlpReq( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uUlpApiT *pUlpReq) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - NW_ASSERT(thiz); - NW_ASSERT(pUlpReq != NULL); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - - switch(pUlpReq->apiType) { - case NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT: { - GTPU_DEBUG("Received NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT from ulp\n"); - rc = NwGtpv1uCreateTunnelEndPoint(thiz, - pUlpReq->apiInfo.createTunnelEndPointInfo.teid, - pUlpReq->apiInfo.createTunnelEndPointInfo.hUlpSession, - &(pUlpReq->apiInfo.createTunnelEndPointInfo.hStackSession)); - } - break; - - case NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT: { - GTPU_DEBUG("Received destroy session req from ulp\n"); - rc = nwGtpv1uDestroyTunnelEndPoint(thiz, pUlpReq); - } - break; - - case NW_GTPV1U_ULP_API_INITIAL_REQ: { - GTPU_DEBUG("Received initial req from ulp\n"); - rc = nwGtpv1uInitialReq(thiz, pUlpReq); - } - break; - - case NW_GTPV1U_ULP_API_SEND_TPDU: { -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("Received send tpdu req from ulp\n"); -#endif - rc = nwGtpv1uSendto(thiz, pUlpReq); - } - break; - - default: - GTPU_DEBUG("Unsupported API received from ulp\n"); - rc = NW_GTPV1U_FAILURE; - break; - } - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/*--------------------------------------------------------------------------- - * Process Timer timeout Request from Timer Manager - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uProcessTimeout(void *timeoutInfo) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz; - - NW_ASSERT(timeoutInfo != NULL); - - thiz = (NwGtpv1uStackT *) (((NwGtpv1uTimeoutInfoT *) timeoutInfo)->hStack); - - NW_ASSERT(thiz != NULL); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - GTPU_DEBUG("Received timeout event from ULP with timeoutInfo 0x%p!\n", - timeoutInfo); - - rc = (((NwGtpv1uTimeoutInfoT *) timeoutInfo)->timeoutCallbackFunc) (timeoutInfo); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -#ifdef __cplusplus -} -#endif - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c deleted file mode 100644 index 365d6d23a5..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c +++ /dev/null @@ -1,558 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "NwTypes.h" -#include "NwLog.h" -#include "NwUtils.h" -#include "NwGtpv1uLog.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uPrivate.h" -#include "NwGtpv1uMsg.h" -#include "assertions.h" - -#include "gtpv1u.h" -#if defined(ENB_MODE) -#include "common/utils/LOG/log.h" -#endif - -#define NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE (12) /**< Size of GTPv1u EPC specific header */ -#define NW_GTPV1U_EPC_MIN_HEADER_SIZE (8) - -#ifdef __cplusplus -extern "C" { -#endif - -static NwGtpv1uMsgT *gpGtpv1uMsgPool = NULL; - -NwGtpv1uRcT -nwGtpv1uMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint8_t seqNumFlag, - NW_IN uint8_t npduNumFlag, - NW_IN uint8_t extHdrFlag, - NW_IN uint8_t msgType, - NW_IN uint8_t teid, - NW_IN uint16_t seqNum, - NW_IN uint8_t npduNum, - NW_IN uint8_t nextExtHeader, - NW_OUT NwGtpv1uMsgHandleT *phMsg) -{ - NwGtpv1uStackT *pStack = (NwGtpv1uStackT *) hGtpuStackHandle; - NwGtpv1uMsgT *pMsg; - - if(gpGtpv1uMsgPool) { - pMsg = gpGtpv1uMsgPool; - gpGtpv1uMsgPool = gpGtpv1uMsgPool->next; - } else { - NW_GTPV1U_MALLOC(pStack, sizeof(NwGtpv1uMsgT), pMsg, NwGtpv1uMsgT *); - } - - - if(pMsg) { - pMsg->version = NW_GTPU_VERSION; - pMsg->protocolType = NW_GTP_PROTOCOL_TYPE_GTP; - pMsg->seqNumFlag = seqNumFlag; - pMsg->npduNumFlag = npduNumFlag; - pMsg->extHdrFlag = extHdrFlag; - pMsg->msgType = msgType; - - if(seqNumFlag) { - pMsg->seqNum = seqNum; - } - - if(npduNumFlag) { - pMsg->npduNum = npduNum; - } - - if(extHdrFlag) { - pMsg->nextExtHdrType = nextExtHeader; - } - - pMsg->msgLen = ((pMsg->seqNumFlag || pMsg->npduNumFlag - || pMsg->extHdrFlag) ? - 4 : 0); - //NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE : (NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE - 4)); - - pMsg->msgBuf = NULL; - pMsg->msgBufLen = 0; - pMsg->msgBufOffset = 0; - *phMsg = (NwGtpv1uMsgHandleT) pMsg; - return NW_GTPV1U_OK; - } - - return NW_GTPV1U_FAILURE; -} - -NwGtpv1uRcT -nwGtpv1uGpduMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint32_t teid, - NW_IN uint8_t seqNumFlag, - NW_IN uint16_t seqNum, - NW_IN uint8_t *tpdu, - NW_IN uint16_t tpduLength, - NW_IN uint32_t tpduOffset, - NW_OUT NwGtpv1uMsgHandleT *phMsg) -{ - NwGtpv1uStackT *pStack = (NwGtpv1uStackT *) hGtpuStackHandle; - NwGtpv1uMsgT *pMsg; - //uint32_t header_len = 0; - uint32_t msgExtraLen = 0; - - if(gpGtpv1uMsgPool) { - pMsg = gpGtpv1uMsgPool; - gpGtpv1uMsgPool = gpGtpv1uMsgPool->next; - } else { - NW_GTPV1U_MALLOC(pStack, sizeof(NwGtpv1uMsgT), pMsg, NwGtpv1uMsgT *); - } - - if(pMsg) { - msgExtraLen = (((seqNumFlag) || (NW_FALSE) || (NW_FALSE) ) ? - (NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE - NW_GTPV1U_EPC_MIN_HEADER_SIZE) : 0); - AssertFatal((msgExtraLen + NW_GTPV1U_EPC_MIN_HEADER_SIZE) <= tpduOffset, - "Mismatch GTPU len, msgExtraLen %u tpduOffset %u", - msgExtraLen, - (uint32_t) tpduOffset); - pMsg->msgBuf = tpdu; - pMsg->msgBufLen = tpduLength + msgExtraLen + NW_GTPV1U_EPC_MIN_HEADER_SIZE; - pMsg->msgBufOffset = tpduOffset - (msgExtraLen + NW_GTPV1U_EPC_MIN_HEADER_SIZE); -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("MSG length %u, offset %u -> length %u offset %u\n", - tpduLength, tpduOffset, - pMsg->msgBufLen, pMsg->msgBufOffset); -#endif - - // Version field: This field is used to determine the version of the GTP-U protocol. - // The version number shall be set to '1'. - pMsg->version = NW_GTPU_VERSION; - // Protocol Type (PT): This bit is used as a protocol discriminator between GTP (when PT is '1') - // and GTP' (when PT is '0'). GTP is described in this document and the GTP' protocol in 3GPP TS 32.295 [8]. - // Note that the interpretation of the header fields may be different in GTP' than in GTP. - pMsg->protocolType = NW_GTP_PROTOCOL_TYPE_GTP; - // Extension Header flag (E): This flag indicates the presence of a meaningful value of the Next Extension - // Header field. When it is set to '0', the Next Extension Header field either is not present or, if present, - // shall not be interpreted. - pMsg->extHdrFlag = NW_FALSE; - // Sequence number flag (S): This flag indicates the presence of a meaningful value of the Sequence Number field. - // When it is set to '0', the Sequence Number field either is not present or, if present, shall not be interpreted. - // When it is set to '1', the Sequence Number field is present, and shall be interpreted, as described below in - // this section. - // For the Echo Request, Echo Response, Error Indication and Supported Extension Headers Notification - // messages, the S flag shall be set to '1'. Since the use of Sequence Numbers is optional for G-PDUs, the PGW, - // SGW, ePDG and eNodeB should set the flag to '0'. However, when a G-PDU (T-PDU+header) is being relayed - // by the Indirect Data Forwarding for Inter RAT HO procedure, then if the received G-PDU has the S flag set to - // '1', then the relaying entity shall set S flag to '1' and forward the G-PDU (T-PDU+header). In an End marker - // message the S flag shall be set to '0'. - pMsg->seqNumFlag = (seqNumFlag? NW_TRUE : NW_FALSE); - pMsg->seqNum = seqNum; - // N-PDU Number flag (PN): This flag indicates the presence of a meaningful value of the N-PDU Number field. - // When it is set to '0', the N-PDU Number field either is not present, or, if present, shall not be interpreted. - // When it is set to '1', the N-PDU Number field is present, and shall be interpreted. - pMsg->npduNumFlag = NW_FALSE; - pMsg->npduNum = 0x00; - // Message Type: This field indicates the type of GTP-U message. - pMsg->msgType = NW_GTP_GPDU; - // Length: This field indicates the length in octets of the payload, i.e. the rest of the packet following the - // mandatory part of the GTP header (that is the first 8 octets). - // The Sequence Number, the N-PDU Number or any Extension headers shall be considered to be part of the payload, - // i.e. included in the length count. - //header_len = ((pMsg->seqNumFlag || pMsg->npduNumFlag || pMsg->extHdrFlag ) ? - // NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE : NW_GTPV1U_EPC_MIN_HEADER_SIZE); - pMsg->msgLen = msgExtraLen + tpduLength; - - // Tunnel Endpoint Identifier (TEID): This field unambiguously identifies a tunnel endpoint in the receiving - // GTP-U protocol entity. The receiving end side of a GTP tunnel locally assigns the TEID value the transmitting - // side has to use. The TEID shall be used by the receiving entity to find the PDP context, except for the - // following cases: - // - The Echo Request/Response and Supported Extension Headers notification messages, where the Tunnel - // Endpoint Identifier shall be set to all zeroes. - // - The Error Indication message where the Tunnel Endpoint Identifier shall be set to all zeros. - pMsg->teid = teid; - pMsg->nextExtHdrType= 0x00; - - //memcpy(pMsg->msgBuf + header_len, tpdu, tpduLength); - *phMsg = (NwGtpv1uMsgHandleT) pMsg; - return NW_GTPV1U_OK; - } - - return NW_GTPV1U_FAILURE; -} - -NwGtpv1uRcT -nwGtpv1uMsgFromMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uMsgHandleT hMsg, - NW_OUT NwGtpv1uMsgHandleT *phMsg) -{ - NwGtpv1uStackT *pStack = (NwGtpv1uStackT *) hGtpuStackHandle; - NwGtpv1uMsgT *pMsg; - - if(gpGtpv1uMsgPool) { - pMsg = gpGtpv1uMsgPool; - gpGtpv1uMsgPool = gpGtpv1uMsgPool->next; - } else { - NW_GTPV1U_MALLOC(pStack, sizeof(NwGtpv1uMsgT), pMsg, NwGtpv1uMsgT *); - } - - - if(pMsg) { - memcpy(pMsg, (NwGtpv1uMsgT *)hMsg, sizeof(NwGtpv1uMsgT)); - *phMsg = (NwGtpv1uMsgHandleT) pMsg; - return NW_GTPV1U_OK; - } - - return NW_GTPV1U_FAILURE; -} - -NwGtpv1uRcT -nwGtpv1uMsgFromBufferNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint8_t *pBuf, - NW_IN uint32_t bufLen, - NW_OUT NwGtpv1uMsgHandleT *phMsg) -{ - NwGtpv1uStackT *pStack = (NwGtpv1uStackT *) hGtpuStackHandle; - NwGtpv1uMsgT *pMsg; - - if(gpGtpv1uMsgPool) { - pMsg = gpGtpv1uMsgPool; - gpGtpv1uMsgPool = gpGtpv1uMsgPool->next; - } else { - NW_GTPV1U_MALLOC(pStack, sizeof(NwGtpv1uMsgT), pMsg, NwGtpv1uMsgT *); - } - - - if(pMsg) { - pMsg->msgBuf = pBuf; - - pMsg->version = ((*pBuf) & 0xE0) >> 5; - pMsg->protocolType = ((*pBuf) & 0x10) >> 4; - pMsg->extHdrFlag = ((*pBuf) & 0x04) >> 2; - pMsg->seqNumFlag = ((*pBuf) & 0x02) >> 1; - pMsg->npduNumFlag = ((*pBuf) & 0x01); - pBuf++; - - pMsg->msgType = *(pBuf); - pBuf++; - - pBuf += 2; - - pMsg->teid = ntohl(*((uint32_t *)pBuf)); - pBuf += 4; - - if(pMsg->extHdrFlag || pMsg->seqNumFlag || pMsg->npduNumFlag) { - pMsg->seqNum = ntohs(*(((uint16_t *)pBuf))); - pBuf += 2; - pMsg->npduNum = *(pBuf++); - pMsg->nextExtHdrType = *(pBuf++); - } - - pMsg->msgBufOffset = (uint32_t)(pBuf - pMsg->msgBuf); - pMsg->msgBufLen = bufLen - pMsg->msgBufOffset; - pMsg->msgLen = bufLen; -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("nwGtpv1uMsgFromBufferNew() msgLen %u msgBufLen %u msgBufOffset %u ", - pMsg->msgLen, pMsg->msgBufLen, pMsg->msgBufOffset); -#endif - *phMsg = (NwGtpv1uMsgHandleT) pMsg; - return NW_GTPV1U_OK; - } - - return NW_GTPV1U_FAILURE; -} - -NwGtpv1uRcT -nwGtpv1uMsgDelete( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uMsgHandleT hMsg) -{ - ((NwGtpv1uMsgT *)hMsg)->next = gpGtpv1uMsgPool; - gpGtpv1uMsgPool = (NwGtpv1uMsgT *) hMsg; - return NW_GTPV1U_OK; -} - -/** - * Set TEID for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[in] teid: TEID value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgSetTeid(NW_IN NwGtpv1uMsgHandleT hMsg, uint32_t teid) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - thiz->teid = teid; -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("nwGtpv1uMsgSetTeid() teid %u", teid); -#endif - return NW_GTPV1U_OK; -} - -/** - * Set sequence for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[in] seqNum: Flag boolean value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgSetSeqNumber(NW_IN NwGtpv1uMsgHandleT hMsg, uint32_t seqNum) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - thiz->seqNum = seqNum; - return NW_GTPV1U_OK; -} - -/** - * Get TEID present for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -uint32_t -nwGtpv1uMsgGetTeid(NW_IN NwGtpv1uMsgHandleT hMsg) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - return (thiz->teid); -} - - -/** - * Get sequence number for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -uint32_t -nwGtpv1uMsgGetSeqNumber(NW_IN NwGtpv1uMsgHandleT hMsg) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - return (thiz->seqNum); -} - -/** - * Get msg type for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -uint32_t -nwGtpv1uMsgGetMsgType(NW_IN NwGtpv1uMsgHandleT hMsg) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - return (thiz->msgType); -} - -/** - * Get tpdu for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -NwGtpv1uRcT -nwGtpv1uMsgGetTpdu(NW_IN NwGtpv1uMsgHandleT hMsg, uint8_t *pTpduBuf, - uint32_t *pTpduLength) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - uint8_t headerLength = ((thiz->seqNumFlag || thiz->extHdrFlag - || thiz->npduNumFlag) ? 12 : 8); - - *pTpduLength = thiz->msgLen - headerLength; - memcpy(pTpduBuf, thiz->msgBuf + headerLength, *pTpduLength); - return NW_GTPV1U_OK; -} - -uint8_t * -nwGtpv1uMsgGetTpduHandle(NW_IN NwGtpv1uMsgHandleT hMsg) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - return (thiz->msgBuf + ((thiz->seqNumFlag || thiz->extHdrFlag - || thiz->npduNumFlag) ? 12 : 8)); -} - -uint32_t -nwGtpv1uMsgGetTpduLength(NW_IN NwGtpv1uMsgHandleT hMsg) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - return (thiz->msgLen - ((thiz->seqNumFlag || thiz->extHdrFlag - || thiz->npduNumFlag) ? 12 : 8)); -} - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV1(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint8_t value) -{ - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; - NwGtpv1uIeTv1T *pIe; - - pIe = (NwGtpv1uIeTv1T *) (pMsg->msgBuf + pMsg->msgLen); - - pIe->t = type; - pIe->v = value; - - pMsg->msgLen += sizeof(NwGtpv1uIeTv1T); - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV2(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint16_t value) -{ - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; - NwGtpv1uIeTv2T *pIe; - - pIe = (NwGtpv1uIeTv2T *) (pMsg->msgBuf + pMsg->msgLen); - - pIe->t = type; - pIe->v = htons(value); - - pMsg->msgLen += sizeof(NwGtpv1uIeTv2T); - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV4(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint32_t value) -{ - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; - NwGtpv1uIeTv4T *pIe; - - pIe = (NwGtpv1uIeTv4T *) (pMsg->msgBuf + pMsg->msgLen); - - pIe->t = type; - pIe->v = htonl(value); - - pMsg->msgLen += sizeof(NwGtpv1uIeTv4T); - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwGtpv1uMsgAddIe(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint8_t *pVal) -{ - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; - NwGtpv1uIeTlvT *pIe; - - pIe = (NwGtpv1uIeTlvT *) (pMsg->msgBuf + pMsg->msgLen); - - pIe->t = type; - pIe->l = htons(length); - - memcpy(pIe + 4, pVal, length); - pMsg->msgLen += (4 + length); - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwGtpv1uMsgHexDump(NwGtpv1uMsgHandleT hMsg, FILE *fp) -{ - - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; - uint8_t *data = pMsg->msgBuf; - uint32_t size = pMsg->msgLen; - - unsigned char *p = (unsigned char *)data; - unsigned char c; - int n; - char bytestr[4] = {0}; - char addrstr[10] = {0}; - char hexstr[ 16*3 + 5] = {0}; - char charstr[16*1 + 5] = {0}; - fprintf((FILE *)fp, "\n"); - - for(n=1; n<=size; n++) { - if (n%16 == 1) { - /* store address for this line */ - snprintf(addrstr, sizeof(addrstr), "%.4lx", - (p-data) ); - } - - c = *p; - - if (isalnum(c) == 0) { - c = '.'; - } - - /* store hex str (for left side) */ - snprintf(bytestr, sizeof(bytestr), "%02X ", *p); - strncat(hexstr, bytestr, sizeof(hexstr)-strlen(hexstr)-1); - - /* store char str (for right side) */ - snprintf(bytestr, sizeof(bytestr), "%c", c); - strncat(charstr, bytestr, sizeof(charstr)-strlen(charstr)-1); - - if(n%16 == 0) { - /* line completed */ - fprintf((FILE *)fp, "[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr); - hexstr[0] = 0; - charstr[0] = 0; - } else if(n%8 == 0) { - /* half line: add whitespaces */ - strncat(hexstr, " ", sizeof(hexstr)-strlen(hexstr)-1); - strncat(charstr, " ", sizeof(charstr)-strlen(charstr)-1); - } - - p++; /* next byte */ - } - - if (strlen(hexstr) > 0) { - /* print rest of buffer if not empty */ - fprintf((FILE *)fp, "[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr); - - } - - fprintf((FILE *)fp, "\n"); - - return NW_GTPV1U_OK; -} - -#ifdef __cplusplus -} -#endif - - - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c deleted file mode 100644 index 27cb59050f..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c +++ /dev/null @@ -1,399 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "NwTypes.h" -#include "NwLog.h" -#include "NwUtils.h" -#include "NwGtpv1uLog.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uPrivate.h" -#include "NwGtpv1uTrxn.h" - -/*--------------------------------------------------------------------------* - * P R I V A T E D E C L A R A T I O N S * - *--------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" { -#endif - -static NwGtpv1uTrxnT *gpGtpv1uTrxnPool = NULL; - -/*--------------------------------------------------------------------------* - * P R I V A T E F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------- - * Send msg retransmission to peer via data request to UDP Entity - *--------------------------------------------------------------------------*/ - -static NwGtpv1uRcT -nwGtpv1uTrxnSendMsgRetransmission(NwGtpv1uTrxnT *thiz) -{ - NwGtpv1uRcT rc; - - NW_ASSERT(thiz); - NW_ASSERT(thiz->pMsg); - - rc = thiz->pStack->udp.udpDataReqCallback(thiz->pStack->udp.hUdp, - thiz->pMsg->msgBuf, - thiz->pMsg->msgLen, - thiz->pMsg->msgBufOffset, - thiz->peerIp, - thiz->peerPort); - - return rc; -} - -static NwGtpv1uRcT -nwGtpv1uTrxnPeerRspTimeout(void *arg) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTrxnT *thiz; - NwGtpv1uStackT *pStack; - NwGtpv1uTimeoutInfoT *timeoutInfo = arg; - - thiz = ((NwGtpv1uTrxnT *)timeoutInfo->timeoutArg); - pStack = thiz->pStack; - - NW_ASSERT(pStack); - - NW_LOG(pStack, NW_LOG_LEVEL_WARN, "T3 timer expired for transaction 0x%p", - thiz); - - rc = nwGtpv1uTrxnSendMsgRetransmission(thiz); - - if(thiz->maxRetries) { - rc = pStack->tmrMgr.tmrStartCallback(pStack->tmrMgr.tmrMgrHandle, - thiz->t3Timer, 0, NW_GTPV1U_TMR_TYPE_ONE_SHOT, (void *)timeoutInfo, - &thiz->hRspTmr); - thiz->maxRetries--; - } else { - NwGtpv1uUlpApiT ulpApi; - ulpApi.apiType = NW_GTPV1U_ULP_API_RSP_FAILURE; - ulpApi.apiInfo.recvMsgInfo.msgType = nwGtpv1uMsgGetMsgType(( - NwGtpv1uMsgHandleT)thiz->pMsg); - ulpApi.apiInfo.recvMsgInfo.hUlpTrxn = thiz->hUlpTrxn; - ulpApi.apiInfo.recvMsgInfo.peerIp = thiz->peerIp; - ulpApi.apiInfo.recvMsgInfo.peerPort = thiz->peerPort; - thiz->hRspTmr = 0; - - rc = nwGtpv1uTrxnDelete(&thiz); - NW_ASSERT(rc == NW_GTPV1U_OK); - - rc = pStack->ulp.ulpReqCallback(pStack->ulp.hUlp, &ulpApi); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - - return rc; -} - -/** - Send timer start request to TmrMgr Entity. - - @param[in] thiz : Pointer to transaction - @param[in] timeoutCallbackFunc : Timeout handler callback function. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uTrxnStartPeerRspTimer(NwGtpv1uTrxnT *thiz, - NwGtpv1uRcT (*timeoutCallbackFunc)(void *)) -{ - NwGtpv1uRcT rc; - NwGtpv1uTimeoutInfoT *timeoutInfo; - - NW_ASSERT(thiz->pStack->tmrMgr.tmrStartCallback != NULL); - - timeoutInfo = &thiz->peerRspTimeoutInfo; - timeoutInfo->timeoutArg = thiz; - timeoutInfo->timeoutCallbackFunc = timeoutCallbackFunc; - timeoutInfo->hStack = (NwGtpv1uStackHandleT)thiz->pStack; - - rc = thiz->pStack->tmrMgr.tmrStartCallback(thiz->pStack->tmrMgr.tmrMgrHandle, - thiz->t3Timer, 0, NW_GTPV1U_TMR_TYPE_ONE_SHOT, (void *)timeoutInfo, - &thiz->hRspTmr); - - return rc; -} - -/** - Send timer stop request to TmrMgr Entity. - - @param[in] thiz : Pointer to transaction - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uTrxnStopPeerRspTimer(NwGtpv1uTrxnT *thiz) -{ - NwGtpv1uRcT rc; - - NW_ASSERT(thiz->pStack->tmrMgr.tmrStopCallback != NULL); - - rc = thiz->pStack->tmrMgr.tmrStopCallback(thiz->pStack->tmrMgr.tmrMgrHandle, - thiz->hRspTmr); - - thiz->hRspTmr = 0; - - return rc; -} - -/*--------------------------------------------------------------------------* - * P U B L I C F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -/** - * Constructor - * - * @param[in] thiz : Pointer to stack - * @param[out] ppTrxn : Pointer to pointer to Trxn object. - * @return NW_GTPV1U_OK on success. - */ -NwGtpv1uRcT -nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT *thiz, - NW_OUT NwGtpv1uTrxnT **ppTrxn) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTrxnT *pTrxn; - - if(gpGtpv1uTrxnPool) { - pTrxn = gpGtpv1uTrxnPool; - gpGtpv1uTrxnPool = gpGtpv1uTrxnPool->next; - } else { - NW_GTPV1U_MALLOC(thiz, sizeof(NwGtpv1uTrxnT), pTrxn, NwGtpv1uTrxnT *); - } - - if (pTrxn) { - pTrxn->maxRetries = 2; - pTrxn->pStack = thiz; - pTrxn->t3Timer = 2; - pTrxn->seqNum = thiz->seq; - - /* Increment sequence number */ - thiz->seq++; - - if(thiz->seq == 0x800000) { - thiz->seq = 0; - } - - } else { - rc = NW_GTPV1U_FAILURE; - } - - NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%p", pTrxn); - - *ppTrxn = pTrxn; - - return rc; -} - -/** - * Overloaded Constructor - * - * @param[in] thiz : Pointer to stack. - * @param[in] seqNum : Sequence number for this transaction. - * @param[out] ppTrxn : Pointer to pointer to Trxn object. - * @return NW_GTPV1U_OK on success. - */ -NwGtpv1uRcT -nwGtpv1uTrxnWithSeqNew( NW_IN NwGtpv1uStackT *thiz, - NW_IN uint32_t seqNum, - NW_OUT NwGtpv1uTrxnT **ppTrxn) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTrxnT *pTrxn; - - if(gpGtpv1uTrxnPool) { - pTrxn = gpGtpv1uTrxnPool; - gpGtpv1uTrxnPool = gpGtpv1uTrxnPool->next; - } else { - NW_GTPV1U_MALLOC(thiz, sizeof(NwGtpv1uTrxnT), pTrxn, NwGtpv1uTrxnT *); - } - - - if (pTrxn) { - pTrxn->maxRetries = 2; - pTrxn->pStack = thiz; - pTrxn->t3Timer = 2; - pTrxn->seqNum = seqNum; - pTrxn->pMsg = NULL; - } else { - rc = NW_GTPV1U_FAILURE; - } - - NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%p", pTrxn); - - *ppTrxn = pTrxn; - - return rc; -} - -/** - * Destructor - * - * @param[out] pthiz : Pointer to pointer to Trxn object. - * @return NW_GTPV1U_OK on success. - */ -NwGtpv1uRcT -nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **pthiz) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uStackT *pStack; - NwGtpv1uTrxnT *thiz = *pthiz; - - pStack = thiz->pStack; - - if(thiz->hRspTmr) { - rc = nwGtpv1uTrxnStopPeerRspTimer(thiz); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - - if(thiz->pMsg) { - rc = nwGtpv1uMsgDelete((NwGtpv1uStackHandleT)pStack, - (NwGtpv1uMsgHandleT)thiz->pMsg); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - - thiz->next = gpGtpv1uTrxnPool; - gpGtpv1uTrxnPool = thiz; - - NW_LOG(pStack, NW_LOG_LEVEL_DEBG, "Purged transaction 0x%p", thiz); - - *pthiz = NULL; - return rc; -} - - -#if 1 -/** - * Send msg to peer via data request to UDP Entity - * - * @param[in] thiz : Pointer to stack. - * @param[in] pTrxn : Pointer to Trxn object. - * @param[in] peerIp : Peer Ip address. - * @param[in] peerPort : Peer Ip port. - * @param[in] pMsg : Message to be sent. - * @return NW_GTPV1U_OK on success. - */ -NwGtpv1uRcT -nwGtpv1uTrxnCreateAndSendMsg( NW_IN NwGtpv1uStackT *thiz, - NW_IN NwGtpv1uTrxnT *pTrxn, - NW_IN uint32_t peerIp, - NW_IN uint32_t peerPort, - NW_IN NwGtpv1uMsgT *pMsg) -{ - NwGtpv1uRcT rc; - uint8_t *msgHdr; - - NW_ASSERT(thiz); - NW_ASSERT(pMsg); - - msgHdr = &pMsg->msgBuf[pMsg->msgBufOffset]; - - NW_ASSERT(msgHdr != NULL); - - *(msgHdr++) = (pMsg->version << 5) | - (pMsg->protocolType << 4) | - (pMsg->extHdrFlag << 2) | - (pMsg->seqNumFlag << 1) | - (pMsg->npduNumFlag); - - *(msgHdr++) = (pMsg->msgType); - *((uint16_t *) msgHdr) = htons(pMsg->msgLen); - msgHdr += 2; - - *((uint32_t *) msgHdr) = htonl(pMsg->teid); - msgHdr += 4; - - if(pMsg->seqNumFlag | pMsg->extHdrFlag | pMsg->npduNumFlag) { - if(pMsg->seqNumFlag) { - *((uint16_t *) msgHdr) = htons((pTrxn ? pTrxn->seqNum : pMsg->seqNum)); - } else { - *((uint16_t *) msgHdr) = 0x0000; - } - - msgHdr += 2; - - if(pMsg->npduNumFlag) { - *((uint8_t *) msgHdr) = pMsg->npduNumFlag; - } else { - *((uint8_t *) msgHdr) = 0x00; - } - - msgHdr++; - - if(pMsg->extHdrFlag) { - *((uint8_t *) msgHdr) = pMsg->extHdrFlag; - } else { - *((uint8_t *) msgHdr) = 0x00; - } - - msgHdr++; - } - - NW_ASSERT(thiz->udp.udpDataReqCallback != NULL); - - rc = thiz->udp.udpDataReqCallback(thiz->udp.hUdp, - pMsg->msgBuf, - pMsg->msgLen, - pMsg->msgBufOffset, - peerIp, - peerPort); - - /* Save the message for retransmission */ - if(rc == NW_GTPV1U_OK && pTrxn) { - pTrxn->pMsg = pMsg; - pTrxn->peerIp = peerIp; - pTrxn->peerPort = peerPort; - - rc = nwGtpv1uTrxnStartPeerRspTimer(pTrxn, nwGtpv1uTrxnPeerRspTimeout); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - - return rc; -} -#endif - - -#ifdef __cplusplus -} -#endif - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c deleted file mode 100644 index c62f60edc2..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c +++ /dev/null @@ -1,135 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "NwTypes.h" -#include "NwUtils.h" -#include "NwGtpv1uError.h" -#include "NwGtpv1uPrivate.h" -#include "NwGtpv1uMsg.h" -#include "NwGtpv1uTunnelEndPoint.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uLog.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------* - * P R I V A T E D E C L A R A T I O N S * - *--------------------------------------------------------------------------*/ - -static NwGtpv1uTunnelEndPointT *gpTunnelEndPointPool = NULL; - -/*--------------------------------------------------------------------------* - * P U B L I C F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -/** - Constructor - - @param[in] msid: MSID - @param[in] peerAddr: Address of the peer. - @return Pointer to Session on success, NULL on failure. - */ - - -NwGtpv1uTunnelEndPointT * -nwGtpTunnelEndPointNew(struct NwGtpv1uStack *pStack) -{ - NwGtpv1uTunnelEndPointT *thiz; - - if(gpTunnelEndPointPool) { - thiz = gpTunnelEndPointPool; - gpTunnelEndPointPool = gpTunnelEndPointPool->next; - } else { - NW_GTPV1U_MALLOC(pStack, sizeof(NwGtpv1uTunnelEndPointT), thiz, - NwGtpv1uTunnelEndPointT *); - } - - return thiz; -} - -/** - Destructor - - @param[in] thiz: Pointer to session - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpTunnelEndPointDestroy(struct NwGtpv1uStack *pStack, - NwGtpv1uTunnelEndPointT *thiz) -{ - thiz->next = gpTunnelEndPointPool; - gpTunnelEndPointPool = thiz; - return NW_GTPV1U_OK; -} - -/** - Purge a Transaction for a Session. - - @param[in] thiz: Pointer to session - @param[in,out] pTrxn: Pointer to the trxn. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpSessionSendMsgApiToUlpEntity(NwGtpv1uTunnelEndPointT *thiz, - NwGtpv1uMsgT *pMsg) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uUlpApiT api; - - api.apiType = NW_GTPV1U_ULP_API_RECV_TPDU; - api.apiInfo.recvMsgInfo.hUlpSession = thiz->hUlpSession; - api.apiInfo.recvMsgInfo.teid = thiz->teid; - api.apiInfo.recvMsgInfo.hMsg = (NwGtpv1uMsgHandleT)pMsg; - - NW_ASSERT(thiz->pStack->ulp.ulpReqCallback != NULL); - - thiz->pStack->ulp.ulpReqCallback(thiz->pStack->ulp.hUlp, &api); - - return rc; -} - -#ifdef __cplusplus -} -#endif - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.am b/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.am deleted file mode 100644 index 69b8e698e9..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# this is example-file: Makefile.am - -# the subdirectories of the project to go into -SUBDIRS = \ - nw-helloworld diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.in b/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.in deleted file mode 100644 index 46928b9e3c..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.in +++ /dev/null @@ -1,461 +0,0 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# this is example-file: Makefile.am -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -subdir = nw-gtpv1u/test-app -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ -AM_LDFLAGS = @AM_LDFLAGS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ - -# the subdirectories of the project to go into -SUBDIRS = \ - nw-helloworld - -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu nw-gtpv1u/test-app/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu nw-gtpv1u/test-app/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-exec-am: - -install-html: install-html-recursive - -install-info: install-info-recursive - -install-man: - -install-pdf: install-pdf-recursive - -install-ps: install-ps-recursive - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic ctags \ - ctags-recursive distclean distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ - tags-recursive uninstall uninstall-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.am b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.am deleted file mode 100644 index f60cd93f55..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -bin_PROGRAMS = helloworld - -AM_CFLAGS = -D__WITH_LIBEVENT__ -I../../shared -I../../include -I../../test-app/nw-udp -I../../test-app/nw-log @AM_CFLAGS@ - -helloworld_SOURCES = \ - NwEvt.h\ - NwMiniLogMgrEntity.h\ - NwMiniTmrMgrEntity.h\ - NwMiniUlpEntity.h\ - NwMiniUdpEntity.h\ - NwMiniLogMgrEntity.c\ - NwMiniTmrMgrEntity.c\ - NwMiniUlpEntity.c\ - NwMiniUdpEntity.c\ - helloworld.c - -helloworld_LDADD = ../../src/libNwGtpv1u.a -levent $(AM_LDFLAGS) diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.in b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.in deleted file mode 100644 index 769d75c16b..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.in +++ /dev/null @@ -1,433 +0,0 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -bin_PROGRAMS = helloworld$(EXEEXT) -subdir = nw-gtpv1u/test-app/nw-helloworld -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) -am_helloworld_OBJECTS = NwMiniLogMgrEntity.$(OBJEXT) \ - NwMiniTmrMgrEntity.$(OBJEXT) NwMiniUlpEntity.$(OBJEXT) \ - NwMiniUdpEntity.$(OBJEXT) helloworld.$(OBJEXT) -helloworld_OBJECTS = $(am_helloworld_OBJECTS) -am__DEPENDENCIES_1 = -helloworld_DEPENDENCIES = ../../src/libNwGtpv1u.a \ - $(am__DEPENDENCIES_1) -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(helloworld_SOURCES) -DIST_SOURCES = $(helloworld_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_CFLAGS = -D__WITH_LIBEVENT__ -I../../shared -I../../include -I../../test-app/nw-udp -I../../test-app/nw-log @AM_CFLAGS@ -AM_LDFLAGS = @AM_LDFLAGS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -helloworld_SOURCES = \ - NwEvt.h\ - NwMiniLogMgrEntity.h\ - NwMiniTmrMgrEntity.h\ - NwMiniUlpEntity.h\ - NwMiniUdpEntity.h\ - NwMiniLogMgrEntity.c\ - NwMiniTmrMgrEntity.c\ - NwMiniUlpEntity.c\ - NwMiniUdpEntity.c\ - helloworld.c - -helloworld_LDADD = ../../src/libNwGtpv1u.a -levent $(AM_LDFLAGS) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu nw-gtpv1u/test-app/nw-helloworld/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu nw-gtpv1u/test-app/nw-helloworld/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -helloworld$(EXEEXT): $(helloworld_OBJECTS) $(helloworld_DEPENDENCIES) - @rm -f helloworld$(EXEEXT) - $(LINK) $(helloworld_OBJECTS) $(helloworld_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NwMiniLogMgrEntity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NwMiniTmrMgrEntity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NwMiniUdpEntity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NwMiniUlpEntity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helloworld.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-info: install-info-am - -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-binPROGRAMS - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwEvt.h b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwEvt.h deleted file mode 100644 index 6df5794a5f..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwEvt.h +++ /dev/null @@ -1,80 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#ifndef __NW_EVT_H__ -#define __NW_EVT_H__ -/** - * @file NwEvt.h - * @brief -*/ - -#ifdef __WITH_LIBEVENT__ - -#include - -typedef struct event NwEventT; - -#define NW_EVT_READ (EV_READ) -#define NW_EVT_PERSIST (EV_PERSIST) -#define NW_EVT_CALLBACK(__cbFunc) __cbFunc(int fd, short event, void *arg) -#define NW_TMR_CALLBACK(__cbFunc) __cbFunc(int fd, short event, void *arg) - -#define NW_EVT_INIT event_init -#define NW_EVT_LOOP event_dispatch - -#define NW_EVENT_ADD(__ev, __evSelObj, __evCallback, __evCallbackArg, __evFlags) \ - do { \ - event_set(&(__ev), __evSelObj, __evFlags, __evCallback, __evCallbackArg); \ - event_add(&(__ev), NULL); \ - } while(0) - -#else - -#warning "Event library not defined!" - -/* HACK : Defining dummy values for compilation!*/ - -typedef struct { - int __tbd; -} NwEventT; - -#define NW_EVT_READ (0) -#define NW_EVT_PERSIST (1) -#define NW_EVT_CALLBACK(__cbFunc) __cbFunc(void *arg) -#define NW_TMR_CALLBACK(__cbFunc) __cbFunc(void *arg) - - -#define NW_EVT_INIT() do { printf("error: Event library not defined!\n"); exit (0); } while(0) -#define NW_EVT_LOOP() do { printf("error: Event library not defined!\n"); exit (0); } while(0) -#define NW_EVENT_ADD(...) do { printf("error: Event library not defined!\n"); exit (0); } while(0) - - -#endif - -#endif /* __NW_EVT_H__ */ diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.c b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.c deleted file mode 100644 index c50e6a17db..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.c +++ /dev/null @@ -1,62 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C L O G M G R E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - -/** - * @file hello-world.c - * @brief This file contains example of a minimalistic log manager entity. -*/ - -#include -#include -#include "NwLog.h" -#include "NwEvt.h" -#include "NwGtpv1u.h" - -#include "NwMiniLogMgrEntity.h" - -#ifdef __cplusplus -extern "C" { -#endif - -uint32_t g_log_level = NW_LOG_LEVEL_INFO; - -/*--------------------------------------------------------------------------- - * Public functions - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT nwMiniLogMgrInit(NwMiniLogMgrT *thiz, uint32_t logLevel ) -{ - thiz->logLevel = logLevel; - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT nwMiniLogMgrSetLogLevel(NwMiniLogMgrT *thiz, uint32_t logLevel) -{ - thiz->logLevel = logLevel; -} - -NwGtpv1uRcT nwMiniLogMgrLogRequest (NwGtpv1uLogMgrHandleT hLogMgr, - uint32_t logLevel, - NwCharT *file, - uint32_t line, - NwCharT *logStr) -{ - NwMiniLogMgrT *thiz = (NwMiniLogMgrT *) hLogMgr; - - if(thiz->logLevel >= logLevel) { - printf("NWGTPv2U-STK %s - %s <%s,%u>\n", gLogLevelStr[logLevel], logStr, - basename(file), line); - } - - return NW_GTPV1U_OK; -} - -#ifdef __cplusplus -} -#endif - diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h deleted file mode 100644 index 18b60aa611..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h +++ /dev/null @@ -1,57 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C L O G M G R E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - -/** - * @file hello-world.c - * @brief This file contains example of a minimalistic log manager entity. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwLog.h" - -#ifndef __NW_MINI_LOG_MGR_H__ -#define __NW_MINI_LOG_MGR_H__ - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -extern uint32_t g_log_level; - - -#define NW_LOG( _logLevel, ...) \ - do { \ - if(g_log_level >= _logLevel) \ - { \ - char _logStr[1024]; \ - snprintf(_logStr, 1024, __VA_ARGS__); \ - printf("NWGTPv2U-APP %s - %s <%s,%d>\n", gLogLevelStr[_logLevel], _logStr, basename(__FILE__), __LINE__);\ - } \ - } while(0) - -typedef struct { - uint8_t logLevel; -} NwMiniLogMgrT; - -#ifdef __cplusplus -extern "C" { -#endif - -NwGtpv1uRcT nwMiniLogMgrLogRequest (NwGtpv1uLogMgrHandleT logMgrHandle, - uint32_t logLevel, - NwCharT* file, - uint32_t line, - NwCharT* logStr); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c deleted file mode 100644 index 63ad59b23f..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c +++ /dev/null @@ -1,101 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C T M R M G R E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - -/** - * @file NwMiniTmrMgrEntity.c - * @brief This file ontains example of a minimalistic timer manager entity. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwGtpv1u.h" -#include "NwMiniLogMgrEntity.h" -#include "NwMiniTmrMgrEntity.h" - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Private functions - *--------------------------------------------------------------------------*/ - -static void -NW_TMR_CALLBACK(nwMiniTmrMgrHandleTimeout) -{ - NwGtpv1uRcT rc; - NwMiniTmrMgrEntityT *pTmr = (NwMiniTmrMgrEntityT *) arg; - - /*--------------------------------------------------------------------------- - * Send Timeout Request to GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - rc = nwGtpv1uProcessTimeout(pTmr->timeoutArg); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - free(pTmr); - - return; -} - -/*--------------------------------------------------------------------------- - * Public functions - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT nwTimerStart( NwGtpv1uTimerMgrHandleT tmrMgrHandle, - uint32_t timeoutSec, - uint32_t timeoutUsec, - uint32_t tmrType, - void *timeoutArg, - NwGtpv1uTimerHandleT *hTmr) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwMiniTmrMgrEntityT *pTmr; - struct timeval tv; - - NW_LOG(NW_LOG_LEVEL_INFO, - "Received start timer request from stack with timer type %d , arg %x, for %d sec and %d usec", - tmrType, (unsigned int)timeoutArg, timeoutSec, timeoutUsec); - - pTmr = (NwMiniTmrMgrEntityT *) malloc (sizeof(NwMiniTmrMgrEntityT)); - - /* set the timevalues*/ - timerclear(&tv); - tv.tv_sec = timeoutSec; - tv.tv_usec = timeoutUsec; - - pTmr->timeoutArg = timeoutArg; - evtimer_set(&pTmr->ev, nwMiniTmrMgrHandleTimeout, pTmr); - - /*add event*/ - - event_add(&(pTmr->ev), &tv); - - *hTmr = (NwGtpv1uTimerHandleT)pTmr; - - return rc; -} - -NwGtpv1uRcT nwTimerStop( NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NwGtpv1uTimerHandleT hTmr) -{ - NW_LOG(NW_LOG_LEVEL_INFO, - "Received stop timer request from stack for timer handle %d", hTmr); - evtimer_del(&(((NwMiniTmrMgrEntityT *)hTmr)->ev)); - free((void *)hTmr); - return NW_GTPV1U_OK; -} - -#ifdef __cplusplus -} -#endif diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.h b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.h deleted file mode 100644 index a1f16ff89b..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.h +++ /dev/null @@ -1,53 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C T M R M G R E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - - -/** - * @file NwMiniTmrMgrEntity.c - * @brief This file ontains example of a minimalistic timer manager entity. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwLog.h" - -#ifndef __NW_MINI_TMR_MGR_H__ -#define __NW_MINI_TMR_MGR_H__ - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -typedef struct { - NwEventT ev; - void* timeoutArg; -} NwMiniTmrMgrEntityT; - - -#ifdef __cplusplus -extern "C" { -#endif - -NwGtpv1uRcT nwTimerStart( NwGtpv1uTimerMgrHandleT tmrMgrHandle, - uint32_t timeoutSec, - uint32_t timeoutUsec, - uint32_t tmrType, - void* timeoutArg, - NwGtpv1uTimerHandleT* hTmr); - - -NwGtpv1uRcT nwTimerStop( NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NwGtpv1uTimerHandleT hTmr); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.c b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.c deleted file mode 100644 index a63b02985c..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.c +++ /dev/null @@ -1,157 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C U D P E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - - -/** - * @file NwMiniUdpEntity.c - * @brief This file contains example of a minimalistic ULP entity. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "NwEvt.h" -#include "NwGtpv1u.h" -#include "NwMiniLogMgrEntity.h" -#include "NwMiniUdpEntity.h" - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -#define MAX_UDP_PAYLOAD_LEN (4096) - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Private functions - *--------------------------------------------------------------------------*/ - -static -void NW_TMR_CALLBACK(nwUdpDataIndicationCallbackData) -{ - NwGtpv1uRcT rc; - uint8_t udpBuf[MAX_UDP_PAYLOAD_LEN]; - NwS32T bytesRead; - uint32_t peerLen; - struct sockaddr_in peer; - NwMiniUdpEntityT *thiz = (NwMiniUdpEntityT *) arg; - - peerLen = sizeof(peer); - - bytesRead = recvfrom(thiz->hSocket, udpBuf, MAX_UDP_PAYLOAD_LEN , 0, - (struct sockaddr *) &peer,(socklen_t *) &peerLen); - - if(bytesRead) { - NW_LOG(NW_LOG_LEVEL_DEBG, "Received UDP message of length %u from %X:%u", - bytesRead, ntohl(peer.sin_addr.s_addr), ntohs(peer.sin_port)); - rc = nwGtpv1uProcessUdpReq(thiz->hGtpv1uStack, udpBuf, bytesRead, - peer.sin_port, peer.sin_addr.s_addr); - } else { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - } -} - - -/*--------------------------------------------------------------------------- - * Public functions - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT nwMiniUdpInit(NwMiniUdpEntityT *thiz, - NwGtpv1uStackHandleT hGtpv1uStack, uint8_t *ipAddr) -{ - int sd; - struct sockaddr_in addr; - - sd = socket(AF_INET, SOCK_DGRAM, 0); - - if (sd < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } - - addr.sin_family = AF_INET; - addr.sin_port = htons(2152); - addr.sin_addr.s_addr = inet_addr(ipAddr); - memset(addr.sin_zero, '\0', sizeof (addr.sin_zero)); - - if(bind(sd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } - - event_set(&(thiz->ev), sd, EV_READ|EV_PERSIST, nwUdpDataIndicationCallbackData, - thiz); - event_add(&(thiz->ev), NULL); - - thiz->hSocket = sd; - thiz->hGtpv1uStack = hGtpv1uStack; - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT nwMiniUdpDestroy(NwMiniUdpEntityT *thiz) -{ - close(thiz->hSocket); -} - -NwGtpv1uRcT nwMiniUdpDataReq(NwGtpv1uUdpHandleT udpHandle, - uint8_t *dataBuf, - uint32_t dataSize, - uint32_t peerIpAddr, - uint32_t peerPort) -{ - struct sockaddr_in peerAddr; - NwS32T bytesSent; - NwMiniUdpEntityT *thiz = (NwMiniUdpEntityT *) udpHandle; - - peerAddr.sin_family = AF_INET; - peerAddr.sin_port = htons(peerPort); - peerAddr.sin_addr.s_addr = (peerIpAddr); - memset(peerAddr.sin_zero, '\0', sizeof (peerAddr.sin_zero)); - - NW_LOG(NW_LOG_LEVEL_DEBG, - "Sending %u bytes on handle 0x%x to peer %u.%u.%u.%u:%u", dataSize, udpHandle, - (peerIpAddr & 0x000000ff), - (peerIpAddr & 0x0000ff00) >> 8, - (peerIpAddr & 0x00ff0000) >> 16, - (peerIpAddr & 0xff000000) >> 24, - peerPort); - - bytesSent = sendto (thiz->hSocket, dataBuf, dataSize, 0, - (struct sockaddr *) &peerAddr, sizeof(peerAddr)); - - if(bytesSent < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - } else { - NW_LOG(NW_LOG_LEVEL_DEBG, "Sent %u bytes on handle 0x%x to peer %u.%u.%u.%u", - dataSize, udpHandle, - (peerIpAddr & 0x000000ff), - (peerIpAddr & 0x0000ff00) >> 8, - (peerIpAddr & 0x00ff0000) >> 16, - (peerIpAddr & 0xff000000) >> 24); - - } - - return NW_GTPV1U_OK; -} - - - -#ifdef __cplusplus -} -#endif - diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.h b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.h deleted file mode 100644 index 568c5b0796..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.h +++ /dev/null @@ -1,51 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C U D P E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - - -/** - * @file NwMiniUdpEntity.h - * @brief This file contains example of a minimalistic ULP entity. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwLog.h" - -#ifndef __NW_MINI_UDP_ENTITY_H__ -#define __NW_MINI_UDP_ENTITY_H__ - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -typedef struct { - uint32_t hSocket; - NwEventT ev; - NwGtpv1uStackHandleT hGtpv1uStack; -} NwMiniUdpEntityT; - -#ifdef __cplusplus -extern "C" { -#endif - -NwGtpv1uRcT nwMiniUdpInit(NwMiniUdpEntityT* thiz, NwGtpv1uStackHandleT hGtpv1uStack, uint8_t* ipAddr); - -NwGtpv1uRcT nwMiniUdpDestroy(NwMiniUdpEntityT* thiz); - -NwGtpv1uRcT nwMiniUdpDataReq(NwGtpv1uUdpHandleT udpHandle, - uint8_t* dataBuf, - uint32_t dataSize, - uint32_t peerAddr, - uint32_t peerPort); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.c b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.c deleted file mode 100644 index e2f505b4eb..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.c +++ /dev/null @@ -1,309 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C U L P E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - -/** - * @file NwMiniUlpEntity.c - * @brief This file contains example of a minimalistic ULP entity. -*/ - -#include -#include -#include -#include -#include "NwEvt.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uIe.h" -#include "NwMiniLogMgrEntity.h" -#include "NwMiniUlpEntity.h" - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Private Functions - *--------------------------------------------------------------------------*/ - -#define MAX_UDP_PAYLOAD_LEN (4096) - -NwGtpv1uRcT -nwMiniUlpSendEchoRequestToPeer(NwMiniUlpEntityT *thiz, uint32_t peerIp) -{ - NwGtpv1uRcT rc; - NwGtpv1uUlpApiT ulpReq; - - /* - * Send Message Request to Gtpv1u Stack Instance - */ - - ulpReq.apiType = NW_GTPV1U_ULP_API_INITIAL_REQ; - - ulpReq.apiInfo.initialReqInfo.hUlpTrxn = (NwGtpv1uUlpTrxnHandleT)thiz; - ulpReq.apiInfo.initialReqInfo.teid = 0x00; - ulpReq.apiInfo.initialReqInfo.peerIp = (peerIp); - ulpReq.apiInfo.initialReqInfo.peerPort = 2152; - - /* Send Echo Request*/ - - rc = nwGtpv1uMsgNew( thiz->hGtpv1uStack, - NW_TRUE, /* SeqNum flag */ - NW_FALSE, - NW_FALSE, - NW_GTP_ECHO_REQ, /* Msg Type */ - 0x00000000UL, /* TEID */ - 0x5678, /* Seq Number */ - 0, - 0, - (&ulpReq.hMsg)); - - NW_ASSERT( rc == NW_GTPV1U_OK ); - - rc = nwGtpv1uMsgAddIeTV1((ulpReq.hMsg), NW_GTPV1U_IE_RECOVERY, - thiz->restartCounter); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - rc = nwGtpv1uProcessUlpReq(thiz->hGtpv1uStack, &ulpReq); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - return NW_GTPV1U_OK; -} - -static -void NW_EVT_CALLBACK(nwMiniUlpDataIndicationCallbackData) -{ - NwMiniUlpEntityT *thiz = (NwMiniUlpEntityT *) arg; - NwGtpv1uRcT rc; - uint8_t udpBuf[MAX_UDP_PAYLOAD_LEN]; - NwS32T bytesRead; - uint32_t peerLen; - struct sockaddr_in peer; - - peerLen = sizeof(peer); - - bytesRead = recvfrom(thiz->hSocket, udpBuf, MAX_UDP_PAYLOAD_LEN , 0, - (struct sockaddr *) &peer,(socklen_t *) &peerLen); - - if(bytesRead) { - NW_LOG(NW_LOG_LEVEL_DEBG, "Received UDP message of length %u from %X:%u", - bytesRead, ntohl(peer.sin_addr.s_addr), ntohs(peer.sin_port)); - rc = nwMiniUlpTpduSend(thiz, udpBuf, bytesRead, thiz->localPort[fd]); - } else { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - } -} - -/*--------------------------------------------------------------------------- - * Public Functions - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwMiniUlpInit(NwMiniUlpEntityT *thiz, NwGtpv1uStackHandleT hGtpv1uStack) -{ - NwGtpv1uRcT rc; - thiz->hGtpv1uStack = hGtpv1uStack; - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwMiniUlpDestroy(NwMiniUlpEntityT *thiz) -{ - NW_ASSERT(thiz); - memset(thiz, 0, sizeof(NwMiniUlpEntityT)); - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwMiniUlpCreateConn(NwMiniUlpEntityT *thiz, char *localIpStr, uint16_t localport, - char *peerIpStr) -{ - NwGtpv1uRcT rc; - int sd; - struct sockaddr_in addr; - NwGtpv1uUlpApiT ulpReq; - - strcpy(thiz->peerIpStr, peerIpStr); - - /* - * Create local tunnel endpoint - */ - - NW_LOG(NW_LOG_LEVEL_NOTI, "Creating tunnel endpoint with teid %d", localport); - ulpReq.apiType = - NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT; - ulpReq.apiInfo.createTunnelEndPointInfo.teid = localport; - ulpReq.apiInfo.createTunnelEndPointInfo.hUlpSession = - (NwGtpv1uUlpSessionHandleT)thiz; - - rc = nwGtpv1uProcessUlpReq(thiz->hGtpv1uStack, &ulpReq); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - thiz->hGtpv1uConn = ulpReq.apiInfo.createTunnelEndPointInfo.hStackSession; - - /* - * Create local udp listening endpoint - */ - - sd = socket(AF_INET, SOCK_DGRAM, 0); - - if (sd < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } - - addr.sin_family = AF_INET; - addr.sin_port = htons(localport); - addr.sin_addr.s_addr = inet_addr(localIpStr); - memset(addr.sin_zero, '\0', sizeof (addr.sin_zero)); - - if(bind(sd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } - - event_set(&(thiz->ev[sd]), sd, EV_READ|EV_PERSIST, - nwMiniUlpDataIndicationCallbackData, thiz); - event_add(&(thiz->ev[sd]), NULL); - - thiz->localPort[sd] = localport; - - /* - * Create local udp for sendign data - */ - - sd = socket(AF_INET, SOCK_DGRAM, 0); - - if (sd < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } - - - thiz->hSocket = sd; - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwMiniUlpDestroyConn(NwMiniUlpEntityT *thiz) -{ - NwGtpv1uRcT rc; - NwGtpv1uUlpApiT ulpReq; - /*--------------------------------------------------------------------------- - * Send Destroy Session Request to GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - ulpReq.apiType = NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT; - ulpReq.apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle = thiz->hGtpv1uConn; - - rc = nwGtpv1uProcessUlpReq(thiz->hGtpv1uStack, &ulpReq); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - thiz->hGtpv1uConn = 0; - - return NW_GTPV1U_OK; -} - - -NwGtpv1uRcT -nwMiniUlpTpduSend(NwMiniUlpEntityT *thiz, uint8_t *tpduBuf, uint32_t tpduLen , - uint16_t fromPort) -{ - NwGtpv1uRcT rc; - NwGtpv1uUlpApiT ulpReq; - - /* - * Send Message Request to GTPv1u Stack Instance - */ - - ulpReq.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - ulpReq.apiInfo.sendtoInfo.teid = fromPort; - ulpReq.apiInfo.sendtoInfo.ipAddr = inet_addr(thiz->peerIpStr); - - rc = nwGtpv1uGpduMsgNew( thiz->hGtpv1uStack, - fromPort, - NW_FALSE, - thiz->seqNum++, - tpduBuf, - tpduLen, - &(ulpReq.apiInfo.sendtoInfo.hMsg)); - - NW_ASSERT( rc == NW_GTPV1U_OK ); - - rc = nwGtpv1uProcessUlpReq(thiz->hGtpv1uStack, &ulpReq); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - rc = nwGtpv1uMsgDelete(thiz->hGtpv1uStack, (ulpReq.apiInfo.sendtoInfo.hMsg)); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwMiniUlpProcessStackReqCallback (NwGtpv1uUlpHandleT hUlp, - NwGtpv1uUlpApiT *pUlpApi) -{ - NwMiniUlpEntityT *thiz; - NW_ASSERT(pUlpApi != NULL); - - thiz = (NwMiniUlpEntityT *) hUlp; - - switch(pUlpApi->apiType) { - case NW_GTPV1U_ULP_API_RECV_TPDU: { - struct sockaddr_in peerAddr; - NwS32T bytesSent; - uint8_t dataBuf[4096]; - uint32_t dataSize; - uint32_t peerIpAddr = (inet_addr(thiz->peerIpStr)); - - NW_ASSERT( NW_GTPV1U_OK == nwGtpv1uMsgGetTpdu(pUlpApi->apiInfo.recvMsgInfo.hMsg, - dataBuf, &dataSize) ); - - NW_LOG(NW_LOG_LEVEL_DEBG, "Received TPDU from gtpv1u stack %u!", - pUlpApi->apiInfo.recvMsgInfo.teid); - - peerAddr.sin_family = AF_INET; - peerAddr.sin_port = htons(pUlpApi->apiInfo.recvMsgInfo.teid); - peerAddr.sin_addr.s_addr = (peerIpAddr); - memset(peerAddr.sin_zero, '\0', sizeof (peerAddr.sin_zero)); - - bytesSent = sendto (thiz->hSocket, dataBuf, dataSize, 0, - (struct sockaddr *) &peerAddr, sizeof(peerAddr)); - - if(bytesSent < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } else { - NW_LOG(NW_LOG_LEVEL_DEBG, "Sent %u bytes to peer %u.%u.%u.%u", dataSize, - (peerIpAddr & 0x000000ff), - (peerIpAddr & 0x0000ff00) >> 8, - (peerIpAddr & 0x00ff0000) >> 16, - (peerIpAddr & 0xff000000) >> 24); - } - - NW_ASSERT(nwGtpv1uMsgDelete(thiz->hGtpv1uStack, - (pUlpApi->apiInfo.recvMsgInfo.hMsg)) == NW_GTPV1U_OK); - - } - break; - - default: - NW_LOG(NW_LOG_LEVEL_WARN, "Received undefined UlpApi (%d) from gtpv1u stack!", - pUlpApi->apiType); - } - - return NW_GTPV1U_OK; -} - -#ifdef __cplusplus -} -#endif - diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.h b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.h deleted file mode 100644 index dd55e8ed7c..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.h +++ /dev/null @@ -1,64 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C U L P E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - -/** - * @file NwMiniUlpEntity.h - * @brief This file contains example of a minimalistic ULP entity. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwLog.h" - -#ifndef __NW_MINI_ULP_H__ -#define __NW_MINI_ULP_H__ - -typedef struct { - int hSocket; - uint16_t seqNum; - uint8_t restartCounter; - uint8_t localIpStr[16]; - uint8_t peerIpStr[16]; - uint32_t localPort[1025]; - NwEventT ev[1025]; - NwGtpv1uStackHandleT hGtpv1uStack; - NwGtpv1uStackSessionHandleT hGtpv1uConn; -} NwMiniUlpEntityT; - -#ifdef __cplusplus -extern "C" { -#endif - -NwGtpv1uRcT -nwMiniUlpInit(NwMiniUlpEntityT* thiz, NwGtpv1uStackHandleT hGtpv1uStack); - -NwGtpv1uRcT -nwMiniUlpDestroy(NwMiniUlpEntityT* thiz); - -NwGtpv1uRcT -nwMiniUlpCreateConn(NwMiniUlpEntityT* thiz, char* localIpStr, uint16_t localPort, char* peerIpStr); - -NwGtpv1uRcT -nwMiniUlpDestroyConn(NwMiniUlpEntityT* thiz); - -NwGtpv1uRcT -nwMiniUlpSendMsg(NwMiniUlpEntityT* thiz); - -NwGtpv1uRcT -nwMiniUlpTpduSend(NwMiniUlpEntityT* thiz, uint8_t* tpduBuf, uint32_t tpduLen , uint16_t fromPort); - -NwGtpv1uRcT -nwMiniUlpProcessStackReqCallback (NwGtpv1uUlpHandleT hUlp, - NwGtpv1uUlpApiT *pUlpApi); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/helloworld.c b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/helloworld.c deleted file mode 100644 index 2f618ad642..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/helloworld.c +++ /dev/null @@ -1,207 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * M I N I M A L I S T I C D E M O N S T R A T I O N * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - - -/** - * @file hello-world.c - * @brief This is a test program demostrating usage of nw-gtpv2 library. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwGtpv1u.h" - -#include "NwMiniLogMgrEntity.h" -#include "NwMiniTmrMgrEntity.h" -#include "NwMiniUdpEntity.h" -#include "NwMiniUlpEntity.h" - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -/*--------------------------------------------------------------------------- - * T H E M A I N F U N C T I O N - *--------------------------------------------------------------------------*/ - -int main(int argc, char *argv[]) -{ - NwGtpv1uRcT rc; - char *logLevelStr; - uint32_t logLevel; - uint32_t num_of_connections; - - NwGtpv1uStackHandleT hGtpv1uStack = 0; - NwMiniUlpEntityT ulpObj; - NwMiniUdpEntityT udpObj; - NwMiniLogMgrT logObj; - NwGtpv1uUlpEntityT ulp; - NwGtpv1uUdpEntityT udp; - NwGtpv1uTimerMgrEntityT tmrMgr; - NwGtpv1uLogMgrEntityT logMgr; - - if(argc != 4) { - printf("Usage: %s \n", argv[0]); - exit(0); - } - - - logLevelStr = getenv ("NW_LOG_LEVEL"); - - if(logLevelStr == NULL) { - logLevel = NW_LOG_LEVEL_INFO; - } else { - if(strncmp(logLevelStr, "EMER",4) == 0) { - logLevel = NW_LOG_LEVEL_EMER; - } else if(strncmp(logLevelStr, "ALER",4) == 0) { - logLevel = NW_LOG_LEVEL_ALER; - } else if(strncmp(logLevelStr, "CRIT",4) == 0) { - logLevel = NW_LOG_LEVEL_CRIT; - } else if(strncmp(logLevelStr, "ERRO",4) == 0) { - logLevel = NW_LOG_LEVEL_ERRO ; - } else if(strncmp(logLevelStr, "WARN",4) == 0) { - logLevel = NW_LOG_LEVEL_WARN; - } else if(strncmp(logLevelStr, "NOTI",4) == 0) { - logLevel = NW_LOG_LEVEL_NOTI; - } else if(strncmp(logLevelStr, "INFO",4) == 0) { - logLevel = NW_LOG_LEVEL_INFO; - } else if(strncmp(logLevelStr, "DEBG",4) == 0) { - logLevel = NW_LOG_LEVEL_DEBG; - } - } - - /*--------------------------------------------------------------------------- - * Initialize event library - *--------------------------------------------------------------------------*/ - - NW_EVT_INIT(); - - /*--------------------------------------------------------------------------- - * Initialize Log Manager - *--------------------------------------------------------------------------*/ - - nwMiniLogMgrInit(&logObj, logLevel); - - /*--------------------------------------------------------------------------- - * Create GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - rc = nwGtpv1uInitialize(&hGtpv1uStack, GTPU_STACK_ENB); - - if(rc != NW_GTPV1U_OK) { - NW_LOG(NW_LOG_LEVEL_ERRO, - "Failed to create gtpv1u stack instance. Error '%u' occured", rc); - exit(1); - } - - NW_LOG(NW_LOG_LEVEL_INFO, "Gtpv1u Stack Handle '%X' Creation Successful!", - hGtpv1uStack); - - /*--------------------------------------------------------------------------- - * Set up Ulp Entity - *--------------------------------------------------------------------------*/ - - rc = nwMiniUlpInit(&ulpObj, hGtpv1uStack); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - ulp.hUlp = (NwGtpv1uUlpHandleT) &ulpObj; - ulp.ulpReqCallback = nwMiniUlpProcessStackReqCallback; - - rc = nwGtpv1uSetUlpEntity(hGtpv1uStack, &ulp); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - - /*--------------------------------------------------------------------------- - * Set up Udp Entity - *--------------------------------------------------------------------------*/ - - rc = nwMiniUdpInit(&udpObj, hGtpv1uStack, (argv[2])); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - udp.hUdp = (NwGtpv1uUdpHandleT) &udpObj; - udp.udpDataReqCallback = nwMiniUdpDataReq; - - rc = nwGtpv1uSetUdpEntity(hGtpv1uStack, &udp); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - /*--------------------------------------------------------------------------- - * Set up Log Entity - *--------------------------------------------------------------------------*/ - - tmrMgr.tmrMgrHandle = 0; - tmrMgr.tmrStartCallback = nwTimerStart; - tmrMgr.tmrStopCallback = nwTimerStop; - - rc = nwGtpv1uSetTimerMgrEntity(hGtpv1uStack, &tmrMgr); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - /*--------------------------------------------------------------------------- - * Set up Log Entity - *--------------------------------------------------------------------------*/ - - logMgr.logMgrHandle = (NwGtpv1uLogMgrHandleT) &logObj; - logMgr.logReqCallback = nwMiniLogMgrLogRequest; - - rc = nwGtpv1uSetLogMgrEntity(hGtpv1uStack, &logMgr); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - /*--------------------------------------------------------------------------- - * Set GTPv1u log level - *--------------------------------------------------------------------------*/ - - rc = nwGtpv1uSetLogLevel(hGtpv1uStack, logLevel); - - /*--------------------------------------------------------------------------- - * Send Create Session Request to GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - num_of_connections = atoi(argv[1]); - - while ( num_of_connections-- ) { - //rc = nwMiniUlpCreateConn(&ulpObj, argv[2], 1234 + num_of_connections, argv[3]); - rc = nwMiniUlpSendEchoRequestToPeer(&ulpObj, inet_addr(argv[3])); - NW_ASSERT( rc == NW_GTPV1U_OK ); - } - - /*--------------------------------------------------------------------------- - * Event loop - *--------------------------------------------------------------------------*/ - - NW_EVT_LOOP(); - - NW_LOG(NW_LOG_LEVEL_ERRO, "Exit from eventloop, no events to process!"); - - /*--------------------------------------------------------------------------- - * Send Destroy Session Request to GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - rc = nwMiniUlpDestroyConn(&ulpObj); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - - /*--------------------------------------------------------------------------- - * Destroy GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - rc = nwGtpv1uFinalize(hGtpv1uStack); - - if(rc != NW_GTPV1U_OK) { - NW_LOG(NW_LOG_LEVEL_ERRO, - "Failed to finalize gtpv1u stack instance. Error '%u' occured", rc); - } else { - NW_LOG(NW_LOG_LEVEL_INFO, "Gtpv1u Stack Handle '%X' Finalize Successful!", - hGtpv1uStack); - } - - - return rc; -} diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c deleted file mode 100644 index 8b9fc77bb1..0000000000 --- a/openair3/UDP/udp_eNB_task.c +++ /dev/null @@ -1,447 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file udp_eNB_task.c -* \brief -* \author Sebastien ROUX, Lionel Gauthier -* \company Eurecom -* \email: lionel.gauthier@eurecom.fr -*/ -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include "queue.h" -#include "intertask_interface.h" -#include "assertions.h" -#include "udp_eNB_task.h" - -#include "common/utils/LOG/log.h" -#include "common/utils/LOG/vcd_signal_dumper.h" -#include "msc.h" - - -#define IPV4_ADDR "%u.%u.%u.%u" -#define IPV4_ADDR_FORMAT(aDDRESS) \ - (uint8_t)((aDDRESS) & 0x000000ff), \ - (uint8_t)(((aDDRESS) & 0x0000ff00) >> 8 ), \ - (uint8_t)(((aDDRESS) & 0x00ff0000) >> 16), \ - (uint8_t)(((aDDRESS) & 0xff000000) >> 24) - - -struct udp_socket_desc_s { - int sd; /* Socket descriptor to use */ - - pthread_t listener_thread; /* Thread affected to recv */ - - char *local_address; /* Local ipv4 address to use */ - uint16_t local_port; /* Local port to use */ - - task_id_t task_id; /* Task who has requested the new endpoint */ - - STAILQ_ENTRY(udp_socket_desc_s) entries; -}; - -static STAILQ_HEAD(udp_socket_list_s, udp_socket_desc_s) udp_socket_list; -static pthread_mutex_t udp_socket_list_mutex = PTHREAD_MUTEX_INITIALIZER; - - -static -struct udp_socket_desc_s * -udp_eNB_get_socket_desc(task_id_t task_id); - -void udp_eNB_process_file_descriptors( - struct epoll_event *events, - int nb_events); - -static -int -udp_eNB_create_socket( - int port, - char *ip_addr, - task_id_t task_id); - -int -udp_eNB_send_to( - int sd, - uint16_t port, - uint32_t address, - const uint8_t *buffer, - uint32_t length); - -void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP); - -void *udp_eNB_task(void *args_p); - -int udp_enb_init(void); -/* @brief Retrieve the descriptor associated with the task_id - */ -static -struct udp_socket_desc_s *udp_eNB_get_socket_desc(task_id_t task_id) -{ - struct udp_socket_desc_s *udp_sock_p = NULL; - -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_T(UDP_, "Looking for task %d\n", task_id); -#endif - - STAILQ_FOREACH(udp_sock_p, &udp_socket_list, entries) { - if (udp_sock_p->task_id == task_id) { -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_T(UDP_, "Found matching task desc\n"); -#endif - break; - } - } - return udp_sock_p; -} - -void udp_eNB_process_file_descriptors(struct epoll_event *events, int nb_events) -{ - int i; - struct udp_socket_desc_s *udp_sock_p = NULL; - - if (events == NULL) { - return; - } - - for (i = 0; i < nb_events; i++) { - STAILQ_FOREACH(udp_sock_p, &udp_socket_list, entries) { - if (udp_sock_p->sd == events[i].data.fd) { -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_D(UDP_, "Found matching task desc\n"); -#endif - udp_eNB_receiver(udp_sock_p); - break; - } - } - } -} - -static -int udp_eNB_create_socket(int port, char *ip_addr, task_id_t task_id) -{ - - struct udp_socket_desc_s *udp_socket_desc_p = NULL; - int sd, rc; - struct sockaddr_in sin; - - LOG_I(UDP_, "Initializing UDP for local address %s with port %d\n", ip_addr, port); - - sd = socket(AF_INET, SOCK_DGRAM, 0); - AssertFatal(sd > 0, "UDP: Failed to create new socket: (%s:%d)\n", strerror(errno), errno); - - memset(&sin, 0, sizeof(struct sockaddr_in)); - sin.sin_family = AF_INET; - sin.sin_port = htons(port); - - if (ip_addr == NULL) { - sin.sin_addr.s_addr = inet_addr(INADDR_ANY); - } else { - sin.sin_addr.s_addr = inet_addr(ip_addr); - } - - if ((rc = bind(sd, (struct sockaddr *)&sin, sizeof(struct sockaddr_in))) < 0) { - close(sd); - LOG_E(UDP_, "Failed to bind socket: (%s:%d) address %s port %d\n", strerror(errno), errno, ip_addr, port); - return -1; - } - - /* Create a new descriptor for this connection */ - udp_socket_desc_p = calloc(1, sizeof(struct udp_socket_desc_s)); - - DevAssert(udp_socket_desc_p != NULL); - - udp_socket_desc_p->sd = sd; - udp_socket_desc_p->local_address = ip_addr; - udp_socket_desc_p->local_port = port; - udp_socket_desc_p->task_id = task_id; - - LOG_I(UDP_, "Inserting new descriptor for task %d, sd %d\n", udp_socket_desc_p->task_id, udp_socket_desc_p->sd); - pthread_mutex_lock(&udp_socket_list_mutex); - STAILQ_INSERT_TAIL(&udp_socket_list, udp_socket_desc_p, entries); - pthread_mutex_unlock(&udp_socket_list_mutex); - - itti_subscribe_event_fd(TASK_UDP, sd); - LOG_I(UDP_, "Initializing UDP for local address %s with port %d: DONE\n", ip_addr, port); - return sd; -} - -int -udp_eNB_send_to( - int sd, - uint16_t port, - uint32_t address, - const uint8_t *buffer, - uint32_t length) -{ - struct sockaddr_in to; - socklen_t to_length; - - if (sd <= 0 || ((buffer == NULL) && (length > 0))) { - LOG_E(UDP_, "udp_send_to: bad param\n"); - return -1; - } - - memset(&to, 0, sizeof(struct sockaddr_in)); - to_length = sizeof(to); - - to.sin_family = AF_INET; - to.sin_port = htons(port); - to.sin_addr.s_addr = address; - - if (sendto(sd, (void *)buffer, (size_t)length, 0, (struct sockaddr *)&to, - to_length) < 0) { - LOG_E(UDP_, - "[SD %d] Failed to send data to "IPV4_ADDR" on port %d, buffer size %u\n", - sd, IPV4_ADDR_FORMAT(address), port, length); - return -1; - } - -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_I(UDP_, "[SD %d] Successfully sent to "IPV4_ADDR - " on port %d, buffer size %u, buffer address %x\n", - sd, IPV4_ADDR_FORMAT(address), port, length, buffer); -#endif - return 0; -} - - -void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP) -{ - uint8_t l_buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - int n; - socklen_t from_len; - struct sockaddr_in addr; - MessageDef *message_p = NULL; - udp_data_ind_t *udp_data_ind_p = NULL; - uint8_t *forwarded_buffer = NULL; - - if (1) { - from_len = (socklen_t)sizeof(struct sockaddr_in); - - if ((n = recvfrom(udp_sock_pP->sd, l_buffer, sizeof(l_buffer), MSG_TRUNC, - (struct sockaddr *)&addr, &from_len)) < 0) { - LOG_E(UDP_, "Recvfrom failed %s\n", strerror(errno)); - return; - } else if (n > sizeof(l_buffer)) { - LOG_E(UDP_, "%s(%d). Message truncated. %d\n", __FUNCTION__, __LINE__, n); - return; - } else if (n == 0) { - LOG_W(UDP_, "Recvfrom returned 0\n"); - return; - } else { - forwarded_buffer = itti_malloc(TASK_UDP, udp_sock_pP->task_id, n*sizeof(uint8_t)); - DevAssert(forwarded_buffer != NULL); - memcpy(forwarded_buffer, l_buffer, n); - message_p = itti_alloc_new_message(TASK_UDP, 0, UDP_DATA_IND); - DevAssert(message_p != NULL); - udp_data_ind_p = &message_p->ittiMsg.udp_data_ind; - udp_data_ind_p->buffer = forwarded_buffer; - udp_data_ind_p->buffer_length = n; - udp_data_ind_p->peer_port = htons(addr.sin_port); - udp_data_ind_p->peer_address = addr.sin_addr.s_addr; - -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_I(UDP_, "Msg of length %d received from %s:%u\n", - n, inet_ntoa(addr.sin_addr), ntohs(addr.sin_port)); -#endif - - /* TODO: this is a hack. Let's accept failures and do nothing when - * it happens. Since itti_send_msg_to_task crashes when the message - * queue is full we wrote itti_try_send_msg_to_task that returns -1 - * if the queue is full. - */ - /* look for HACK_RLC_UM_LIMIT for others places related to the hack. Please do not remove this comment. */ - if (itti_send_msg_to_task(udp_sock_pP->task_id, INSTANCE_DEFAULT, message_p) < 0) { - LOG_E(UDP_, "Failed to send message %d to task %d\n", - UDP_DATA_IND, - udp_sock_pP->task_id); - itti_free(TASK_UDP, message_p); - itti_free(TASK_UDP, forwarded_buffer); - return; - } - } - } - - //close(udp_sock_p->sd); - //udp_sock_p->sd = -1; - - //pthread_mutex_lock(&udp_socket_list_mutex); - //STAILQ_REMOVE(&udp_socket_list, udp_sock_p, udp_socket_desc_s, entries); - //pthread_mutex_unlock(&udp_socket_list_mutex); -} - - -void *udp_eNB_task(void *args_p) -{ - int nb_events; - struct epoll_event *events; - MessageDef *received_message_p = NULL; - //const char *msg_name = NULL; - //instance_t instance = 0; - udp_enb_init(); - - itti_mark_task_ready(TASK_UDP); - MSC_START_USE(); - - while(1) { - itti_receive_msg(TASK_UDP, &received_message_p); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UDP_ENB_TASK, VCD_FUNCTION_IN); -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_D(UDP_, "Got message %p\n", &received_message_p); -#endif - - if (received_message_p != NULL) { - - //msg_name = ITTI_MSG_NAME (received_message_p); - //instance = ITTI_MSG_DESTINATION_INSTANCE (received_message_p); - - switch (ITTI_MSG_ID(received_message_p)) { - case UDP_INIT: { - LOG_D(UDP_, "Received UDP_INIT\n"); - udp_init_t *udp_init_p; - udp_init_p = &received_message_p->ittiMsg.udp_init; - udp_eNB_create_socket( - udp_init_p->port, - udp_init_p->address, - ITTI_MSG_ORIGIN_ID(received_message_p)); - } - break; - - case UDP_DATA_REQ: { -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_D(UDP_, "Received UDP_DATA_REQ\n"); -#endif - int udp_sd = -1; - ssize_t bytes_written; - - struct udp_socket_desc_s *udp_sock_p = NULL; - udp_data_req_t *udp_data_req_p; - struct sockaddr_in peer_addr; - - udp_data_req_p = &received_message_p->ittiMsg.udp_data_req; - - memset(&peer_addr, 0, sizeof(struct sockaddr_in)); - - peer_addr.sin_family = AF_INET; - peer_addr.sin_port = htons(udp_data_req_p->peer_port); - peer_addr.sin_addr.s_addr = udp_data_req_p->peer_address; - - pthread_mutex_lock(&udp_socket_list_mutex); - udp_sock_p = udp_eNB_get_socket_desc(ITTI_MSG_ORIGIN_ID(received_message_p)); - - if (udp_sock_p == NULL) { - LOG_E(UDP_, - "Failed to retrieve the udp socket descriptor " - "associated with task %d\n", - ITTI_MSG_ORIGIN_ID(received_message_p)); - pthread_mutex_unlock(&udp_socket_list_mutex); - - if (udp_data_req_p->buffer) { - itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), udp_data_req_p->buffer); - } - - goto on_error; - } - - udp_sd = udp_sock_p->sd; - pthread_mutex_unlock(&udp_socket_list_mutex); - -//#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_D(UDP_, "[%d] Sending message of size %u to "IPV4_ADDR" and port %u\n", - udp_sd, - udp_data_req_p->buffer_length, - IPV4_ADDR_FORMAT(udp_data_req_p->peer_address), - udp_data_req_p->peer_port); -//#endif - bytes_written = sendto( - udp_sd, - &udp_data_req_p->buffer[udp_data_req_p->buffer_offset], - udp_data_req_p->buffer_length, - 0, - (struct sockaddr *)&peer_addr, - sizeof(struct sockaddr_in)); - - if (bytes_written != udp_data_req_p->buffer_length) { - LOG_E(UDP_, "There was an error while writing to socket %d rc %zd" - "(%d:%s) May be normal if GTPU kernel module loaded on same host (may NF_DROP IP packet)\n", - udp_sd, bytes_written, errno, strerror(errno)); - } - - itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), udp_data_req_p->buffer); - } - break; - - case TERMINATE_MESSAGE: { - LOG_W(UDP_, " *** Exiting UDP thread\n"); - itti_exit_task(); - } - break; - - case MESSAGE_TEST: { - } break; - - default: { - LOG_W(UDP_, "Unkwnon message ID %d:%s\n", - ITTI_MSG_ID(received_message_p), - ITTI_MSG_NAME(received_message_p)); - } - break; - } - -on_error: - itti_free (ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p); - received_message_p = NULL; - } - - nb_events = itti_get_events(TASK_UDP, &events); - - /* Now handle notifications for other sockets */ - if (nb_events > 0) { -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_D(UDP_, "UDP task Process %d events\n",nb_events); -#endif - udp_eNB_process_file_descriptors(events, nb_events); - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UDP_ENB_TASK, VCD_FUNCTION_OUT); - } - - LOG_I(UDP_, "Task UDP eNB exiting\n"); - return NULL; -} - -int udp_enb_init(void) -{ - LOG_I(UDP_, "Initializing UDP task interface\n"); - STAILQ_INIT(&udp_socket_list); - LOG_I(UDP_, "Initializing UDP task interface: DONE\n"); - return 0; -} diff --git a/openair3/UDP/udp_eNB_task.h b/openair3/UDP/udp_eNB_task.h deleted file mode 100644 index 8b783f7455..0000000000 --- a/openair3/UDP/udp_eNB_task.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file udp_eNB_task.h -* \brief -* \author Sebastien ROUX, Lionel Gauthier -* \company Eurecom -* \email: lionel.gauthier@eurecom.fr -*/ -#include -#include - -#ifndef UDP_ENB_TASK_H_ -#define UDP_ENB_TASK_H_ -#include "enb_config.h" - - -/** \brief UDP recv callback prototype. Will be called every time a payload is - * received on socket. - * \param port Port on which data had been received - * \param address Sender Ipv4 address - * \param buffer Pointer to data (should be freed by user) - * \param length Length of message received - * \param arg_p User provided argument (transparent for wrappers) - * @returns Execution result - */ -typedef int (*udp_recv_callback)(uint16_t port, - uint32_t address, - uint8_t *buffer, - uint32_t length, - void *arg_p); - -typedef struct { - int sd; /* Socket descriptor to use */ - pthread_t listener_thread; /* Thread affected to recv */ - char *local_address; /* Local ipv4 address to use */ - uint16_t local_port; /* Local port to use */ - task_id_t task_id; /* Task who has requested the new endpoint */ -} udp_data_t; - -/** \brief Create new datagram connection-less socket and create new thread - * for data in downstream. - * \param ip_addr Local IPv4 address to use - * \param port Local port to use - * \param udp_data_p - * \param recv_callback Pointer to data (should be freed by user) - * \param arg_p Optionnal argument to pass to recv_callback - * @returns < 0 on failure or socket descriptor on success - */ -int udp_create_connection(char *ip_addr, uint16_t port, - udp_data_t *udp_data_p, - udp_recv_callback recv_callback, - void *arg_p); - -/** \brief Send buffer to remote peer. - * \param sd socket descriptor to use - * \param port remote port - * \param address remote address - * \param buffer Data buffer to send - * \param length Buffer length - * @returns < 0 on failure or socket descriptor on success - */ -int udp_send_to(int sd, uint16_t port, uint32_t address, - const uint8_t *buffer, uint32_t length); - - -/** \brief UDP ITTI task on eNB. - * \param args_p - * @returns always NULL - */ -void *udp_eNB_task(void *args_p); - -/** \brief init UDP layer. - * \param enb_config_p configuration of eNB - * @returns always 0 - */ -int udp_enb_init(void); - -#endif /* UDP_ENB_TASK_H_ */ diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index 64146bc7ca..379ec415dc 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -46,7 +46,7 @@ typedef struct Gtpv1uMsgHeader { #define GTP_GPDU (255) -typedef struct ocp_gtpv1u_bearer_s { +typedef struct gtpv1u_bearer_s { /* TEID used in dl and ul */ teid_t teid_incoming; ///< eNB TEID teid_t teid_outgoing; ///< Remote TEID @@ -55,10 +55,10 @@ typedef struct ocp_gtpv1u_bearer_s { tcp_udp_port_t outgoing_port; uint16_t seqNum; uint8_t npduNum; -} ocp_gtpv1u_bearer_t; +} gtpv1u_bearer_t; typedef struct { - map bearers; + map bearers; } teidData_t; typedef struct { @@ -173,7 +173,7 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b return; } - map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); + map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); if ( ptr2 == ptrRnti->second.bearers.end() ) { LOG_E(GTPU,"[%ld] GTP-U instance: sending a packet to a non existant RNTI:RAB: %x/%x\n", instance, rnti, rab_id); @@ -191,7 +191,7 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b ptr2->second.npduNum++; // copy to release the mutex - ocp_gtpv1u_bearer_t tmp=ptr2->second; + gtpv1u_bearer_t tmp=ptr2->second; pthread_mutex_unlock(&globGtp.gtp_lock); gtpv1uCreateAndSendMsg(compatInst(instance), tmp.outgoing_ip_addr, @@ -216,7 +216,7 @@ static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req, return; } - map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); + map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); if ( ptr2 == ptrRnti->second.bearers.end() ) { LOG_D(GTPU,"GTP-U instance: %ld sending a packet to a non existant RNTI:RAB: %x/%x\n", instance, rnti, rab_id); @@ -234,7 +234,7 @@ static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req, ptr2->second.npduNum++; // copy to release the mutex - ocp_gtpv1u_bearer_t tmp=ptr2->second; + gtpv1u_bearer_t tmp=ptr2->second; pthread_mutex_unlock(&globGtp.gtp_lock); gtpv1uCreateAndSendMsg(compatInst(instance), tmp.outgoing_ip_addr, @@ -257,7 +257,7 @@ static void gtpv1uEndTunnel(instance_t instance, gtpv1u_enb_tunnel_data_req_t *r return; } - map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); + map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); if ( ptr2 == ptrRnti->second.bearers.end() ) { LOG_E(GTPU,"[%ld] GTP-U sending a packet to a non existant RNTI:RAB: %x/%x\n", instance, rnti, rab_id); @@ -267,7 +267,7 @@ static void gtpv1uEndTunnel(instance_t instance, gtpv1u_enb_tunnel_data_req_t *r LOG_D(GTPU,"[%ld] sending a end packet packet to RNTI:RAB:teid %x/%x/%x\n", instance, rnti, rab_id,ptr2->second.teid_outgoing); - ocp_gtpv1u_bearer_t tmp=ptr2->second; + gtpv1u_bearer_t tmp=ptr2->second; pthread_mutex_unlock(&globGtp.gtp_lock); Gtpv1uMsgHeaderT msgHdr; // N should be 0 for us (it was used only in 2G and 3G) @@ -383,12 +383,12 @@ static int udpServerSocket(openAddr_s addr) { return sockfd; } -instance_t ocp_gtpv1Init(openAddr_t context) { +instance_t gtpv1Init(openAddr_t context) { pthread_mutex_lock(&globGtp.gtp_lock); int id=udpServerSocket(context); if (id>=0) { - itti_subscribe_event_fd(OCP_GTPV1_U, id); + itti_subscribe_event_fd(TASK_GTPV1_U, id); } else LOG_E(GTPU,"can't create GTP-U instance\n"); @@ -408,7 +408,7 @@ void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer return; } - map::iterator ptr2=ptrRnti->second.bearers.find(bearer_id); + map::iterator ptr2=ptrRnti->second.bearers.find(bearer_id); if ( ptr2 == ptrRnti->second.bearers.end() ) { LOG_E(GTPU,"[%ld] Update tunnel for a existing rnti %x, but wrong bearer_id %u\n", instance, rnti, bearer_id); @@ -447,7 +447,7 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer inst->te2ue_mapping[incoming_teid].callBack=callBack; - ocp_gtpv1u_bearer_t *tmp=&inst->ue2te_mapping[rnti].bearers[outgoing_bearer_id]; + gtpv1u_bearer_t *tmp=&inst->ue2te_mapping[rnti].bearers[outgoing_bearer_id]; int addrs_length_in_bytes = remoteAddr.length / 8; @@ -487,7 +487,7 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer return incoming_teid; } -int ocp_gtpv1u_create_s1u_tunnel(instance_t instance, +int gtpv1u_create_s1u_tunnel(instance_t instance, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) { LOG_D(GTPU, "[%ld] Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x\n", @@ -521,7 +521,7 @@ int ocp_gtpv1u_create_s1u_tunnel(instance_t instance, return !GTPNOK; } -int ocp_gtpv1u_update_s1u_tunnel( +int gtpv1u_update_s1u_tunnel( const instance_t instance, const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req, const rnti_t prior_rnti @@ -546,7 +546,7 @@ int ocp_gtpv1u_update_s1u_tunnel( LOG_W(GTPU,"[%ld] Update a not existing tunnel, start create the new one (new rnti %x, old rnti %x)\n", instance, create_tunnel_req->rnti, prior_rnti); pthread_mutex_unlock(&globGtp.gtp_lock); gtpv1u_enb_create_tunnel_resp_t tmp; - (void)ocp_gtpv1u_create_s1u_tunnel(instance, create_tunnel_req, &tmp); + (void)gtpv1u_create_s1u_tunnel(instance, create_tunnel_req, &tmp); return 0; } @@ -593,14 +593,14 @@ int gtpv1u_update_ngu_tunnel( return GTPNOK; } -int ocp_gtpv1u_create_x2u_tunnel( +int gtpv1u_create_x2u_tunnel( const instance_t instanceP, const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP, gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP) { AssertFatal( false, "to be developped\n"); } -int newGtpuDeleteTunnel(instance_t instance, rnti_t rnti) { + int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) { LOG_D(GTPU, "[%ld] Start delete tunnels for RNTI %x\n", instance, rnti); pthread_mutex_lock(&globGtp.gtp_lock); @@ -627,20 +627,58 @@ int newGtpuDeleteTunnel(instance_t instance, rnti_t rnti) { LOG_I(GTPU, "[%ld] Deleted all tunnels for RNTI %x (%d tunnels deleted)\n", instance, rnti, nb); return !GTPNOK; } - -// Legacy delete tunnel finish by deleting all the rnti -// so the list of bearer provided is only a design bug -int ocp_gtpv1u_delete_s1u_tunnel( const instance_t instance, + + // Legacy delete tunnel finish by deleting all the rnti + // so the list of bearer provided is only a design bug + int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { - return newGtpuDeleteTunnel(instance, req_pP->rnti); + return newGtpuDeleteAllTunnels(instance, req_pP->rnti); } + + int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id) { + LOG_D(GTPU, "[%ld] Start delete tunnels for RNTI %x\n", + instance, rnti); + pthread_mutex_lock(&globGtp.gtp_lock); + auto inst=&globGtp.instances[compatInst(instance)]; + auto ptrRNTI=inst->ue2te_mapping.find(rnti); + if ( ptrRNTI == inst->ue2te_mapping.end() ) { + LOG_W(GTPU,"[%ld] Delete GTP tunnels for rnti: %x, but no tunnel exits\n", instance, rnti); + pthread_mutex_unlock(&globGtp.gtp_lock); + return -1; + } + + int nb=0; + + for (int i=0; isecond.bearers.find(pdusession_id[i]); + if ( ptr2 == ptrRNTI->second.bearers.end() ) { + LOG_E(GTPU,"[%ld] GTP-U instance: delete of not existing tunnel RNTI:RAB: %x/%x\n", instance, rnti,pdusession_id[i]); + } else { + inst->te2ue_mapping.erase(ptr2->second.teid_incoming); + nb++; + } + } + + if (ptrRNTI->second.bearers.size() == 0 ) + // no tunnels on this rnti, erase the ue entry + inst->ue2te_mapping.erase(ptrRNTI); + pthread_mutex_unlock(&globGtp.gtp_lock); + LOG_I(GTPU, "[%ld] Deleted all tunnels for RNTI %x (%d tunnels deleted)\n", instance, rnti, nb); + return !GTPNOK; + } + int gtpv1u_delete_x2u_tunnel( const instance_t instanceP, - const gtpv1u_enb_delete_tunnel_req_t *const req_pP, - int enbflag) { + const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + LOG_E(GTPU,"x2 tunnel not implemented\n"); return 0; } - + +int gtpv1u_delete_ngu_tunnel( const instance_t instance, + gtpv1u_gnb_delete_tunnel_req_t * req) { + return newGtpuDeleteTunnels(instance, req->rnti, req->num_pdusession, req->pdusession_id); +} + static int Gtpv1uHandleEchoReq(int h, uint8_t *msgBuf, uint32_t msgBufLen, @@ -871,14 +909,14 @@ void gtpv1uReceiver(int h) { #include -void *ocp_gtpv1uTask(void *args) { +void *gtpv1uTask(void *args) { while(1) { /* Trying to fetch a message from the message queue. If the queue is empty, this function will block till a message is sent to the task. */ MessageDef *message_p = NULL; - itti_receive_msg(OCP_GTPV1_U, &message_p); + itti_receive_msg(TASK_GTPV1_U, &message_p); if (message_p != NULL ) { openAddr_t addr= {0}; @@ -888,7 +926,7 @@ void *ocp_gtpv1uTask(void *args) { case GTPV1U_ENB_TUNNEL_DATA_REQ: { gtpv1uSend(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)), >PV1U_ENB_TUNNEL_DATA_REQ(message_p), false, false); - itti_free(OCP_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer); + itti_free(TASK_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer); } break; @@ -908,7 +946,7 @@ void *ocp_gtpv1uTask(void *args) { case GTPV1U_ENB_END_MARKER_REQ: gtpv1uEndTunnel(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)), >PV1U_ENB_TUNNEL_DATA_REQ(message_p)); - itti_free(OCP_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer); + itti_free(TASK_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer); break; case GTPV1U_ENB_DATA_FORWARDING_REQ: @@ -923,7 +961,7 @@ void *ocp_gtpv1uTask(void *args) { strcpy(addr.originHost, GTPV1U_REQ(message_p).localAddrStr); strcpy(addr.originService, GTPV1U_REQ(message_p).localPortStr); strcpy(addr.destinationService,addr.originService); - AssertFatal((legacyInstanceMapping=ocp_gtpv1Init(addr))!=0,"Instance 0 reserved for legacy\n"); + AssertFatal((legacyInstanceMapping=gtpv1Init(addr))!=0,"Instance 0 reserved for legacy\n"); break; default: @@ -932,12 +970,12 @@ void *ocp_gtpv1uTask(void *args) { break; } - AssertFatal(EXIT_SUCCESS==itti_free(OCP_GTPV1_U, message_p), "Failed to free memory!\n"); + AssertFatal(EXIT_SUCCESS==itti_free(TASK_GTPV1_U, message_p), "Failed to free memory!\n"); } struct epoll_event *events; - int nb_events = itti_get_events(OCP_GTPV1_U, &events); + int nb_events = itti_get_events(TASK_GTPV1_U, &events); for (int i = 0; i < nb_events; i++) if ((events[i].events&EPOLLIN)) diff --git a/openair3/ocp-gtpu/gtp_itf.h b/openair3/ocp-gtpu/gtp_itf.h index 3893acf40f..22a86bc887 100644 --- a/openair3/ocp-gtpu/gtp_itf.h +++ b/openair3/ocp-gtpu/gtp_itf.h @@ -8,19 +8,6 @@ extern "C" { #endif -#include -#if defined(NEW_GTPU) -#define gtpv1u_create_s1u_tunnel ocp_gtpv1u_create_s1u_tunnel -#define gtpv1u_update_s1u_tunnel ocp_gtpv1u_update_s1u_tunnel -#define gtpv1u_delete_s1u_tunnel ocp_gtpv1u_delete_s1u_tunnel -#define gtpv1u_create_x2u_tunnel ocp_gtpv1u_create_x2u_tunnel -#define gtpv1u_eNB_task ocp_gtpv1uTask -#define nr_gtpv1u_gNB_task ocp_gtpv1uTask -#define TASK_VARIABLE OCP_GTPV1_U -#else -#define TASK_VARIABLE TASK_GTPV1_U -#endif - typedef boolean_t (*gtpCallback)( protocol_ctxt_t *ctxt_pP, const srb_flag_t srb_flagP, @@ -43,18 +30,18 @@ typedef struct openAddr_s { // the init function create a gtp instance and return the gtp instance id // the parameter originInstance will be sent back in each message from gtp to the creator -void ocp_gtpv1uReceiver(int h); -void ocp_gtpv1uProcessTimeout(int handle,void *arg); -int ocp_gtpv1u_create_s1u_tunnel(const instance_t instance, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, +void gtpv1uReceiver(int h); +void gtpv1uProcessTimeout(int handle,void *arg); +int gtpv1u_create_s1u_tunnel(const instance_t instance, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp); -int ocp_gtpv1u_update_s1u_tunnel(const instance_t instanceP, +int gtpv1u_update_s1u_tunnel(const instance_t instanceP, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req_pP, const rnti_t prior_rnti ); -int ocp_gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); +int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); -int ocp_gtpv1u_create_x2u_tunnel( +int gtpv1u_create_x2u_tunnel( const instance_t instanceP, const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP, gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP); @@ -64,8 +51,10 @@ int ocp_gtpv1u_create_x2u_tunnel( teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_rb_id, teid_t teid, transport_layer_addr_t remoteAddr, int port, gtpCallback callBack); void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer_id, teid_t newOutgoingTeid); -instance_t ocp_gtpv1Init(openAddr_t context); -void *ocp_gtpv1uTask(void *args); +int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti); + int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id); +instance_t gtpv1Init(openAddr_t context); +void *gtpv1uTask(void *args); #ifdef __cplusplus } diff --git a/openair3/GTPV1-U/gtpv1u_eNB_defs.h b/openair3/ocp-gtpu/gtpv1u_eNB_task.h similarity index 61% rename from openair3/GTPV1-U/gtpv1u_eNB_defs.h rename to openair3/ocp-gtpu/gtpv1u_eNB_task.h index fb317e4ca6..dbfb6ae917 100644 --- a/openair3/GTPV1-U/gtpv1u_eNB_defs.h +++ b/openair3/ocp-gtpu/gtpv1u_eNB_task.h @@ -19,32 +19,23 @@ * contact@openairinterface.org */ -/*! \file gtpv1u_eNB_defs.h - * \brief - * \author Sebastien ROUX, Lionel GAUTHIER - * \version 1.0 - * \company Eurecom - * \email: lionel.gauthier@eurecom.fr - */ +/*! \file gtpv1u_eNB_task.h +* \brief +* \author Lionel Gauthier +* \company Eurecom +* \email: lionel.gauthier@eurecom.fr +*/ -#include "hashtable.h" -#include "LTE_asn_constant.h" +#ifndef GTPV1U_ENB_TASK_H_ +#define GTPV1U_ENB_TASK_H_ -#ifndef GTPV1U_ENB_DEFS_H_ -#define GTPV1U_ENB_DEFS_H_ +typedef struct gtpv1u_data_s { + /* RB tree of UEs */ + hash_table_t *ue_mapping; +} gtpv1u_data_t; -#include "NwGtpv1u.h" - -#define GTPV1U_UDP_PORT (2152) #define GTPV1U_BEARER_OFFSET 3 - #define GTPV1U_MAX_BEARERS_ID (max_val_LTE_DRB_Identity - GTPV1U_BEARER_OFFSET) - -#define GTPV1U_SOURCE_ENB (0) -#define GTPV1U_TARGET_ENB (1) -#define GTPV1U_MSG_FROM_SOURCE_ENB (0) -#define GTPV1U_MSG_FROM_SPGW (1) - typedef enum { BEARER_DOWN = 0, BEARER_IN_CONFIG, @@ -54,16 +45,7 @@ typedef enum { BEARER_MAX, } bearer_state_t; - -typedef struct gtpv1u_teid_data_s { - /* UE identifier for oaisim stack */ - module_id_t enb_id; - rnti_t ue_id; - ebi_t eps_bearer_id; -} gtpv1u_teid_data_t; - - -typedef struct gtpv1u_bearer_s { +typedef struct fixMe_gtpv1u_bearer_s { /* TEID used in dl and ul */ teid_t teid_eNB; ///< eNB TEID uintptr_t teid_eNB_stack_session; ///< eNB TEID @@ -76,7 +58,7 @@ typedef struct gtpv1u_bearer_s { tcp_udp_port_t port; //NwGtpv1uStackSessionHandleT stack_session; bearer_state_t state; -} gtpv1u_bearer_t; +} fixMe_gtpv1u_bearer_t; typedef struct gtpv1u_ue_data_s { /* UE identifier for oaisim stack */ @@ -89,45 +71,43 @@ typedef struct gtpv1u_ue_data_s { * Note that the first LCID available for data is 3 and we fixed the maximum * number of e-rab per UE to be (32 [id range]), max RB is 11. The real rb id will 3 + rab_id (3..32). */ - gtpv1u_bearer_t bearers[GTPV1U_MAX_BEARERS_ID]; + fixMe_gtpv1u_bearer_t bearers[GTPV1U_MAX_BEARERS_ID]; //RB_ENTRY(gtpv1u_ue_data_s) gtpv1u_ue_node; } gtpv1u_ue_data_t; - -typedef struct gtpv1u_data_s { - /* nwgtpv1u stack internal data */ - NwGtpv1uStackHandleT gtpv1u_stack; - - /* RB tree of UEs */ - hash_table_t *ue_mapping; // PDCP->GTPV1U - hash_table_t *teid_mapping; // GTPV1U -> PDCP - - //RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head; - /* Local IP address to use */ - in_addr_t enb_ip_address_for_S1u_S12_S4_up; - /* UDP internal data */ - //udp_data_t udp_data; - - uint16_t seq_num; - uint8_t restart_counter; - -} gtpv1u_data_t; - +/* int gtpv1u_new_data_req( - uint8_t enb_module_idP, - rnti_t ue_rntiP, - uint8_t rab_idP, - uint8_t *buffer_pP, - uint32_t buf_lenP, - uint32_t buf_offsetP -); + uint8_t enb_id, + uint8_t ue_id, + uint8_t rab_id, + uint8_t *buffer, + uint32_t buf_len, + uint32_t buf_offset);*/ + +int gtpv1u_eNB_init(void); +void *gtpv1u_eNB_process_itti_msg(void*); +void *gtpv1u_eNB_task(void *args); int -gtpv1u_initial_req( - gtpv1u_data_t *gtpv1u_data_p, - uint32_t teid, - uint16_t port, - uint32_t address); +gtpv1u_create_x2u_tunnel( + const instance_t instanceP, + const gtpv1u_enb_create_x2u_tunnel_req_t * const create_tunnel_req_pP, + gtpv1u_enb_create_x2u_tunnel_resp_t * const create_tunnel_resp_pP); -#endif /* GTPV1U_ENB_DEFS_H_ */ +int +gtpv1u_create_s1u_tunnel( + const instance_t instanceP, + const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, + gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP); + +int +gtpv1u_update_s1u_tunnel( + const instance_t instanceP, + const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, + const rnti_t prior_rnti); + +int gtpv1u_delete_x2u_tunnel( + const instance_t instanceP, + const gtpv1u_enb_delete_tunnel_req_t * const req_pP); +#endif /* GTPV1U_ENB_TASK_H_ */ diff --git a/openair3/GTPV1-U/gtpv1u_gNB_task.h b/openair3/ocp-gtpu/gtpv1u_gNB_task.h similarity index 94% rename from openair3/GTPV1-U/gtpv1u_gNB_task.h rename to openair3/ocp-gtpu/gtpv1u_gNB_task.h index fcfaa90304..cc36ee26fc 100644 --- a/openair3/GTPV1-U/gtpv1u_gNB_task.h +++ b/openair3/ocp-gtpu/gtpv1u_gNB_task.h @@ -47,5 +47,8 @@ gtpv1u_update_ngu_tunnel( const rnti_t prior_rnti ); +int gtpv1u_delete_ngu_tunnel( const instance_t instance, + gtpv1u_gnb_delete_tunnel_req_t *req); + #endif /* GTPV1U_GNB_TASK_H_ */ diff --git a/targets/COMMON/create_tasks.c b/targets/COMMON/create_tasks.c index 4463228dc7..a6ae906d9d 100644 --- a/targets/COMMON/create_tasks.c +++ b/targets/COMMON/create_tasks.c @@ -28,7 +28,6 @@ #include "sctp_eNB_task.h" #include "x2ap_eNB.h" #include "s1ap_eNB.h" - #include "udp_eNB_task.h" #include "gtpv1u_eNB_task.h" #if ENABLE_RAL #include "lteRALue.h" @@ -67,11 +66,7 @@ int create_tasks(uint32_t enb_nb) { if (EPC_MODE_ENABLED && !NODE_IS_DU(type) && ! ( split73==SPLIT73_DU ) ) { rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL); AssertFatal(rc >= 0, "Create task for S1AP failed\n"); - if (!(get_softmodem_params()->emulate_rf)){ - rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL); - AssertFatal(rc >= 0, "Create task for UDP failed\n"); - } - rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL); + rc = itti_create_task(TASK_GTPV1_U, gtpv1uTask, NULL); AssertFatal(rc >= 0, "Create task for GTPV1U failed\n"); } @@ -91,7 +86,7 @@ int create_tasks(uint32_t enb_nb) { rc = itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL); AssertFatal(rc >= 0, "Create task for DU F1AP failed\n"); // DU is now GTP-U instead of protobuf - rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL); + rc = itti_create_task(TASK_GTPV1_U, gtpv1uTask, NULL); AssertFatal(rc >= 0, "Create task for GTPV1U failed\n"); } diff --git a/targets/COMMON/create_tasks_mbms.c b/targets/COMMON/create_tasks_mbms.c index 1cd3bb2f3a..b82b4f158b 100644 --- a/targets/COMMON/create_tasks_mbms.c +++ b/targets/COMMON/create_tasks_mbms.c @@ -28,7 +28,6 @@ #include "sctp_eNB_task.h" #include "x2ap_eNB.h" #include "s1ap_eNB.h" - #include "udp_eNB_task.h" #include "gtpv1u_eNB_task.h" #include "m2ap_eNB.h" #include "m2ap_MCE.h" @@ -75,46 +74,10 @@ int create_tasks_mbms(uint32_t enb_nb) { rc = itti_create_task (TASK_MCE_APP, MCE_app_task, NULL); AssertFatal(rc >= 0, "Create task for MCE APP failed\n"); - -// LOG_I(ENB_APP, "Creating ENB_APP eNB Task\n"); -// rc = itti_create_task (TASK_ENB_APP, eNB_app_task, NULL); -// AssertFatal(rc >= 0, "Create task for eNB APP failed\n"); -// -// LOG_I(RRC,"Creating RRC eNB Task\n"); -// rc = itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL); -// AssertFatal(rc >= 0, "Create task for RRC eNB failed\n"); -// -// if (EPC_MODE_ENABLED) { -// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL); -// AssertFatal(rc >= 0, "Create task for SCTP failed\n"); -// } -// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL); -// AssertFatal(rc >= 0, "Create task for SCTP failed\n"); -// -// -// if (EPC_MODE_ENABLED && !NODE_IS_DU(type)) { -// rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL); -// AssertFatal(rc >= 0, "Create task for S1AP failed\n"); -// if (!(get_softmodem_params()->emulate_rf)){ -// rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL); -// AssertFatal(rc >= 0, "Create task for UDP failed\n"); -// } -// rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL); -// AssertFatal(rc >= 0, "Create task for GTPV1U failed\n"); -// if (is_x2ap_enabled()) { -// rc = itti_create_task(TASK_X2AP, x2ap_task, NULL); -// AssertFatal(rc >= 0, "Create task for X2AP failed\n"); -// } else { -// LOG_I(X2AP, "X2AP is disabled.\n"); -// } -// } -//// if(!EPC_MODE_ENABLED){ // rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL); // AssertFatal(rc >= 0, "Create task for SCTP failed\n"); - rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL); - AssertFatal(rc >= 0, "Create task for UDP failed\n"); - rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL); + rc = itti_create_task(TASK_GTPV1_U, gtpv1uTask, NULL); AssertFatal(rc >= 0, "Create task for GTPV1U failed\n"); } /// diff --git a/targets/COMMON/create_tasks_ue.c b/targets/COMMON/create_tasks_ue.c index 9341107af9..cdca62c399 100644 --- a/targets/COMMON/create_tasks_ue.c +++ b/targets/COMMON/create_tasks_ue.c @@ -27,7 +27,6 @@ #include "sctp_eNB_task.h" #include "s1ap_eNB.h" #include "openair3/NAS/UE/nas_ue_task.h" - #include "udp_eNB_task.h" #include "gtpv1u_eNB_task.h" #if ENABLE_RAL #include "lteRALue.h" diff --git a/targets/RT/USER/TOOLS/thread_ipc.h b/targets/RT/USER/TOOLS/thread_ipc.h deleted file mode 100644 index ec008c30df..0000000000 --- a/targets/RT/USER/TOOLS/thread_ipc.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -#ifndef __THREAD_IPC_H__ -#define __THREAD_IPC_H__ - - -#define SUB_FRAME_LENGTH 7680 -#define FRAME_LENGTH 76800 - -#define UE_UL_DELAY 6 /*设置上行组帧在同步时钟基础上的延时(子帧个数)*/ -#define UE_UL_SEND_DELAY 6 /*上行发送子帧号在接收子帧时间戳上的延时(子帧个数)*/ - -#define BUFFERMAX 5 /*环形缓冲区个数*/ -#define LOWBUFFER 3 /*环形缓冲区下限, 不能为0*/ -#define HIGHBUFFER 4 /*环形缓冲区上限*/ - -typedef struct { - long long subframe_num; /*子帧编号*/ - int buffer[SUB_FRAME_LENGTH * 2]; /*一子帧数据*/ -} buffer_t; - -typedef struct { - int packet_num; /*环形缓冲区数据包计数器,表示环形缓冲区有效数据包个数*/ - int isfull; /*标记环形缓冲区有效数据包是否达到上限标志*/ - int isempty; /*标记环形缓冲区有效数据包是否达到下限标志*/ - - pthread_mutex_t buffer_mutex; /*环形缓冲区操作保护锁*/ - pthread_cond_t full_cond; /*环形缓冲区上限条件变量,配合isfull使用 */ - pthread_cond_t empty_cond; /*环形缓冲区下限条件变量,配合isempty使用*/ - - buffer_t loop_buf[BUFFERMAX]; /*环形缓冲区*/ -} loop_buffer_op_t; - -typedef struct { - int decoding_subframe_num; /*待解码子帧的编号*/ - pthread_mutex_t buffer_mutex; /*对sync_buffer临界区的保护锁*/ - int sync_buffer[SUB_FRAME_LENGTH * 10]; /*同步线程与下行解码线程数据共享缓冲区*/ -} sync_buffer_t; - -typedef struct { - unsigned int rx_timestamp; /*接收数据包第一个sample时间戳*/ - unsigned int tx_timestamp; /*待发送数据包的时间戳*/ - unsigned long long current_subframe; /*当前子帧编号*/ - - int ue_sync_state; /*表示UE是否在同步状态,0表示失同步,1表示同步*/ - pthread_mutex_t sync_mutex; /*根据ue_sync_state标志,唤醒组帧线程*/ - - pthread_mutex_t ul_send_mutex; /*用于sync线程唤醒发送线程发送数据*/ - pthread_mutex_t dl_decode_mutex;/*下行解码保护锁,用于sync线程唤醒解码线程解码*/ - - loop_buffer_op_t loop_buffer; - sync_buffer_t sync_buffer; -} g_thread_ipc_t; - -void loop_buffer_reset(buffer_t *loop_buf); -int thread_ipc_init(void); -int thread_ipc_deinit(void); -int set_thread_attr(pthread_attr_t *attr, int policy, int priority, int cpuid); -int find_subframe_num(unsigned long long current_subframe_num, buffer_t *buf, int *flag); -int ue_unsync_thread_ipc_reset(void); - -extern g_thread_ipc_t thread_ipc; - -#endif From 00e058537d0bbc05da3cf4564179474484685e3d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 26 Jan 2022 16:34:41 +0100 Subject: [PATCH 101/196] Remove MSC library, it is not used anywhere --- ci-scripts/yaml_files/fr1_epc_20897/mme.conf | 1 - .../yaml_files/magma_nsa_20897/mme.conf | 1 - cmake_targets/CMakeLists.txt | 31 +- cmake_targets/at_commands/CMakeLists.txt | 2 - cmake_targets/build_oai | 2 +- cmake_targets/epc_test/CMakeLists.template | 1 - .../install_external_packages.ubuntu20 | 1 - .../s1c_mme_test/CMakeLists.template | 1 - cmake_targets/tools/build_helper | 3 +- .../tools/example_enb_exmimo_mme_hss.txt | 13 +- .../example_oaisim_enb_ue_mme_virtual.txt | 13 +- cmake_targets/tools/run_enb_s1_usrp | 38 - cmake_targets/tools/run_enb_ue_virt_noS1 | 32 - cmake_targets/tools/run_enb_ue_virt_s1 | 35 - common/config/DOC/config/rtusage.md | 1 - common/utils/LOG/DOC/rtusage.md | 3 - common/utils/LOG/log.c | 1 - common/utils/LOG/log.h | 1 - common/utils/msc/msc.c | 785 ------------------ common/utils/msc/msc.h | 131 --- common/utils/ocp_itti/intertask_interface.h | 2 - common/utils/telnetsrv/DOC/telnetlog.md | 1 - .../oai_enb.log | 1 - .../oai_gnb.log | 1 - executables/nr-softmodem-common.h | 3 - executables/nr-softmodem.c | 3 - executables/ocp-gnb.c | 1 - executables/softmodem-common.c | 1 - executables/softmodem-common.h | 4 - openair1/PHY/INIT/lte_init.c | 2 - openair1/PHY/INIT/nr_init.c | 1 - openair1/PHY/INIT/nr_init_ue.c | 1 - openair1/PHY/defs_UE.h | 1 - openair1/PHY/defs_common.h | 1 - openair1/PHY/defs_eNB.h | 1 - openair1/PHY/defs_nr_UE.h | 1 - openair1/SCHED/phy_procedures_lte_eNb.c | 1 - openair1/SCHED/prach_procedures.c | 1 - openair1/SCHED/ru_procedures.c | 1 - openair1/SCHED_NR/nr_prach_procedures.c | 1 - openair1/SCHED_NR/nr_ru_procedures.c | 1 - openair1/SCHED_NR/phy_procedures_nr_gNB.c | 1 - openair1/SIMULATION/NR_PHY/prachsim.c | 2 - openair2/F1AP/f1ap_common.h | 1 - openair2/F1AP/f1ap_du_interface_management.c | 16 - openair2/LAYER2/MAC/eNB_scheduler_RA.c | 3 - openair2/LAYER2/MAC/main.c | 1 - openair2/LAYER2/MAC/ra_procedures.c | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 23 - openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 58 -- openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c | 2 - openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c | 6 - openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c | 195 +---- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h | 9 - .../LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c | 11 - .../LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c | 1 - .../LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c | 1 - .../LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c | 1 - .../AM_v9.3.0/rlc_am_timer_poll_retransmit.c | 16 - .../RLC/AM_v9.3.0/rlc_am_timer_reordering.c | 17 - .../AM_v9.3.0/rlc_am_timer_status_prohibit.c | 17 - openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c | 182 +--- openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h | 15 - .../RLC/UM_v9.3.0/rlc_um_control_primitives.c | 50 -- openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c | 1 - .../LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c | 12 - .../LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c | 1 - openair2/M2AP/m2ap_MCE_generate_messages.c | 18 - openair2/M2AP/m2ap_MCE_handler.c | 1 - openair2/M2AP/m2ap_MCE_interface_management.c | 56 +- openair2/M2AP/m2ap_eNB_generate_messages.c | 25 - openair2/M2AP/m2ap_eNB_handler.c | 1 - openair2/M2AP/m2ap_eNB_interface_management.c | 71 -- openair2/M2AP/m2ap_handler.c | 1 - openair2/RRC/LTE/L2_interface.c | 1 - openair2/RRC/LTE/L2_interface_common.c | 11 - openair2/RRC/LTE/L2_interface_ue.c | 11 - openair2/RRC/LTE/rrc_UE.c | 11 - openair2/RRC/LTE/rrc_eNB.c | 266 ------ openair2/RRC/LTE/rrc_eNB_GTPV1U.c | 10 - openair2/RRC/LTE/rrc_eNB_M2AP.c | 1 - openair2/RRC/LTE/rrc_eNB_S1AP.c | 104 --- openair2/RRC/LTE/rrc_eNB_UE_context.c | 5 - openair2/RRC/NR/L2_nr_interface.c | 11 - openair2/RRC/NR/rrc_gNB.c | 177 ---- openair2/RRC/NR/rrc_gNB_GTPV1U.c | 19 - openair2/RRC/NR/rrc_gNB_NGAP.c | 74 -- openair2/RRC/NR/rrc_gNB_UE_context.c | 5 - openair2/RRC/NR_UE/rrc_UE.c | 11 - openair2/SIMULATION/NR_RRC/itti_sim.c | 5 - openair2/X2AP/x2ap_eNB_generate_messages.c | 28 - openair2/X2AP/x2ap_eNB_handler.c | 1 - openair3/GTPV1-U/gtpv1u_eNB.c | 98 --- openair3/GTPV1-U/gtpv1u_gNB.c | 61 -- openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c | 31 - openair3/M3AP/m3ap_MCE_generate_messsages.c | 24 - openair3/M3AP/m3ap_MCE_handler.c | 1 - openair3/M3AP/m3ap_MCE_interface_management.c | 44 +- openair3/M3AP/m3ap_MME_generate_messages.c | 18 - openair3/M3AP/m3ap_MME_handler.c | 1 - openair3/M3AP/m3ap_MME_interface_management.c | 37 - openair3/M3AP/m3ap_handler.c | 1 - openair3/NAS/COMMON/UTIL/nas_timer.c | 1 - openair3/NAS/NR_UE/nr_nas_msg_sim.c | 1 - openair3/NAS/TEST/MSC/ActivatePDN.png | Bin 9430 -> 0 bytes .../NAS/TEST/MSC/AuthenticationReject.png | Bin 21465 -> 0 bytes openair3/NAS/TEST/MSC/DeactivatePDN.png | Bin 8833 -> 0 bytes openair3/NAS/TEST/MSC/InitialAttach.png | Bin 32243 -> 0 bytes openair3/NAS/TEST/MSC/InitialAttachReject.png | Bin 16271 -> 0 bytes openair3/NAS/TEST/MSC/NomalDetach.png | Bin 5844 -> 0 bytes openair3/NAS/TEST/MSC/README | 34 - openair3/NAS/TEST/MSC/SwitchOffDetach.png | Bin 3697 -> 0 bytes openair3/NAS/TEST/MSC/msc_gen.py | 354 -------- openair3/NAS/UE/EMM/Detach.c | 1 - openair3/NAS/UE/EMM/Identification.c | 1 - openair3/NAS/UE/EMM/SAP/emm_as.c | 1 - openair3/NAS/UE/EMM/SecurityModeControl.c | 1 - openair3/NAS/UE/nas_itti_messaging.c | 43 - openair3/NAS/UE/nas_itti_messaging.h | 1 - openair3/NAS/UE/nas_proc.c | 1 - openair3/NAS/UE/nas_ue_task.c | 4 - openair3/NGAP/ngap_gNB.c | 2 - .../ngap_gNB_context_management_procedures.c | 21 - openair3/NGAP/ngap_gNB_handlers.c | 15 - openair3/NGAP/ngap_gNB_nas_procedures.c | 96 --- openair3/S1AP/s1ap_eNB.c | 2 - .../s1ap_eNB_context_management_procedures.c | 21 - openair3/S1AP/s1ap_eNB_handlers.c | 15 - openair3/S1AP/s1ap_eNB_nas_procedures.c | 106 --- openair3/SCTP/sctp_eNB_task.c | 3 - openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 2 - .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 1 - openair3/UDP/udp_eNB_task.c | 2 - targets/RT/USER/lte-ru.c | 1 - targets/RT/USER/lte-softmodem.c | 10 - targets/RT/USER/lte-softmodem.h | 1 - targets/RT/USER/lte-uesoftmodem.c | 7 - targets/RT/USER/ru_control.c | 1 - targets/SCRIPTS/msc_gen.py | 329 -------- 139 files changed, 65 insertions(+), 4023 deletions(-) delete mode 100644 common/utils/msc/msc.c delete mode 100644 common/utils/msc/msc.h delete mode 100644 openair3/NAS/TEST/MSC/ActivatePDN.png delete mode 100644 openair3/NAS/TEST/MSC/AuthenticationReject.png delete mode 100644 openair3/NAS/TEST/MSC/DeactivatePDN.png delete mode 100644 openair3/NAS/TEST/MSC/InitialAttach.png delete mode 100644 openair3/NAS/TEST/MSC/InitialAttachReject.png delete mode 100644 openair3/NAS/TEST/MSC/NomalDetach.png delete mode 100644 openair3/NAS/TEST/MSC/README delete mode 100644 openair3/NAS/TEST/MSC/SwitchOffDetach.png delete mode 100755 openair3/NAS/TEST/MSC/msc_gen.py delete mode 100755 targets/SCRIPTS/msc_gen.py diff --git a/ci-scripts/yaml_files/fr1_epc_20897/mme.conf b/ci-scripts/yaml_files/fr1_epc_20897/mme.conf index 9dcb44ef2a..923bf1c388 100644 --- a/ci-scripts/yaml_files/fr1_epc_20897/mme.conf +++ b/ci-scripts/yaml_files/fr1_epc_20897/mme.conf @@ -114,7 +114,6 @@ MME : MME_APP_LOG_LEVEL = "TRACE"; S6A_LOG_LEVEL = "TRACE"; UTIL_LOG_LEVEL = "ERROR"; - MSC_LOG_LEVEL = "ERROR"; ITTI_LOG_LEVEL = "ERROR"; ASN1_VERBOSITY = "annoying"; }; diff --git a/ci-scripts/yaml_files/magma_nsa_20897/mme.conf b/ci-scripts/yaml_files/magma_nsa_20897/mme.conf index 242b780a40..6bdace2c28 100644 --- a/ci-scripts/yaml_files/magma_nsa_20897/mme.conf +++ b/ci-scripts/yaml_files/magma_nsa_20897/mme.conf @@ -121,7 +121,6 @@ MME : S11_LOG_LEVEL = "DEBUG"; S6A_LOG_LEVEL = "DEBUG"; UTIL_LOG_LEVEL = "INFO"; - MSC_LOG_LEVEL = "ERROR"; ITTI_LOG_LEVEL = "ERROR"; MME_SCENARIO_PLAYER_LOG_LEVEL = "ERROR"; ASN1_VERBOSITY = "INFO"; diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f2eda66fc0..7ec3590857 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -938,10 +938,6 @@ add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only vali add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????") add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????") -add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams") -add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams") -add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams") - add_boolean_option(UE_EXPANSION False "enable UE_EXPANSION with max 256 UE") add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION with max 256 UE") add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE") @@ -1301,11 +1297,6 @@ add_library(HASHTABLE ) include_directories(${OPENAIR_DIR}/common/utils/hashtable) -add_library(msc MODULE ${OPENAIR_DIR}/common/utils/msc/msc.c ) -target_link_libraries (msc LFDS) - -include_directories(${OPENAIR_DIR}/common/utils/msc) - set(UTIL_SRC # ${OPENAIR2_DIR}/UTIL/CLI/cli.c # ${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c @@ -2807,7 +2798,7 @@ target_link_libraries (lte-softmodem -Wl,--start-group RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7 - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} -Wl,--end-group z dl) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) @@ -2851,7 +2842,7 @@ target_link_libraries (ocp-enb RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} -Wl,--end-group z dl) target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB}) @@ -2945,7 +2936,7 @@ target_link_libraries (lte-uesoftmodem RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES} -Wl,--end-group z dl) target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES}) @@ -2989,7 +2980,7 @@ target_compile_definitions(nr-softmodem PUBLIC NEW_GTPU) target_link_libraries (nr-softmodem -Wl,--start-group UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA - ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB + ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} -Wl,--end-group z dl) @@ -3029,7 +3020,7 @@ add_executable(ocp-gnb target_link_libraries (ocp-gnb -Wl,--start-group UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA - ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB + ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON -Wl,--end-group z dl) @@ -3075,9 +3066,9 @@ target_link_libraries (nr-uesoftmodem RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} NFAPI_USER_LIB S1AP_LIB S1AP_ENB - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} -Wl,--end-group z dl) target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES}) @@ -3326,7 +3317,7 @@ add_executable(test_epc_generate_scenario ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h ) target_link_libraries (test_epc_generate_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) add_executable(test_epc_play_scenario @@ -3345,7 +3336,7 @@ add_executable(test_epc_play_scenario ) target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c) target_link_libraries (test_epc_play_scenario - -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) @@ -3386,7 +3377,7 @@ if (${T_TRACER}) ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai - coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO + coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX @@ -3501,7 +3492,7 @@ target_compile_definitions(nr-ittisim PUBLIC NEW_GTPU) target_link_libraries (nr-ittisim -Wl,--start-group UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA - ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB + ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE diff --git a/cmake_targets/at_commands/CMakeLists.txt b/cmake_targets/at_commands/CMakeLists.txt index bd71125cf0..dc91f3c31c 100755 --- a/cmake_targets/at_commands/CMakeLists.txt +++ b/cmake_targets/at_commands/CMakeLists.txt @@ -409,7 +409,6 @@ set(emm_HDR add_library(emm ${emm_SRC} ${emm_HDR}) target_include_directories(emm PRIVATE - ${OPENAIR_DIR}/common/utils/msc ${OPENAIR_DIR}/common/utils ${OPENAIR_DIR}/openair2/COMMON ${OPENAIR_NAS_DIR}/UE @@ -693,7 +692,6 @@ include_directories( ${OPENAIR_TARGETS}/COMMON ${OPENAIR_NAS_DIR}/UE ${OPENAIR_DIR}/common/utils - ${OPENAIR_DIR}/common/utils/msc ${OPENAIR3_DIR}/COMMON ${OPENAIR3_DIR}/SECU ${OPENAIR_NAS_DIR}/src diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 68aef48c6b..fdb4875cfb 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -67,7 +67,7 @@ BUILD_ECLIPSE=0 NR="False" ITTI_SIM="False" SANITIZE_ADDRESS="False" -OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope msc" +OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope" RU=0 trap handle_ctrl_c INT diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template index 7a097fffb0..28da13437c 100755 --- a/cmake_targets/epc_test/CMakeLists.template +++ b/cmake_targets/epc_test/CMakeLists.template @@ -26,7 +26,6 @@ set ( LOG_NO_THREAD True ) set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False) set ( MSG_PRINT False ) set ( MU_RECEIVER False ) set ( NAS_ADDRESS_FIX False ) diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20 index 33e558a234..226d4c40c6 100755 --- a/cmake_targets/install_external_packages.ubuntu20 +++ b/cmake_targets/install_external_packages.ubuntu20 @@ -410,7 +410,6 @@ check_install_ubuntu_packages() { libxml2 \ libxml2-dev \ libxslt1-dev \ - mscgen \ octave-signal \ openssh-client \ openssh-server \ diff --git a/cmake_targets/s1c_mme_test/CMakeLists.template b/cmake_targets/s1c_mme_test/CMakeLists.template index e62df04bc6..d2d2d3e053 100755 --- a/cmake_targets/s1c_mme_test/CMakeLists.template +++ b/cmake_targets/s1c_mme_test/CMakeLists.template @@ -26,7 +26,6 @@ set ( LOG_NO_THREAD True ) set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False) set ( MSG_PRINT False ) set ( MU_RECEIVER False ) set ( NAS_ADDRESS_FIX False ) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 1df7808b0f..955fde4dba 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -765,7 +765,6 @@ check_install_oai_software() { libxml2 \ libxml2-dev \ libxslt1-dev \ - mscgen \ octave-signal \ openssh-client \ openssh-server \ @@ -793,7 +792,7 @@ check_install_oai_software() { fi $SUDO $INSTALLER install -y python-epdb vim-common else - $SUDO $INSTALLER install -y mscgen pydb + $SUDO $INSTALLER install -y pydb fi $SUDO $INSTALLER install -y \ diff --git a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt index 238554f8e2..b55266dfe7 100755 --- a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt +++ b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt @@ -85,18 +85,7 @@ Tools available: 1) itti_analyser (list messages exchanged between protocol layers) 2) xforms (Layer 1) -3) mscgen (under construction, but can give some results now) - (http://www.mcternan.me.uk/mscgen/) - We use the software to generate sequence diagrams - with traces generated during the execution of the eNB. - After the enb execution: - yang@yang:...$ cd /tmp - yang@yang:/tmp$ /home/yang/openair4G/trunk/targets/SCRIPTS/msc_gen.py - The results are located in the current directory (/tmp in this example) in a folder. The name of the folder - is the current date (for example: 2015-04-08_20.34.10). - The results are input files for the mscgen tool containing events or messages and the - corresponding generated png files. -4) vcd (timing mesurements) +3) vcd (timing mesurements) diff --git a/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt b/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt index 9996a53e19..805d121e6d 100755 --- a/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt +++ b/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt @@ -92,18 +92,7 @@ Tools available: 1) itti_analyser (list messages exchanged between protocol layers) 2) xforms (Layer 1) -3) mscgen (under construction, but can give some results now) - (http://www.mcternan.me.uk/mscgen/) - We use the software to generate sequence diagrams - with traces generated during the execution of the eNB. - After the enb execution: - yang@yang:...$ cd /tmp - yang@yang:/tmp$ /home/yang/openair4G/trunk/targets/SCRIPTS/msc_gen.py - The results are located in the current directory (/tmp in this example) in a folder. The name of the folder - is the current date (for example: 2015-04-08_20.34.10). - The results are input files for the mscgen tool containing events or messages and the - corresponding generated png files. -4) vcd (timing mesurements) +3) vcd (timing mesurements) diff --git a/cmake_targets/tools/run_enb_s1_usrp b/cmake_targets/tools/run_enb_s1_usrp index 1a4c6b10b8..db22e31493 100755 --- a/cmake_targets/tools/run_enb_s1_usrp +++ b/cmake_targets/tools/run_enb_s1_usrp @@ -32,8 +32,6 @@ ################################ THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) source $THIS_SCRIPT_PATH/build_helper -declare -i g_run_msc_gen=0 -declare g_msc_dir="/tmp" function help() @@ -55,7 +53,6 @@ function help() echo_error " -M, --target-dl-mcs mcs Downlink target MCS." echo_error " -n, --T-no-wait don't wait for tracer, start immediately" echo_error " -p, --T-port port use given port" - echo_error " -m, --mscgen directory Generate mscgen output files in a directory" echo_error " -s, --show-stdout Do not redirect stdout and stderr to file /tmp/lte_softmodem.stdout.txt." echo_error " -S, --enable-missed-slot Continue execution in case of missed slot." echo_error " -T, --target-ul-mcs mcs Uplink target MCS." @@ -68,30 +65,10 @@ function help() } -function do_msc_gen() -{ - cd $g_msc_dir - last_created_file=`ls -t mscgen* | head -1 | tr -d ':'` - $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py - sync - last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'` - - if [ x"$last_created_file" != x"$last_created_file2" ]; then - if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then - command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png - fi - fi - -} - - function control_c() # run if user hits control-c { echo_warning "\nExiting by ctrl+c\n" - if [ $g_run_msc_gen -eq 1 ]; then - do_msc_gen - fi exit $? } @@ -153,18 +130,6 @@ function main() exe_arguments="$exe_arguments --rf-config-file=$rf_config_file" fi ;; - -m | --mscgen) - g_msc_dir=$2 - # can omit file name if last arg on the line - if [ -d "$g_msc_dir" ]; then - echo "setting mscgen log files to dir: $g_msc_dir" - g_run_msc_gen=1 - shift 2; - else - echo_error "Mscgen log dir does not exist" - exit -1 - fi - ;; -M | --target-dl-mcs) echo "setting target dl MCS to $2" exe_arguments="$exe_arguments -m $2" @@ -251,9 +216,6 @@ function main() else gdb -n -x ~/.gdb_lte_softmodem fi - if [ $g_run_msc_gen -eq 1 ]; then - do_msc_gen - fi fi } diff --git a/cmake_targets/tools/run_enb_ue_virt_noS1 b/cmake_targets/tools/run_enb_ue_virt_noS1 index 79d5bc35dc..5f8e7e5374 100755 --- a/cmake_targets/tools/run_enb_ue_virt_noS1 +++ b/cmake_targets/tools/run_enb_ue_virt_noS1 @@ -57,7 +57,6 @@ function help() echo_error " -l, --log-level set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error). Note that the log configuration is eNB config file is ignored for oaisim." echo_error " -h, --help Print this help." echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)" - echo_error " -m, --mscgen directory Generate mscgen output files in a directory" echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format." echo_error " -W, --wireshark-l2 Dump MAC frames for visualization with wireshark." echo_error " You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE," @@ -75,11 +74,9 @@ function main() cecho "OPENAIR_DIR = $OPENAIR_DIR" $green local -i run_gdb=0 - local -i run_mscgen=0 local exe_arguments="" local DEFAULT_CONFIG_FILE_ENB=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf local CONFIG_FILE_ENB=$DEFAULT_CONFIG_FILE_ENB - local MSC_DIR="/tmp" local abstraction_flag=0 until [ -z "$1" ] @@ -136,17 +133,6 @@ function main() exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE" ;; - -m | --mscgen) - MSC_DIR=$2 - if [ -d "$MSC_DIR" ]; then - echo "setting mscgen log files to dir: $MSC_DIR" - run_mscgen=1 - shift 2; - else - echo_error "Mscgen log dir does not exist" - exit -1 - fi - ;; # -u | --num-ue ) -V | --vcd) @@ -212,10 +198,6 @@ function main() cd $OPENAIR_DIR/targets/bin - if [ $run_mscgen -eq 1 ]; then - $SUDO rm -f /tmp/openair.msc.* - fi - if [ $run_gdb -eq 0 ]; then exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt else @@ -227,20 +209,6 @@ function main() cat ~/.gdb_enb_ue_nos1 $SUDO gdb -n -x ~/.gdb_enb_ue_nos1 fi - - if [ $run_mscgen -eq 1 ]; then - cd $MSC_DIR - last_created_file=`ls -t mscgen* | head -1 | tr -d ':'` - $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN - sync - last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'` - - if [ x"$last_created_file" != x"$last_created_file2" ]; then - if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then - command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png - fi - fi - fi } main "$@" diff --git a/cmake_targets/tools/run_enb_ue_virt_s1 b/cmake_targets/tools/run_enb_ue_virt_s1 index 50fc819ec8..76bc3c2b39 100755 --- a/cmake_targets/tools/run_enb_ue_virt_s1 +++ b/cmake_targets/tools/run_enb_ue_virt_s1 @@ -81,7 +81,6 @@ function help() echo_error " -g, --gdb Run with GDB." echo_error " -h, --help Print this help." echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)" - echo_error " -m, --mscgen directory Generate mscgen output files in a directory" echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format." echo_error " -W, --wireshark-l2 Dump MAC frames for visualization with wireshark." echo_error " You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE," @@ -100,11 +99,9 @@ function main() cecho "OPENAIR_DIR = $OPENAIR_DIR" $green local -i run_gdb=0 - local -i run_mscgen=0 local exe_arguments="" local DEFAULT_CONFIG_FILE_ENB=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf local CONFIG_FILE_ENB=$DEFAULT_CONFIG_FILE_ENB - local MSC_DIR="/tmp" until [ -z "$1" ] do @@ -160,19 +157,6 @@ function main() exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE" ;; - -m | --mscgen) - MSC_DIR=$2 - # can omit file name if last arg on the line - if [ -d "$MSC_DIR" ]; then - echo "setting mscgen log files to dir: $MSC_DIR" - run_mscgen=1 - shift 2; - else - echo_error "Mscgen log dir does not exist" - exit -1 - fi - ;; - -V | --vcd) echo "setting gtk-wave output" exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd" @@ -258,10 +242,6 @@ function main() cd $OPENAIR_DIR/targets/bin - if [ $run_mscgen -eq 1 ]; then - rm -f /tmp/openair.msc.* - fi - if [ $run_gdb -eq 0 ]; then exec $OPENAIR_DIR/targets/bin/oaisim.Rel14 $exe_arguments | tee /tmp/enb_ue_s1.log.txt else @@ -273,21 +253,6 @@ function main() cat ~/.gdb_enb_ue_s1 gdb -n -x ~/.gdb_enb_ue_s1 fi - - if [ $run_mscgen -eq 1 ]; then - cd $MSC_DIR - last_created_file=`ls -t mscgen* | head -1 | tr -d ':'` - $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN - sync - last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'` - - if [ x"$last_created_file" != x"$last_created_file2" ]; then - if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then - command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png - fi - fi - fi - } sudo echo diff --git a/common/config/DOC/config/rtusage.md b/common/config/DOC/config/rtusage.md index 10cbee2495..8db58ddac3 100644 --- a/common/config/DOC/config/rtusage.md +++ b/common/config/DOC/config/rtusage.md @@ -65,7 +65,6 @@ To get help on supported parameters you can use specific options: -R: Enable online log -g: Set the global log level, valide options: (4:trace, 3:debug, 2:info, 1:warn, (0:error)) --telnetsrv: Start embedded telnet server - --msc: Enable the MSC tracing utility -------------------------------------------------------------------- [LIBCONFIG] loader: 2/2 parameters successfully set, (2 to default value) diff --git a/common/utils/LOG/DOC/rtusage.md b/common/utils/LOG/DOC/rtusage.md index d7c748952d..6af7cdb08c 100644 --- a/common/utils/LOG/DOC/rtusage.md +++ b/common/utils/LOG/DOC/rtusage.md @@ -49,7 +49,6 @@ The list of components defined within oai can be retrieved from the [config mod [CONFIG] log_config.perf_log_level set to default value "info" [CONFIG] log_config.oip_log_level set to default value "info" [CONFIG] log_config.cli_log_level set to default value "info" -[CONFIG] log_config.msc_log_level set to default value "info" [CONFIG] log_config.ocm_log_level set to default value "info" [CONFIG] log_config.udp_log_level set to default value "info" [CONFIG] log_config.gtpv1u_log_level set to default value "info" @@ -108,8 +107,6 @@ The list of components defined within oai can be retrieved from the [config mod [CONFIG] log_config.oip_log_infile set to default value [CONFIG] cli_log_infile: 0 [CONFIG] log_config.cli_log_infile set to default value -[CONFIG] msc_log_infile: 0 -[CONFIG] log_config.msc_log_infile set to default value [CONFIG] ocm_log_infile: 0 [CONFIG] log_config.ocm_log_infile set to default value [CONFIG] udp_log_infile: 0 diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index 28134d6db1..8034119a99 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -447,7 +447,6 @@ int logInit (void) register_log_component("OCG","",OCG); register_log_component("PERF","",PERF); register_log_component("OIP","",OIP); - register_log_component("MSC","log",MSC); register_log_component("OCM","log",OCM); register_log_component("HW","",HW); register_log_component("OSA","",OSA); diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 350337b61b..7179079dd5 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -210,7 +210,6 @@ typedef enum { PERF, OIP, CLI, - MSC, OCM, UDP_, GTPU, diff --git a/common/utils/msc/msc.c b/common/utils/msc/msc.c deleted file mode 100644 index 84b723b022..0000000000 --- a/common/utils/msc/msc.c +++ /dev/null @@ -1,785 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file msc.c - * \brief Message chart generator logging utility (generated files to processed by a script to produce a mscgen input file for generating a sequence diagram document) - * \author Lionel GAUTHIER - * \date 2015 - * \email: lionel.gauthier@eurecom.fr - */ -#include -#include -#include -#include -#include -#include - -#define MSC_LIBRARY -#include "msc.h" - -#include "liblfds611.h" -#include "intertask_interface.h" - - - -#include "assertions.h" - -//------------------------------- -#define MSC_MAX_QUEUE_ELEMENTS 1024 -#define MSC_MAX_PROTO_NAME_LENGTH 16 -#define MSC_MAX_MESSAGE_LENGTH 512 - -//------------------------------- - -FILE *g_msc_fd; -char g_msc_proto2str[MAX_MSC_PROTOS][MSC_MAX_PROTO_NAME_LENGTH]; - -msc_interface_t msc_interface; - -typedef unsigned long msc_message_number_t; -typedef struct msc_queue_item_s { - char *message_str; - uint32_t message_str_size; - uint8_t *message_bin; - uint32_t message_bin_size; -} msc_queue_item_t; - -msc_message_number_t g_message_number = 0; -struct lfds611_queue_state *g_msc_message_queue_p = NULL; -struct lfds611_stack_state *g_msc_memory_stack_p = NULL; - -//------------------------------------------------------------------------------ -void *msc_task(void *args_p) -//------------------------------------------------------------------------------ -{ - MessageDef *received_message_p = NULL; - // const char *msg_name = NULL; - // instance_t instance = 0; - long timer_id; - itti_mark_task_ready(TASK_MSC); - msc_start_use(); - timer_setup(0, // seconds - 50000, // usec - TASK_MSC, - INSTANCE_DEFAULT, - TIMER_PERIODIC, - NULL, - &timer_id); - - while(1) { - itti_receive_msg(TASK_MSC, &received_message_p); - - if (received_message_p != NULL) { - // msg_name = ITTI_MSG_NAME (received_message_p); - // instance = ITTI_MSG_DESTINATION_INSTANCE (received_message_p); - switch (ITTI_MSG_ID(received_message_p)) { - case TIMER_HAS_EXPIRED: { - msc_flush_messages(); - } - break; - - case TERMINATE_MESSAGE: { - fprintf(stderr, " *** Exiting MSC thread\n"); - timer_remove(timer_id); - msc_end(); - itti_exit_task(); - } - break; - - case MESSAGE_TEST: { - } - break; - - default: { - } - break; - } - } - } - - fprintf(stderr, "Task MSC exiting\n"); - return NULL; -} - -//------------------------------------------------------------------------------ -int msc_init(const msc_env_t envP, const int max_threadsP) -//------------------------------------------------------------------------------ -{ - int i; - int rv; - void *pointer_p; - char msc_filename[256]; - fprintf(stderr, "Initializing MSC logs\n"); - rv = snprintf(msc_filename, 256, "/tmp/openair.msc.%i.log", envP); // TODO NAME - - if ((0 >= rv) || (256 < rv)) { - fprintf(stderr, "Error in MSC log file name"); - } - - g_msc_fd = fopen(msc_filename,"w"); - AssertFatal(g_msc_fd != NULL, "Could not open MSC log file %s : %s", msc_filename, strerror(errno)); - rv = lfds611_stack_new(&g_msc_memory_stack_p, (lfds611_atom_t)max_threadsP + 2); - - if (0 >= rv) { - AssertFatal (0, "lfds611_stack_new failed!\n"); - } - - rv = lfds611_queue_new(&g_msc_message_queue_p, (lfds611_atom_t)MSC_MAX_QUEUE_ELEMENTS); - AssertFatal (rv, "lfds611_queue_new failed!\n"); - AssertFatal (g_msc_message_queue_p != NULL, "g_msc_message_queue_p is NULL!\n"); - msc_start_use(); - - for (i=0; i < max_threadsP * 30; i++) { - pointer_p = malloc(MSC_MAX_MESSAGE_LENGTH); - AssertFatal (pointer_p, "malloc failed!\n"); - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, pointer_p ); - AssertFatal (rv, "lfds611_stack_guaranteed_push failed for item %d\n", i); - } - - for (i = MIN_MSC_PROTOS; i < MAX_MSC_PROTOS; i++) { - switch (i) { - case MSC_IP_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "IP_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_IP_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "IP_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if (envP == MSC_E_UTRAN_LIPA) { - msc_log_declare_proto(i); - } - - break; - - case MSC_NAS_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_RRC_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RRC_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_PDCP_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PDCP_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_RLC_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RLC_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_MAC_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MAC_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_PHY_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PHY_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_PHY_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PHY_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_MAC_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MAC_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_RLC_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RLC_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_PDCP_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PDCP_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_RRC_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RRC_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_S1AP_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S1AP_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_GTPU_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "GTPU_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_GTPU_SGW: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "GTPU_SGW"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_S1AP_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S1AP_MME"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_MMEAPP_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MME_APP"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_NAS_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_MME"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - msc_log_declare_proto(i); - break; - - case MSC_NAS_EMM_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_EMM"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_NAS_ESM_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_ESM"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_SP_GWAPP_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "SP_GW_MME"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if (envP == MSC_MME_GW) { - msc_log_declare_proto(i); - } - - break; - - case MSC_S11_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S11_MME"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if (envP == MSC_MME) { - msc_log_declare_proto(i); - } - - break; - - case MSC_S6A_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S6A"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_HSS: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "HSS"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - case MSC_F1AP_CU: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "F1AP_CU"); - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;} - //if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - //} - break; - case MSC_F1AP_DU: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "F1AP_DU"); - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;} - //if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - //} - break; - default: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "UNKNOWN"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - } - } - - rv = itti_create_task (TASK_MSC, msc_task, NULL); - AssertFatal (rv == 0, "Create task for MSC failed!\n"); - fprintf(stderr, "Initializing MSC logs Done\n"); - return 0; -} - -//------------------------------------------------------------------------------ -void msc_start_use(void) -//------------------------------------------------------------------------------ -{ - lfds611_queue_use(g_msc_message_queue_p); - lfds611_stack_use(g_msc_memory_stack_p); -} - - -//------------------------------------------------------------------------------ -void msc_flush_messages(void) -//------------------------------------------------------------------------------ -{ - int rv; - msc_queue_item_t *item_p = NULL; - - while ((rv = lfds611_queue_dequeue( g_msc_message_queue_p, (void **)&item_p )) == 1) { - if (NULL != item_p->message_str) { - fputs(item_p->message_str, g_msc_fd); - // TODO BIN DATA - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, item_p->message_str ); - } - - // TODO FREE BIN DATA - free(item_p); - } - - fflush(g_msc_fd); -} - - -//------------------------------------------------------------------------------ -void msc_end(void) -//------------------------------------------------------------------------------ -{ - int rv; - - if (NULL != g_msc_fd ) { - msc_flush_messages(); - rv = fflush(g_msc_fd); - - if (rv != 0) { - fprintf(stderr, "Error while flushing stream of MSC log file: %s", strerror(errno)); - } - - rv = fclose(g_msc_fd); - - if (rv != 0) { - fprintf(stderr, "Error while closing MSC log file: %s", strerror(errno)); - } - } -} - -//------------------------------------------------------------------------------ -void msc_log_declare_proto( - const msc_proto_t protoP -) -//------------------------------------------------------------------------------ -{ - int rv = 0; - msc_queue_item_t *new_item_p = NULL; - char *char_message_p = NULL; - - if ((MIN_MSC_PROTOS <= protoP) && (MAX_MSC_PROTOS > protoP)) { - // may be build a memory pool for that also ? - new_item_p = malloc(sizeof(msc_queue_item_t)); - - if (NULL != new_item_p) { - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - - if (0 == rv) { - msc_flush_messages(); - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - } - - if (1 == rv) { - rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [PROTO] %d %s\n", __sync_fetch_and_add (&g_message_number, 1), protoP, &g_msc_proto2str[protoP][0]); - - if (0 > rv) { - fprintf(stderr, "Error while declaring new protocol in MSC: %s", strerror(errno)); - } - - new_item_p->message_str = char_message_p; - new_item_p->message_str_size = rv; - new_item_p->message_bin = NULL; - new_item_p->message_bin_size = 0; - rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p ); - - if (0 == rv) { - rv = lfds611_queue_guaranteed_enqueue(g_msc_message_queue_p, new_item_p ); - - if (0 == rv) { - fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p); - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p ); - free(new_item_p); - } - } - - return; - } else { - fprintf(stderr, "Error while lfds611_stack_pop()\n"); - } - - free(new_item_p); - } else { - fprintf(stderr, "Error while malloc in MSC"); - } - } -} -//------------------------------------------------------------------------------ -void msc_log_event( - const msc_proto_t protoP, - char *format, ...) -//------------------------------------------------------------------------------ -{ - va_list args; - int rv; - int rv2; - msc_queue_item_t *new_item_p = NULL; - char *char_message_p = NULL; - - if ((MIN_MSC_PROTOS > protoP) || (MAX_MSC_PROTOS <= protoP)) { - return; - } - - new_item_p = malloc(sizeof(msc_queue_item_t)); - - if (NULL != new_item_p) { - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - - if (0 == rv) { - msc_flush_messages(); - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - } - - if (1 == rv) { - rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [EVENT] %d ", __sync_fetch_and_add (&g_message_number, 1), protoP); - - if ((0 > rv) || (MSC_MAX_MESSAGE_LENGTH < rv)) { - fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]); - goto error_event; - } - - va_start(args, format); - rv2 = vsnprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, format, args); - va_end(args); - - if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) { - fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]); - goto error_event; - } - - rv += rv2; - rv2 = snprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, "\n"); - - if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) { - fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]); - goto error_event; - } - - rv += rv2; - new_item_p->message_str = char_message_p; - new_item_p->message_str_size = rv; - new_item_p->message_bin = NULL; - new_item_p->message_bin_size = 0; - rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p ); - - if (0 == rv) { - fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p); - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p ); - free(new_item_p); - } - } else { - fprintf(stderr, "Error while lfds611_stack_pop()\n"); - } - } - - return; -error_event: - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p ); - free(new_item_p); -} -//------------------------------------------------------------------------------ -void msc_log_message( - const char *const message_operationP, - const msc_proto_t proto1P, - const msc_proto_t proto2P, - const uint8_t *const bytesP, - const unsigned int num_bytes, - char *format, ...) -//------------------------------------------------------------------------------ -{ - va_list args; - uint64_t mac = 0; // TO DO mac on bytesP param - int rv; - int rv2; - msc_queue_item_t *new_item_p = NULL; - char *char_message_p = NULL; - - if ((MIN_MSC_PROTOS > proto1P) || (MAX_MSC_PROTOS <= proto1P) || - (MIN_MSC_PROTOS > proto2P) || (MAX_MSC_PROTOS <= proto2P) ) { - return; - } - - new_item_p = malloc(sizeof(msc_queue_item_t)); - - if (NULL != new_item_p) { - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - - if (0 == rv) { - msc_flush_messages(); - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - } - - if (1 == rv) { - rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [MESSAGE] %d %s %d %"PRIu64" ", - __sync_fetch_and_add (&g_message_number, 1), proto1P, message_operationP, proto2P, mac); - - if ((0 > rv) || (MSC_MAX_MESSAGE_LENGTH < rv)) { - fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]); - goto error_event; - } - - va_start(args, format); - rv2 = vsnprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, format, args); - va_end(args); - - if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) { - fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]); - goto error_event; - } - - rv += rv2; - rv2 = snprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, "\n"); - - if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) { - fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]); - goto error_event; - } - - rv += rv2; - new_item_p->message_str = char_message_p; - new_item_p->message_str_size = rv; - new_item_p->message_bin = NULL; // TO DO - new_item_p->message_bin_size = 0; // TO DO - rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p ); - - if (0 == rv) { - fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p); - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p ); - free(new_item_p); - } - } else { - fprintf(stderr, "Error while lfds611_stack_pop()\n"); - msc_flush_messages(); - } - } - - return; -error_event: - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p ); - free(new_item_p); -} - -//------------------------------------------------------------------------------ -// function called when oai loader loads the msc shared lib -int msc_autoinit(msc_interface_t *msc_interface) -//------------------------------------------------------------------------------ -{ - msc_interface->msc_init = msc_init; - msc_interface->msc_start_use = msc_start_use; - msc_interface->msc_end = msc_end; - msc_interface->msc_log_event = msc_log_event; - msc_interface->msc_log_message = msc_log_message; - msc_interface->msc_loaded = 1; - return 0; -} diff --git a/common/utils/msc/msc.h b/common/utils/msc/msc.h deleted file mode 100644 index adb0d9e657..0000000000 --- a/common/utils/msc/msc.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -#ifndef MSC_H_ -#define MSC_H_ -#include -#include - -typedef enum { - MIN_MSC_ENV = 0, - MSC_E_UTRAN = MIN_MSC_ENV, - MSC_E_UTRAN_LIPA, - MSC_MME_GW, - MSC_MME, - MSC_SP_GW, - MAX_MSC_ENV -} msc_env_t; - - -typedef enum { - MIN_MSC_PROTOS = 0, - MSC_IP_UE = MIN_MSC_PROTOS, - MSC_NAS_UE, - MSC_RRC_UE, - MSC_PDCP_UE, - MSC_RLC_UE, - MSC_MAC_UE, - MSC_PHY_UE, - MSC_PHY_ENB, - MSC_MAC_ENB, - MSC_RLC_ENB, - MSC_PDCP_ENB, - MSC_PDCP_GNB, - MSC_RRC_ENB, - MSC_RRC_GNB, - MSC_IP_ENB, - MSC_S1AP_ENB, - MSC_NGAP_GNB, - MSC_GTPU_ENB, - MSC_GTPU_GNB, - MSC_GTPU_SGW, - MSC_S1AP_MME, - MSC_NGAP_AMF, - MSC_MMEAPP_MME, - MSC_NAS_MME, - MSC_NAS_EMM_MME, - MSC_NAS_ESM_MME, - MSC_SP_GWAPP_MME, - MSC_S11_MME, - MSC_S6A_MME, - MSC_HSS, - MSC_F1AP_CU, - MSC_F1AP_DU, - MSC_X2AP_SRC_ENB, - MSC_X2AP_TARGET_ENB, - MAX_MSC_PROTOS, -} msc_proto_t; - - - -// Access stratum -#define MSC_AS_TIME_FMT "%05u:%02u" - -#define MSC_AS_TIME_ARGS(CTXT_Pp) \ - (CTXT_Pp)->frame, \ - (CTXT_Pp)->subframe - -typedef int(*msc_init_t)(const msc_env_t, const int ); -typedef void(*msc_start_use_t)(void ); -typedef void(*msc_end_t)(void); -typedef void(*msc_log_event_t)(const msc_proto_t,char *, ...); -typedef void(*msc_log_message_t)(const char *const, const msc_proto_t, const msc_proto_t, - const uint8_t *const, const unsigned int, char *, ...); -typedef struct msc_interface { - int msc_loaded; - msc_init_t msc_init; - msc_start_use_t msc_start_use; - msc_end_t msc_end; - msc_log_event_t msc_log_event; - msc_log_message_t msc_log_message; -} msc_interface_t; - -#ifdef MSC_LIBRARY -int msc_init(const msc_env_t envP, const int max_threadsP); -void msc_start_use(void); -void msc_flush_messages(void); -void msc_end(void); -void msc_log_declare_proto(const msc_proto_t protoP); -void msc_log_event(const msc_proto_t protoP,char *format, ...); -void msc_log_message( - const char *const message_operationP, - const msc_proto_t receiverP, - const msc_proto_t senderP, - const uint8_t *const bytesP, - const unsigned int num_bytes, - char *format, ...); - -#else - -#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded - -extern msc_interface_t msc_interface; -#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2) -#define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use -#define MSC_END if(msc_interface.msc_loaded) msc_interface.msc_end -#define MSC_LOG_EVENT(mScPaRaMs, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_event(mScPaRaMs, fORMAT, ##aRGS) -#define MSC_LOG_RX_MESSAGE(rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("<-",rECEIVER, sENDER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS) -#define MSC_LOG_RX_DISCARDED_MESSAGE(rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("x-",rECEIVER, sENDER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS) -#define MSC_LOG_TX_MESSAGE(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("->",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS) -#define MSC_LOG_TX_MESSAGE_FAILED(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("-x",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS) -#endif - -#endif diff --git a/common/utils/ocp_itti/intertask_interface.h b/common/utils/ocp_itti/intertask_interface.h index 3188e5889f..97042842e4 100644 --- a/common/utils/ocp_itti/intertask_interface.h +++ b/common/utils/ocp_itti/intertask_interface.h @@ -338,7 +338,6 @@ void *rrc_enb_process_msg(void *); TASK_DEF(TASK_RRC_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \ - TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\ TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\ TASK_DEF(OCP_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\ TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\ @@ -560,7 +559,6 @@ MessageDef *itti_alloc_new_message_sized( This function should be called from the main thread after having created all ITTI tasks. **/ void itti_wait_tasks_end(void); -#define ADDED_QUEUES_MAX 10 // Fix me: MSC component too hard to understand, we keep room for 10 queues created dynamically void itti_set_task_real_time(task_id_t task_id); /** \brief Send a termination message to all tasks. diff --git a/common/utils/telnetsrv/DOC/telnetlog.md b/common/utils/telnetsrv/DOC/telnetlog.md index 36c5cfb348..cb008fc8bb 100644 --- a/common/utils/telnetsrv/DOC/telnetlog.md +++ b/common/utils/telnetsrv/DOC/telnetlog.md @@ -62,7 +62,6 @@ component verbosity level enabled 16 PERF: medium info N 17 OIP: medium info N 18 CLI: medium info N -19 MSC: medium info N 20 OCM: medium info N 21 UDP: medium info N 22 GTPV1U: medium info N diff --git a/doc/testing_gnb_w_cots_ue_resources/oai_enb.log b/doc/testing_gnb_w_cots_ue_resources/oai_enb.log index 9b9de24a86..7356c0c88d 100755 --- a/doc/testing_gnb_w_cots_ue_resources/oai_enb.log +++ b/doc/testing_gnb_w_cots_ue_resources/oai_enb.log @@ -62,7 +62,6 @@ ITTI init, useMME: 1 [TMR] Starting itti queue: TASK_RRC_UE as task 31 [TMR] Starting itti queue: TASK_NAS_UE as task 32 [TMR] Starting itti queue: TASK_RAL_UE as task 33 -[TMR] Starting itti queue: TASK_MSC as task 34 [TMR] Starting itti queue: TASK_GTPV1_U as task 35 [TMR] Starting itti queue: TASK_UDP as task 36 [TMR] Starting itti queue: TASK_CU_F1 as task 37 diff --git a/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log b/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log index 37b3c10516..3c76c0d0d6 100755 --- a/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log +++ b/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log @@ -58,7 +58,6 @@ CPU Freq is 3.092986 [TMR] Starting itti queue: TASK_RRC_UE as task 31 [TMR] Starting itti queue: TASK_NAS_UE as task 32 [TMR] Starting itti queue: TASK_RAL_UE as task 33 -[TMR] Starting itti queue: TASK_MSC as task 34 [TMR] Starting itti queue: TASK_GTPV1_U as task 35 [TMR] Starting itti queue: TASK_UDP as task 36 [TMR] Starting itti queue: TASK_CU_F1 as task 37 diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index 45d7852adc..47fd816db5 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -104,7 +104,6 @@ #define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n" #define CONFIG_HLP_LOGV "Set the global log verbosity \n" #define CONFIG_HLP_TELN "Start embedded telnet server \n" -#define CONFIG_HLP_MSC "Enable the MSC tracing utility \n" #define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n" #define CONFIG_HLP_NOS1 "Disable s1 interface\n" #define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n" @@ -112,13 +111,11 @@ /* command line parameters for LOG utility */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*--------------------------------------------------------------------------------------------------------------------------------*/ -#define START_MSC softmodem_params.start_msc #define CMDLINE_LOGPARAMS_DESC_NR { \ {"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ {"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ {"G" , CONFIG_HLP_LOGV, 0, uptr:&glog_verbosity, defintval:0, TYPE_UINT16, 0}, \ {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ - {"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \ } #define CMDLINE_ONLINELOG_IDX 0 diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 5f57919645..82567e534e 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -29,8 +29,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include -#include "msc.h" - #include "PHY/types.h" #include "common/ran_context.h" @@ -684,7 +682,6 @@ int main( int argc, char **argv ) { cpuf=get_cpu_freq_GHz(); itti_init(TASK_MAX, tasks_info); // initialize mscgen log after ITTI - MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); init_opt(); if(PDCP_USE_NETLINK && !IS_SOFTMODEM_NOS1) { netlink_init(); diff --git a/executables/ocp-gnb.c b/executables/ocp-gnb.c index 462a07c707..23fd3ae132 100644 --- a/executables/ocp-gnb.c +++ b/executables/ocp-gnb.c @@ -93,7 +93,6 @@ time_stats_t softmodem_stats_rx_sf; // total rx time // not used but needed for link openair0_config_t openair0_cfg[MAX_CARDS]; uint16_t slot_ahead=6; -msc_interface_t msc_interface; AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]; AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]; int flexran_agent_start(mid_t mod_id) { diff --git a/executables/softmodem-common.c b/executables/softmodem-common.c index 3e20081b18..12c60e98fd 100644 --- a/executables/softmodem-common.c +++ b/executables/softmodem-common.c @@ -45,7 +45,6 @@ static softmodem_params_t softmodem_params; char *parallel_config=NULL; char *worker_config=NULL; -msc_interface_t msc_interface; int usrp_tx_thread = 0; uint8_t nfapi_mode=0; diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index 9aca677473..47d5556c17 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -173,19 +173,16 @@ extern int usrp_tx_thread; #define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n" #define CONFIG_HLP_LOGV "Set the global log verbosity \n" #define CONFIG_HLP_TELN "Start embedded telnet server \n" -#define CONFIG_HLP_MSC "Enable the MSC tracing utility \n" #define CONFIG_FLOG_OPT "R" #define CONFIG_LOGL_OPT "g" /*-------------------------------------------------------------------------------------------------------------------------------------------------*/ /* command line parameters for LOG utility */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*-------------------------------------------------------------------------------------------------------------------------------------------------*/ -#define START_MSC softmodem_params.start_msc #define CMDLINE_LOGPARAMS_DESC { \ {CONFIG_FLOG_OPT , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ {CONFIG_LOGL_OPT , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ - {"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \ {"log-mem", NULL, 0, strptr:(char **)&logmem_filename, defstrval:NULL, TYPE_STRING, 0}, \ {"telnetclt", NULL, 0, uptr:&start_telnetclt, defstrval:NULL, TYPE_UINT, 0}, \ } @@ -250,7 +247,6 @@ typedef struct { int chain_offset; int numerology; int band; - unsigned int start_msc; uint32_t clock_source; uint32_t timing_source; int hw_timing_advance; diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 308a059d51..c92d926a8f 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -415,10 +415,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset ); - LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02"PRIu8"][]\n", eNB->Mod_id); LOG_I (PHY, "[eNB %" PRIu8 "] Initializing DL_FRAME_PARMS : N_RB_DL %" PRIu8 ", PHICH Resource %d, PHICH Duration %d\n", eNB->Mod_id, fp->N_RB_DL, fp->phich_config_common.phich_resource, fp->phich_config_common.phich_duration); - LOG_D (PHY, "[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02" PRIu8 "][]\n", eNB->Mod_id); crcTableInit(); lte_gold (fp, eNB->lte_gold_table, fp->Nid_cell); generate_pcfich_reg_mapping (fp); diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 9e1e472fd6..31ec287c3f 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -104,7 +104,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, load_dftslib(); - LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_gNB][MOD %02"PRIu8"][]\n", gNB->Mod_id); crcTableInit(); init_scrambling_luts(); init_pucch2_luts(); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index c193733aef..ab63d939d8 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -145,7 +145,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int n_scid; abstraction_flag = 0; LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx); - //LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST); phy_init_nr_top(ue); // many memory allocation sizes are hard coded AssertFatal( fp->nb_antennas_rx <= 4, "hard coded allocation for ue_common_vars->dl_ch_estimates[gNB_id]" ); diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index 2d2697a4b7..fc3d939f65 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -55,7 +55,6 @@ #include #include #include "common_lib.h" -#include "msc.h" #include "defs_common.h" #include "impl_defs_top.h" diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h index a371b2334b..c79530434a 100644 --- a/openair1/PHY/defs_common.h +++ b/openair1/PHY/defs_common.h @@ -54,7 +54,6 @@ #include #include #include "common_lib.h" -#include "msc.h" #include #include "assertions.h" diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index 030d50bc04..995a4a934e 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -55,7 +55,6 @@ #include #include "common_lib.h" -#include "msc.h" #include "defs_common.h" #include "defs_RU.h" #include "impl_defs_top.h" diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 69978f5548..650025a1be 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -44,7 +44,6 @@ #include #include #include "common_lib.h" -#include "msc.h" #include "fapi_nr_ue_interface.h" #include "assertions.h" diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 569d2a464a..ee1e0be49a 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -43,7 +43,6 @@ #include #include "assertions.h" -#include "msc.h" #include diff --git a/openair1/SCHED/prach_procedures.c b/openair1/SCHED/prach_procedures.c index 4d0fe428e8..805354ce1b 100644 --- a/openair1/SCHED/prach_procedures.c +++ b/openair1/SCHED/prach_procedures.c @@ -40,7 +40,6 @@ #include "assertions.h" -#include "msc.h" #include diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c index 15eba7b5bc..dc84279a96 100644 --- a/openair1/SCHED/ru_procedures.c +++ b/openair1/SCHED/ru_procedures.c @@ -69,7 +69,6 @@ #include "assertions.h" #include "common/utils/system.h" -#include "msc.h" #include diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index 1ea8dbdf3c..b0f59d5f47 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -41,7 +41,6 @@ #include "assertions.h" -#include "msc.h" #include diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 3f4c2f71fb..5efdc52601 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -44,7 +44,6 @@ #include "T.h" #include "assertions.h" -#include "msc.h" #include // RU OFDM Modulator gNodeB diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c86f5bd682..82748cfe79 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -44,7 +44,6 @@ #include "executables/softmodem-common.h" #include "assertions.h" -#include "msc.h" #include diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index fb0f37d7ac..1b7e0a36a1 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -72,13 +72,11 @@ openair0_config_t openair0_cfg[MAX_CARDS]; uint64_t downlink_frequency[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; uint16_t sl_ahead = 0; -msc_interface_t msc_interface; uint32_t N_RB_DL = 106; //void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe); /* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */ -msc_interface_t msc_interface; uint64_t get_softmodem_optmask(void) {return 0;} softmodem_params_t *get_softmodem_params(void) {return 0;} int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); } diff --git a/openair2/F1AP/f1ap_common.h b/openair2/F1AP/f1ap_common.h index a393930c81..66451530a6 100644 --- a/openair2/F1AP/f1ap_common.h +++ b/openair2/F1AP/f1ap_common.h @@ -357,7 +357,6 @@ #include #include "T.h" #include "common/ran_context.h" -#include "msc.h" /* Checking version of ASN1C compiler */ #if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION) diff --git a/openair2/F1AP/f1ap_du_interface_management.c b/openair2/F1AP/f1ap_du_interface_management.c index ce54e90191..6d4757be6f 100644 --- a/openair2/F1AP/f1ap_du_interface_management.c +++ b/openair2/F1AP/f1ap_du_interface_management.c @@ -481,14 +481,6 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, for (int i=0; i 0, "System Information %d is missing",i); - MSC_LOG_RX_MESSAGE( - MSC_F1AP_DU, - MSC_F1AP_CU, - 0, - 0, - MSC_AS_TIME_FMT" DU_handle_F1_SETUP_RESPONSE successfulOutcome assoc_id %d", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - assoc_id); LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message\n"); itti_send_msg_to_task(TASK_F1APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p); return 0; @@ -910,14 +902,6 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, AssertFatal(TransactionId!=-1,"TransactionId was not sent\n"); LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate); F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).num_cells_to_activate = num_cells_to_activate; - MSC_LOG_RX_MESSAGE( - MSC_F1AP_DU, - MSC_F1AP_CU, - 0, - 0, - MSC_AS_TIME_FMT" DU_handle_GNB_CU_CONFIGURATION_UPDATE initiatingMessage assoc_id %d", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - assoc_id); LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message \n"); itti_send_msg_to_task(TASK_F1APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p); return 0; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index e62978782c..e5b95a7f47 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -34,7 +34,6 @@ #include "assertions.h" #include "platform_types.h" -#include "msc.h" #include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac_extern.h" @@ -1421,8 +1420,6 @@ cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rnti) { unsigned char i; RA_t *ra = (RA_t *) & RC.mac[module_idP]->common_channels[CC_id].ra[0]; - MSC_LOG_EVENT(MSC_PHY_ENB, "RA Cancelling procedure ue %" PRIx16 " ", - rnti); LOG_D(MAC, "[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n", module_idP, CC_id, frameP, rnti); diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index a4e924c68b..3eaeedee3f 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -215,7 +215,6 @@ void mac_init_cell_params(int Mod_idP, int CC_idP) int j; UE_TEMPLATE *UE_template; - LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_eNB][MOD %02d][]\n", Mod_idP); //COMMON_channels_t *cc = &RC.mac[Mod_idP]->common_channels[CC_idP]; memset(&RC.mac[Mod_idP]->eNB_stats, 0, sizeof(eNB_STATS)); diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c index 1aa959e103..af68cebbe1 100644 --- a/openair2/LAYER2/MAC/ra_procedures.c +++ b/openair2/LAYER2/MAC/ra_procedures.c @@ -348,7 +348,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id, Size16 = (uint16_t) Size; // LOG_D(MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",module_idP,frameP,Size); LOG_I(RRC, - "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n", + "[FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n", frameP, module_idP, eNB_indexP, module_idP); LOG_I(MAC, "[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n", diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 4d2e157728..9fb290e6a1 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -48,7 +48,6 @@ #include "platform_constants.h" #include "nfapi/oai_integration/vendor_ext.h" #include "common/utils/LOG/vcd_signal_dumper.h" -#include "msc.h" #include "common/ngran_types.h" #include "targets/COMMON/openairinterface5g_limits.h" #include "targets/RT/USER/lte-softmodem.h" @@ -1058,14 +1057,6 @@ pdcp_data_ind( ctxt_pP->rnti, rb_id + 4, sdu_buffer_sizeP - payload_offset ); - MSC_LOG_TX_MESSAGE( - MSC_PDCP_ENB, - MSC_GTPU_ENB, - NULL,0, - "0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u", - ctxt_pP->rnti, - rb_id + 4, - sdu_buffer_sizeP - payload_offset); //LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset); gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U, sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX); @@ -2228,20 +2219,6 @@ pdcp_config_set_security( pdcp_pP->kUPenc = kUPenc; /* Activate security */ pdcp_pP->security_activated = 1; - MSC_LOG_EVENT( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - "0 Set security ciph %X integ %x UE %"PRIx16" ", - pdcp_pP->cipheringAlgorithm, - pdcp_pP->integrityProtAlgorithm, - ctxt_pP->rnti); - } else { - MSC_LOG_EVENT( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - "0 Set security failed UE %"PRIx16" ", - ctxt_pP->rnti); - LOG_E(PDCP,PROTOCOL_PDCP_CTXT_FMT" bad security mode %d", - PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP), - security_modeP); } } diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index b49b020428..1e126f878a 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -58,7 +58,6 @@ extern int otg_enabled; #include "nfapi/oai_integration/vendor_ext.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "platform_constants.h" -#include "msc.h" #include "pdcp.h" #include "assertions.h" @@ -343,12 +342,6 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %ld][RB %ld][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %04x][RB %ld]\n", ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id, ctxt.rnti, rab_id); - MSC_LOG_RX_MESSAGE((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL, 0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt.instance, rab_id, rab_id, len); pdcp_data_req( &ctxt, SRB_FLAG_NO, @@ -368,14 +361,6 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p // , NULL, NULL // ); } else { - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt.instance, rab_id, rab_id, len); LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %ld][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %04x][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n", ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id, @@ -566,17 +551,6 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx (NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.destinationL2Id ); } else { /* else of h_rc == HASH_TABLE_OK */ - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - pdcp_read_header_g.inst, - pdcp_read_header_g.rb_id, - rab_id, - pdcp_read_header_g.data_size); LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n", ctxt.frame, @@ -739,17 +713,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP) ctxt.module_id, ctxt.rnti, rab_id); - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - pc5s_header->inst, - pc5s_header->rb_id, - rab_id, - pc5s_header->data_size); /* pointers to pc5s_header fields possibly not aligned because pc5s_header points to a packed structure * Using these possibly unaligned pointers in a function call may trigger alignment errors at run time and * gcc, from v9, now warns about it. fix these warnings by using local variables @@ -771,17 +734,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP) pc5s_header->sourceL2Id = sourceL2Id; pc5s_header->destinationL2Id=destinationL2Id; } else { /* else of h_rc == HASH_TABLE_OK */ - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - pc5s_header->inst, - pc5s_header->rb_id, - rab_id, - pc5s_header->data_size); LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n", ctxt.frame, @@ -803,16 +755,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP) ctxt.module_id, ctxt.rnti, DEFAULT_RAB_ID); - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL,0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u default rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - pc5s_header->inst, - pc5s_header->rb_id, - DEFAULT_RAB_ID, - pc5s_header->data_size); /* pointers to pc5s_header fields possibly not aligned because pc5s_header points to a packed structure * Using these possibly unaligned pointers in a function call may trigger alignment errors at run time and * gcc, from v9, now warns about it. fix these warnings by using local variables diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c index 891c38209b..0bd1b8fa8d 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c @@ -60,7 +60,6 @@ #include "pdcp.h" #include "pdcp_primitives.h" -#include "msc.h" #define PDCP_QUEUE_NB_ELEMENTS 200 @@ -187,7 +186,6 @@ void *pdcp_netlink_thread_fct(void *arg) pdcp_thread_read_state = 0; memset(nl_rx_buf, 0, NL_MAX_PAYLOAD); LOG_I(PDCP, "[NETLINK_THREAD] binding to fd %d\n",nas_sock_fd); - MSC_START_USE(); while (1) { len = recvmsg(nas_sock_fd, &nas_msg_rx, 0); diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c index cb108f5d26..6664dd2a33 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c @@ -37,7 +37,6 @@ #include "LAYER2/MAC/mac_extern.h" #include "pdcp.h" -#include "msc.h" #include "pdcp_primitives.h" //----------------------------------------------------------------------------- @@ -223,11 +222,6 @@ pdcp_validate_security( if (stream_check_integrity(pdcp_pP->integrityProtAlgorithm, &decrypt_params, &pdcp_pdu_buffer[sdu_buffer_size]) != 0) { - MSC_LOG_EVENT( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - " Security: failed MAC-I Algo %X UE %"PRIx16" ", - pdcp_pP->integrityProtAlgorithm, - ctxt_pP->rnti); LOG_E(PDCP, "[OSA][RB %ld] %s failed to validate MAC-I (key %llx) of incoming PDU\n", rb_id, (pdcp_pP->is_ue != 0) ? "UE" : "eNB",((long long unsigned int*)decrypt_params.key)[0]); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_VALIDATE_SECURITY, VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index de947225bb..4eb0907046 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -27,7 +27,6 @@ //----------------------------------------------------------------------------- #include "assertions.h" -#include "msc.h" #include "hashtable.h" #include "rlc_am.h" #include "rlc_am_segment.h" @@ -238,17 +237,6 @@ void config_req_rlc_am_asn1 ( (config_am_pP->ul_AM_RLC.t_PollRetransmitdl_AM_RLC.t_Reordering<32) && (config_am_pP->dl_AM_RLC.t_StatusProhibitenb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_PollRetx %u t_Reord %u t_StatusPro %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit], - am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering], - t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]); LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d)\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p), maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold], @@ -267,14 +255,6 @@ void config_req_rlc_am_asn1 ( am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering], t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]); } else { - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p)); LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"ILLEGAL CONFIG_REQ (max_retx_threshold=%ld poll_pdu=%ld poll_byte=%ld t_poll_retransmit=%ld t_reord=%ld t_status_prohibit=%ld), RLC-AM NOT CONFIGURED\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p), @@ -537,27 +517,6 @@ rlc_am_mac_status_indication ( } } - if (MESSAGE_CHART_GENERATOR) { - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE, - NULL,0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-IND %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc)); - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE, - NULL,0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-RESP BO:%u/n%u(%u) %s sdu remain %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc), - status_resp.buffer_occupancy_in_bytes, - status_resp.buffer_occupancy_in_pdus,rlc->nb_sdu, - (status_resp.head_sdu_is_segmented)?"sdu seg":"sdu not seg", - status_resp.head_sdu_remaining_size_to_send); - } - if (LOG_DEBUGFLAG(DEBUG_RLC)) { LOG_UI(RLC, PROTOCOL_RLC_AM_CTXT_FMT" MAC_STATUS_INDICATION (DATA) -> %d bytes\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc), @@ -610,7 +569,7 @@ rlc_am_mac_data_request ( data_req.rlc_info.rlc_protocol_state = l_rlc_p->protocol_state; - if ( (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC))&& data_req.data.nb_elements > 0) { + if ( (LOG_DEBUGFLAG(DEBUG_RLC))&& data_req.data.nb_elements > 0) { tb_p = data_req.data.head; while (tb_p != NULL) { @@ -619,39 +578,6 @@ rlc_am_mac_data_request ( if ((((struct mac_tb_req *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) { if (rlc_am_get_data_pdu_infos(ctxt_pP,l_rlc_p,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) { - if (MESSAGE_CHART_GENERATOR) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA SN %u size %u RF %u P %u FI %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - pdu_info.sn, - tb_size_in_bytes, - pdu_info.rf, - pdu_info.p, - pdu_info.fi); - - if (pdu_info.rf) { - message_string_size += sprintf(&message_string[message_string_size], " LSF %u\n", pdu_info.lsf); - message_string_size += sprintf(&message_string[message_string_size], " SO %u\n", pdu_info.so); - } - - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "| HE:"); - - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]); - } - } - - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (char *)rlc_am_pdu_sn_10_p, - tb_size_in_bytes, - message_string); - } - if ( LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size = 0; message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); @@ -723,34 +649,6 @@ rlc_am_mac_data_request ( if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &l_rlc_p->control_pdu_info) >= 0) { tb_size_in_bytes = ((struct mac_tb_req *) (tb_p->data))->tb_size; //tb_size_in_bytes modified by rlc_am_get_control_pdu_infos! - if (MESSAGE_CHART_GENERATOR ) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS ACK_SN %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - l_rlc_p->control_pdu_info.ack_sn); - - for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) { - if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) { - message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u SO START %u SO END %u", - l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn, - l_rlc_p->control_pdu_info.nack_list[num_nack].so_start, - l_rlc_p->control_pdu_info.nack_list[num_nack].so_end); - } else { - message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u", - l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn); - } - } - - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (char *)rlc_am_pdu_sn_10_p, - tb_size_in_bytes, - message_string); - } - if ( LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size = 0; message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); @@ -780,7 +678,7 @@ rlc_am_mac_data_request ( tb_p = tb_p->next; } /* while */ - } /* MESSAGE_CHART_GENERATOR && data_req.data.nb_elements > 0 */ + } /* data_req.data.nb_elements > 0 */ data_req.buffer_occupancy_in_pdus = 0; return data_req; @@ -812,7 +710,7 @@ rlc_am_mac_data_indication ( (void)index; (void)l_rlc_p; /* avoid gcc warning "unused variable" */ - if ( LOG_DEBUGFLAG(DEBUG_RLC) || MESSAGE_CHART_GENERATOR ) { + if ( LOG_DEBUGFLAG(DEBUG_RLC)) { if (data_indP.data.nb_elements > 0) { tb_p = data_indP.data.head; @@ -822,39 +720,6 @@ rlc_am_mac_data_indication ( if ((((struct mac_tb_ind *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) { if (rlc_am_get_data_pdu_infos(ctxt_pP,l_rlc_p,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) { - if (MESSAGE_CHART_GENERATOR) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA SN %u size %u RF %u P %u FI %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - pdu_info.sn, - tb_size_in_bytes, - pdu_info.rf, - pdu_info.p, - pdu_info.fi); - - if (pdu_info.rf) { - message_string_size += sprintf(&message_string[message_string_size], " LSF %u\n", pdu_info.lsf); - message_string_size += sprintf(&message_string[message_string_size], " SO %u\n", pdu_info.so); - } - - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "| HE:"); - - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]); - } - } - - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (char *)rlc_am_pdu_sn_10_p, - tb_size_in_bytes, - message_string); - } - if ( LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes); @@ -923,34 +788,6 @@ rlc_am_mac_data_indication ( } } else { if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &l_rlc_p->control_pdu_info) >= 0) { - if (MESSAGE_CHART_GENERATOR) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS size ACK_SN %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - l_rlc_p->control_pdu_info.ack_sn); - - for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) { - if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) { - message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u SO START %u SO END %u", - l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn, - l_rlc_p->control_pdu_info.nack_list[num_nack].so_start, - l_rlc_p->control_pdu_info.nack_list[num_nack].so_end); - } else { - message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u", - l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn); - } - } - - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (char *)rlc_am_pdu_sn_10_p, - tb_size_in_bytes, - message_string); - } - if ( LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size = 0; message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); @@ -1009,16 +846,6 @@ rlc_am_data_req ( mui = ((struct rlc_am_data_req *) (sdu_pP->data))->mui; data_offset = ((struct rlc_am_data_req *) (sdu_pP->data))->data_offset; data_size = ((struct rlc_am_data_req *) (sdu_pP->data))->data_size; - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (const char *)(&sdu_pP->data[data_offset]), - data_size, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-REQ size %u mui %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - data_size, - mui); if (LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); @@ -1094,22 +921,6 @@ rlc_am_data_req ( l_rlc_p->vt_s); } } else { - if( MESSAGE_CHART_GENERATOR) { - mui = ((struct rlc_am_data_req *) (sdu_pP->data))->mui; - data_offset = ((struct rlc_am_data_req *) (sdu_pP->data))->data_offset; - data_size = ((struct rlc_am_data_req *) (sdu_pP->data))->data_size; - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (const char *)(&sdu_pP->data[data_offset]), - data_size, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-REQ size %u mui %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - data_size, - mui); - } - LOG_W(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RLC_AM_DATA_REQ BUFFER FULL, NB SDU %d current_sdu_index=%d next_sdu_index=%d size_input_sdus_buffer=%d vtA=%d vtS=%d\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p), l_rlc_p->nb_sdu, diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h index 3127f67eca..b4073303dd 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h @@ -78,16 +78,7 @@ int pmtl_rc = pthread_mutex_trylock(mUTEX);\ if (pmtl_rc != 0){\ if (pmtl_rc == EBUSY) {\ - MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 " PROTOCOL_RLC_AM_MSC_FMT " Warning try lock %s busy",\ - PROTOCOL_RLC_AM_MSC_ARGS(cTXT,rLC),\ - #mUTEX);\ pthread_mutex_lock(mUTEX);\ - } else {\ - MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 " PROTOCOL_RLC_AM_MSC_FMT " Error try lock %s %d",\ - PROTOCOL_RLC_AM_MSC_ARGS(cTXT,rLC),\ - #mUTEX, pmtl_rc);\ }\ }\ } while (0); diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c index 793d0057ac..0957c20bdf 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c @@ -30,7 +30,6 @@ #include "list.h" //#include "LAYER2/MAC/extern.h" #include "common/utils/LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- inline void @@ -152,16 +151,6 @@ rlc_am_send_sdu ( #if !ENABLE_ITTI RLC_AM_MUTEX_UNLOCK(&rlc_pP->lock_input_sdus); #endif - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (const char *)(rlc_pP->output_sdu_in_construction->data), - rlc_pP->output_sdu_size_to_write, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-IND size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), - rlc_pP->output_sdu_size_to_write - ); rlc_data_ind (ctxt_pP, BOOL_NOT(rlc_pP->is_data_plane), MBMS_FLAG_NO, diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c index f9a4affb6b..916d1513b0 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c @@ -24,7 +24,6 @@ #include "platform_types.h" //----------------------------------------------------------------------------- #include "assertions.h" -#include "msc.h" #include "rlc.h" #include "rlc_am.h" #include "list.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c index 4d34338ea9..56b37e1e39 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c @@ -28,7 +28,6 @@ #include "rlc.h" #include "LAYER2/MAC/mac_extern.h" #include "common/utils/LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- boolean_t rlc_am_nack_pdu ( const protocol_ctxt_t* const ctxt_pP, diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c index dbe55c483d..ed81e119ac 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c @@ -26,7 +26,6 @@ //----------------------------------------------------------------------------- #include "platform_types.h" //----------------------------------------------------------------------------- -#include "msc.h" #include "list.h" #include "rlc_am.h" #include "LAYER2/MAC/mac_extern.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c index e421a36619..969ed2d7a5 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c @@ -29,7 +29,6 @@ #include "rlc_am.h" #include "LAYER2/MAC/mac_extern.h" #include "common/utils/LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- void rlc_am_check_timer_poll_retransmit( @@ -69,11 +68,6 @@ rlc_am_check_timer_poll_retransmit( rlc_pP->t_poll_retransmit.running = 0; rlc_pP->t_poll_retransmit.timed_out = 1; rlc_pP->stat_timer_poll_retransmit_timed_out += 1; -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit timed-out",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] TIME-OUT\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); @@ -144,11 +138,6 @@ rlc_am_stop_and_reset_timer_poll_retransmit( rlc_pP->t_poll_retransmit.ms_time_out = 0; rlc_pP->t_poll_retransmit.ms_start = 0; rlc_pP->t_poll_retransmit.timed_out = 0; -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit stopped & reseted",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif } //----------------------------------------------------------------------------- void @@ -167,11 +156,6 @@ rlc_am_start_timer_poll_retransmit( LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] STARTED (TIME-OUT = FRAME %05d)\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_poll_retransmit.ms_time_out); -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit started (TO %u ms)",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_poll_retransmit.ms_time_out); -#endif } else { LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c index 262b8a8391..d161d29a65 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c @@ -28,7 +28,6 @@ #include "rlc_am.h" # include "LAYER2/MAC/mac_extern.h" #include "common/utils//LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- void rlc_am_check_timer_reordering( @@ -64,12 +63,6 @@ rlc_am_check_timer_reordering( // - start t-Reordering; // - set VR(X) to VR(H). -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering timed out",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif - //AssertFatal (rlc_pP->vr_x != RLC_SN_UNDEFINED, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id); if(rlc_pP->vr_x == RLC_SN_UNDEFINED){ LOG_E(RLC, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id); @@ -153,11 +146,6 @@ rlc_am_stop_and_reset_timer_reordering( rlc_pP->t_reordering.ms_time_out = 0; rlc_pP->t_reordering.ms_start = 0; rlc_pP->t_reordering.timed_out = 0; -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering stopped & reseted",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif } //----------------------------------------------------------------------------- void @@ -175,11 +163,6 @@ rlc_am_start_timer_reordering( LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] STARTED (TIME-OUT = %5u ms)\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_reordering.ms_time_out); -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering started (TO %u ms)",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_reordering.ms_time_out); -#endif } else { LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] NOT STARTED, CAUSE CONFIGURED 0 ms\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c index 5b0b0a70fa..aae7465bcf 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c @@ -28,7 +28,6 @@ #include "rlc_am.h" #include "LAYER2/MAC/mac_extern.h" #include "common/utils/LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- void rlc_am_check_timer_status_prohibit( @@ -60,12 +59,6 @@ rlc_am_check_timer_status_prohibit( rlc_pP->t_status_prohibit.running = 0; rlc_pP->t_status_prohibit.timed_out = 1; rlc_pP->stat_timer_status_prohibit_timed_out += 1; - -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit timed out",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] TIME-OUT\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); //#warning TO DO rlc_am_check_timer_status_prohibit @@ -91,11 +84,6 @@ rlc_am_stop_and_reset_timer_status_prohibit( rlc_pP->t_status_prohibit.ms_time_out = 0; rlc_pP->t_status_prohibit.ms_start = 0; rlc_pP->t_status_prohibit.timed_out = 0; -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit stopped & reseted",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif } } //----------------------------------------------------------------------------- @@ -117,11 +105,6 @@ rlc_am_start_timer_status_prohibit( PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_status_prohibit.ms_time_out); LOG_D(RLC, "TIME-OUT = FRAME %u\n", rlc_pP->t_status_prohibit.ms_time_out); -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit started (TO %u ms)",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_status_prohibit.ms_time_out); -#endif } else { LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c index 654ddb8da7..1d40b12cc8 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c @@ -30,7 +30,6 @@ #include "intertask_interface.h" #endif #include "assertions.h" -#include "msc.h" #include "rlc_um.h" #include "list.h" #include "rlc_primitives.h" @@ -166,7 +165,6 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind char message_string[10000]; mem_block_t *tb_p; int16_t tb_size_in_bytes; - size_t message_string_size = 0; rlc_um_pdu_info_t pdu_info; int index; int octet_index; @@ -183,38 +181,15 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind LOG_I(RLC, PROTOCOL_RLC_UM_CTXT_FMT" ERROR MAC_DATA_IND IN RLC_NULL_STATE\n", PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,l_rlc_p)); - if (data_indP.data.nb_elements > 0 && MESSAGE_CHART_GENERATOR) { + if (data_indP.data.nb_elements > 0) { tb_p = data_indP.data.head; while (tb_p != NULL) { tb_size_in_bytes = ((struct mac_tb_ind *) (tb_p->data))->size; rlc_um_get_pdu_infos(ctxt_pP,l_rlc_p,(rlc_um_pdu_sn_10_t *) ((struct mac_tb_ind *) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length); - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT"DATA SN %u size %u FI %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p), - pdu_info.sn, - tb_size_in_bytes, - pdu_info.fi); - - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "| HE:"); - - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]); - } - } - - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (const char *)pdu_info.payload, - tb_size_in_bytes, - message_string); tb_p = tb_p->next; } - }/*MESSAGE_CHART_GENERATOR*/ + } list_free (&data_indP.data); break; @@ -237,7 +212,7 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind // - enters the LOCAL_SUSPEND state. data_indP.tb_size = data_indP.tb_size >> 3; - if (data_indP.data.nb_elements > 0 && (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC))) { + if (data_indP.data.nb_elements > 0 && (LOG_DEBUGFLAG(DEBUG_RLC))) { LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" MAC_DATA_IND %d TBs\n", PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,l_rlc_p), data_indP.data.nb_elements); @@ -251,32 +226,6 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind &pdu_info, l_rlc_p->rx_sn_length); - if (MESSAGE_CHART_GENERATOR) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT"DATA SN %u size %u FI %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p), - pdu_info.sn, - tb_size_in_bytes, - pdu_info.fi); - - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "| HE:"); - - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]); - } - } - - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (char *)pdu_info.payload, - tb_size_in_bytes, - message_string); - } - if (LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size = 0; message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); @@ -483,89 +432,61 @@ rlc_um_mac_data_request (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP,cons continue; } - if (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC) ) { + if (LOG_DEBUGFLAG(DEBUG_RLC) ) { rlc_um_get_pdu_infos(ctxt_pP, l_rlc_p,(rlc_um_pdu_sn_10_t *) ((struct mac_tb_req *) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length); - if(MESSAGE_CHART_GENERATOR) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA SN %u size %u FI %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p), - pdu_info.sn, - tb_size_in_bytes, - pdu_info.fi); + message_string_size = 0; + message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); + message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes); + message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size); + message_string_size += sprintf(&message_string[message_string_size], "Payload size: %u\n", pdu_info.payload_size); + message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC UM DATA IND: UMD PDU\n\n"); + message_string_size += sprintf(&message_string[message_string_size], "Header :\n"); + message_string_size += sprintf(&message_string[message_string_size], " FI : %u\n", pdu_info.fi); + message_string_size += sprintf(&message_string[message_string_size], " E : %u\n", pdu_info.e); + message_string_size += sprintf(&message_string[message_string_size], " SN : %u\n", pdu_info.sn); - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "|HE:"); + if (pdu_info.e) { + message_string_size += sprintf(&message_string[message_string_size], "\nHeader extension : \n"); - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]); - } + for (index=0; index < pdu_info.num_li; index++) { + message_string_size += sprintf(&message_string[message_string_size], " LI : %u\n", pdu_info.li_list[index]); } - - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (const char *)pdu_info.payload, - pdu_info.payload_size, - message_string); } - if(LOG_DEBUGFLAG(DEBUG_RLC)) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); - message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes); - message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size); - message_string_size += sprintf(&message_string[message_string_size], "Payload size: %u\n", pdu_info.payload_size); - message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC UM DATA IND: UMD PDU\n\n"); - message_string_size += sprintf(&message_string[message_string_size], "Header :\n"); - message_string_size += sprintf(&message_string[message_string_size], " FI : %u\n", pdu_info.fi); - message_string_size += sprintf(&message_string[message_string_size], " E : %u\n", pdu_info.e); - message_string_size += sprintf(&message_string[message_string_size], " SN : %u\n", pdu_info.sn); + message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n"); + message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n"); + message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n"); + message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n"); - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "\nHeader extension : \n"); - - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI : %u\n", pdu_info.li_list[index]); - } - } - - message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n"); - message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n"); - message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n"); - message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n"); - - for (octet_index = 0; octet_index < pdu_info.payload_size; octet_index++) { - if ((octet_index % 16) == 0) { - if (octet_index != 0) { - message_string_size += sprintf(&message_string[message_string_size], " |\n"); - } - - message_string_size += sprintf(&message_string[message_string_size], " %04d |", octet_index); + for (octet_index = 0; octet_index < pdu_info.payload_size; octet_index++) { + if ((octet_index % 16) == 0) { + if (octet_index != 0) { + message_string_size += sprintf(&message_string[message_string_size], " |\n"); } - /* - * Print every single octet in hexadecimal form - */ - message_string_size += sprintf(&message_string[message_string_size], " %02x", pdu_info.payload[octet_index]); - /* - * Align newline and pipes according to the octets in groups of 2 - */ + message_string_size += sprintf(&message_string[message_string_size], " %04d |", octet_index); } /* - * Append enough spaces and put final pipe + * Print every single octet in hexadecimal form */ - for (index = octet_index; index < 16; ++index) { - message_string_size += sprintf(&message_string[message_string_size], " "); - } + message_string_size += sprintf(&message_string[message_string_size], " %02x", pdu_info.payload[octet_index]); + /* + * Align newline and pipes according to the octets in groups of 2 + */ + } - message_string_size += sprintf(&message_string[message_string_size], " |\n"); - LOG_UI(RLC, "%s\n", message_string); - } /*LOG_DEBUGFLAG(DEBUG_RLC) */ - } /* MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC) */ + /* + * Append enough spaces and put final pipe + */ + for (index = octet_index; index < 16; ++index) { + message_string_size += sprintf(&message_string[message_string_size], " "); + } + + message_string_size += sprintf(&message_string[message_string_size], " |\n"); + LOG_UI(RLC, "%s\n", message_string); + } /* LOG_DEBUGFLAG(DEBUG_RLC) */ tb_p = tb_p->next; } /* while (tb_p != NULL) */ @@ -607,15 +528,6 @@ rlc_um_data_req (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, mem_block_t //rlc_p->next_sdu_index = (rlc_p->next_sdu_index + 1) % rlc_p->size_input_sdus_buffer; rlc_p->stat_tx_pdcp_sdu += 1; rlc_p->stat_tx_pdcp_bytes += ((struct rlc_um_tx_sdu_management *) (sdu_pP->data))->sdu_size; - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA-REQ size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, rlc_p), - ((struct rlc_um_tx_sdu_management *) (sdu_pP->data))->sdu_size); if (LOG_DEBUGFLAG(DEBUG_RLC) ) { data_offset = sizeof (struct rlc_um_data_req_alloc); @@ -660,14 +572,6 @@ rlc_um_data_req (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, mem_block_t list_add_tail_eurecom(sdu_pP, &rlc_p->input_sdus); RLC_UM_MUTEX_UNLOCK(&rlc_p->lock_input_sdus); - if (MESSAGE_CHART_GENERATOR) { - if (rlc_p->buffer_occupancy > 4096) { - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" BO %u bytes",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_p), rlc_p->buffer_occupancy); - } - } - LOG_T(RLC, PROTOCOL_RLC_UM_CTXT_FMT" BO %d , NB SDU %d\n", PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p), rlc_p->buffer_occupancy, diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h index be06551dde..bd04ff3ece 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h @@ -56,28 +56,13 @@ rLC_Pp->rb_id,\ __FUNCTION__ -#define PROTOCOL_RLC_UM_MSC_FMT "[RNTI %" PRIx16 " %s %02ld]" -#define PROTOCOL_RLC_UM_MSC_ARGS(CTXT_Pp, rLC_Pp) \ - CTXT_Pp->rnti,\ - (rLC_Pp->is_data_plane) ? "DRB UM" : "SRB UM",\ - rLC_Pp->rb_id - #if defined(TRACE_RLC_MUTEX) #define RLC_UM_MUTEX_LOCK(mUTEX, cTXT, rLC) \ do {\ int pmtl_rc = pthread_mutex_trylock(mUTEX);\ if (pmtl_rc != 0){\ if (pmtl_rc == EBUSY) {\ - MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 " PROTOCOL_RLC_UM_MSC_FMT " Warning try lock %s busy",\ - PROTOCOL_RLC_UM_MSC_ARGS(cTXT,rLC),\ - #mUTEX);\ pthread_mutex_lock(mUTEX);\ - } else {\ - MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 " PROTOCOL_RLC_UM_MSC_FMT " Error try lock %s %d",\ - PROTOCOL_RLC_UM_MSC_ARGS(cTXT,rLC),\ - #mUTEX, pmtl_rc);\ }\ }\ } while (0); diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c index 05c3423f76..bec815ac5d 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c @@ -32,7 +32,6 @@ #include "rlc_um_control_primitives.h" #include "LTE_T-Reordering.h" -#include "msc.h" //----------------------------------------------------------------------------- void config_req_rlc_um ( @@ -173,15 +172,6 @@ void config_req_rlc_um_asn1 ( PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p), rlc_p->rb_id, ul_rlc_pP->sn_FieldLength); - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ UL sn_FieldLength %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p), - ul_rlc_pP->sn_FieldLength); return; } } @@ -201,15 +191,6 @@ void config_req_rlc_um_asn1 ( PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p), rlc_p->rb_id, dl_rlc_pP->sn_FieldLength); - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ DL sn_FieldLength %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p), - dl_rlc_pP->sn_FieldLength); return; } @@ -220,15 +201,6 @@ void config_req_rlc_um_asn1 ( PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p), rlc_p->rb_id, dl_rlc_pP->t_Reordering); - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p), - dl_rlc_pP->t_Reordering); return; } } @@ -239,34 +211,12 @@ void config_req_rlc_um_asn1 ( ul_sn_FieldLength, dl_sn_FieldLength, mbms_flagP); - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u rx snfl %u tx snfl %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p), - t_Reordering, - ul_sn_FieldLength, - dl_sn_FieldLength); } else { rlc_um_configure(ctxt_pP,rlc_p, t_Reordering, dl_sn_FieldLength, ul_sn_FieldLength, mbms_flagP); - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u rx snfl %u tx snfl %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p), - t_Reordering, - dl_sn_FieldLength, - ul_sn_FieldLength); } } } diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c index c8faa08358..6d2380d4ff 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c @@ -24,7 +24,6 @@ #include "platform_types.h" #include "assertions.h" //----------------------------------------------------------------------------- -#include "msc.h" #include "rlc.h" #include "rlc_um.h" #include "rlc_primitives.h" diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c index 2eba223803..ca43dab667 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c @@ -35,7 +35,6 @@ #include "list.h" #include "LAYER2/MAC/mac_extern.h" #include "common/utils/LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- inline void @@ -117,17 +116,6 @@ rlc_um_send_sdu (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP) rlc_pP->stat_rx_pdcp_sdu += 1; rlc_pP->stat_rx_pdcp_bytes += rlc_pP->output_sdu_size_to_write; - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (const char*)(rlc_pP->output_sdu_in_construction->data), - rlc_pP->output_sdu_size_to_write, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA-IND size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP,rlc_pP), - rlc_pP->output_sdu_size_to_write - ); - #if TEST_RLC_UM #if TRACE_RLC_UM_DISPLAY_ASCII_DATA rlc_pP->output_sdu_in_construction->data[rlc_pP->output_sdu_size_to_write] = 0; diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c index 932bb1376e..4c047e3d92 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c @@ -27,7 +27,6 @@ //----------------------------------------------------------------------------- #include #include "assertions.h" -#include "msc.h" #include "list.h" #include "rlc_um.h" #include "rlc_primitives.h" diff --git a/openair2/M2AP/m2ap_MCE_generate_messages.c b/openair2/M2AP/m2ap_MCE_generate_messages.c index a28097cf1a..969863b445 100644 --- a/openair2/M2AP/m2ap_MCE_generate_messages.c +++ b/openair2/M2AP/m2ap_MCE_generate_messages.c @@ -39,7 +39,6 @@ #include "m2ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -174,8 +173,6 @@ int m2ap_MCE_generate_m2_setup_request( return -1; } - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); - m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0); return ret; @@ -311,8 +308,6 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC m2ap_MCE_data_p->state = M2AP_MCE_STATE_READY; - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id); - m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0); return ret; @@ -367,11 +362,6 @@ int m2ap_MCE_generate_m2_setup_failure(instance_t instance, return -1; } - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, - // MSC_M2AP_TARGET_MCE, NULL, 0, - // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u", - // assoc_id, cause_type, cause_value); - m2ap_MCE_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0); return ret; @@ -557,8 +547,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -650,8 +638,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -712,8 +698,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -796,8 +780,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; diff --git a/openair2/M2AP/m2ap_MCE_handler.c b/openair2/M2AP/m2ap_MCE_handler.c index 5a0e303218..3f6d5ff64d 100644 --- a/openair2/M2AP/m2ap_MCE_handler.c +++ b/openair2/M2AP/m2ap_MCE_handler.c @@ -44,7 +44,6 @@ #include "m2ap_MCE_interface_management.h" //#include "m2ap_eNB_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair2/M2AP/m2ap_MCE_interface_management.c b/openair2/M2AP/m2ap_MCE_interface_management.c index 3b12f41cbe..28f5fccffa 100644 --- a/openair2/M2AP/m2ap_MCE_interface_management.c +++ b/openair2/M2AP/m2ap_MCE_interface_management.c @@ -210,16 +210,7 @@ int MCE_handle_MBMS_SESSION_START_RESPONSE(instance_t instance, AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n"); AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n"); //M2AP_SESSION_START_RESP(msg_p). -// MSC_LOG_RX_MESSAGE( -// MSC_M2AP_MCE, -// MSC_M2AP_ENB, - //return 0; -// 0, -// 0, -// MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d", -// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// assoc_id); -// + LOG_D(M2AP, "Sending M2AP_SESSION_START_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); itti_send_msg_to_task(TASK_MCE_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_g); @@ -348,14 +339,6 @@ int MCE_handle_MBMS_SESSION_STOP_RESPONSE(instance_t instance, AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n"); AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n"); // M2AP_SESSION_STOP_RESP(msg_p). - // MSC_LOG_RX_MESSAGE( - // MSC_M2AP_MCE, - // MSC_M2AP_ENB, - // 0, - // 0, - // MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_STOP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); // LOG_D(M2AP, "Sending M2AP_SESSION_START_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); @@ -645,14 +628,6 @@ int MCE_handle_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance, // } // // M2AP_SESSION_STOP_RESP(msg_p). -// MSC_LOG_RX_MESSAGE( -// MSC_M2AP_MCE, -// MSC_M2AP_ENB, -// 0, -// 0, -// MSC_AS_TIME_FMT" MCE_handle_M2_SCHEDULING_INFORMATION_RESPONSE successfulOutcome assoc_id %d", -// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// assoc_id); // // LOG_D(M2AP, "Sending M2AP_SCHEDULING_INFO_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); @@ -836,15 +811,6 @@ int MCE_handle_M2_SETUP_REQUEST(instance_t instance, *m2ap_mce_data_from_enb = M2AP_SETUP_REQ(message_p); //printf("m2ap_mce_data_from_enb->assoc_id %d %d\n",m2ap_mce_data_from_enb->assoc_id,assoc_id); -// MSC_LOG_TX_MESSAGE( -// MSC_M2AP_MCE, -// MSC_RRC_ENB, -// 0, -// 0, -// MSC_AS_TIME_FMT" MCE_handle_M2_SETUP_REQUEST", -// 0,0//MSC_AS_TIME_ARGS(ctxt_pP), -// ); -// if (num_mbms_available > 0) { itti_send_msg_to_task(TASK_MCE_APP, ENB_MODULE_ID_TO_INSTANCE(instance), message_p); } else { @@ -1217,15 +1183,6 @@ int MCE_handle_MCE_CONFIGURATION_UPDATE_FAILURE(instance_t instance, //for (int i=0;i 0, "System Information %d is missing",i); - //MSC_LOG_RX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_CU, - // 0, - // 0, - // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); - //LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id)); @@ -1430,16 +1387,7 @@ int MCE_handle_MBMS_SERVICE_COUNTING_RESPONSE(instance_t instance, //AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n"); //AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n"); //M2AP_SESSION_START_RESP(msg_p). -// MSC_LOG_RX_MESSAGE( -// MSC_M2AP_MCE, -// MSC_M2AP_ENB, - //return 0; -// 0, -// 0, -// MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d", -// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// assoc_id); -// + //LOG_D(M2AP, "Sending ITTI message to ENB_APP with assoc_id (%d->%d)\n", //assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); diff --git a/openair2/M2AP/m2ap_eNB_generate_messages.c b/openair2/M2AP/m2ap_eNB_generate_messages.c index b6c821e1ce..6496d608b8 100644 --- a/openair2/M2AP/m2ap_eNB_generate_messages.c +++ b/openair2/M2AP/m2ap_eNB_generate_messages.c @@ -39,7 +39,6 @@ #include "m2ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -169,15 +168,6 @@ // // // LOG_W(M2AP,"pdu.present %d\n",pdu.present); -// // MSC_LOG_TX_MESSAGE( -// // MSC_M2AP_eNB, -// // MSC_M2AP_MCE, -// // (const char *)buffer, -// // len, -// // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", -// // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// // m2ap_eNB_data_p->ENBname); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p, m2ap_eNB_data_p->assoc_id, buffer, len, 0); // // return 0; @@ -315,8 +305,6 @@ // // m2ap_eNB_data_p->state = M2AP_ENB_STATE_READY; // -// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 0); // // return ret; @@ -371,11 +359,6 @@ // return -1; // } // -// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, -// // MSC_M2AP_TARGET_ENB, NULL, 0, -// // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u", -// // assoc_id, cause_type, cause_value); -// // m2ap_eNB_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0); // // return ret; @@ -561,8 +544,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -654,8 +635,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -716,8 +695,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -800,8 +777,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; diff --git a/openair2/M2AP/m2ap_eNB_handler.c b/openair2/M2AP/m2ap_eNB_handler.c index 9abc337408..7c4a9758da 100644 --- a/openair2/M2AP/m2ap_eNB_handler.c +++ b/openair2/M2AP/m2ap_eNB_handler.c @@ -44,7 +44,6 @@ //#include "m2ap_MCE_interface_management.h" #include "m2ap_eNB_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair2/M2AP/m2ap_eNB_interface_management.c b/openair2/M2AP/m2ap_eNB_interface_management.c index 486e382e69..9bab800525 100644 --- a/openair2/M2AP/m2ap_eNB_interface_management.c +++ b/openair2/M2AP/m2ap_eNB_interface_management.c @@ -44,7 +44,6 @@ #include "m2ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -255,15 +254,6 @@ int eNB_send_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance, m2ap_mbms LOG_D(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); - m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0); return 0; } @@ -359,14 +349,6 @@ int eNB_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m2ap_session_start LOG_D(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0); return 0; @@ -531,14 +513,6 @@ int eNB_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m2ap_session_stop_r LOG_D(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0); return 0; @@ -700,15 +674,6 @@ int eNB_send_M2_SETUP_REQUEST(m2ap_eNB_instance_t *instance_p, m2ap_eNB_data_t* LOG_D(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); - // buffer = &bytes[0]; // len = 40; @@ -826,15 +791,6 @@ int eNB_handle_M2_SETUP_RESPONSE(instance_t instance, //for (int i=0;i 0, "System Information %d is missing",i); - //MSC_LOG_RX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_CU, - // 0, - // 0, - // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); - //LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id)); //itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p2); @@ -880,15 +836,6 @@ int eNB_handle_M2_SETUP_FAILURE(instance_t instance, //for (int i=0;i 0, "System Information %d is missing",i); - //MSC_LOG_RX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_CU, - // 0, - // 0, - // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); - //LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id)); @@ -1025,15 +972,6 @@ int eNB_send_eNB_CONFIGURATION_UPDATE(instance_t instance, m2ap_enb_configuratio LOG_D(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); - // buffer = &bytes[0]; // len = 40; @@ -1086,15 +1024,6 @@ int eNB_handle_eNB_CONFIGURATION_UPDATE_FAILURE(instance_t instance, //for (int i=0;i 0, "System Information %d is missing",i); - //MSC_LOG_RX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_CU, - // 0, - // 0, - // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); - //LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id)); diff --git a/openair2/M2AP/m2ap_handler.c b/openair2/M2AP/m2ap_handler.c index 1221bcedb5..6d8405db14 100644 --- a/openair2/M2AP/m2ap_handler.c +++ b/openair2/M2AP/m2ap_handler.c @@ -44,7 +44,6 @@ #include "m2ap_MCE_interface_management.h" #include "m2ap_eNB_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair2/RRC/LTE/L2_interface.c b/openair2/RRC/LTE/L2_interface.c index 3759519228..0a63acc8fb 100644 --- a/openair2/RRC/LTE/L2_interface.c +++ b/openair2/RRC/LTE/L2_interface.c @@ -43,7 +43,6 @@ #include "common/utils/LOG/log.h" #include "rrc_eNB_UE_context.h" #include "pdcp.h" -#include "msc.h" #include "common/ran_context.h" #include "intertask_interface.h" diff --git a/openair2/RRC/LTE/L2_interface_common.c b/openair2/RRC/LTE/L2_interface_common.c index f70cc68550..1993fe7de0 100644 --- a/openair2/RRC/LTE/L2_interface_common.c +++ b/openair2/RRC/LTE/L2_interface_common.c @@ -34,7 +34,6 @@ #include "common/utils/LOG/log.h" #include "rrc_eNB_UE_context.h" #include "pdcp.h" -#include "msc.h" #include "common/ran_context.h" #include "intertask_interface.h" @@ -62,16 +61,6 @@ rrc_data_req( return FALSE; } - MSC_LOG_TX_MESSAGE( - ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE, - ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE, - buffer_pP, - sdu_sizeP, - MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->rnti, - muiP, - sdu_sizeP); MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). uint8_t *message_buffer; diff --git a/openair2/RRC/LTE/L2_interface_ue.c b/openair2/RRC/LTE/L2_interface_ue.c index 5c1800cdd4..534030864a 100644 --- a/openair2/RRC/LTE/L2_interface_ue.c +++ b/openair2/RRC/LTE/L2_interface_ue.c @@ -44,7 +44,6 @@ #include "common/utils/LOG/log.h" #include "rrc_eNB_UE_context.h" #include "pdcp.h" -#include "msc.h" #include "intertask_interface.h" @@ -274,16 +273,6 @@ rrc_data_req_ue( ) //------------------------------------------------------------------------------ { - MSC_LOG_TX_MESSAGE( - ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE, - ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE, - buffer_pP, - sdu_sizeP, - MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->rnti, - muiP, - sdu_sizeP); { MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index d0b89abb51..b46bba2492 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -71,7 +71,6 @@ #include "pdcp.h" #include "plmn_data.h" -#include "msc.h" #include #include "intertask_interface.h" @@ -1390,16 +1389,6 @@ rrc_ue_process_radioResourceConfigDedicated( uint8_t *kUPenc = NULL; derive_key_up_enc(UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm, UE_rrc_inst[ctxt_pP->module_id].kenb, &kUPenc); - MSC_LOG_TX_MESSAGE( - MSC_RRC_UE, - MSC_PDCP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security %X)", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->rnti, - UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm | - (UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm << 4)); // Refresh DRBs rrc_pdcp_config_asn1_req(ctxt_pP, (LTE_SRB_ToAddModList_t *)NULL, diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 260b6fceaa..b78c6d0c62 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -58,7 +58,6 @@ #include "rlc.h" #include "rrc_eNB_UE_context.h" #include "platform_types.h" -#include "msc.h" #include "LTE_SL-CommConfig-r12.h" #include "LTE_PeriodicBSR-Timer-r12.h" #include "LTE_RetxBSR-Timer-r12.h" @@ -1247,16 +1246,6 @@ rrc_eNB_generate_SecurityModeCommand( size, rrc_eNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" securityModeCommand UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); if (!NODE_IS_DU(RC.rrc[ctxt_pP->module_id]->node_type)) { LOG_I(RRC,"calling rrc_data_req :securityModeCommand\n"); @@ -1301,16 +1290,6 @@ rrc_eNB_generate_UECapabilityEnquiry( size, rrc_eNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" rrcUECapabilityEnquiry UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -1352,16 +1331,6 @@ rrc_eNB_generate_NR_UECapabilityEnquiry( size, rrc_eNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" rrcNRUECapabilityEnquiry UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -1391,15 +1360,6 @@ rrc_eNB_generate_RRCConnectionReject( (char *)(ue_p->Srb0.Tx_buffer.Payload), ue_p->Srb0.Tx_buffer.payload_size, "[MSG] RRCConnectionReject\n"); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReject UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReject (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -1509,14 +1469,6 @@ rrc_eNB_generate_RRCConnectionReestablishment( } // for (int cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) } // if (*SRB_configList != NULL) - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_RRC_UE, - ue_context->Srb0.Tx_buffer.Header, - ue_context->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishment UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context->rnti, - ue_context->Srb0.Tx_buffer.payload_size); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReestablishment (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), ue_context->Srb0.Tx_buffer.payload_size); @@ -2058,16 +2010,6 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( LOG_D(RRC, "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -2154,15 +2096,6 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject( (char *)(ue_p->Srb0.Tx_buffer.Payload), ue_p->Srb0.Tx_buffer.payload_size, "[MSG] RRCConnectionReestablishmentReject\n"); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishmentReject UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReestablishmentReject (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -2230,16 +2163,6 @@ rrc_eNB_generate_RRCConnectionRelease( size, rrc_eNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionRelease UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); pthread_mutex_lock(&rrc_release_freelist); for (release_num = 0; release_num < NUMBER_OF_UE_MAX; release_num++) { @@ -2525,16 +2448,6 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *co LOG_D(RRC, "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -2773,16 +2686,6 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *cons LOG_D(RRC, "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -2883,16 +2786,6 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release( const protocol_ LOG_D(RRC, "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -3603,15 +3496,6 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req(ctxt_pP, DCCH, rrc_eNB_mui++, @@ -4316,15 +4200,6 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req(ctxt_pP, DCCH, rrc_eNB_mui++, @@ -4392,16 +4267,6 @@ rrc_eNB_generate_RRCConnectionReconfiguration_SCell( ); LOG_I(RRC,"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE id %x)\n", ctxt_pP->module_id,ctxt_pP->frame, size, ue_context_pP->ue_context.rnti); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -4996,7 +4861,6 @@ void rrc_eNB_handover_ue_context_release( //msg_release_p = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE); //itti_send_msg_to_task(TASK_S1AP, ctxt_pP->module_id, msg_release_p); s1ap_ue_context_release(ctxt_pP->instance, ue_context_p->ue_context.eNB_ue_s1ap_id); - //MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_GTPU_ENB, NULL,0, "0 GTPV1U_ENB_DELETE_TUNNEL_REQ rnti %x ", eNB_ue_s1ap_id); gtpv1u_enb_delete_tunnel_req_t delete_tunnels={0}; delete_tunnels.rnti = ue_context_p->ue_context.rnti; delete_tunnels.from_gnb = 0; @@ -6330,16 +6194,6 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct LOG_D(RRC, "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration handover to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" rrcConnectionReconfiguration handover UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); /* Refresh SRBs/DRBs */ rrc_pdcp_config_asn1_req(ctxt_pP, *SRB_configList2, // NULL, @@ -6535,9 +6389,6 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ue_context_pP->ue_context.kenb, &kRRCint); /* Refresh SRBs/DRBs */ - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_PDCP_ENB, NULL, 0, MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security unchanged)", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti); rrc_pdcp_config_asn1_req(ctxt_pP, SRB_configList, // NULL, DRB_configList, @@ -6906,15 +6757,6 @@ rrc_eNB_generate_RRCConnectionSetup( LOG_W(RRC, "Unknown node type %d\n", RC.rrc[ctxt_pP->module_id]->node_type); } - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, // LG WARNING - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" RRCConnectionSetup UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCConnectionSetup (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -7326,13 +7168,6 @@ rrc_eNB_decode_ccch( LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), Idx); - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_PDCP_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x SRB", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti); rrc_pdcp_config_asn1_req(ctxt_pP, ue_context_p->ue_context.SRB_configList, (LTE_DRB_ToAddModList_t *) NULL, @@ -7373,15 +7208,6 @@ rrc_eNB_decode_ccch( if (ue_context_p != NULL) { // erase content rrc_eNB_free_mem_UE_context(ctxt_pP, ue_context_p); - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - dec_rval.consumed, - MSC_AS_TIME_FMT" LTE_RRCConnectionRequest UE %x size %u (UE already in context)", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - dec_rval.consumed); } else { rrcConnectionRequest = &ul_ccch_msg->message.choice.c1.choice.rrcConnectionRequest.criticalExtensions.choice.rrcConnectionRequest_r8; { @@ -7467,18 +7293,6 @@ rrc_eNB_decode_ccch( } } - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - dec_rval.consumed, - MSC_AS_TIME_FMT" RRCConnectionRequest UE %x size %u (s-TMSI mmec %u m_TMSI %u random UE id (0x%" PRIx64 ")", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - dec_rval.consumed, - ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code, - ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi, - ue_context_p->ue_context.random_ue_identity); } else { LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionRequest without random UE identity or S-TMSI not supported, let's reject the UE\n", @@ -7567,14 +7381,6 @@ rrc_eNB_decode_ccch( LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), Idx); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_PDCP_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x SRB", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti); rrc_pdcp_config_asn1_req(ctxt_pP, ue_context_p->ue_context.SRB_configList, (LTE_DRB_ToAddModList_t *) NULL, @@ -7949,15 +7755,6 @@ rrc_eNB_decode_dcch( LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)(Rx_sdu),sdu_sizeP, "[MSG] RRC Connection Reconfiguration Complete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfigurationComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(RRCConnectionReconfigurationComplete) ---> RRC_eNB]\n", @@ -8169,15 +7966,6 @@ rrc_eNB_decode_dcch( T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC Connection Reestablishment Complete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishmentComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(rrcConnectionReestablishmentComplete) ---> RRC_eNB\n", @@ -8254,15 +8042,6 @@ rrc_eNB_decode_dcch( LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC Connection SetupComplete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" LTE_RRCConnectionSetupComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(RRCConnectionSetupComplete) ---> RRC_eNB\n", @@ -8308,15 +8087,6 @@ rrc_eNB_decode_dcch( LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC Security Mode Complete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" securityModeComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" received securityModeComplete on UL-DCCH %d from UE\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -8345,15 +8115,6 @@ rrc_eNB_decode_dcch( T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC Security Mode Failure\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" securityModeFailure UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_W(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(securityModeFailure) ---> RRC_eNB\n", @@ -8383,15 +8144,6 @@ rrc_eNB_decode_dcch( LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC UECapablility Information\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" ueCapabilityInformation UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" received ueCapabilityInformation on UL-DCCH %d from UE\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -8569,15 +8321,6 @@ rrc_eNB_decode_dcch( LOG_D(RRC,"[MSG] RRC UL Information Transfer \n"); LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC UL Information Transfer \n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" ulInformationTransfer UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); if (EPC_MODE_ENABLED == 1) { rrc_eNB_send_S1AP_UPLINK_NAS(ctxt_pP, @@ -8668,15 +8411,6 @@ rrc_eNB_decode_dcch( LOG_I(RRC,"THINH [LTE_UL_DCCH_MessageType__messageClassExtension_PR_c2]\n"); LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC SidelinkUEInformation \n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" SidelinkUEInformation UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(SidelinkUEInformation) ---> RRC_eNB\n", diff --git a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c index 3fa17bcd6b..918c84d565 100644 --- a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c +++ b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c @@ -32,7 +32,6 @@ # include "RRC/LTE/MESSAGES/asn1_msg.h" # include "rrc_eNB_GTPV1U.h" # include "rrc_eNB_UE_context.h" -# include "msc.h" #include "asn1_conversions.h" @@ -77,15 +76,6 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP( create_tunnel_resp_pP->enb_addr.length); } - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_GTPU_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u ebid %u enb-s1u teid %u", - 0,0,rnti, - create_tunnel_resp_pP->num_tunnels, - ue_context_p->ue_context.enb_gtp_ebi[0], - ue_context_p->ue_context.enb_gtp_teid[0]); (void)rnti; /* avoid gcc warning "set but not used" */ return 0; } else { diff --git a/openair2/RRC/LTE/rrc_eNB_M2AP.c b/openair2/RRC/LTE/rrc_eNB_M2AP.c index a9c65eae1a..5516308a10 100644 --- a/openair2/RRC/LTE/rrc_eNB_M2AP.c +++ b/openair2/RRC/LTE/rrc_eNB_M2AP.c @@ -32,7 +32,6 @@ # include "RRC/LTE/MESSAGES/asn1_msg.h" # include "rrc_eNB_M2AP.h" //# include "rrc_eNB_UE_context.h" -# include "msc.h" # include "asn1_conversions.h" # include "intertask_interface.h" # include "common/ran_context.h" diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index 1a5fe55c26..4af9b9ff66 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -48,7 +48,6 @@ #include "pdcp_primitives.h" #include "UTIL/OSA/osa_defs.h" -#include #include "LTE_UERadioAccessCapabilityInformation.h" @@ -586,17 +585,6 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP( // TODO add cause when it will be integrated } } - - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)&S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p), - sizeof(s1ap_initial_context_setup_resp_t), - MSC_AS_TIME_FMT" INITIAL_CONTEXT_SETUP_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p).eNB_ue_s1ap_id, - e_rabs_done, e_rabs_failed); } //------------------------------------------------------------------------------ @@ -804,14 +792,6 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ( ue_context_pP->ue_context.ue_gummei.mnc_len = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len; ue_context_pP->ue_context.ue_gummei.mme_code = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code; ue_context_pP->ue_context.ue_gummei.mme_group_id = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_group_id; - MSC_LOG_TX_MESSAGE(MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)&message_p->ittiMsg.s1ap_nas_first_req, - sizeof(s1ap_nas_first_req_t), - MSC_AS_TIME_FMT" S1AP_NAS_FIRST_REQ eNB %u UE %x", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->module_id, - ctxt_pP->rnti); LOG_I(S1AP, "[eNB %d] Build S1AP_NAS_FIRST_REQ adding in s_TMSI: GUMMEI mme_code %u mme_group_id %u ue %x\n", ctxt_pP->module_id, S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code, @@ -852,15 +832,6 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( eNB_ue_s1ap_id); if (ue_context_p == NULL) { - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u eNB_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - eNB_ue_s1ap_id); /* Can not associate this message to an UE index, send a failure to S1AP and discard it! */ MessageDef *msg_fail_p; LOG_W(RRC, "[eNB %ld] In S1AP_DOWNLINK_NAS: unknown UE from S1AP ids (%d, %d)\n", instance, ue_initial_id, eNB_ue_s1ap_id); @@ -869,15 +840,6 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( S1AP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.length = S1AP_DOWNLINK_NAS (msg_p).nas_pdu.length; S1AP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.buffer = S1AP_DOWNLINK_NAS (msg_p).nas_pdu.buffer; // TODO add failure cause when defined! - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" S1AP_NAS_NON_DELIVERY_IND UE initial id %u eNB_ue_s1ap_id %u (ue ctxt !found)", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - eNB_ue_s1ap_id); itti_send_msg_to_task (TASK_S1AP, instance, msg_fail_p); return (-1); } else { @@ -889,15 +851,6 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( ue_context_p->ue_context.eNB_ue_s1ap_id = S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id; } - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u eNB_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id); /* Create message for PDCP (DLInformationTransfer_t) */ length = do_DLInformationTransfer ( instance, @@ -1195,12 +1148,6 @@ rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ( if (ue_context_pP == NULL) { LOG_E(RRC, "[eNB] In S1AP_UE_CONTEXT_RELEASE_REQ: invalid UE\n"); } else { - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_S1AP_ENB, - NULL, - 0, - "0 S1AP_UE_CONTEXT_RELEASE_REQ eNB_ue_s1ap_id 0x%06"PRIX32" ", - ue_context_pP->ue_context.eNB_ue_s1ap_id); MessageDef *msg_context_release_req_p = NULL; msg_context_release_req_p = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE_REQ); S1AP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id; @@ -1214,9 +1161,6 @@ void rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT( module_id_t enb_mod_idP, uint32_t eNB_ue_s1ap_id ) { - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_S1AP_ENB, NULL, 0, - "0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ", - eNB_ue_s1ap_id); MessageDef *msg = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE_COMPLETE); S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg).eNB_ue_s1ap_id = eNB_ue_s1ap_id; itti_send_msg_to_task(TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_mod_idP), msg); @@ -1247,14 +1191,6 @@ rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND( LOG_W(RRC, "[eNB %ld] In S1AP_UE_CONTEXT_RELEASE_COMMAND: unknown UE from eNB_ue_s1ap_id (%d)\n", instance, eNB_ue_s1ap_id); - MSC_LOG_EVENT(MSC_RRC_ENB, "0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" context not found", - eNB_ue_s1ap_id); - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_S1AP_ENB, - NULL, - 0, - "0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ", - eNB_ue_s1ap_id); msg_complete_p = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE_COMPLETE); S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id; itti_send_msg_to_task(TASK_S1AP, instance, msg_complete_p); @@ -1432,16 +1368,6 @@ int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t *const ctxt_pP, if ((e_rabs_done > 0) ) { LOG_I(RRC,"S1AP_E_RAB_SETUP_RESP: sending the message: nb_of_erabs %d, total e_rabs %d, index %d\n", ue_context_pP->ue_context.nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)&S1AP_E_RAB_SETUP_RESP (msg_p), - sizeof(s1ap_e_rab_setup_resp_t), - MSC_AS_TIME_FMT" E_RAB_SETUP_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - S1AP_E_RAB_SETUP_RESP (msg_p).eNB_ue_s1ap_id, - e_rabs_done, e_rabs_failed); itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p); } @@ -1667,16 +1593,6 @@ int rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t *const ctxt_pP, if (e_rabs_done > 0 || e_rabs_failed > 0) { LOG_D(RRC,"S1AP_E_RAB_MODIFY_RESP: sending the message: nb_of_modify_e_rabs %d, total e_rabs %d, index %d\n", ue_context_pP->ue_context.nb_of_modify_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)&S1AP_E_RAB_SETUP_RESP (msg_p), - sizeof(s1ap_e_rab_setup_resp_t), - MSC_AS_TIME_FMT" E_RAB_MODIFY_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - S1AP_E_RAB_MODIFY_RESP (msg_p).eNB_ue_s1ap_id, - e_rabs_done, e_rabs_failed); itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p); } else { itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); @@ -2067,16 +1983,6 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP, if (e_rabs_done > 0) { LOG_I(RRC,"S1AP_PATH_SWITCH_REQ: sending the message: nb_of_erabstobeswitched %d, total e_rabs %d, index %d\n", S1AP_PATH_SWITCH_REQ (msg_p).nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)&S1AP_PATH_SWITCH_REQ (msg_p), - sizeof(s1ap_path_switch_req_t), - MSC_AS_TIME_FMT" PATH_SWITCH_REQ UE %X eNB_ue_s1ap_id %u e_rabs:%u succ", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id, - e_rabs_done); itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p); } else { itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p); @@ -2355,16 +2261,6 @@ int rrc_eNB_send_E_RAB_Modification_Indication(const protocol_ctxt_t *const ctxt if (e_rab_modify_index > 0) { LOG_I(RRC,"S1AP_E_RAB_MODIFICATION_IND: sending the message: nb_of_erabstobemodified %d, total e_rabs %d, index %d\n", S1AP_E_RAB_MODIFICATION_IND (msg_p).nb_of_e_rabs_tobemodified, ue_context_pP->ue_context.setup_e_rabs, e_rab); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)&S1AP_E_RAB_MODIFICATION_IND (msg_p), - sizeof(s1ap_e_rab_modification_ind_t), - MSC_AS_TIME_FMT" E RAB MODIFICATION IND UE %X eNB_ue_s1ap_id %u e_rabs:%u succ", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - S1AP_E_RAB_MODIFICATION_IND (msg_p).eNB_ue_s1ap_id, - e_rab_modify_index); itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p); } else { itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p); diff --git a/openair2/RRC/LTE/rrc_eNB_UE_context.c b/openair2/RRC/LTE/rrc_eNB_UE_context.c index 2cc89adf15..0d262064b5 100644 --- a/openair2/RRC/LTE/rrc_eNB_UE_context.c +++ b/openair2/RRC/LTE/rrc_eNB_UE_context.c @@ -35,7 +35,6 @@ #include "common/utils/LOG/log.h" #include "rrc_eNB_UE_context.h" -#include "msc.h" //------------------------------------------------------------------------------ @@ -210,10 +209,6 @@ void rrc_eNB_remove_ue_context( } RB_REMOVE(rrc_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP); - MSC_LOG_EVENT( - MSC_RRC_ENB, - "0 Removed UE %"PRIx16" ", - ue_context_pP->ue_context.rnti); rrc_eNB_free_mem_UE_context(ctxt_pP, ue_context_pP); uid_linear_allocator_free(rrc_instance_pP, ue_context_pP->local_uid); free(ue_context_pP); diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index eb402092b9..eb0996b6f4 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -34,7 +34,6 @@ #include "nr_rrc_extern.h" #include "common/utils/LOG/log.h" #include "pdcp.h" -#include "msc.h" #include "common/ran_context.h" #include "LAYER2/NR_MAC_COMMON/nr_mac_common.h" #include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h" @@ -172,16 +171,6 @@ nr_rrc_data_req( return FALSE; } - MSC_LOG_TX_MESSAGE( - ctxt_pP->enb_flag ? MSC_RRC_GNB : MSC_RRC_UE, - ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE, - buffer_pP, - sdu_sizeP, - MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->rnti, - muiP, - sdu_sizeP); MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). uint8_t *message_buffer; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2c2020412d..49ebedaf95 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -66,7 +66,6 @@ #include "rlc.h" #include "rrc_eNB_UE_context.h" #include "platform_types.h" -#include "msc.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "T.h" @@ -421,15 +420,6 @@ rrc_gNB_generate_RRCSetup( LOG_D(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" RRC_gNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_gNB\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP)); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, // LG WARNING - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" RRCSetup UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -499,15 +489,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( (NR_CellGroupConfig_t *)NULL ); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, // LG WARNING - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" RRCSetup UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -549,14 +530,6 @@ rrc_gNB_generate_RRCReject( (char *)(ue_p->Srb0.Tx_buffer.Payload), ue_p->Srb0.Tx_buffer.payload_size, "[MSG] RRCReject \n"); - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" NR_RRCReject UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating NR_RRCReject (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -817,15 +790,6 @@ rrc_gNB_generate_defaultRRCReconfiguration( rrc_gNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" NR_RRCReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, @@ -1047,16 +1011,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( LOG_D(NR_RRC, "[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated RRCReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; @@ -1155,16 +1109,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( LOG_D(NR_RRC, "[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated NR_RRCReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; uint8_t *message_buffer; @@ -1229,9 +1173,6 @@ rrc_gNB_process_RRCReconfigurationComplete( ue_context_pP->ue_context.kgnb, &kRRCint); /* Refresh SRBs/DRBs */ - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, MSC_PDCP_ENB, NULL, 0, MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security unchanged)", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti); #ifndef ITTI_SIM LOG_D(NR_RRC,"Configuring PDCP DRBs/SRBs for UE %x\n",ue_context_pP->ue_context.rnti); @@ -1459,14 +1400,6 @@ rrc_gNB_generate_RRCReestablishment( } } // if (*SRB_configList != NULL) - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_RRC_UE, - ue_context->Srb0.Tx_buffer.Header, - ue_context->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" NR_RRCReestablishment UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context->rnti, - ue_context->Srb0.Tx_buffer.payload_size); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-DCCH, Generating NR_RRCReestablishment (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), ue_context->Srb0.Tx_buffer.payload_size); @@ -1729,16 +1662,6 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( LOG_D(NR_RRC, "[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; uint8_t *message_buffer; @@ -1809,15 +1732,6 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP, ue_context_p = rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti); if (ue_context_p != NULL) { rrc_gNB_free_mem_UE_context(ctxt_pP, ue_context_p); - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - dec_rval.consumed, - MSC_AS_TIME_FMT" NR_RRCSetupRequest UE %x size %u (UE already in context)", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - dec_rval.consumed); } else { rrcSetupRequest = &ul_ccch_msg->message.choice.c1->choice.rrcSetupRequest->rrcSetupRequest; if (NR_InitialUE_Identity_PR_randomValue == rrcSetupRequest->ue_Identity.present) { @@ -2109,13 +2023,6 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP, LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), Idx); - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_PDCP_GNB, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x SRB", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti); // nr_rrc_pdcp_config_asn1_req(ctxt_pP, // ue_context_p->ue_context.SRB_configList, // NULL, @@ -2259,15 +2166,6 @@ rrc_gNB_decode_dcch( LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)(Rx_sdu), sdu_sizeP, "[MSG] RRC Connection Reconfiguration Complete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" NR_RRCReconfigurationComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_D(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(RRCReconfigurationComplete) ---> RRC_gNB]\n", @@ -2329,15 +2227,6 @@ rrc_gNB_decode_dcch( LOG_DUMPMSG(NR_RRC, DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC SetupComplete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" NR_RRCSetupComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_D(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(RRCSetupComplete) ---> RRC_gNB\n", @@ -2416,15 +2305,6 @@ rrc_gNB_decode_dcch( LOG_D(NR_RRC,"[MSG] RRC UL Information Transfer \n"); LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC UL Information Transfer \n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" ulInformationTransfer UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); if (AMF_MODE_ENABLED == 1) { rrc_gNB_send_NGAP_UPLINK_NAS(ctxt_pP, @@ -2464,15 +2344,6 @@ rrc_gNB_decode_dcch( case NR_UL_DCCH_MessageType__c1_PR_securityModeFailure: LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] NR RRC Security Mode Failure\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" securityModeFailure UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_W(NR_RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(securityModeFailure) ---> RRC_gNB\n", @@ -2495,15 +2366,6 @@ rrc_gNB_decode_dcch( LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] NR_RRC UECapablility Information\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" ueCapabilityInformation UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" received ueCapabilityInformation on UL-DCCH %d from UE\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -2609,15 +2471,6 @@ rrc_gNB_decode_dcch( case NR_UL_DCCH_MessageType__c1_PR_rrcReestablishmentComplete: LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] NR_RRC Connection Reestablishment Complete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" NR_RRCConnectionReestablishmentComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(NR_RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(rrcConnectionReestablishmentComplete) ---> RRC_gNB\n", @@ -3766,16 +3619,6 @@ rrc_gNB_generate_SecurityModeCommand( size, rrc_gNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" securityModeCommand UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; uint8_t *message_buffer; @@ -3848,16 +3691,6 @@ rrc_gNB_generate_UECapabilityEnquiry( size, rrc_gNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" rrcNRUECapabilityEnquiry UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; uint8_t *message_buffer; @@ -3917,16 +3750,6 @@ rrc_gNB_generate_RRCRelease( size, rrc_gNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" NR_RRCRelease UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; diff --git a/openair2/RRC/NR/rrc_gNB_GTPV1U.c b/openair2/RRC/NR/rrc_gNB_GTPV1U.c index 293f9e8b9f..f7b491af14 100644 --- a/openair2/RRC/NR/rrc_gNB_GTPV1U.c +++ b/openair2/RRC/NR/rrc_gNB_GTPV1U.c @@ -32,7 +32,6 @@ # include "RRC/LTE/MESSAGES/asn1_msg.h" # include "rrc_eNB_GTPV1U.h" # include "rrc_eNB_UE_context.h" -# include "msc.h" # include "openair2/RRC/NR/rrc_gNB_UE_context.h" //# if defined(ENABLE_ITTI) @@ -77,15 +76,6 @@ rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP( create_tunnel_resp_pP->enb_addr.length); } - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_GTPU_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u ebid %u enb-s1u teid %u", - 0,0,rnti, - create_tunnel_resp_pP->num_tunnels, - ue_context_p->ue_context.gnb_gtp_ebi[0], - ue_context_p->ue_context.gnb_gtp_teid[0]); (void)rnti; /* avoid gcc warning "set but not used" */ return 0; } else { @@ -126,15 +116,6 @@ nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP( create_tunnel_resp_pP->gnb_addr.length); } - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_GTPU_GNB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u psid %u enb-s1u teid %u", - 0,0,rnti, - create_tunnel_resp_pP->num_tunnels, - ue_context_p->ue_context.gnb_gtp_psi[0], - ue_context_p->ue_context.gnb_gtp_teid[0]); (void)rnti; /* avoid gcc warning "set but not used" */ return 0; } else { diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 043d136604..14c0ee4d68 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -40,8 +40,6 @@ #include "pdcp.h" #include "pdcp_primitives.h" -#include "msc.h" - #include "gtpv1u_eNB_task.h" #include "gtpv1u_gNB_task.h" #include "RRC/LTE/rrc_eNB_GTPV1U.h" @@ -453,14 +451,6 @@ rrc_gNB_send_NGAP_NAS_FIRST_REQ( ue_context_pP->ue_context.ue_guami.amf_set_id = NGAP_NAS_FIRST_REQ(message_p).ue_identity.guami.amf_set_id; ue_context_pP->ue_context.ue_guami.amf_pointer = NGAP_NAS_FIRST_REQ(message_p).ue_identity.guami.amf_pointer; - MSC_LOG_TX_MESSAGE(MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)&message_p->ittiMsg.ngap_nas_first_req, - sizeof(ngap_nas_first_req_t), - MSC_AS_TIME_FMT" NGAP_NAS_FIRST_REQ gNB %u UE %x", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->module_id, - ctxt_pP->rnti); LOG_I(NGAP, "[gNB %d] Build NGAP_NAS_FIRST_REQ adding in s_TMSI: GUAMI amf_set_id %u amf_region_id %u ue %x\n", ctxt_pP->module_id, NGAP_NAS_FIRST_REQ (message_p).ue_identity.guami.amf_set_id, @@ -636,16 +626,6 @@ rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP( } } - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_S1AP_ENB, - (const char *)&NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p), - sizeof(ngap_initial_context_setup_resp_t), - MSC_AS_TIME_FMT" INITIAL_CONTEXT_SETUP_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).gNB_ue_ngap_id, - pdu_sessions_done, pdu_sessions_failed); NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).nb_of_pdusessions = pdu_sessions_done; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).nb_of_pdusessions_failed = pdu_sessions_failed; itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p); @@ -794,15 +774,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( gNB_ue_ngap_id); if (ue_context_p == NULL) { - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_NGAP_GNB, - NULL, - 0, - MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u gNB_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - gNB_ue_ngap_id); /* Can not associate this message to an UE index, send a failure to NGAP and discard it! */ MessageDef *msg_fail_p; LOG_W(NR_RRC, "[gNB %ld] In NGAP_DOWNLINK_NAS: unknown UE from NGAP ids (%d, %u)\n", instance, ue_initial_id, gNB_ue_ngap_id); @@ -811,15 +782,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( NGAP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.length = NGAP_DOWNLINK_NAS (msg_p).nas_pdu.length; NGAP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.buffer = NGAP_DOWNLINK_NAS (msg_p).nas_pdu.buffer; // TODO add failure cause when defined! - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_NGAP_GNB, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" NGAP_NAS_NON_DELIVERY_IND UE initial id %u gNB_ue_ngap_id %u (ue ctxt !found)", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - gNB_ue_ngap_id); itti_send_msg_to_task (TASK_NGAP, instance, msg_fail_p); return (-1); } else { @@ -830,15 +792,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( ue_context_p->ue_context.gNB_ue_ngap_id = NGAP_DOWNLINK_NAS (msg_p).gNB_ue_ngap_id; } - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_NGAP_GNB, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u gNB_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - NGAP_DOWNLINK_NAS (msg_p).gNB_ue_ngap_id); /* Create message for PDCP (DLInformationTransfer_t) */ length = do_NR_DLInformationTransfer ( instance, @@ -997,16 +950,6 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP( if ((pdu_sessions_done > 0) ) { LOG_I(NR_RRC,"NGAP_PDUSESSION_SETUP_RESP: sending the message: nb_of_pdusessions %d, total pdu_sessions %d, index %d\n", ue_context_pP->ue_context.nb_of_pdusessions, ue_context_pP->ue_context.setup_pdu_sessions, pdusession); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_NGAP_GNB, - (const char *)&NGAP_PDUSESSION_SETUP_RESP (msg_p), - sizeof(ngap_pdusession_setup_resp_t), - MSC_AS_TIME_FMT" PDUSESSION_SETUP_RESP UE %X gNB_ue_ngap_id %u pdu_sessions:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - NGAP_PDUSESSION_SETUP_RESP (msg_p).gNB_ue_ngap_id, - pdu_sessions_done, pdu_sessions_failed); itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p); } @@ -1126,12 +1069,6 @@ rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( if (ue_context_pP == NULL) { LOG_E(RRC, "[gNB] In NGAP_UE_CONTEXT_RELEASE_REQ: invalid UE\n"); } else { - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_NGAP_GNB, - NULL, - 0, - "0 NGAP_UE_CONTEXT_RELEASE_REQ gNB_ue_ngap_id 0x%06"PRIX32" ", - ue_context_pP->ue_context.gNB_ue_ngap_id); MessageDef *msg_context_release_req_p = NULL; msg_context_release_req_p = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_REQ); NGAP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id; @@ -1204,14 +1141,6 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND( LOG_W(NR_RRC, "[gNB %ld] In NGAP_UE_CONTEXT_RELEASE_COMMAND: unknown UE from gNB_ue_ngap_id (%u)\n", instance, gNB_ue_ngap_id); - MSC_LOG_EVENT(MSC_RRC_GNB, "0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" context not found", - gNB_ue_ngap_id); - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_NGAP_GNB, - NULL, - 0, - "0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" ", - gNB_ue_ngap_id); msg_complete_p = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE); NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).gNB_ue_ngap_id = gNB_ue_ngap_id; itti_send_msg_to_task(TASK_NGAP, instance, msg_complete_p); @@ -1235,9 +1164,6 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND( void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE( instance_t instance, uint32_t gNB_ue_ngap_id) { - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, MSC_NGAP_GNB, NULL, 0, - "0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" ", - gNB_ue_ngap_id); MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE); NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = gNB_ue_ngap_id; itti_send_msg_to_task(TASK_NGAP, instance, msg); diff --git a/openair2/RRC/NR/rrc_gNB_UE_context.c b/openair2/RRC/NR/rrc_gNB_UE_context.c index ad8bd01470..b8ff19b749 100644 --- a/openair2/RRC/NR/rrc_gNB_UE_context.c +++ b/openair2/RRC/NR/rrc_gNB_UE_context.c @@ -35,7 +35,6 @@ #include "common/utils/LOG/log.h" #include "rrc_gNB_UE_context.h" -#include "msc.h" //------------------------------------------------------------------------------ @@ -208,10 +207,6 @@ void rrc_gNB_remove_ue_context( } RB_REMOVE(rrc_nr_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP); - MSC_LOG_EVENT( - MSC_RRC_ENB, - "0 Removed UE %"PRIx16" ", - ue_context_pP->ue_context.rnti); rrc_gNB_free_mem_UE_context(ctxt_pP, ue_context_pP); nr_uid_linear_allocator_free(rrc_instance_pP, ue_context_pP->local_uid); free(ue_context_pP); diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index bc209afd02..1ac4bef17c 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2164,17 +2164,6 @@ nr_rrc_ue_establish_srb2( nr_derive_key_up_int(NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm, NR_UE_rrc_inst[ctxt_pP->module_id].kgnb, &kUPint); - MSC_LOG_TX_MESSAGE( - MSC_RRC_UE, - MSC_PDCP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security %X)", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->rnti, - NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm | - (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4)); - // Refresh DRBs nr_rrc_pdcp_config_asn1_req(ctxt_pP, NULL, diff --git a/openair2/SIMULATION/NR_RRC/itti_sim.c b/openair2/SIMULATION/NR_RRC/itti_sim.c index 28de1ca3b8..a6ac444e45 100644 --- a/openair2/SIMULATION/NR_RRC/itti_sim.c +++ b/openair2/SIMULATION/NR_RRC/itti_sim.c @@ -36,8 +36,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include -#include "msc.h" - #include "common/ran_context.h" #include "common/config/config_userapi.h" @@ -572,9 +570,6 @@ int main( int argc, char **argv ) cpuf=get_cpu_freq_GHz(); itti_init(TASK_MAX, tasks_info); - // initialize mscgen log after ITTI - MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); - init_opt(); diff --git a/openair2/X2AP/x2ap_eNB_generate_messages.c b/openair2/X2AP/x2ap_eNB_generate_messages.c index 9724e0cc38..be5ab82740 100644 --- a/openair2/X2AP/x2ap_eNB_generate_messages.c +++ b/openair2/X2AP/x2ap_eNB_generate_messages.c @@ -40,7 +40,6 @@ #include "x2ap_eNB_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -260,8 +259,6 @@ int x2ap_eNB_generate_x2_setup_request( return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; @@ -486,8 +483,6 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eN x2ap_eNB_data_p->state = X2AP_ENB_STATE_READY; - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/successfulOutcome assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; @@ -542,11 +537,6 @@ int x2ap_eNB_generate_x2_setup_failure(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, - MSC_X2AP_TARGET_ENB, NULL, 0, - "0 X2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u", - assoc_id, cause_type, cause_value); - x2ap_eNB_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0); return ret; @@ -732,8 +722,6 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1); return ret; @@ -846,8 +834,6 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p, return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1); return ret; @@ -908,8 +894,6 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2 return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1); return ret; @@ -992,8 +976,6 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_ return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1); return ret; @@ -1090,8 +1072,6 @@ int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2 return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2SeNBAdditionRequest/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1); return ret; @@ -1367,8 +1347,6 @@ MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; @@ -1578,8 +1556,6 @@ int x2ap_eNB_generate_ENDC_x2_setup_response( return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; @@ -1737,8 +1713,6 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request( # if 0 // TODO: Sanitizer complains we are trying to access this after free. free(ie->value.choice.MeNBtoSgNBContainer.buf); #endif - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; @@ -1844,8 +1818,6 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *in return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; diff --git a/openair2/X2AP/x2ap_eNB_handler.c b/openair2/X2AP/x2ap_eNB_handler.c index f71229f066..f70cd632aa 100644 --- a/openair2/X2AP/x2ap_eNB_handler.c +++ b/openair2/X2AP/x2ap_eNB_handler.c @@ -41,7 +41,6 @@ #include "x2ap_eNB_management_procedures.h" #include "x2ap_eNB_generate_messages.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" #include "X2AP_FreqBandNrItem.h" diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c index 6f5ef004b5..290a5a4aa8 100644 --- a/openair3/GTPV1-U/gtpv1u_eNB.c +++ b/openair3/GTPV1-U/gtpv1u_eNB.c @@ -33,7 +33,6 @@ #include "assertions.h" #include "intertask_interface.h" -#include "msc.h" #include "gtpv1u.h" #include "NwGtpv1u.h" @@ -51,7 +50,6 @@ #include "gtpv1u_eNB_defs.h" #include "gtpv1u_eNB_task.h" #include "rrc_eNB_GTPV1U.h" -#include #undef GTP_DUMP_SOCKET @@ -146,11 +144,6 @@ static int gtpv1u_eNB_send_init_udp(const Gtpv1uS1Req *req) { addr.s_addr = req->enb_ip_address_for_S1u_S12_S4_up; UDP_INIT(message_p).address = inet_ntoa(addr); LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,UDP_INIT(message_p).port); - MSC_LOG_EVENT( - MSC_GTPU_ENB, - "0 UDP bind %s:%u", - UDP_INIT(message_p).address, - UDP_INIT(message_p).port); return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); } @@ -266,14 +259,6 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( #endif //#warning "LG eps bearer mapping to DRB id to do (offset -4)" PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_PDCP_ENB, - NULL,0, - MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - 0,0, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - buffer_len); ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.module_id], ctxt.rnti); if((ue_context_p != NULL) && @@ -736,14 +721,6 @@ gtpv1u_create_x2u_tunnel( hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; int i; ebi_t eps_bearer_id = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_X2U_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u ebid %u enb-x2u teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->eps_bearer_id[0], - create_tunnel_req_pP->tenb_X2u_teid[0]); create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; create_tunnel_resp_pP->status = 0; create_tunnel_resp_pP->num_tunnels = 0; @@ -795,13 +772,6 @@ gtpv1u_create_x2u_tunnel( } } - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - x2u_teid); LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", create_tunnel_req_pP->rnti, create_tunnel_resp_pP->status); @@ -885,14 +855,6 @@ gtpv1u_create_s1u_tunnel( int addrs_length_in_bytes= 0; int loop_counter = 0; int ret = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u ebid %u sgw-s1u teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->eps_bearer_id[0], - create_tunnel_req_pP->sgw_S1u_teid[0]); create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; create_tunnel_resp_pP->status = 0; create_tunnel_resp_pP->num_tunnels = 0; @@ -1005,13 +967,6 @@ gtpv1u_create_s1u_tunnel( } } - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - s1u_teid); LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", create_tunnel_req_pP->rnti, create_tunnel_resp_pP->status); @@ -1175,13 +1130,6 @@ int gtpv1u_delete_s1u_tunnel( GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti, GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).enb_S1u_teid, GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).status); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_DELETE_TUNNEL_RESP rnti %x teid %x", - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti, - teid_eNB); if (req_pP->from_gnb) return itti_send_msg_to_task(TASK_RRC_GNB, instanceP, message_p); else @@ -1351,27 +1299,12 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) { if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,sgw_s1u_teid,data_req_p->length); (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ } else { rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,sgw_s1u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - sgw_s1u_teid, - data_req_p->length); } rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, @@ -1428,27 +1361,12 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) { if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ } else { rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - tenb_x2u_teid, - data_req_p->length); } rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, @@ -1506,8 +1424,6 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) { if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ } else { pMsg = (NwGtpv1uMsgT *) stack_req.apiInfo.sendtoInfo.hMsg; @@ -1516,19 +1432,6 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) { if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - tenb_x2u_teid, - data_req_p->length); } rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, @@ -1589,7 +1492,6 @@ void *gtpv1u_eNB_task(void *args) { rc = gtpv1u_eNB_init(); AssertFatal(rc == 0, "gtpv1u_eNB_init Failed"); itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); while(1) { (void) gtpv1u_eNB_process_itti_msg (NULL); diff --git a/openair3/GTPV1-U/gtpv1u_gNB.c b/openair3/GTPV1-U/gtpv1u_gNB.c index ff7c8c0604..7be922f4c2 100644 --- a/openair3/GTPV1-U/gtpv1u_gNB.c +++ b/openair3/GTPV1-U/gtpv1u_gNB.c @@ -30,7 +30,6 @@ #include "mme_config.h" #include "intertask_interface.h" -#include "msc.h" #include "gtpv1u.h" #include "NwGtpv1u.h" @@ -170,14 +169,6 @@ NwGtpv1uRcT gtpv1u_gNB_process_stack_req( #endif //warning "LG eps bearer mapping to DRB id to do (offset -4)" PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_PDCP_ENB, - NULL,0, - MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - 0,0, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - buffer_len); result = pdcp_data_req( &ctxt, @@ -300,7 +291,6 @@ void *gtpv1u_gNB_task(void *args) { rc = gtpv1u_gNB_init(); AssertFatal(rc == 0, "gtpv1u_eNB_init Failed"); itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); while(1) { (void) gtpv1u_eNB_process_itti_msg (NULL); @@ -366,14 +356,6 @@ NwGtpv1uRcT nr_gtpv1u_gNB_process_stack_req( // #endif //warning "LG eps bearer mapping to DRB id to do (offset -4)" PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->gnb_id, GNB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->gnb_id); - // MSC_LOG_TX_MESSAGE( - // MSC_GTPU_ENB, - // MSC_PDCP_ENB, - // NULL,0, - // MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - // 0,0, - // (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - // buffer_len); result = pdcp_data_req( &ctxt, @@ -515,14 +497,6 @@ gtpv1u_create_ngu_tunnel( int addrs_length_in_bytes= 0; int loop_counter = 0; int ret = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u psid %u upf-ngu teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->pdusession_id[0], - create_tunnel_req_pP->outgoing_teid[0]); create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; create_tunnel_resp_pP->status = 0; create_tunnel_resp_pP->num_tunnels = 0; @@ -634,13 +608,6 @@ gtpv1u_create_ngu_tunnel( } } - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - "0 GTPV1U_GNB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - ngu_teid); LOG_D(GTPU, "Tx GTPV1U_GNB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", create_tunnel_req_pP->rnti, create_tunnel_resp_pP->status); @@ -805,13 +772,6 @@ int gtpv1u_delete_ngu_tunnel( GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti, GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).gnb_NGu_teid, GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - "0 GTPV1U_GNB_DELETE_TUNNEL_RESP rnti %x teid %x", - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti, - teid_gNB); return itti_send_msg_to_task(TASK_RRC_GNB, instanceP, message_p); } @@ -830,11 +790,6 @@ static int gtpv1u_gNB_send_init_udp(const Gtpv1uNGReq *req) { addr.s_addr = req->gnb_ip_address_for_NGu_up; UDP_INIT(message_p).address = inet_ntoa(addr); LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,UDP_INIT(message_p).port); - MSC_LOG_EVENT( - MSC_GTPU_ENB, - "0 UDP bind %s:%u", - UDP_INIT(message_p).address, - UDP_INIT(message_p).port); return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); } @@ -883,27 +838,12 @@ static int gtpv1u_gnb_tunnel_data_req(gtpv1u_gnb_tunnel_data_req_t *gnb_tunnel_d if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_GNB,"0 Failed send G-PDU ltid %u rtid %u size %u", - gnb_ngu_teid,outgoing_teid,data_req_p->length); (void)gnb_ngu_teid; /* avoid gcc warning "set but not used" */ } else { rc = nwGtpv1uProcessUlpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, &stack_req); if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_GNB,"0 Failed send G-PDU ltid %u rtid %u size %u", - gnb_ngu_teid,outgoing_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - gnb_ngu_teid, - outgoing_teid, - data_req_p->length); } rc = nwGtpv1uMsgDelete(RC.nr_gtpv1u_data_g->gtpv1u_stack, @@ -1002,7 +942,6 @@ void *nr_gtpv1u_gNB_task(void *args) { rc = nr_gtpv1u_gNB_init(); AssertFatal(rc == 0, "gtpv1u_gNB_init Failed"); itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); while(1) { (void) gtpv1u_gNB_process_itti_msg (NULL); diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c index 0d962cad7d..53bb9127df 100644 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c +++ b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c @@ -47,7 +47,6 @@ #include "assertions.h" #include "intertask_interface.h" -#include "msc.h" #include "gtpv1u.h" #if defined(ENB_MODE) @@ -563,26 +562,10 @@ nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz, GTPU_DEBUG("Received T-PDU over tunnel end-point '%x' of size %u (%u) (decapsulated %u)from "NW_IPV4_ADDR"\n", ntohl(msgHdr->teid), gpduLen, pMsg->msgLen, pMsg->msgBufLen, NW_IPV4_ADDR_FORMAT((peerIp))); #endif - MSC_LOG_RX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - " G-PDU ltid %u size %u", - tunnelEndPointKey.teid, - gpduLen); rc = nwGtpSessionSendMsgApiToUlpEntity(pTunnelEndPoint, pMsg); } } else { - MSC_LOG_RX_DISCARDED_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - " G-PDU ltid %u size %u", - tunnelEndPointKey.teid, - gpduLen); GTPU_DEBUG("Received T-PDU over non-existent tunnel end-point '%x' from "NW_IPV4_ADDR"\n", ntohl(msgHdr->teid), NW_IPV4_ADDR_FORMAT((peerIp))); } @@ -614,13 +597,6 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz, seqNum = ntohs(*(uint16_t *) (msgBuf + (((*msgBuf) & 0x02) ? 8 : 4))); - MSC_LOG_RX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" ECHO-REQ seq %u size %u", - 0,0,seqNum, msgBufLen); /* Send Echo Response */ rc = nwGtpv1uMsgNew( (NwGtpv1uStackHandleT)thiz, @@ -661,13 +637,6 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz, peerPort, seqNum); #endif - MSC_LOG_TX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" ECHO-RSP seq %u", - 0,0,seqNum); rc = nwGtpv1uCreateAndSendMsg( thiz, peerIp, diff --git a/openair3/M3AP/m3ap_MCE_generate_messsages.c b/openair3/M3AP/m3ap_MCE_generate_messsages.c index 8d8c7f3853..4822a09db9 100644 --- a/openair3/M3AP/m3ap_MCE_generate_messsages.c +++ b/openair3/M3AP/m3ap_MCE_generate_messsages.c @@ -39,7 +39,6 @@ #include "m2ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -169,14 +168,6 @@ int m2ap_eNB_generate_m2_setup_request( LOG_W(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); m2ap_eNB_itti_send_sctp_data_req(instance_p, m2ap_eNB_data_p->assoc_id, buffer, len, 0); @@ -315,8 +306,6 @@ int m2ap_eNB_generate_m2_setup_request( // // m2ap_eNB_data_p->state = M2AP_ENB_STATE_READY; // -// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 0); // // return ret; @@ -371,11 +360,6 @@ int m2ap_eNB_generate_m2_setup_request( // return -1; // } // -// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, -// // MSC_M2AP_TARGET_ENB, NULL, 0, -// // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u", -// // assoc_id, cause_type, cause_value); -// // m2ap_eNB_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0); // // return ret; @@ -561,8 +545,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -654,8 +636,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -716,8 +696,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -800,8 +778,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; diff --git a/openair3/M3AP/m3ap_MCE_handler.c b/openair3/M3AP/m3ap_MCE_handler.c index 21d10d1b04..3da0c00145 100644 --- a/openair3/M3AP/m3ap_MCE_handler.c +++ b/openair3/M3AP/m3ap_MCE_handler.c @@ -44,7 +44,6 @@ //#include "m3ap_MME_interface_management.h" #include "m3ap_MCE_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair3/M3AP/m3ap_MCE_interface_management.c b/openair3/M3AP/m3ap_MCE_interface_management.c index fb54579258..ef26312245 100644 --- a/openair3/M3AP/m3ap_MCE_interface_management.c +++ b/openair3/M3AP/m3ap_MCE_interface_management.c @@ -44,7 +44,6 @@ #include "m3ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -149,15 +148,7 @@ int MCE_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m3ap_session_start // // // LOG_W(M3AP,"pdu.present %d\n",pdu.present); -// // MSC_LOG_TX_MESSAGE( -// // MSC_M3AP_MCE, -// // MSC_M3AP_MCE, -// // (const char *)buffer, -// // len, -// // MSC_AS_TIME_FMT" M3_SETUP_REQUEST initiatingMessage MCEname %s", -// // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// // m3ap_MCE_data_p->MCEname); -// + m3ap_MCE_itti_send_sctp_data_req(instance, m3ap_mce_data_g->assoc_id, buffer, len, 0); return 0; } @@ -318,14 +309,6 @@ int MCE_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m3ap_session_start_ LOG_D(M3AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M3AP_MCE, - // MSC_M3AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M3_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m3ap_MCE_data_p->MCEname); m3ap_MCE_itti_send_sctp_data_req(instance, m3ap_mce_data_g->assoc_id, buffer, len, 0); return 0; @@ -425,14 +408,6 @@ int MCE_send_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance, m3ap_mbms_session LOG_D(M3AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M3AP_MCE, - // MSC_M3AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M3_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m3ap_MCE_data_p->MCEname); m3ap_MCE_itti_send_sctp_data_req(instance, m3ap_mce_data_g->assoc_id, buffer, len, 0); return 0; @@ -646,14 +621,6 @@ int MCE_send_M3_SETUP_REQUEST(m3ap_MCE_instance_t *instance_p, m3ap_MCE_data_t * // // // LOG_W(M3AP,"pdu.present %d\n",pdu.present); -// // MSC_LOG_TX_MESSAGE( -// // MSC_M3AP_MCE, -// // MSC_M3AP_MCE, -// // (const char *)buffer, -// // len, -// // MSC_AS_TIME_FMT" M3_SETUP_REQUEST initiatingMessage MCEname %s", -// // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// // m3ap_MCE_data_p->MCEname); // // //// buffer = &bytes[0]; @@ -725,15 +692,6 @@ int MCE_handle_M3_SETUP_RESPONSE(instance_t instance, //for (int i=0;i 0, "System Information %d is missing",i); - //MSC_LOG_RX_MESSAGE( - // MSC_M3AP_MCE, - // MSC_M3AP_CU, - // 0, - // 0, - // MSC_AS_TIME_FMT" MCE_handle_M3_SETUP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); - //LOG_D(M3AP, "Sending M3AP_SETUP_RESP ITTI message to MCE_APP with assoc_id (%d->%d)\n", // assoc_id,MCE_MOMCELE_ID_TO_INSTANCE(assoc_id)); itti_send_msg_to_task(TASK_MCE_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p); diff --git a/openair3/M3AP/m3ap_MME_generate_messages.c b/openair3/M3AP/m3ap_MME_generate_messages.c index a28097cf1a..969863b445 100644 --- a/openair3/M3AP/m3ap_MME_generate_messages.c +++ b/openair3/M3AP/m3ap_MME_generate_messages.c @@ -39,7 +39,6 @@ #include "m2ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -174,8 +173,6 @@ int m2ap_MCE_generate_m2_setup_request( return -1; } - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); - m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0); return ret; @@ -311,8 +308,6 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC m2ap_MCE_data_p->state = M2AP_MCE_STATE_READY; - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id); - m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0); return ret; @@ -367,11 +362,6 @@ int m2ap_MCE_generate_m2_setup_failure(instance_t instance, return -1; } - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, - // MSC_M2AP_TARGET_MCE, NULL, 0, - // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u", - // assoc_id, cause_type, cause_value); - m2ap_MCE_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0); return ret; @@ -557,8 +547,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -650,8 +638,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -712,8 +698,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -796,8 +780,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; diff --git a/openair3/M3AP/m3ap_MME_handler.c b/openair3/M3AP/m3ap_MME_handler.c index 688e3937e1..eaba0e8ef1 100644 --- a/openair3/M3AP/m3ap_MME_handler.c +++ b/openair3/M3AP/m3ap_MME_handler.c @@ -43,7 +43,6 @@ #include "m3ap_MME_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair3/M3AP/m3ap_MME_interface_management.c b/openair3/M3AP/m3ap_MME_interface_management.c index ccdfa4fc5e..fd50e80618 100644 --- a/openair3/M3AP/m3ap_MME_interface_management.c +++ b/openair3/M3AP/m3ap_MME_interface_management.c @@ -296,16 +296,6 @@ int MME_handle_MBMS_SESSION_START_RESPONSE(instance_t instance, //AssertFatal(MME_MBMS_M3AP_ID!=-1,"MME_MBMS_M3AP_ID was not sent\n"); //AssertFatal(MCE_MBMS_M3AP_ID!=-1,"MCE_MBMS_M3AP_ID was not sent\n"); ////M3AP_SESSION_START_RESP(msg_p). -//// MSC_LOG_RX_MESSAGE( -//// MSC_M3AP_MME, -//// MSC_M3AP_MCE, - // //return 0; -//// 0, -//// 0, -//// MSC_AS_TIME_FMT" MME_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d", -//// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -//// assoc_id); -//// // LOG_W(M3AP, "Sending M3AP_SESSION_START_RESP ITTI message to MCE_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); itti_send_msg_to_task(TASK_MME_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_g); @@ -434,14 +424,6 @@ int MME_handle_MBMS_SESSION_STOP_RESPONSE(instance_t instance, //AssertFatal(MME_MBMS_M3AP_ID!=-1,"MME_MBMS_M3AP_ID was not sent\n"); //AssertFatal(MCE_MBMS_M3AP_ID!=-1,"MCE_MBMS_M3AP_ID was not sent\n"); // M3AP_SESSION_STOP_RESP(msg_p). - // MSC_LOG_RX_MESSAGE( - // MSC_M3AP_MME, - // MSC_M3AP_MCE, - // 0, - // 0, - // MSC_AS_TIME_FMT" MME_handle_M2_SESSION_STOP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); // LOG_D(M3AP, "Sending M3AP_SESSION_START_RESP ITTI message to MCE_APP with assoc_id (%d->%d)\n", // assoc_id,MCE_MODULE_ID_TO_INSTANCE(assoc_id)); @@ -628,15 +610,6 @@ int MME_handle_M3_SETUP_REQUEST(instance_t instance, *m3ap_mme_data_from_mce = M3AP_SETUP_REQ(message_p); //printf("m3ap_mme_data_from_mce->assoc_id %d %d\n",m3ap_mme_data_from_mce->assoc_id,assoc_id); // -//// MSC_LOG_TX_MESSAGE( -//// MSC_M3AP_MME, -//// MSC_RRC_MCE, -//// 0, -//// 0, -//// MSC_AS_TIME_FMT" MME_handle_M3_SETUP_REQUEST", -//// 0,0//MSC_AS_TIME_ARGS(ctxt_pP), -//// ); -//// itti_send_msg_to_task(TASK_MME_APP, ENB_MODULE_ID_TO_INSTANCE(instance), message_p); // if (num_mbms_available > 0) { // itti_send_msg_to_task(TASK_MME_APP, MCE_MODULE_ID_TO_INSTANCE(instance), message_p); @@ -1086,16 +1059,6 @@ int MME_handle_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance, //AssertFatal(MME_MBMS_M3AP_ID!=-1,"MME_MBMS_M3AP_ID was not sent\n"); //AssertFatal(MCE_MBMS_M3AP_ID!=-1,"MCE_MBMS_M3AP_ID was not sent\n"); ////M3AP_SESSION_START_RESP(msg_p). -//// MSC_LOG_RX_MESSAGE( -//// MSC_M3AP_MME, -//// MSC_M3AP_MCE, - // //return 0; -//// 0, -//// 0, -//// MSC_AS_TIME_FMT" MME_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d", -//// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -//// assoc_id); -//// // LOG_W(M3AP, "Sending M3AP_SESSION_START_RESP ITTI message to MCE_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); itti_send_msg_to_task(TASK_MME_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_g); diff --git a/openair3/M3AP/m3ap_handler.c b/openair3/M3AP/m3ap_handler.c index 832aa0dbac..583552528b 100644 --- a/openair3/M3AP/m3ap_handler.c +++ b/openair3/M3AP/m3ap_handler.c @@ -44,7 +44,6 @@ #include "m3ap_MME_interface_management.h" #include "m3ap_MCE_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair3/NAS/COMMON/UTIL/nas_timer.c b/openair3/NAS/COMMON/UTIL/nas_timer.c index 9ccca12520..8448d9a78c 100644 --- a/openair3/NAS/COMMON/UTIL/nas_timer.c +++ b/openair3/NAS/COMMON/UTIL/nas_timer.c @@ -46,7 +46,6 @@ Description Timer utilities #include "intertask_interface.h" #include "nas_timer.h" #include "commonDef.h" -#include "msc.h" /****************************************************************************/ /**************** E X T E R N A L D E F I N I T I O N S ****************/ diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c index 2628c5b0b2..8c8c88beb9 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c +++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c @@ -812,7 +812,6 @@ void *nas_nrue_task(void *args_p) ue_security_key=(ue_sa_security_key_t **)calloc(1,sizeof(ue_sa_security_key_t*)*NB_UE_INST); itti_mark_task_ready (TASK_NAS_NRUE); - MSC_START_USE(); while(1) { // Wait for a message or an event diff --git a/openair3/NAS/TEST/MSC/ActivatePDN.png b/openair3/NAS/TEST/MSC/ActivatePDN.png deleted file mode 100644 index 7bdfb63d699e306fd53e495fc0b4cc7d13cd98e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9430 zcmch7cT`i`x9&!dat??bML?0FVxyzdtBQaaLZp{aL;i}BzK2%?{D1u-uvg>SMtXmYh>&-_g-tx_04a7b3eIlV#voM z!UF&RpV7@5W&ps=0>{I@?*p%=RuOsN6)?JS%_1DVKruz-77YO7Q)O3j>s@Xo7kU~a zK2Nb=#RZ2pe?n#pEGLByZC=P zXurD1h+5xd)vTHA2M!-Y5SYKXV`*Pm1dOlgZ?OS8L81Fvzvg>rXdVE@uQHg3jQrV_ zHPW&n){PqozJmNEjNkl~5b&DL4*==P!i-!eCT3@qAFw_;I`1^R?|FL(@;Jr*z_Jq; zaQtI5f2*M`aOma{;B(G8f9{$yKQM?_8X6P53e;w=w`&joBuRXB{wM(ewH4Il;D(kZ zZUC^(TL*3LH(lfgVvpD?b00ivvY3fw#kH`RqY{9<;|6;_(0b|^*B#LT#&4WWiG_R^ z2WNmk`=@=n|GmL;T1*QjYag&|rnAd+M@eVb+2$5|&y>H^e;zc({el-vV~5)H(zvY_ zPkj0zQr8Gq35V`uy1Fd-U5q-DWIje1cqZKdn?{v0o1OVUpV2_)`8P9nb)e?!O0usF zVCEzxZOJbFih$wAb!n=2effmQjdu{kIrCwOsWkOLo2JjG!%|}sgvBdi?7HdF&s^Xd zuYr#DukeO$ppF^W48YQVmWYQGzjnp!`d({K->*_FKH7KlLYg6bCegGfF1G?YC~7%W zorkX|L?sVr5a*Op+L=_HUPMX;BHMxu8Vvt{>@fj=(N6m&2kFVtz_cIprg6V_m%2}4 z`Lj>-ut! z4gmh<+uX5_f~C$eiVO|cro#;2Y55ddJYhgVwDq;sk}!Cf(%nmufC;`TpWU}T4{!I? zE_ZR=;j<1W&IH|fnTCKd3b&44RSBPH&G7PeT*j6Y&AyYpx|(=QR(zMhXlRvrL+5YZ zdS~>Lie8!d6hz=Q$Q!-yq6F2+QgceRR8NS{6c|FMZx|;NtZLG?Eyt`*lOyz5iY6Jb ziEEMlrQywlulF$dNXgR;u+38qFcrNJq{+Q)(DI?qrFV+*t*nDZA&%|Ojd9rooGg7GnU4joSgm@lLOn_ToNU@(-R;8gbu;1)I}9Y6x($jI)vC;4P8i~)W6erE%; z-H65tieI|oQ2-G!g<&p@VUx>A;G3{mI-0xyF#a1D`1ZHdDr4j)btDYwwAn}ZAvxoj zrAG!|XC6KYEoMWyeF*9lY>seooh2bDIuujcV~xvhi;65;4hj_l*P<@FxxY0}OQw;e z6qh$z(9eqAsj`#dfAn}eUrY|0>SpuZOs%L?n7ZNKiiIMan!W}sZe6a%6j!u?n|EhG z7ifPY^M&$k6Jp+LU309jpfDhT%qCc{01PHc67jC!YSvZT*rg}8 zH(BkgtP|j@tBGuM)*i?J-%|g($h9~Be*nJLw;;yvlIACJ?z0zA* zaYlDqyu0N2EH`9)KIG6RBUAV+1?tY{%?k=T5J!%7C*IpgGyA<6`6H?JHrJ-w9`s4p zk1c@?gyo9mdq@laiS>vycrBsjq7(OtM82)u=G}R6gGrbJT)VCc)PmaDu*u2xJ$Lm!WGObziM5FgG4Tw!`axV2RyCZb#&5#F$YRdQN8+o8|g~UxfG>h~@j;X(HG5AwC zCF^PPu$5j*8#dEUw?;T6_yw<+LZ-kX>*-BNg+y4+wo@wkWHX9O?b)7d5W#2(iq%Ks zWY1zL!-U6`oxHtmMT>npODZ~R8ySDM4I}hu^ev^osh39(#D#Z+FUnEkE9dr?b=PRe z%7W1e0QFQyvC%?^X|1)Zdd61sm0??*Dq)BWJNm`_D%~n!(R=jKvx=v@I0^m`Hqb2~ zD5WaqH2wPH_|VExe~}Osj6iCMw}yjbp}IxWuXR^kLBvN)9->Y6Lj#>)9A@M23Yon6 zP&en%(ed1-kti{L`AQau&jzm?=CskO!}uF4QLT~Nr&E8mMz|<_)XEBUOr4#(zMK|7 zP*+%ZBc4`ju0SttF8$)!Qn6KnXZ>{i@scF04P{qcuZJPNUu@4i1;@?)TKwb_5gj^O zNN7f#cxukyr9=1fZH>V&^{s)oi7=#2oL5@S^v@|iIf}ezb26{}BM^DOU(v;!)oUf} z{f{a+xOnJ>U@UCH?!b3ql+<%$sssQWyxS}d*c<0Gv%|GwVqzTM99q`-4`Kzzg`&S^MT9AXxgVurI8t^KMX* z&lB=v%5day~!?vH8{dPW<|1O8YjYq@1Z0O+n8M^gK>ltTa z;61&jM0CURwVk{N<&A=tYoxE^IZDF=`R!LuPFEJvv-+a@?x~1bij$#Ia{4C9$uOMt z;1I6er=njJ)f{Lwy?LHp@6$SVuHc;4<|RW~cFho45Y`923nr(%XF z{xkJwi7Cb6%vkWp_mgPtP?|$AVZduWQkg7z88@1G7_wWCy&B4M+lX@vHWfR_ws@i5 zq|W!Nom_^p?xv~6r~CVoD+EF+qg1*u4hwepo@^nOG#sZzk2^6ilrC3uG)us@ z_y93LWdVtrsUv4DUTmBwFtFCQDH@HWhZ^NabqzKar*~ijEmZSFs##JBO5>OJV#m7J z_LbzzvO!aukGWbax;wo=0cjcM6y8H;a`2I?IRF# zY0;Mp`fwUVa3|yAn`AlrH_H5dxrAMU+sp1!(Yo%w0`R2l;$FpjNv4S{6ZZ4w_$r(r zt290Bgd56QvPBvfPLj28S$Iv2w3K#4|Lz0xaN2`_Eh0DYeCCnPF2BR=pQZClR2qzy zBbObO7V5X_O8H~yr~{oI_%n}nBzOCWQA|C**c3nXE zsT2Swjf?KpN?R*y*J@p38iT_(gER6ox-_+W`&?WX zf{NRB7q23+Ad%+9yWsXHol%$~EcTM^GHC9O+H@qM7U6Ybg=JXx>7eOU`ID{uw#E@p^!j)2p3FX( zDsiE=B*z=@wnYo^G@tsJ0z#QwbsDrfx_=xu zb`T^~ImGijBx<>+|0uY&f;sQ)ij63lF-G-RJ6m`~21LTR!X?}|`LPCr z!ARy;ui9!1?DD2y1c~u=vyc?8qZet__hU40J64y{G)3R!AtDoPpx7Bas=4s?2{{c< zouxDn?>?G*+d{eR8c9MqD%4Lb_7Yeh0DvBoF@|I_$Jp6f2WF$DHBQG(502ePHw(l? z23y39o$#^D2*sV0#_d#cr}s}A2m_OfG%#E~(`kbWA?!`Tnde zn`$~Vw_(;YHzNIB1NTMZv(cKA*3D#|HKQm~lk-faxxnpBA$t?&AZ4dco8cUP3p{pc z&^jYJIQ)?}jO#cF4yynT(`QH}KgJ+8`fwwc*! zs|6z=w$}#SErZE0ch~s`*(=EXpwSj)dpRexVsmWSV1Si%AaswXYq9}F5e#eZqA0sZd%)N; z;~*U8X#W2m{F;nuNl3<2=sIX+at&_~4tqS% z)9sAE3!gjfad5J@!n~8Ub z3w$cDppJ2s-xQ9sqNW=5MRO{o&@MU`u&8MF1=~2dl{6aLd&E0pf!GS+S|>9pI~u9{_!O z86<#Rimq5k-ud?dN$~aaPlv1u7U<;1zg`fwsB5NiLZlPxK9PyU{QHox@cRP+t~rjM z5UL!hjFS$=71%8166Y*eR>nf8X2%vSZIj%Zm!5~B_!mC)5p==(zGd06TiHxHExlfs zug}%8qG3THEarBK>T0}Kwfma-rLTm1(sWve9vRXSc2w?{uI}OVf?LA776H#icE^!ZlOt`Y=*U$%{pE0Tl>E0xT{M z#=LnPpxtQ%p3O#Gp!HMjo8N%ke-{}Jb%W;;{P}AyGC$Ui`b-Cao4CW40OIcs=pO2{ zV=Gqu$Dw4a1F_EnCP9k_CpZZaJhF-+Yb@X&xocoMp%;NbKuPPnyG_)B`#s~k$-g{8 zT|{!0)t;s%qG#|KL^Jg2WYwqAt@ou0iO%pAf=jIw=K4Meyh76IJ}vwCT%S&NZtn}{ zjRL~y`f2%>WX!pn3h89Hr@?+wmI*kJA0M2Cs90(Z;+}j z7aHvUh#TzT7EC8Sjp%(Xp49OeQGWOe1D~ zy5ZN$v4C|_bX5?XzlnW(L$1;wq&_Ky;dL=I0p^D!_L|hlYV)~osw5kQeqI?E7%{np zqbYV{%i){rR@$p^h~Xqce!7mM*!RGxy0cBg+c|ya=0RUw!#d;T=B_5yl;{HjPRv*o&sMbKd7>Qoi!EZRdh6etu|LqxfBy#eat{|SZ=sNV>NA3z{e<= zkWI2o!(Q&bFtSowYF!i|XPEmzBQ`E^s64KWF0wqok;iyk8X#ha^8oduw=c(J?%4aJ z#TD3GkrVbIE%c(8m~+?i?;P|x4$|}Uv%ze#u@$rW81{T|AiVgA&w};vvw~9S)~l$L z?hDWZoAKdp@Le{-uzFAzRt^c&go_ zZonVShrFhg`d0^cT^L#SO0uh$P|+=TKE%+s8~fP@tE5ohZ8a{P7?s=2)s?$*3@Ak3%xVPo9^ZgW}|ranIVeq}`7$419~+l2xc~Hfoo{-0VJXfbi4oOv|kg zzB4jyA)roi_k#1`rpu|@+)aXedV_^i z(igHua~-$PBRE>(91XXj2iIbJib||WQXSO#(sQ`j{_MZf_ygjGFZ&TyO|TwLCDjx1v$mG`2$z}L6E=!n*aBDB>R^&7|f>fbGsh(K^KQ@T42zi zv?qDas`~OvC_cy3)|jE!%#*iZ-8pmcpY1S8q{b&xi#LeXU8LsN6;3kP|r#ynGUQge&yvE9Wb@aLZ9ja$3!;22r$vJDcSdPj7Qti#L;k0JfDC({s}U@0 zAA&eL4f;LS`Y$(s81e^8-o&SL#Ek*7_VY8=7_`UT_N#4+Qo%^REa6b^?sTByBQJNp zwOhRsyKx-mjL9okhL{!-17CzirGkXR@heEX9q)ypBH?^WMI-XnCl~+RJ@=iE>x;xm z3mDwI&@;H6r*(?{FOkf5Pb9luwDxqz8LfnAd$e8vUx`jj{i*|H8(a^?EME)7c*oDN zM7!6)(|8=^q~>gY%cT5CdKc|P(EZz+%oC~#GQja<7|4V<(%ASmsEUE*2iU?o1Qi5S zR$fMEyBrpaxW)yvs=Z=4-)~;$287KEmUP9F!J^0dJa{wulc$rSJZ+b&l`fmcLb6%A zbo%tagl4c?QkEZ~|11gO{9}pXUZv>f3@IqBYdV4Z^dogNKi<**&gq_Oh{r)7`-YL$ z>GY7$GvKb$z*ZZ;!VcQMzHisP=3(KKgl`;CLRT&7x^L>F#@D|;LSH|zhS>gHQ(HWF zX=$ml67;+YM=#HNe1$f9d2ubkq9sP>FZ?l{<{^=Q#5!tuZ`F27|Brk$2_X{sAp@Q_ z|HYl5PK&0`Ni||;d34>~K?k7QAA;f@p|VXAYHl-^cx!>!0V}RvRlHf?H{2Vj;SnDv z7neI6nc|B)7(Lw2AZLosW-FL8>!f9Nz~_Tlr--h5_@n8s79~MM2;_8PhDeyrF3vb4 zHAr|zeKDF`wfS)7t-_$(Kdq)a#-xpN6fdC{9>0$adNy=-3T4sWu34&Wm>Yl@9H;;* zhT4+6eT$6@}gGkZ5_3&LiS_l2i$)fXt&|58yf01LGGM|L;h{-{`&doc2O1YkV1-SB{_ zL|N$Jtl>nkbm!9mYo)|ZSq7%#s>rd$U^7<2wY18YO ze`0>=MSZARC2~J8VCqF(6XtWu+b2)t6ytz!y8PLf6dx}xr3PeuOk}+tLcrm$anpp- zoVU(}^R`35^^Imh1(ChfPWf(Kh0V$;;(EsdtU5U43A@~oT5~l?({}m*@;djqR_=(J zFqLupe|+IoRU2L36F&0yY{9;Ue&1R>Je{1|me~8-S}-93>SQJS5ck}?C&GicUf`V- zS?EOf(YIozb-P!C4V<4Sbn`Ed?R3FD#9X_<3Hbw3IOeNF0kH-p9nB>R{n=izhn+$1 z9t>e)3i-Y-1+@(D097kg;%p#&6>pD5`%-7VMO%M8$K$fsT?MX6>RXPY=*T<%LOY-i z{-9vra-Dq>0FRh`oWdaktyjBD4#Yl_>SstKcYwl*Oe)uC0=fB){Qz@+Z13he_}zo8 z^ezaWOd72dyH_oN`?mjy^bLmYJM2)R$K$riizX_886%!LkN`q5NvLKf72m8B@3SkN zJdq#G^M|a@*Cd;q(x}Tt5auzn;fx8-F&Z2uP_RYy>>?nB&sgA_gY8aq|EFdw`YVWc z0Fb*^+*8;2_bGc@^7ZghoV9{k;a*S#yUQFB@9} zLNur-JT8BnQF>JT*w+17ym%!0()`I#lMwSZIIewB?})NS*o4rJ`qyl}CHeQT_OqG9 zaZzbPQ7QckRe{HGzOIcpWD6{{?Y+6T;-FCt>X?l6U0dxUIg?B>K0DX6va!qDrfK1_ zNK+R!#GHmJk(C%^Y(e%r$01lEAI&45ovCV}`tRgMOT&@Vw1=wq;v`OSI-)@9#UvTt zfg8TXF9wYF>y|mi;b$bsC0EQVqoKpk^6&(vDAroQXO>pmjM0?R5lhU%9V6{$Thsx^n=7q}cUUUd__c&dGcg-Sb_A97P zh43g|-jkIMTG|+Ey^_1H^4Gv$3QMV3#~t5X#XIo@cqR>lVX^gC)ee;;{o}dO6V%3Wx^{!k=t6+|El#-6pj_3gba##gNUmK1CRZh{?a9)kga$dg zJ{e39GlXoa-IL?@d^9A2yG-vmiqqr((BqU_rcJBrHBQ!IWPasv2A5hoM@<924k_%} q?{B%cC19faFJG*H^Zu9ru(>n;$|n4AA$o{&hmpR?jk4=^9{wA%N>}3m diff --git a/openair3/NAS/TEST/MSC/AuthenticationReject.png b/openair3/NAS/TEST/MSC/AuthenticationReject.png deleted file mode 100644 index de5d3ead9db8457be75a1d26a9eb8d73c3d0655b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21465 zcmce;c|2R|`aYbtyYpaoP_40Zi-uNFHFi=%l$zUwsA_14v1Wpfc4?@pm}wEJhLl81 z4azAchDuB^tBuAKN@57|KGD6;@0|1g{&~OW`+4(+&-x_Rv!3;==f3ajzV7Q@FK!v? z?A{@|0|J5U*3-Ri0)cE@gFrUSZ`%mIDL=l?5&}5_(Yt=d%r|MW58WBRs??1843)fWcu!Rk(^nGnO7csmW3;=jSy_ho1kKoguDX-2_QFv;1bERR}T`y(%BT{ zb6fGcx=IFPhG3n(2~rlXIWMadIA7y+nvDpk6+>sdo(Oljz`1r(zLDdZKePGw7s?wN)JjAAL;F3WlIy!;NHC|maTOp8U z%!;hWG@G{pQgugfbrYoOneGDkD-3>=J7Lv(5xTmQ&u0e&L)`qC16v^>;jexRnfO?F zdVN)r!gdF*9}JphtZfh+{eM0fDtm6*rS=3AAs(ntVg;^5RRI4z5q&CyyE2Wg0K6ygRC_o-2ABTx&9+#Cn2hR1~kR1$(cyQ>s zyLft*t%;I^PN;I1 z>~L7T2X5IbGS2SZIx3m$OQyJymaiW0p!vnDiVKVxg8 z)!aOLYCvr(qj3IxxMx%V%x3CIf@CNz_r1B)mmMrm6pehbYqeUi9Jt)&ts#e5j`K*m z*GTbm^C{Cj{jyTaM(E+GY$B7b*XZJXpu<07bYfz{a>7ew=oGtUc2~{J+#Jd000dIi z44%;4+C#qHI;K8|?)Z+cm8VW7ukC)~bphX@+MW8lZawdzfsKt#&AFAOIS2M-aK%2| z)lF_H1dUZ#K#9CFrQmzig=SpgHD7wC2t45?t*sdHK@pkV<*{lYwr1AwCc&C~bN}Rz zxw*NC2`Ba$FaUOuC~Xz{=Yg%3M)Sp4Y*=t^k;%yH5rh3i6@?xTtm`Ts&iW(Gn!}Ko z6Tuzp@lbtl!ba0r6?|spZ?{t0YoQ@BA_l|5AB(sOLFB^n`P#09g@x6iRHWC7ja3A} zUimp1I`MN>=u=9n`V5A^{>RGNDsOnWCg68Ser=YPRR@u}39Mbp^xWJ-I1iXkQVK7~ z&H8j#ojBxn1Dg+VleSo`LEYg9#f}b3K@2lJocKYN{FRkY3Wp$&yYkb#&t9c-z)tOm z!H^?=GNj}tD#3^$>0-}qzihcvW7Eo*3UEgC=%qH}>m^xfb|mOcl#Zj(g}A`r;K<>{ z+1Uc0BVh3-z)DuV^m4i{SyWv%Y=bDIM=Gfqt3^I(WsnUh*~hcKB90|(N!-K#dhJPP z$pCv;WqG0k?7u5q@XYz!A2tzQ^5@6ro0xbwjv8u2x=GlYb*}nVA*z~-aBT01|6tH$ zNOIq4pWSANy~W&Cqr!+|+z2GbhX+i~{CfPFg548L&OIy?-8xldkK;SOAnohFwmk9# zM~}KOa4yb2*R$+FhHW0J;xSp%tZN9^;78!|)(TJosj=B(6%#qb7Zczx%hk%uWn4a& zeQ_7O;vr;gv;q913osKmacIwA?;gsi#?60R?AVc-FKJkYXiZxU2kSqW3pU@Nl-j8X z#B$TLd#cN`0lFonW1RDo`6*aB1J9L3tiYzhle(PTrUh9^pLf78+DACvba-oOjWyJu z(1CB}O5PiM`($^7R^m0A14tEX+bnBJukP2>T}f z9D}r&!Eljir4wy@Di`n z*~xgKlPDBf#)>jI!BL1r+DE=|Y=;?c_;l(??>=wq;g{wz&x=Te2CodID5jUmsii_I{mldVJg))kTK88aKUbe)YzS<*HYam(omIB* z7KQ@dj1{)Sbt8d#9VOFbh|;%wGpPl}3Ro)gfk0k$I`u7_;Ke-VBCE#WQ&rf zG_W&Ym5liPYfV{3G z$(mn^$5aG-=}>IB%?XBiG~jY3v*0nF4~cOBD01pWdi!kK9ESmou1$Wt{9F(PCP2Vj z8E#3{N=;1-(Akj8X{fI_TTt$Po_7N7Q+X+W%^&CKGj?b*_}47kcC8sL;K6>bO}=;E zy+#*zf(N1Zt;FfgX#=O#U$RHRj+MG6LU}$_G8D0#fzof1>(1N`&P3LK2p;qoMr>TWvq^H*xr-py6q>f;N}HZS$7Av^GJeXj|nSN$bA#=*4G2FYDc)cV) zSusUF5@-C3w;9FXcxAqGFI~nsk`*hQ=9GIf2n_El$(MdM;h#Z}QCnGDft5uT!1XH^k^6B*ef5V_j?s6!tuv5#bdo_r^v?NU(kKF`O zIeZZW+QDPJ3r{A%Z(tZN5So=VSBDBGIYO2Tv$N+ThJlmpe{^g9yKn-vOzioPQdE{i zOoYMK(95w9i#PEauW@eL@!TV^<6WZ|)2ZXm=o7hJ9?qVn@aMs(NOji(62v8aT1!bI znAB~ZajB9%mtx+kX2kGn(16Mmt)Rg%CVXsB5kjX{4(4=)zAy zrDEbwozp0JZ;)MnEk3!18`T`vT~FyXu}?mKOZ8`l@%_l$SKK0(ZD4TqMB+-7*X~mJ z)n`2Z;*#5Mwy#}OkK4)-Ju~Qr*|&Z54E)-E=-RPa?Mh;{8k5Vqq(1YAH4 z>g>lkqhDmvwNI=3VIgGD5db&TYPT8$f`73uYO1I@OCop< zHeBD2`_Vp33v$5rzbxANO_uhF`Z?X&D<{S!=2@L(uVKKfZYM4cbu_pQp53+A@FZA$ zFXfdDzGBArhl^O?|k~D7RHUU zcCOsUD+XRnaeoH2JZ9tRSNu}Z`CZ%S+>P@+_Ovtf*xp@WWR)X)^CuIpbN!Ap9G8Ef z6E^n;89H3F*5ftQ?$-vJk9+Jar)c);oU#@=P~5`C`jmtv#UT40YLIZyr5^tCM}w8~ z7xP#g32Q~b_XOCy8-Zi#XZ%;IT9EOYH~YiqHbX3jK_sRnO6Ak)w0Ityr$=%x@E^M; zr|*<&R@(B{ug|q0lQpiX0hcBkEALv3{Q&MiME2FcAWAUP|G=34vu}Ja)SP=7DOE_s ze+ZQkcA#Z!9)Fkbl4WM^{SjK&Wbcq}X=9z>$jX@=q}!7^Tj&w`L(t@aq=+_BOvka>HaRUGDi@$d_VR6Xvp3D!Cy!Pv z@5+Cb{FK~?QL}ywZf!6Iz#Ly!BmH_M7fhiXLNpKM!g^0Ipmbo^6YBE26RdAbNMygf zXLlE8bH_I>#qe{R>t4bbR@)bCgNvV-qJ~aAjbENDeP1lq?wC~L<=>}0i2Dx^-QQJl zm|EMP{s#L-MNZfWErXTTr`d06=2jTP*x2#_`sI#z>UoCysO7+K+nAzEVUQ)D!Dx*Y}+EhsPu*g^@I_CP!G z{OTFx5r@-`>4XVRfBMc6R~u?$&<0eWHlk9=1pUe6Je8=78mnQSeEOvjL^MNGHBBvd zg!kLlg{7q>4yR}x`)jU*?#_objNaV+tmz+FPjIE|a~I;APxCxgKb- zh27=A^LEDdL{nijF`WYc+Cr+1*wX zSjO}%eAKREd6<(Cw3}>oVp5K3J-@n&tsKa*Ojd!E97tVryVJkoX05q)DH?m>_0M-1 zR@)~D^EaagDuaUq14|S({EJunaip96rwMfvd2wYWsbdX5!mP0hDXUJB4`eH3&)5Gk zVt;$8anK+#v~pZHU4f)ih&7jtjZmcYDuiKZ;SCEh5l&y!9eTFg$Y>arPbjs>m%~M= z756CFI!>%V3UvxaYSN}DH>{i=20X<{P&4llk{x!<{8mv}S?9j8xY(ukJJ@+%n8i(Q zp1>6ZYkP0QV|G0o5o0Pu-YE3SszX09WrugX$S{{NidC+NrRQeq*pK;n2f5TYIvCxG z_3K}CWWBenWTIdGq_sw+Ti2kMc@OsXt3Eq`BYV0dJ3#zjTkBT?gvZ^jz&R91M;#bd ztvOCmd_c7zr27|0$CkNBJHgg+_Ss6C_ZbI}h7u;|rQ60n@JhQLwCa|(tl(we5e$fN zB!^4Rl=+C9`SRtnS?tev9~7Ur^!Kdus{lO;>HZGokEq5T@pc4j#xtQ=1Yzd^MR(pJ+chZj0r(l3hb z&muv!*k^@;ZyGrSpSmvMh_;fw5v8FCplG(gKXzcQh*r*l{+(*PePGa$W1(*-d%MRe z?~nWF82pz`PEm0S(on7Zr_VET(HJgGBeK*p18bMRuqJ0oJHd;XNK>q09*;Q(_vp3d zR-SLu=H86bVh0w@FFu}*7)?mu0)ZR@D|VqUz#@bGC))0ylH)rfdTI(2-@vGQBIm?q z+`#8wk;}gL^V7ptg&Ny>?#3L4Adb4!xMO^KQ29N&2i{V#r*m(Ri+W9Tvn64=yb(mW zs%VhT9nh{%S4=$Y%y37P(3a*DOxcNCN1OLz&Ul4W<(X&4eQ2IgRo2$|<-ypLk%rkP zpN7Znk6V>(GO9bYEQiyoTLJ+|kdA}|XCRET>PH%$kUR2xHs%mUF!64TDStJN@OPFB zn;xZDXBl7c{@H6!smMvgv$pZbv3uUNg?6r&M3{1L5IB}gQhbWqp6CtBo4cmAcm8ps z`{#vsBd6|-l}XnJZsQ!FHdVij#Wx{7re z-0WQm?;rWi`e@9j?^csRtBqyVFM57h_dkJLmKUH)fnN>CT2gZPayezbJ#2puHqBe; zZEN{IO234imkfqSNF4^4uu2MmTVHw{7m_(oS2M5V!hBG2*lbau*4>$7EDd%S+VD+ znxQ?+G`x8*?V`P%dW)Fr@JweB$z2BGs|*rCNJ#STnsX6$i;K1mna?6gk|Q-+i?8+v zI|j;#o9hL%Y)Nvy^eOmUk70J>fksT0F#0&t9)>Mi=vT2bYS#?&Ki>M~8?81z_z`RB zWBxrNgt9aEb?<8*6hU93b-={FZbB+#-}+@Vw3%fl``pm>P)Fr}6IitM4u#y5Elj$- zFZp#{%tSdF5+J>YAi-A9NG=0a<0dNKqPm~`?jv+ zit*C?@*}^;IJkWsS#|wft}w2M$Rs3_8=p*SRkf}NP$C3!FLGBmzNiX>-Fx}{KQZh` z@d3;u{EajPW3HQSg-{gs6&@XB{Z*WjG=;UWYXmS=r;t(MQd?+iwA;Q%np2TRY%>4lTU4nUkWa1;XSUuiP*Jo6NGp|KuWr)^e_Tr>|LMDf5-PT+AE;ATrqoi zNhf@G?4%+ImXUru#u&2;(`tDzGmC+X*XPjvY($aWmM}GIfB9!-s{I}X&s_7fYDsAl zF9Jd)){)xXf-_s;4PKNCQCUv$vc zf%YuwE=V~EWJQpw6#A5A;g^&*_h1X0>2?fJVc5o6)at%5yJg#3`cIN+{g6f^vmYTh z*pB7U2_v;PWabzbQ*QZRbXoMd#%H;!4h`+mW^9(4CYj0aSMK+@1;K#y5)9m2jbbxn zMrA!5hYEXp1~7e-qFn8XUfCDj?O1|dE!Vrcnwc>+86}r~d%^lqt#|cjd!2&i#2v;R zC4_~^#+Dl;Cr4-6YvE{hLP4?B_86yJk1ZliEqHdqQ!PDumazzHxYnNZ=jw(%Un2pd zQJJ(sK#Gn{-QOQ8!jgEqQ>$W7V2i+%-%@fzf))U&NLgR2!4hs$DQ$5R#I+%HNstf! zzrbxs0=kaR0t_^!-ehNwoi8#5>hC3TQyTIyf(nvK$lZd;)D6D$fh~ug56xZ-72*|d z_19J@a{Kf1#wx`6HA41CIGNYvu%+aULu6H?%R z4~p>}rI#N2!ZU)C?$R~BHuxN<#snQQTJ$*pzqdv5x$WZ85>su*pj+>S(1}9FE$a+l zZgjqeO_@H`L^H74XC%O^1bcvbELR8Fec=6p3%3-gM#22G)!EsoigE03o%aP#5Tb63 ztx3I=-AESK)DORy|12^LrX zs?AH4T2|5Kd|+Ki*8mN9+O)JNxN;ykCs70aF9(Z~G^gnvR0jG0N7u!g z__Vf)?uXQHdxqX+fDM&6Mke|FV7sXn;0N^PpQNolJf674`nR;GNQpjziAnaVOEj!^#?P&d}ltU^eZLWTKKTe@ybA7Uj6LYfVhOB6Pgpcua zcRPsjA&KZgV_xy|8CCB-pKTMPmjY1s2t&p!v}k-bV=JQBL)yWb7$Z!*NYatH7T!-I z@UC%gq-EL*HLvwPX!Dt5MR_XAoG)&?p-d4bMIl=V3avLQ$QHCN64a<$CjpTAcA=@v z8zJEzhk%{TIM&z@i5%U8PxfAO(8YV7-7`?y1h4+f;t$xmS^L zgLn5t9~r*t5jM^AOf8^CKGT1sjdQJhkp3xnq@6HFLQO(1O`qcpNSc?6RATA)MQ-k5W6rb7#3;N zaN1?*;FqufGbX%6MFjEl(>t#@(mcLrF24pZ^>r#QFZ|)K5oL<{GI(LLqn5lH5?A#_ zP)matk==_hamW`Ik0bdm6;|UpW=`7bP$nM}!y+J^LS5@i^jqzB=9X;OZ~oH0qMVR3 zjQAd(T!4eS?Cd*;+}@Hn<|z_|u`yDuWR?EWZ^c@<-t)DMLF}nPNULviQOOU7w z{yq!i8WI7-R4UWS(w;bjIqw(zHd*Shn{^Nx5|VRiGKR|q@`$PnB?^}3(2!5b|Cd_o7r@Ox zAg-rYHpMVf4;V(0SK1#Gc!#Rc6>K2xA}sFeeQvW)MS%9?luN9ZfaG}yQM$V z@+wy}k-ATR3M17WMtWFv$5~w4lW`33Hpm;IvQZ3Fn;|p*I9cD)yu~nl)~7{XZk#&X zUvzGEIg&xfzvD@9kf!JvB z$iYAXf>^KVx*ahN@`lNkcdGVIb`NY(yTKIqCa&3;F6+7@d>IKK;z0 zvcACoc@0E=VDF3E6#Nt7v6htZ2SFB!oXI;kd-UY<=pJilK2}6QW_GP3?XC0*OQYLC zKIQVoHs|do?io69x;szeKEC-*lqW_YceonPch6_Gb#CBt=xYS7e|@%P7F{F5MJVPWz|UX&Zh(JbM*Pz*!CRx9dBt$$^lX+ zw3_v#QV#TFjl87Z#HLS50Rl@9Z=Sf|B7gfq@AvHO%XqV&bidmguFSil(S7K6y!?jy zV#MHrx8yw2@>v^LPG#fx%{fb}{?LT>9}*&z!;%<3%QAC_o1%qasH7{j=O>~(iLV=` zPja5|hhULywzQ68*J@J7oTV9Z-5u&;b7n`>!n}?b6IDh2)&eB&KBaN{k{VQq4lh0t zkBGd)n|k!I17Dz{?{JA)OR<5r9&Xf3iAkQR4U5Tik&kc3>9cqG1&5^1rXS9y$vdo* z?D8(O4p}yeryI$)_q+3SV$E|Zz;E?i{<$3SP}(jz+J|6(x?m-S;|@Gs;swi-Iy^PH z5vTAx($Qi=m!Px-fqaU07>gkB=;}pvvgdLD)vqAyR0gVvlgi^w2m zKD*ZXSzm{s!1|1_;k>s;iDh5x=|bB*wZ0MMOc5}V0ZoB+J`)1!@e;cgaU|f`#T&OB zNo^j4S-CNHyPc3vM4NReQ8lqkkQ#ZO2vm)*gP)T5y(k)+l=*;!l971Ur*tsCI6Cu6 zvErd3D_6(XSLILJ3Zgpy(R(cH&snl05`HRiL5OzUT3wQyG;)x6Fh!9Ho!eCPLV#Hy zZo;7UmvFGrzFwAokZzA?Q2cPVE~Uf5=!<=i-h|w$$7PCJ_QJUh$q~m?_wC6lu%JwU z;^#G4PR#Biq!U`5`H2rLu_8HKfSUU6%!tLB`LcLv#;m|53%%3IGNz&;5RqSqU7LXZ zhRf?)%cMA1+J>5sk4&_~ghQX3b7Rb0?c_;U@ZZIYb(09 zDrxKyyJMWA8753;HQPlX8&#W_JAK##kWZU)1kt3Yr6m&e4x>2YCX1q@+Mq@7 z>(E>pj=Su5)f+}&5_)arO3X4Vz6E$a3@@oA_fq zxxz4NTG~w7)Y02JHf#QFtn1x3ZCS_6WG<+ALz1Jg@i=A4})q!f=!7WSgb)uP$vV3nGaY=P+W(EI4vzM9;%z= z@dDO04-Nv+Nr-Hjpa$R1UZ8FQICgn1Myf>4W_eRcPJPgFC@5C-K_G^;{9m*Puy_(5 zZ0MxOe@Pd9A^zBPLOuLME zBiB6Au_HbEebn+@hpb~5Kjmr+qzCl`^D>Y!Qum}*Z(9qC-k*9g3}Xs~7C%)Cc;+K6 zD57Vb<_J~!8_Ov)!6Jrlw^(LgYMLBAvp-=f=j8dalkdcf82jksc!#+)V&mpYj8)47 z)lQ8Wh^1MllJ5a3{?GACfc74I42Z=lee^+(MOpQ@rq`B=qx0z%7FpLp5ihnncq09e z9cGTu1e`y6DEX!5fz~KD60uHH8@LH3 zXN3ppk|)FI=IYeIZs)?A<`sv(^>c15Qm$m*CK#MV_jJ)PuLxyKE@LYrVfN@9_?pUV zYcok)P61JPSii;2j?IfW_S(<`H3$ZqQ3ny{u$GqAL42Xv0A}<}jWgS6#fjH0R`k*3 z0hN+yR0(%?x}B=o{=xM+$+IX3_EgMCiDI!_TjMCtD$S@5>KnAvgkMYQZAqI76fnl-coZg(B++=!r3$B z%>yNX<>hX*9sK}^2A1`#g&Cl_4d;t*r(0uXs9E+-MU(A8JH7i};FF49`gk8-to2UY zQe(Vc-}W1)mvr;O8Y5)IS}<&R$uH1L*jC28yle&vp3wAq0i>C4llj-Gy)+7SVNYYC&KCtb* z0>O>Ig7a(3v_KLps2y;ZLvwil$3_Q*pI4@3F^@++8QQ^Q=@RY*sKw04Ox@>=@3Y1B zTeSHx{r%LHouxv*ADaFlCCDpT&hp;Sy!4E8jMRVrn1>=P`+SGY))dlagyY& zRZOMzJES)SjSX^r-eDI_R>L>uR2t31bzxp{zM}ZRiKv{<4jz=^@*gSkKDkEt_D!oA z=hgj=R1QP4u)f9VYd4?G+T@f6&FX^x9gJIfCsdN(7b{sKS1qfBO{$Qu9ww9_BCZn+ zBWrN}j8Gf3^k4Yip|gUa~D##(NB2my{j#QIw8Osp?&(!VIZSQ5aL6d2(?w9qb-M=) z!0jkYs(ZIjO=Lvxnsoru=<&kp{)(Y6&Y6_?md&A$Vs1o1Nyp+$9tpA4}8N)^O7 zs|n!rL4%b_k$l+bPHqu4JnlKK^bn8$5Jsqy5ZFs)9P)~z54 zxXO=6@8VSJV_=q$Q)`Wa2l>C_I*Au{U7Mdj%5$XnpXt%15XlDF7TNw98Tx(xG|oNF zHrWlBSWxBBVX*=}aFKM`huXt9orBhby6ng1b#E#o;4}*6=e^5u!*P-?cU%{ijU-8E zNX9zm%{+jLjolyt9oFLkl`!rrRpp-vaftiGMt@)C&TK*>-ANLR(*fdqh-F+8PwV~# zmN4^1T5Z6HxzwYk{M$yA$Xg$Z9%OL(YyR{od#|plAo22Eep`cgpGl7U142dNyACHP zF3S^T7<-S4$wZ~matVz!zea_FB%(?)({qg5wvwLB>#U?E_jU zshV*X386aGa3h__QKCh>FooT;V=t{Q-F8-5BcHD z4%{Us!6}CX`;z53GdX&pryMaAqBo9FZ`oG3dhdbIDfrp|^1O`JC}lKNc_sUew31o? z&TC0?!+k)h1!1vM5`YW+D8%o1I`P`|J15O^eE3QkDlkAmHr+GszSuC-p|&IZ+0wxB z89LlnmudY|EWjuf-?#Y;LU!tWLYg84cf4uOhqi$3pK+7CRLN|exQMh9)c1vU+3I@` zvQ0JPPLc=p*k0J+-~sjm%iK}|VihKk_P7R>$Vu@({!!dG5&!V^yLqM9U-eF3#5$uJ zN?R7Fs~}a3U(_D}lMDf#nRvi^xd|daxBxi713=RY$lg%c-0XjFf8drx7FGw#dY86_ z%oPB}`}dzLp;*p9{|3lqhn$O~@sgb#=XOPQR4dEsT%9QE5p^$Wn%b-EJ)aO3bUhXB(z44F`yGZ(;=PlAR|&4`trNt z^a4+yEiwl4Rs)3apjmYc$5eD-R;6*waQnay-IGI!O?!*u%J!(;B=HH;2frlY@0<_A zU`Wu|o`&}#U~&QDECm>YK{Lt2{Xpzs=K97lSUu=L%Y#V%xR^IN z)=<=TM3>M}1~fx06f4IMDae6^KrgLGx8DH*gg`({9rVcD<*{%g2ra!l8Kr;d7qfI| z{1`9uYpPEL+&}P&&$rl#g8znh@K0zTLiyF5R=_;3=J!(`0A|G|ri`s{0o;&) zv93bL>?>i+7L@JA-X~hkV4lK!23d!$4G?C>RBXWixcvq)>ZF_A#duHIr60Z}c`Fn5 zR%Hza94;0S#r33mDJLt^r=E-_P8Lt=VBr}y-Woso~dZr(}~jA>6;>(@!E1_ z*QGV@YnCeRR!K$zu2&G|fTO(}Y`NIy|K(7m7PKxB)RZCc|K;)-n8>f{TkN@AHSQ55mLHv5gg z2w+frObN47bKI9Z0S@P_?_`L2-??4GDw>i;LM~UXx{23)G#H;Xxt;k_WlBR#k6L#p zGLGc#qNpZTd}I-q{y-=jc6=gjN~sDtbv@lzJx>UVIMu|{LD7{hTWnACR7cBY;FmTG z2Cf%7R7y=6Y*=I*)daPV8^(} zEPt3^`)-`U;?*%&8=H}vjN@y)^|vo;&-K1XjgrjijJ+{>b$hCW*SVJ}|H%9I(5nId zCmOZn%1)kB%q=vEPGrJk4q7avIBQ|gK`Zt|J}oNDA*H)3af|L*4KcK-Y_%|5)%uu6 zoq6RJhzw}#Xx3|DahO!d4nal+$$tQIR8k!A6XBGTJDi>I7xIc+23b%Xq9$!}@)QiM zPMXU7!_6+QwnKlw_jcZJ^HuBo8L!UqG(19|JC!hZ`1#P-m;?JvNX@zk{%xW(U(6-v zwM$K5x*WO}oz1HyV|{W}iTU=9dGwq(Ym`{w=C+szyvlPNUGMNJ4jyTGb8d*)h2Sq@%QH6W)qS<6C zM+XIo(veYzfQky#WKt~v%6Iuv0#T+*5NLZ?8WCDYmTX!(&9+p9Y0V1i2LMbTthXpIwSHj-fIRcQiRa06Y3=;BiCOEj{)Ox;rb!F_IV(*@X ze@zYrO$bX}6H;H-Wy8R6lnoJopt)a%@5YTMM3~7?icPl@>4vm3g(!MIV);YkpZJPG zosN1+v}Q7NuHpC;DJt1OB?7=hcX2Q~pz!I6Uhk3UVyZ;cR8E*=)iGv0+Z`$T{^!(R z|AL$!o5+pBx)g&02Gr!T<*u4@t(I=3Hfefb;vRgaFMg>kMHa?N(gD5eniTj#plN=tF7fAOJ4t;>Tk0=@?1^^ zOR$MKgVo*?QL{(ua)W>!fb>_*ndC!Zl$ry<(kYXg%7ki;Z<@DigofjI_Tedi5@E`d z8*}3rt7W!S<YRPMV-E!>*Dam`jr>92(uV%t;YZ1VqB}9*FK>OYh?1yGv24)eAK%IGWcNKKiqXd z!g0AgumM;#VTY4@2BG3OEDs`S<3O z|N5H}ARn);6JlDz+OOfDv5xKKvR>q?lqhC@55gs>7{5iNp2Bo0OF8h6QtovUAwx-8 zm?VfJyU!L`p+C|5db>74*b{;#6Ogy6)|`7eeA`bw!p>Kn<0}o_Pf$q5*Hqi8 z78R6ZBE!{HWt1wuO#be2WkyV=RnnyH26F$y@H4OR6Q`lkO}tQ4VW%VQj!TsDkRGE) z0W=xK32KlK%htHx0AE*54y2v@9P4d)Cqg4HFD0yr65V0FJQ9K#GGW_pRF%;7JRxpq zmxt+u7Kw&hjLV8SQak9rg?@a5+v@!md-y3T%Dik(dbMo72vmQ}iK4GsU>xtomWLSD ztP`l=J03npbZpLIwIQLMJbm8HaPtN;6Dp3{xaH1=#C3nnlzhFJRWragX**p>C33Ia zjI6m~(e@$o-ZRg#LX2^7ThLeLBwyd9% zPbA9w@nLAIzDmW@VsiKMiMLy(lY(Xr%xoyuZ>gPod89`^j(az4gg+&m{*yW3&^?o7 zlG!#nDQCp`EH_YfCfi8+z1b+V-v*){xn3LA1`Ne|$@=r2G~6&FxlV1mOtQ#IDD#Bl zY3EW@=t6d~=TIQccLGP${ixh*G(T=8o7g9Z%b^nW-?#SPG^Pn?aa(oPneor}Q*T@| zlp1(Ulb+0EaH(35l{LjF(&R@=>ZwsyfPq_UylS2#qB8YW@BSn z^B>wkf(JMNw>$qVY71I!N<{e!>mqnS?9l4!>Qo{?m3bYqs)q|0HLKRuAgQ|9ph~s` zP?Ud56$r|g=u!}?n_PxgFTakx1>&Z##{SEOtrAv)L6`^>i03^(1Q4_c{YsV3t_N-K z+yA(aO<;Ea&FNi0@jEknjoWU*`Id%vh%{SvJj4v_Vtw|H;o`-{@(7=`1+63xS{vod zo{qN{lNnt>>yS)-)Qz6vUJI_TA`2XC2k1-!-6XR$Z_;;3IcPM53T1YrA*=C-2(z+8 zoTJ4dN02t)CvM(+g1srXh#K}svL$-96PH-5Nx;t;EGzmC8)PcTs||zONeTgLEUSI# z+iT&ahFW|&@?eY*PX?Ns;v!@4Z!G;x1xz*UhptLeEu5K;aLg04%qHp!NTXLY-oWE< z^?=>iQSfeQ&KZFi_;UI>FTp?b`cp7j)E~{Mt&Ry}z+x0)GMxVpAFqBaX^pxXFm`uY z^a|={4-bAme}bUD2tWcZ)fl+`Wb?mwpFCcO z?n}eM`YY+MF5hh8M}126`+MCUG~|@28te5Oezw`=w}CFhw!11}`t@WBWutYvJ&Ng$ z8jhb@{gPgCGE3fH)GJEU1)~h>mjbi(UK85h$@zNB9GL3d2EbfvocJs0P+oZiBh`S1 z0v`4{eXY~uCJwqMEBTwM2ml+$qKLsIWZvr9+?=U@yZlyQO)e{-JyctOt-x4??bOkscUX{3MeW*P*-U+#i5m$}Qxhre zVe#pFMRZRh)?~@QetuVe;v5}ytLz@b34@Mg9?EyiSWPaRR=1FJAmX8Y=KjGWQJz+u zdojmb!b@oZfJDA44LCJ`5kX$65&=+OY=5YLop~*OxNf#U*Vg}*^g;ZK?ncT5iS1AP z;y&o?bwN9LD}%1Gl0s-p^9^{8yG2$R$C44}x|R3+>w&Qg30M1Is+ z5@LGXxpWWWK2NnS$}?{0WlTS9;^!Jv>vtD^#Xx{{F|YaI@{K>9cc{!6;cjukV*6@< zDFp**ut0e9-7t&%b3^oTyH|>p5(?E`2MLuhKmO$Gvc%)%4?V2e$%bAGiE|H~_pz>a zTe^yCA`u6)b27{)SXcBsC=4|lc6ZiC7>EwY%QlbB1>KO~@9N*dPIlXauwTpGn`s2L zFY+>=BkQhk`RLZy?=|2Ql-J{u*FH|UoF8SKn5XeYwRnU@pQdCd?M(vq!OP%=rkmz; zkQomgORAw`JlUS%!gC*|CzGzBJ{jLzp5-3qQ(G5BNn`WS=DXbF#DhD>E~)!=xq}N~ zfXeT_I+yQv$7jN%2dzBrx0LO**JV<+F^_o25*?Vva!}#58DeCgmG`am#(VS z0Qw*5FlGWbY*IvrHxG}e8gm{lXF7aD?HO4WkSnBdskaY^C&|$59fX2BNtkq;TL4bj z_BxH<`Neyp;HaKr7)HHSe~3Kus;3&I{8N~;x2QL+!b;Rg9_ny9x#pp`9zmY4U$VKK zE<1iWB6tg8^c*iD;`!X9?B`^lGalpsceLlU!4N7tQP4WoCVUMM$2~!%lb67W+p#^mWS*=@$RpKHOlJFr}WzdHut!cjYw5NNO zl`Gy4>=%DwpS^~xP-+}X(?fRutmW-cYko-6MFd^dRI>L25$&$Xn(W5TlZOk+&-78g zd#bz$f2!A&#VzdAtKaiY`{#7hm1Pg@zgVZg8fJfK#@2ge@$2Hh|0;M1{KvnCPTw-y zLo!B)9T_9nz&2-0Mlq+;#yPKKye6QX;V3cJ?RU#Di9Ko!DHUUAHi|`vgED+ilv#)! z2UZ<&5M-|EodPo9xe*X)4YxAdR3ajkv$mS5F`{Nz=|%IppiQg#e1}lJQ)z#jA{jJs z2jC_^3%4$@ojF5SfLi)`=Jku_`+<4gz7F`-(+$#d$6X+h{eKAF3ovRz+Kjj7Pe`B$ zn}NWL>*aJCl^Qhk*35~eD@zT%c$Ka_!m>OD82$h3>^3d4s6pr$vzZDcOJ5c|W>ruI zS&wH`&phuykqU&H4gu&=qiiVQtSlyE-wsR7X|CzirGRTZ}6`Z$D-!q zP1sOp?-x@Y(!2pnbl=0%?RvLQrdh6fN~m^r|qpf8*tP;N$N_jXqf zumQv-?gD1s75+Dv70?8bZA+jDeVr?KOKMNNp<4U?mx!c6l z{BM5IS8F+RWO5p$?&5Wkk&)|#Wn>+wXwUHd^PauHx2vbzSQ`29wG}^IB8kVJTJYVtAhgnZuJu_a!g&Ft83y&SdgUe8TS; z(sB=J|LW<`zK{wfbuJ}n?40S4RQqdR2muX~n@r>`wn~KUhl~0}T9R612Xb97XSZ56 z>@@D9M}~=0-I=YesbUMDZWNW%XM2O$^4 zp1=D^CR~PVzL9LvbXGTck%z>1TZJQ?BR}q|@@6WRd$y_Mlk0@3TCN9}nQ*wvcIg0Z zZOg^N%MUNy@w-^0Q=z&A(meH7ntxW1<{#3$x%0YCt@}$y!sbF~Y>K92vG^U;vNNNY zB(bLETIjZ*;WORW#_3LNr6p zWFYtJHRb63eq)O|Gj^VB4Ay%$Crp0p*>Men{aLh{^y7@rXGZncGyD!*PMalRK_oKG z^O=!|8&~v?21N>EB$@tiJnLVQpY7=B!r_Ji>1dVm%Rw^xN2Nrx75*!-^^G9^gHUv zc%NDMk9k~a-cr`?V0~0|fH0#Ht#$|fD9gToLTv4+K1#Ii3vU^?@Ab0%;F*;Y@Oq1# zAfLq<@ttH&4lr^T((>9tLLM~2#I-V>KzUhN(9oV8N|dCg%{n^W0g;ZVxk>^Y9of2F z->yf64jm5rj=uDSD6UPpoIQ<61f}isEy}NP%A)8+M{G)+WTME@5f#Eb+B4e0VhVO~u}yyaje-q>$yQe@fSV0}6A*o5se*$XuzCBYzj9 zaxQhJj6$k*F8z9q=zUfH`@yBnUQa^MsA|fL%??IMg?fY2r2sw~20>mF7jL-I) z5XL$C<|+yw_KXC^7!IWAHET9=+xOXaH)A51aSp^(&q+eg$sUaN=)@Fx*QGo<-I}^H zV)$R&FZX^8cwiw<*59@B?$g~l_fIBA&f+OnuBXRUc`9LUc4{2v8Qig4L~1@0pZ=(^ z!EpE(A)aY`;6~k?a1ld=i)24Oh(2!2MmI8z8zVHt9&-KVHsdM1n&jGt35L9~1rd4g z%7Mzt%7uuHD!&Q*N67IVj6ZZ>#oDFS*2j9WLH26cvr!TI>WV$8Y?YPOP4wG3oMOJ~ zm8(7W@8^4e6*PyGFBG*-YJ4z>Eabb671XqV>YI-3`pix1r;qKE@cWa^{X>p;GNsn~ zX4&mdOLR(2D?!I(*oL6MXqe45@Xw%6lE*)pVY~;en>*8^PA7l!a`@QEOY1CBEi%1i zgIErmmZ46rez^b|@pOMl^KMPh-KJ<&#Q~_abLD2GFdFN6USa`qt~bR`D0)!`)@{*j zsn|lwo`OT{m#NPZrvMkx5 z-8CoRe^|@lPc=CVN5TU>SM$mGgluLT*J;}M`tZ0ft|->;vu@~!|58ELN4B0Z_)|)gYwdq z7-#(@FcBsmn)ua~O(i5x)z7~tA{4mH{;c--p;;53Ru2v)kL=GnaD9#eWNPL@CDsHY zW+t0?$x7rQF)Cloa=7s#Qi}wKPkZFyZyaR{&2+4^J)ig)0I&vleM7%CuR~G%3UQ9} zX>K~~dxM}ge|`O`3ci|9W07MMeq(*Yo2xdjOVWTx`Hz=Kh47u&{jc|TK7xdN|G+dZ zJayajHlr~iQ0x6{`wx_@+Iiivz}Z)DsNGfiK~OBUHvWrx&OalN!2%-1@{OR>1cH>T zzQADt0!)|yHW~Q*2%~GQA9!lBqyVDZ#!zf$YrYY^zv+2l0TdJ2B}6BVLisJ)X;A5!aTH4}!BWlJhg$fS%jN;WQYz zsyHzdoiaA#!eWka)mw~-Ux%|l-t_(hB+p&cmr%N*8IFeVFPwxYKe+ z?^Js6OA~kmH8&5LkXNh6)8qlFd6@pgc7tlN_Pnl2axIei4&kq4n5Sr=-0n|wn3GO! zp|KLMN(^Pfg$o)}>9vUiB3^_}ry`jD-E?Jw--d4&*RNAsSf;RCUI!nK%(2`olSyIk zFaVMXSwerUu|@P*PE)Os>sc5jOCSr4noO8}fW+Aq89A0pY+-)O(G1^BuZeLcJ$#c) z_qoF2d=PJEIBckr1!*Rz8uhY$a;{wZFkLC?u$E&M*MG@hvE%s>G|`zw=v0>54J#%6 zKb@RwP*Q0a$8o!DWw|z)mT9exX$tDPWLj!%7NjQSH7zn+bAVEbRxJ_4EbV4fnM&Sh z)ks}$Wf!wBNq4m(Kv7e0T{2QLFIb3zDDL|@J3F&8?T6j-;e0vsat`mj|K~l=|M{KA z)S9D-46dlp31gItw-~J{+FfUE#gmWrS`N>ftZ|v9bv1srBa!3P9}sCg=o_0z!58D; zomC`ERxDVk*$sj%$e{t4q!tt)Wa@Duf-PrLju00+oy*)zbt`X z6Nzp6Kzx$-ZUHcv`;}&%PC~aR$b_!oKI8kSBjdEXh{ju9xqe+8huPvq2AYK!&zb$_ zyrO~zmhWJ}B1@8Ck75!~WpS&f^M+H0dqZt~QL2;s3mnXBZC+pmc72(A-zqeYzg*#+ z2kmD1(DN-TgYRRD+8swSE23Hb9qvJv9mBRa`~7RLPb^V-5`Fh=OxTihlBV@LZTtX0 zq3u75%Rc4V*M(}UT+ANN7$PXYUQIM%9nm2O=)Z~3xHV%{X?n%46R4LO?m~hIF%KBc zyn8DH^-lX#YM(#G116%CD|PBa@C?Rkwx`V*%?{UwRJ3}Tx5#E0ASCeW^I;*%rE-WL zVW7`!a;1JIEO?Fwy+^0hUn{3os@OOSu+C3G)g>7ouIh|uS9K0aE`r7140uozmi>$# zk5qk2*QzpCrE5SBOf<;AeYP<`l5gbYXUBO_~lfv;i zqwfC)f+W-(@-H%m_2w4~^&{4KdSpu5vB+4-dehtHkEkt8`Ucs%og(FDO)Y8$rrS3K zD4tp2!l$!dpf**odu5+4fvIlEhVtiWv%e^QQn}xnvWKnc#wc^8%>r4t>cZjV_osw~ zZXA!~Nd830Vsj%ahH*I#)xA+Wu~_Cz<_nrZzL`XY@X}A!Mxwhvlv-q0q;KE+Bj@+* zxbD^ys4}On&Cs(q4;Q98$OQt7GY$XAyg zrhGpe>q2{45MK8-bVNeO?X9MMh)LiG3Z%R3k39a3`QU7e7#VegU6$!Qm=>xThsIP4 z$k&UWX!4BwAwybi|rHkNj%;ZW5Y)bGIa+!#Hng92pG(oN?LT z7K)*C{pX~6G&WR155j_J#;3FFpXBO@DGz+SyO5y&5XcENZH7%MYxBPx=B;wEAtDV_ zSM))J*8x43HX?Q~@snq%by9aZ6eh^C^+65I1h`LOq|PB#Vm*ruLC~0{6d3Hz4JA6* zfiFjRq;l=Nq*l=CEe!0U7}(!Pqy%n-%OB9t>e%^Ta|_8i{qdC20@@*W)YEbF=zF+( zuWi^ql|+p&7JYR+W*>X3t}SsJqdDa&YwFDgmLuH>m*Y7&;1SbfvCV5M-t9(K^W>@d z=G+hv2;D)Tsu$vb^Lv1mYI|T zbJ`0qyAv%g6Nz+}r4D>pw5^K=TlALSJ+Z(Rz!*A40tki{YDoA_@P4!IH{Y6BGxN=?;g7>!S?9btd++ys-sgFCUfeT) z^6`l9006*u`<9L|0C2Ox@$lh&;Pv;F@Ivqk+}62n8l3fG%qS3r`wh6q%%&JQ-|a-a zR$eQ6vGG9(mHO0VAS#8A;2p>Vy#F(&Z$|Mb zwS`1lf})+d0j0~~v%+JQGwTJ3&nDB+p3 z-~whp`18MqLID3;zXIEN4F0B7M}A;KMU^rkb`8KG8HB6DUrCbNjvpie09QR#@88g} z$PEBNg$yvZxDlNjh?1~e;@0@hfSy^zj^5qfXo3K^riI1*z_oJ%T)C2;Hx6(XCCcXQ zB=`jQHySqp`9B*l=C@!u+53PcV=Wd}uBsL*&*skVUMO$5e-3Q58S;ZGqy>6jm$;mb z?nSch1=a3D*xP@!c=WKuoecl-`5tB!X5=(t>UAV`QS>tyqA>@2shKb>BtcQfknqHn zp`?72aKbS(IidP)x=jeRu4DQhRT^=$K&y~--9E!Fq0QaHD{Y09=aK2UNln!g2iFA9 z0N3w*XO%JqYOH8y1IdoB#*tC?Q^VIA4vIF5RhDinrRr*wXbxZUeCc~(0siBiGqx*_ zxCXyl+ejXU31QzZQ1nN1Hg38Nzck(D0)XJRExiT+P~lWM-V67U#NY7>#A-hyHn~vI z{2z~^BPAop)zgcAhd8Fq^i<1|}nDcXnGMSlgSMOLP1{)AAhuSk-3;5L6vu(Z7F6L=b2<$17-0QQjE1%0J* zXPC%P8cNM_hNyrjaH{shvVjYUW}d=jsjes>T6 zB)}47xLURpgc0{$5^b%k{jx}Niti2hv?aU1yZ}7}rfC&tHs$zz^qO$#3pXUyF+z>$ zQ>7Vf>{cp)_DEID0ldfiAQ)%#ZeVSyzs%O7FkIQrye~`s{Dg~et%ApGNzHY^X4Lf4 zuJ{FV8MNlhWZ5b_(ce!Rd=Muv;Sw8R)xR&1bVDYD5Z1AlCi;EquYPqT8~7xOWPg&c zW^?5>Nkr6-D}J1pOr3WD6B|%w2L*B}2mr3>{S#w2pZrJE`QQ8`J5&p~W?0=2o1Z{Q zjdvB$AnHn=!>c_*FuIN`q$N-aP+dNSSG{IgIHQL*hIA@!%Y@y$NnU-Y;|IOOyd!g9 zB62hlcaJOhN@R96=c~^JbHMAFA?gqaVV(nrjItJ}zR95vv?yW-oeQyUT3Kyx5C}U>wJi7X0xm|RCvflFNvLNVthd>*yxP_hU3_VpOWS#7ja25C`;CkKZ#O)47$1~e zG)I4_^j};3soG-?yBSikT9JkVck4Cf zXvxmhXIF}n-0L2O8P*GkyiAhgHdYhyd)4g|NHd{0U;I^!~JgmpCQ$#E_)vxeQ%AVf@`QLjD6ZL?| zWImsPagscru=NX%c(EU~Aq$j_2S2pR%%MX&{;k2%33YYzOPkQGvhU$7N`D~w&TPoX zR^AOvGj$9>Zu^)?Bv30{ya+syYh5730s#B6#oMc`N=B@MXD2-eP;cc|M#&=UNljCE zBgy*KFPn$|#lUBB^{3*)d56~Veuy9U(bUs^{1rUE>+MZ%*EBU5p})g_qg>W*NPp+? z*I8vV1FPz@4IMqdMr!9aZ&=((+IrzcA|)LHRGm2~02ox_5M45?A~!Et56fK_Gp6>X z=zGzf3;m}r`vvTJ>WRWd3!0#EKNjYijHeUwh0j-3yKJ4A05iI0@0IWH#MhArvkA3# zB(694-b#Inr5MkKZ~C=ud54`cNbt_twEfnK8>St`jZ4b4H$S4sfiRWZ13k#-R*2sNZn19?@u>@vZ8CZr zVq_|Q@x(YbR}d>Tn`*TS&SSwhDSv=%G)h&|?-lPQ9+LvO9!ORIU{by$X+PixwjA&- zVAA}*IACjB;RNbkhH1q*rb{I8x5|^K_%Q;Spg8E!xo-B{w%4)$ge;G-#PHYmgpT-= z&d0wfWIlAFO;?hrGtcC=ZX0DG6(3Rkq1)4~AeszC<*$ET4mr@-QY0|qW=nlK|0bzAU>Ctu zjqZvVmTEGW3~<5gs$vlbmJBUq;qZ(iFBp-{3ry^rDtYHY^tg-j!_;tHiy-vJyg z1=2?>7ON1jt0gEDd*p`|gZ6w9>;H*oG3?>0`svQDw`k8UJwWhDng#wyB*Lya^4}@2 ztRY2j8|RLKNo#YT1>Sq^3AU@-Aivw**0{pk`{qK61bf!U(pAfj(O6_<`X&6pR@!P$ zYLH|AN{${4gyL zXt7%R5`QSVsp<@|xq09lYD~2wQ6NgoF7)+5@8WpF>U{u06vE<_+u0lgEDH&{CjM#< z$Ft*w-Z}m334#&8`aSJ~lXkd8Zk8`7Cqw;eqr17HgqI>CXHz&em3sz>L_#1CKZuzK z5S8gem3-&atH9_60bw=)ydhVWz4((L1B_`Z^}&f44hSCyGbAyeqbIL!@9c=hOo1(C zK?elob=Wlb_B6=9KV>eUBXR7c2|i%bd1nHQ%3&$~L=JQJhR~VUTSm9IqsBKGdzVFwHKuzt_em+bn$IfHOtKog2;v_d365EQw!{9y(xqRx+JK{&?Q)wavi_qL#od8nD_UW z+QfvM!eoM)WPQ~K{jb@Z@J3K@iStd4SxY>~oD1V?w?_&LQE9hBueL0_1iO;=Igq?A z2%6oTi7RKyr5i!v5QIBK^=&9jlht53PNX-icXLrb`ZdJ{Sq=QN-aV;^dCVtfJaoBd zh$Z>qYT$f4z+Z_oq%gaV?rT80MDhRAhUMtX1VMA6W)m7phGls{A1)~a|a zU{;C)z*oS{-J72KoxX;=1Rqnk~W z);}mP1O2M1dH;|?V&3PyJw;<}6!)DOcRo=rv+w?*f<)UH_3(ZYLqV><)2-DRq`Cl5`RA^_cFRX! zW5;O8MSf6`dP#9zdkovYQ4g{XyXw|GZ)G%z8Sx2=Dc3v(G)7JAa^=c7vu@Ovt?}D2 zcXoERwlbI{4#&U}8r=k?u>q%yIbxOZu@M5+r(xu5sxX8BmjCV^0L6(k&M|MOA$`QO zl?Xl}77X4`gJqQ#!&0L1p<-|foj|LauM0E0d+uk`JjQV}$Fu~U{ zFWqfoC{04EM~=%$5*X_<*_i+pFT@rBljv!Qb5NpOPaX`qV*a zj;QaJc-1eBRq;VVOs;*vuN+mT5HV}9y}Y}&CRnk%TC~UyzgaU2RlbQ?F+|;S6)$i0 zH={hh+hYzzvDM0mA?FFo5MHa1kF_(8Jg$)4Mc)KbR^!>U@E}^FCsuAJjfQhS&+3<( z;G%_6b|Wm0yU^|Oof|1Io-m>(J|!&a7;tL~v<6sM3fogWeYXPA{R{OXI9m-pZj-@k~)XQ@?rUtqM?t2jq_ox7Y05$ zW~*L}>8JV^P~N(v$f(*BvagA6XfzR-j{Z|aZ#L1XMxhE3`@v#Tdolo7icLyNay-%8 z($Z&8@V0K~T_6GAslL_9soQzu`nlq@uL8WCxivo}`s&J4Tz6i}LJtwrr2LpXz=+6{u)2eR7= z=-&ZLi5FC@ehbbxQ+nBANna@B7IeGk?oy9L!a_3vNves32zNa{-REQmiBp={UZK-a zzpmBFB3GoVwhHh=VsG23Q|hoMEvB9m#R>QWLVW>w;lW0Q*X!(V#{VFoMSDAjQ{yQy z8xRRSvVP$2eyCe#pbxN}>Q~~VZ%v70`aW9IAkzGnHwbu5Qk1(x_*@c?1#MV0r9P0F z#|2n%Og@gneXmZt6Y=<0^|9vFG`!LbBAv-h&@LZ#dV9=rb{6LVOG-q-t7_!!s6Ajq6nt>l$N1czDb!)kZzAa2Y*MAi&$&He5CBo|xT1 zj7-gtFm>4Ziufwu(0hcP%4n?RP;;{Wslm~t7|7MQiIhiLH8mUB#b!;=gY?>xq6U4N z&$>Ax7Kse_&F?5?Xxat=>MQ;I@}gT8*p)uwjav+@Vbt+CL)vuUcdIr72ESt#{(_C82gC} z^;)Q>6jNfxyIn#mHk4-YYID=VUi`=HVafE`^oNBA_p(uD9ohA}-8g?Y7N_*KZ0X*h zq)R{~NNZDfCJt>EzVi_;Pt{lVpM%G5ITQV*`(2sZhRkbKSj!Kb+S7L%joBHGL3F0E;|-UT~}g+MVFP|0`|w{XA%uwWc!A zuGCMXiLOumAJh?J{;Im(wckq2*(oOaz6a<-V&DV_b0xVDF$1+zF%1;+p^vF*aw-R(n zWer>CzpORmEb8VFO|r2nWDAv{6?^y9j0SlnyEsa9MqNfjBd@2fJ2nJ-!(vAeX3srR zCWTz+u++Qj@{l|lAsuYqQ)MWJr!=XE{n<8Ny-eaJ>92b0;Vc4WLzODJn!j@^Up@BJ z;|oSJj&Fbf_cS@~M%Mtn^e7s~CCjV%a@A|X3N~T>wtVY!YmC}d7NgDVHOKYPz@9X< zX6MW|X^LxY_YVf2-?oslEt#@=wtO99w`^x;V=<**8U}){-gA%`gUYn2`gX(@pX-6FJk^t0oNL) zf;{uOOe}1;h^7ZnCZokka+mE8|Bd3dfi7=5emL{!-!AXc>G7OM{?g$|0|2lOKvKPFfx#>G*C3W%O&t>JY&}H`tT&LC8hZ=!q+E5*h(EA* zd09yURnEr72E_`@qjUGb>@;u9STi{p1QQ#=wsZHVYJX6*Ia6^lKs*p(zB}{I2JScP zOpq4x!@Rk=LQ!$a#+sjrcK_*6fN&rtw8J%N{*h-<@u*{os%&ji5;VScMe$a#=WxHT zhHFf;d~{P?!s#)sLt^D3%&&J7{rb{MSfg-|`vU-|D+rkFpjq>WypG<@EhvK zRMiT$d#%0_hO`@Ot~?vQ^u=N`F_m9dp~|6JqW}KW>RtwfuRJ`^n5W~z&D`gO7Y*G+f*BSJ?4{n zF+!zJ>Q#4M(V=+x%;3Mp0Yk%9%)0LG`o5foN9a>Z>Qu^MZo6CG*+BT7897NCxZ@PK z9#r?bS=Pg8%J;^!QkI;Zmx?MuL$vbt|IGUhrhR88P44Tp-*1%JrRH~V+pHaLO#G+) z>wO(0+~7i>6-z>HBzIUo(U&W~GSdM89Raj5Wx-z5*K*;iC?s5wc#^;VS(wu~IP^cO z1bZR7CceT~Gl_bdUFtWM-5fSlJ$KzGR?2ga3EUP$xd5WZ)>^C>-C^5-gDPjX{)`hug2m zqow#noz#R28tEn~1~rSL%ajnbY~Q_vtFz ztSm1&?UTPn=UJYg))4SsH?Gt+buBX24+IS$DzSLqQnPIn;2tvbEQfQ{eGS@Ua4;%U zW^e-(Kamj;_8CXL#m$*dBCJ4x5=te3=glq^jNN%MHYtgp!{os>0sxBhCvVk1TPrGF zH?6kVR{E!y@KdkX5K#`3KjwIWpyd1J1|I9${nbAD&1Ywv+WPi5>400ryA#z_#Ja=q zroL?R;^luJ>fZ+OS(1PM%wh>@?!dq@)a0p)Vy8bW%S)1~nO20-eKqrSFzLRRt!wYJ z+8Pw)i)|Yx9j#V(;qM(j6OflG2>|;vIll!+9do}>*c#Hu`P!~=xsjd(uZs(HljWgF zf$GvH=`)}|!DKQQ&PVBicnpf*w910aa%%~JEj4l<-t&vhkl7LJ)kPxz&A~aPXHf6? z``fCG4ar)3DWkAM=zB)yBcVyfY?BAJQ!`);Oy!=lJ#Sj^SJh|JdOMr1Wt}c>iC@Bq zE0<7}p$$`y#Qcv+esHuMV#>*NwO)8OKqz5&1&cQ3A#`sZ07x$wQ~SMh@4JswW{Yqz6r=!Z>q_Ho{{xz|@RZ+L#G zcU%O1`FW<#ZEYr?<#T-%MYbrBX(y*Gj5v#ydripFzNTgmc<|cwu%zvLUA(4BJi9gE zqJs*m-$VhRY|q01&d%LG-!HN}cOklsNa|p^BjUHflPCD<17iR4cj>8uU34?t)+=XA zd!6R0W8;;%wi%9uaTGy$2j3MLs7EwY4H6Ox0uAHYaQbslC|9QP^UtO^NbdbSU`_{f z)3n#_<+PjL2U~gMVBTY&aY%?mh5g^w@aP@PX)?a83IqRMk=hp@palcQU+sCrQT1pI oe&E#J$q-0@1pgNX@ZJ52k#}6ZwbR~!jRd%T(?F*}`;RC825=%T&Hw-a diff --git a/openair3/NAS/TEST/MSC/InitialAttach.png b/openair3/NAS/TEST/MSC/InitialAttach.png deleted file mode 100644 index 35723a48fe2593974950dcfaee36faffed9518ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32243 zcmb@ucRXAD`#*j<-JR|Zv=m)xHB_rM>7=D7HHx5CHTGUXbf~)&r9`c|OJi5;y;`+b z1tmz(6b)i0Au)chxbOG){Jx*Z_xJmZ^GACm=e*AAyvFmouIKf<^6I{p+M)ft`ymKA zbob6JT?pdXgrJ?nzwHE{_)FD^LeOdG?yc*3K1s7gQ?E3+GU$GlVYi5Kdf&TfDgE$Q ztT7Y+(9Pd(oZzDeX4)Kc_1G<^#c#c)qS<>0v;aYJVdx00?K9}aU5eoLnbz(9@rlIG zz&f?ac{qO@FO;A5%amjShmy4Eb?X%F+faD~I#LUg8nR zHG!bAK&bpQX!tM|U9R9vhg_Vnt(%k3&ib{F&T~E7^P4XG-0M4_peu=+>Se4zICyVy zEEhwa^e5Z*v%f6pa%tGoZI7* z6p9BefaAY>f*9Bcge&ZU#WJapH27q3#H1uW0YH1$ax#;p0|!gx$QAt9Y| z#3Jxb_**LD1O8&ir($feVa-HRy}MWo3|Y3@_i-1D8<&EYpq&luyMQXG?sElQ7%Pm~ z+~FfnsHDO~v-3U`V1C5BkUdC$*T4DO!%)PuGSNQpRP3i2lueZrA;hU{k`KcBG2977^kGnP0%Hma`p^EX2uV9YPEk(dlq-r7NsqyWY@V|SC-;^coIp` z;h~&oU}}druEGyL_n6feydARQVl!OKaVpRP^rc=^eGAHeRCjWOQoXb`sxIogse|pz zOfnH0ayPfY)*k<4w$UwfIL?9BrqA?6VkI2ce03iLjes|J)YBXKByGB<$A7KU7j~z2 zj_(GA@3>h-#9CX0t4)~q?_eGD7JY|9k{QM6XyhSAi3Ojx(q}g+;moX5UQ<7{R|Y1y zvt=)CcF=93Sku+c5zay@+utaY2UQBg!3^Z0^);Bq}l%)HcfnRj>4%;FqpoXuyjIpyFpTVQao z4;MHjG`S!jl{()s5wid=;QZ=aE=ZLX4oLVx);u~eFc6J~UpWaTRm6bxY^IPT2)19= z$`*?;9~sFxzX`cqC2fos=F&K!19J>iv)D;SU24WK&qzzt-4uz^R;QDej|MUK2~oy_ zyC0jIoA*iw`1_wq{tbc_l-M)#r*lMy70zXpf`jQ(nv;@6x~!~Lq#fTLqO}PvVGd4x zPH#X@eE96{9~h|ByRx?C>v0zJyU1up5ZV;Zy&5OBxvV{<-BmiDw5`RU2 zJ8hU@EWObeZ7Wn0veLl8hdmdrVsVM_kmAvQr=ez&wZDyd-y#?cUVSbaTD53jQqg{Z z3mC9%c9vGtu-$-PS72<>myhj*rN{@lyH9}CD+{2(hac8HHe%+`g);ubc|_cQNIA)) zBvpTgX9sA=NOWUYJtqfugbA}V&oxCNcoc8wg_~PjB2=P9v6$6Zp-nCZxbROc0HlE; z0pX4cRn-E*L~*9Vh?7N>GE2Xv=f?WDM337#ftQ)R@}+^xOToG|8E?qSW^bQs$y+iF zo}x+Dr+?tW!Z-!<>f292c}-Pt#CN!wFa%Za-x6YDhCA5!L0dYkz2Fb6YyV@=2Caa0 z0Qd(DxYdmgr#$xN)c3kKoa=b0EX$b^HgY2Srp)A<2;OG>Ay*$2!hKj&(Uiwx8>0Fr zxNi)}MvpTLRzO1f0Lb~5=&xCZf7i-sLy3*3}HL=&R%^nQh`eMz0BGJHAfr7S( zakJs&eb3djd7P(SI2MxakjusHY)ljd(_nVHR6S8;e$>n9L1mKO7MKRPwmSBx`KC<<*pgp7DB>f( z@cdaK%Q^J?Kj0E=#n;%c@3!6tr`eo<`}X9IT+5g!uP6JCYW~Fi4NKPqi#DIWo}YKV zqAy=Ihegug(a;)pZQ(_;Q#E1}lREPA9>R~u?o=&j4a`iLTnHE66Ryd&8O(Py&h>?< z?v$-f*8H!FW4Dz*-q}yH;RN#Bqf9^6?G7{23BKz;CjaKycr!#cJ2b1u?tFiov8aaeq3DL75A9E zx4<9^GB(C4&8(%Ipt1P%4NfS|@;e-XDcKyytH9xPb#)qWTJsKYGao=Omm_nm&z@{F z$ZM*GL*=}{LK}T&hUBnTSKp;mW@cu7-4gLzI@qa01ZHi@`n{Ll&}HXpj+f`Z^*naf zkZFjJq2A5AdTG)!lO9#Nd!M&Mh0IF?jFD1kLg#C&x34|w8`*vkjEsudb3Y8f?;;j9PN(3gw2{Ws$i(7+zQ-y-lqP*gbz)6Sqt&1a{9UgyH;9@6XgxPUzY6>&?nEqT}&AxA)8-l==DIKJr+?;D(5U;ERvfY7vWEDyGMSZ z9U|BueWSfx-F0Z0B7p4sbK*qpkcfJX-j^l2B+d*jN=Jcuq4P(kry}P1M5b`9V@rmQaC*+7j1DJEtyuUgSvvq z6!|5(9PAv`hbm3q?9fqKw;o9IrL#j_V_C9ds(VJXro zhrQ>W-bRQIrx#nJ~2fCYr?N*PMNy6=1KiM!@ye|JF&@BYBP#lKi1?KApts8 zzLV{;fjXnkp_q+-J4J(`Wh zHHF(ZJjP{~@W}D08GVH|%@}gE&pzcTIncd);2ziWm54g}-+VZ1NRj*KIC%u-WgNA)^(BnfPePH84C}K*rmsI9 zPP-k&Co3?qaOK^8w8lvEfT2yC-w`;Uupd(wKnN7Xfkg)y^60Oq@A+2JUnb&Ejy;-P zph6;{N^zKX6l}m%gS;|EpoSC5 z`kY!;>CaxDgRIw;Vf8caslee)1XH4@P@3Co%80c46Ptk4cv^^mEQZ!SlejRbuWsxo zI7}p&=Hi#GKh;qS?9=>nj+BFk5Sm?DA~}- ze--1TMpJA)+5ebnf2UsGfL5!vGqwdK*(g9-emJXK`LUUPRbAQ5Y9L4JYqr(HyBAo- z?|IgZn}VD z7N_;1T3B$4bjlN7Mw6Tc*&)lrwf&9GN`S$iQd)9@vm%x7tlyIv7*dg1pi~1)UhUYj z30-|TtE?kJnIAcEy>j4_-`<&4>lD=x36`JpTJjt0+*aGYEe~qFL}l9WNY&aHx(3~;&3=*f{Kbtgch(>J_2mG%w%l{1lrCj zzsqu!>=+oD zNi_EQ3`$=iTQ<=?E8v)+Nw#V1K@IHm)1ii!?s*zhXO#>Zx*JtU<^3AGyU}p5W?~zEZz=$s3|H!@E zgNB^S9$}v7O@@_ToQn-V79Yqf7pj)QU$(!}`I3_G62d4?FmG+F?n}iJ>FE~luf8QY zLMTj{E{ft=dBV4@$bZW|uyR%LOyzwI^7M(@UM$O>x|vMP2&-;GB#VqVwPYN4)nFC8 zT?don4^3b@)Z2ac+Oy2~<8z5v?5chWs;W0RsENe-*hA;LjpBEw-f5mh%x{?HVT|Zp zvbT^yVJ2e8;=b~RX|z>#&MA}Kqx1gye$^Y*9~(}+e^Vb;-uDP>)1v^`s%I0pvK+8T zDK}n=T;DmWWnx=z^Yb(A^xo6Wwlp3izq7)Q7a7S>#6M9r&oNqUxCw5v0fvX^h? zw`leY9_2#~Qv6Gn&j2Xi4(Tm*vP3>TR&DnfG01bPHRqoW2t!bN-O?I$)2;hs^f#R3 z5jk4S1Ac)^_T6qatgz}I)7)1ORXe-uPc>=1KnE|=zDuftg{%yaX~YRG-eU17dlBp? zM~}}1LT;s+<-fd?wE|xHD704<3w`>mAMx<`hx4W-=c<%%9&AUCz%a`zPu8>=2Qe1)`5T;DcUPJXF?3fnJkdI-; z+RP`b)9H*n&()_2N>5eiqo=s}t^AuCmLlW<${zfq^w7f8j7C77aA(B=?BE_#gkBJ4ud7*>QGODy;A_*VO=58G-$fSLzCgB3xdxHdHhp ztgc$*B?m_q2~Zn2%5Lm|AB?4n+r15c%YQ@7oM4KVS^k4t@zb5>)(se@-F%JBN0hzb zZRHjRR537rO=%st^jdy3p?uTTstF9rGtMiEhiNi&%4cKO@7n~F+%>&K@!0k6-+NN? z$1#mRP=go3i?SIG=CBta!gsz*q_y*eu!VJW4>EOy0l zQ)_IGJ$#Lzh&#%_%{={?O|{c<18R#MSA4qrH=N<-M9PU?!#T^O;?C#O@cOV-wpE3o zRdl2u0TW-R{XSqlb5WnS`*wYaBR=xBx&6JvIti{6!4J7Zc zg~;w5MXu^K-Yfk9n1*w`g#$l=jdc|iErwueK9eUAG0Gm;r-lx#JGS{T0D)Y?VSeE? zv$Ddn;UkwbYoBI>tA*RwkyDb-@;hezrzW-J>q$IH6pN>0!eF_?`2=mXQ^Ba9-Un=^ zt~}`}S8L{8h5hTotBotRix0x+Su5--<51>aw@Kd4ERD zAxNzN@J>+u4t%3>VP`2%-(&>-KH+wK^Y?k<{mJ2u>2)u6BW(2NQRnZ!s`eI@ubwIx zM70YMi31`x&&ux2I+aqe_5xq!O36W)EoAgvs2-Z23UdX8Hcm7K9oWW}AbzU!Ky3}4r@yyo&B16Pqwp(Q#z8~n8b|Ne(>L4Ha^DMa zy0vguh&@wn)E6~eJ=R_AY&?S-SpBlQaLu~8KVzkH$1=Sbhaq3NbhG?7a9@1lQy0^8 zKq0b8<=zFiy^muPZDs2u#=dO37!dS`KUnEeRDbc<4-m9N5Kk(|DGZDU22v3&U&gY?bo|Imvwh*O zu+0^y*Y;OND01HG9=WsS_>3^eLKE()2m$8`V|6&u=e$PT=O%lr*+CP(lR|CoRxiW( zm2I2-l4kFk57Pz)2Bb9w1qE+j-c5=Dh93$NoMW)0H5qkpcMEQjp36U{U_5XO8H}sT zhk9#L1NhEK&c*WI{{CYyMU*PbYsiR-v?kwLENd}?BcHc<4!+Y?E7h^Yl6Xpz!sc8( zf4-spvPY@qTz(a((}#Ap4tviZ@`RLAh&_5~L-~>cg{y2ZUD<~*$QkvXVc5PPBZ4iS z8(nhJ_uU7$&cJ{GN9}`hJFuWzV`ye*HLb?%lUc86jj6-$2Im{17hxiEF{!uvQ_gUF zI(NsbI!Ej^-?2aNCm!yO{4vUl=NqIAo>}3anvIPQPr{H*=-E?mogC!bu?e05xZGbQ z@kHH|#w*4WM8Ry1S2tizi1nJDC$odSFiKD6&k;B2!V1q*;VXU;C9j;8u&9#P%6z`x zYjbeWd!xF1j(o~A9y_KZ@8*irU(*ZCU)JaO&Pd!VbH}5^+Pp$X zJv^j%e)U#OMzigojRl6KeUT48PCT(LlT?)m&K~{w4p*Gt`viv({}8<}6h+#6AE9qc z*bl$f21r?GEMzWw(K1mqUd8CuG448rrMrxT_vHrKLyehucOf^Auiqo2J6$r)$?!-G zO!j8z-9(H?@%ub{Y8rcU)QrzYk)LKaZBUn#ijrxFd`KC%f&H94HY_=mIcL5`86p?i z%)+kDsJZa`Qu4bJbmt$@1i%pqqk0>{Db1QL16ux?w^7shB94w{c9UP1~_U< z@x=EQHkT>cQJDQ3IX{YDr;>Ck=V$H>&eyuVJRY2OFLjlm<=kC4(CkVby#BU_auYBUcaehW-A&TlMQQGHwGoaa)3M<>lYrvSd zPYZd6OoRPx}?SlgcCtV>~-b zRWX~jD{MVIXlAKwCxqzCsbM*r9~{T39w+7aB5%x%K$OV60T)gP{^S$*f=G3-h0ni}|@Y3LGXiRS#`0|ZcO{12}Sm`Fl zwa{sn;|`h}0cO!5f|YJiPn4c&1a#OZ!2-H}rJAv>`5r}9FDAICOft_@KDq&=-QAU! zx^j4Hvi}V3S+VBv@$V@8zHY5{afvE2NleXQQP!Gn(wo+dy$^M4KlL)V{axgBF%t;~ zoMK!XlORXIs6THeJ7i`yf zQ7n0F`4L?|-V1LwJZ@O2P(+x1b>Si}F)ESK%0w(-k%F1k(X8qs9Th)RcU0J)`7_LY ztfFOaolxV-u~YqxaoUtSwO{51gACKy=5e6`;h8)n=+2W1x95dci&PNr1c> z3TB{Wc>C~_x^3i5y|{adRE@MvWMt+a)djd(fBcWl>>8*3v`R5-TX@JF#-i_{f*T!C zj2_H9Za1Hn&~#Vw6W(J}q@W-kN{VH#+j`FMi6TRBIKK+9miz~80+C(Hi7=S>9eH;n zeogQ3j2gGFjV&KMbkpSWJ?~LZ3+x$Hn}waNztoKcAD!DC;n!1!$#ikgPodTJJ8BjicGwSWQ6zLT!Y;(#a5P{4Xr-Up z_`zmomLQa9?B}dRLyni*?EBMUfmul{OQA6$j%`SkkmtB^42U{DpVN3vxd@bXYTQIs zl2cH|w#$7Y%|<8UPNkWe&7Mf+*R3b}R-0n4&7teuJ*^VGdhjGdQjx~6t?>P_NDry_ z;qIX)$o3ySe{|g;D=}w96#TR~`thjB0NWEE|DgqNo@jIMeKV&oXejg6!HL!q0780T zn9$f;hR*cG)Y%=*BLzpN=`m@QIu!3`l>me#)ygH%0z25w1AL@@!pLld9wkud(H*EP zz?$YGv3g$~BMB+Y%uLj4Y-jA{(C1b`xva6LZJ=h zkX+vhnGx51jQTuHiO1%7UxSR-(7W+BI@S#`AjIP9X8&JOu)+3`tagfrgoFC%ku;z>N<2>+OP`Rezwf8 zAQVr${AyXxj9|PpqQ~kwTSa9FMga?#x+6A84OBu{j z2|Y|1Z!0AXwyRQd{`9C7Q}Y}!v4^S^LBbmf8fGvU0&gFVpE3FQ>3F&9tMpVUHu#wXXINS_jP8ekA~PD=d(-C5j(8*Tl-VjXyYE_*#ye2>%KHTz-T@q7uRbqd?2?@~X;Jb2 z-N3j(AAzqrOc9&XN%Zqx)(o4)V4_HF$EHjot||MVl0+WKg{rrE;2b=wr1R*tVp)&7 zA0=o5rqS@7wnC`iWkN>Jo8IQKk^aQeR%|; zc0#JY)ht7U)y1+M`8|8K;#@zUSvEtYx)^N>Rt^+=;jDicnhjN7V5iqc)_@W8EwO0> zLG1z>U4Fryt&j<3d!A@?Twt~|1PPOyfO{@q=VA&5tG=HdFy%FE{hjNF29_2Vr8Iki z58d+$>^Kw~fP%!C>+4DB6yW*)x&fvJSc|pV5yyQYz2%0bGng7?lm2uLp7mDEmCc@fwn?ekn<@iyRaf4Y3EXGQ z_w0if=wB+`88Ooy&AORtjYZPF)m3w&mqXXoVr61e9sjlOl`bc3)d<;MTGv5>UGMo? z+`lrLVWoEDE~lH#80hAuB%`fsO$KlOjl|!Wy4g2|Bd8abEQTl%O zY`-y1diopO77zIGVYogvSe1)GJP&Su1Oth2!OiuxQ%v_+*+O)kn}`zV>QyP6RA3F{%O&3sXT}r<;3o%cV)biC2)QG*`^-M zFG8DXTrVacBNG=`s9xOuOx&Rf1GX#Y2^uLIrqTh!J~MzzD;jgW)&4c4v9tMkZSZUZ zM~~qLQnY7a>cp5hs=rD+Jk{nCU0zFJqI%-DixRs>PYCZn5s`|&OcXcCkOAw-~6dF65Y$AtXXGt#4L(uKbncoIzA_Dqghq87+T1}tM{WC@PRHNw2 z_JU7}WCgmI;!3;ZpoQI=n;bzJQZs@Q?Z!Zo1Bmg_(NSy)lMJL4P2p%j9R0@L$!z6~ zp%swj{FM!~-)QIu3Y&YqD>Ry?$JvF0Y&i}A78yQ%kl?Ff(@d9(T@iCF3^>%9A2^~w zA8Pn9*eipDX}9u#@rd}a!a3qpHas;oC9Me_s3yFV<=5f0Z>stpy0c_VbYbvl?5iok zV8_%Jf=u|y@5>dV^TwE8h&__rMumYR$m6uLA^b)qVrq9X17*r$AQ_8<~3ENX=e^> z7JE~hz$K9IW8lp2L+`w*dyX}vy8W&SBbC+DI#z=Kvj$F0jqJq(mBe?s2FBLWtOTD~k z3qSuBrm8sw#tGWXrh=F@hAjE>Y~uORq1o**?mN9lw?j`xNc$-EXRzkK*`@0%hb1SJ3{K( z&Sk^Wnv|x@>oQtHI$5L5WDgA)trWF&hsm1&|AHG%;whHuyPhivPjM6MOWvE&@pi}} zx;|(K$^oL6`UvisO-@3kFKSTzXJ%ZZTzJhW?_+{3Jnh@!c#wWgNaKWuu5Ymo>BIzr zAU^EbZWex1oEEEDQado@uRbvC@A|m=@ld*ljlqyoZU7f(^;$3>6_xrCBO{kT%M;6# zht55%;2n;uud%=c7`JxL^}Dhx3K$OSE1#8ml}3)v#U_Uegy$6C=+`?V8&311`qg^Q zC?g0mun#Y**|OR{ZveehhTqU-NvwR|P3|Vjuy^!6KsHU#%rTQ(Q9-9WqP}{{3JH>RQbVcI zR2^Bp_iH5_3klrwdw_Mxu>FLFy!y)h*Yfm-FrHQlmJ$1D&%~>3*`5o%Jxw`&p<#E9 z*XtqMxXF~iGNq=~EySEh<%TRGxL@flc>P&%V|A6P4vl6@#`yC~4wXWPUl)en&FQz* z9T!WukfN33e9|;vC=iw8*M-GU%m~w7NCY)NUpLwCCnx#inx4Q%6ft`$=lwl8lF7f1 zAT$2lAyEgn^N9r$4nYXamhBhMEa~flxa2AKjt{02_E((DG$9vdc6MbuhMuzB0N7Z5 z9LQ#|Sv#-&b)khK?i~1#Ey0x*WbO)jo7KmFZ!3RN;(-*$<#wuL(=?iA%aDwaAN%}!PMZc~Hnq1E%#)-?P zCT3>r6Vf9iBh!wtxvb`Aa0o%n6us2rkkH(l87<)GTSAaU7O?s+S07Rr{lx0F5R4Sm z?tJru2vk6Tpaa$k^oDKayG|z=!Fe17Bh#|y$k&Upx}r*hbyLY;RbJr$fV&fHp~gW0?67Yky;|zxQddz$n%lbN z&u@dpy|*8y9uzkbL(#&|Rs~48iRx`!XfBw_al83N8r}7IKN#vDFqeo%#B~9)uacU# z%|~?areT}-4Yv3mm`)6yT@9Sd!IP;|XWK%3|ygLR`;2V_g!6qL_is(Lp*#O1Sh@{-rtb@3!gA)t7M zv{b=zecO`P87(0s=*Srti#E$c-yW4teEg6Qty1nN-mKQn(a%G0Hi~>w@L6ZdzW)vw z>@og$^45{K6ik66{nH#(Q|7s5o?%!U5p z*9mZy>D7*5lcNXh8T>V6Q@uxQTdvkkctgPSH)I;D$#FDL;;GjsJnyemd)2IDKIAg_nBJ0K=~C zTaeXuIO1X)=8k7^S8)p7gV#x19f~%sRjNFBKR(x(lS}iGc1BX!YbVz;t4(sWBn=o? zMV{06@*!5}#R&1lZp(RXfkv2oKu_;VA{SnUYLRwO<0O@Sf)xSIvJT#jXK0%s0H+*jW2FbnCg1^yy~12QB7m-IiN zXZb~T00_C{v&?&XXEDu9`F&TNvt|bcGNR3dwAw|0GKplu%s$l$3$Q6$Y2DU#`%Yr$ zX;I4W78Gi0Ytxa;)m1r#BV%{AGXrCfdZmfzE{$Zt?%`ge9FR^9AICT(HXWQ$?zkqU-zF2poZ|h%v^~L)Jt7Ca>$1t z=rnY7)6QsNivGT236oSb8Uv&PE!+Ld&kanp=;QxmPLALE zI+J~ou%h>74>3E`w{jp829vj)Z|+Eo;NIiL2L%~gvB@%sL!-TrqAQPewsy>FiOlYJ zSwv3r{~|q|Gi*ED0dFhKLi0Jw)R;63iU&BtEs+j#X zhpi|elvWAtIMM}FR$0;nH{mx$elt&Wko`87Gxn2LJeH8Knw^i7499lV8r#_@(3Q&k zoJvm!6TPV+y9&cKYC`t>@;KguaghuEf7h~Tm(HONNQ})A?hW6HLky+&k%tV`)9`D? zBSOmgI*B|L7Q5=-{sk*Ai*Yyd${IeBcP86pvTpQ1ih#(~oZ_q)KR%Svy~1K=nLy^F z_sBr)3m@U7))}d4WIML3e3^XdPO}+J$KwvCVQFWRnT)#mbL_Ide0F%*ij2_y`r+-@ zC=WoR=cQi74oJrtF%qj0*(`VlV*zPSyh6;uolh1BF=^17%jZVeJxKXQOtz@O;f1+) z({7`bC4!oJ$0sN{-bb9OIulaN_rPEwjKlR@+a@TE{!azET%;eduFw!gzIjkoC^B13 zO@B4KhZ~EGto%?oVI?@Sm-uVvST2y#KtVH1+Du&K7MFAvZq)24HHQ__n_^z!Rngmg zytHMqNG+NgcOP}RXJw1dpGJS+w8n;J^+eslM*a7N18ac;svGwKCPP88+l(=y2cR0x zye^{a+0-k{EA4@k+kD%bJdO9nXyBuIV|9vi7gU<>3U|qpu$j{Kk;nENRMYuevfk7m z@Uvl+aOK_P13++dO}>ptWjnFbKUWq%xzI}eFQ)bVS!hV%;-Q)-nDfoc+oroA+xvaV18~LkZ09H zmnVQCbF~hRc*{R3^<4iZL5OIr}Lt3md>aUPSf(klVu*uSsy3lhw~|( zEt{&IP6bI8AuX$QObblZMsjuGPpWGZa46+Y{*!FmmI_<{EfsF(x|Y^LsAaZQA(K?x zm%{!}vTdLFp5@-gDivhntc_r8%wzY&jAV8Z8z~N$(V1IZ-O(letWS(- zr3G<~=QUW5$r+piC%d*tfh75NaMd@YSFhR#u>X{9107AARc6VV)O0$bZ_EcMM^wU( zP>*&=;BFY$wu)$_Y@FuHwC z`_e}drR>5}o&KXIs3Oh^p#ybnrp)KTcQ*HkN6g~0Cy4mp!rkkq=5GZ|7*8L_>o-&Q z)ZJ~ZKR{VhCw>^Zo#D(})9iE4=r^r%${sH1MSTM+ej41O2<#Zf>4u&aeNqUmwIZ^^**(T@eI-ZWMY+#Hp1M z_C9?y_f08sUm_N0N}&3)Tb?gwbd`4gr7>YUI1=sK_7yx7h=SOBBqQh3jl=B4E?o#} zV;WN6Xi!5_msZ672x0;-Uhf8Y(zgNL7aAjizu8pSKSAd0fjU#MfK#8OXoHtOc9PY` zftw_q6CsC{Qf>ZlycBOZdZ)-yeNv(@?TOOM5R`RnjZ9%=LqOT7HTp^_$$a`3Xx4=n z6xVqgtd7f1CLpuE#bb=bJMk?vIau(RNJF^mwAwkM_z-r2`$oGNRTLzFma|g6-MqE- zk>Z&&kz1=%w!-fIO?J&*=YF`7n%+efg=E3hrI`bd2QyG&%pY_n|FaN0X3Z6=DdbQ? zNUiB!`XQp_6%HP~&~{H66eFO1#N&k?C~#Y~O2l4K%ju4pXHkYQSpVrG>f~&}0uS8U zpZacHZCV&@*;2K)TmVA^Ml4Tl-+x`OBsMob5A4s*7U?^`=VF=t1&0;{gc z<>@9BwmidCqSDVr;Z ziHBcHZwzW?&5#Xvbj|4bOa}^NQ~!QN^nao6DUv`qy;l328_2EMq!_{SYZ# zb;O~YJ#J-b9{duIQ@2;C`|6f3!mxBF?Qi?JI5^KS=+qAj)!i-G`zWSL7zx18nXty3;+s5}PaZ5D|1i=elBaG)WZd2^6Och`*wrfGyX%%pc z>HRz9$33#Ehu%iUn-S#)-R59n0}rhd+nOrrGrpukY?bCF% z^KXAMS^%1v0$KZfhs}uZ6-^$Xwj-kqu_j8)(JqxVA=$T6Gcr5L$PHe5U6Q5|L`L2u`>n$^oflPQk2bd@$)+3N-ASaVBgka)XY=fQ}hdZEavah6`n|w8H}k zOX((JQy%KI9yvJ8(yH5Oc~cHQ+s(!U&K=@3M&eBV>Jhpfh&%yhH$4i}wQ{f2s7U>O zPsdjn@8ao;l4dussgC41E121`VeOX&OOH`pFuuSM-cHNGo;wZR!}%6P@R5=6mn#i1 z);rX6VOqLEkXgqQoKw^j$*X$W?=&szM#E!P;1K zQwfZCw{cj6@9;vDbKEfdRX|BeMZrU+unvJu|;b?OseBPP5iN)X%A^% z`Vlg-MCUXdi#_~eT?^UEVNgl{n{zD7!|8Zk} z9BaeOcL;ylQBb|i@NCGTLRb9hScjQTZnetk44t1%X?;gsVjViD{5IOZ0*6pWDA&is z(oV1P8k!D*HT&le_RNkYZ42_)mG%WOphou zF`(AA`42yG)kQO3J&oYx$emWcD3S5Dtv6EfRt?bhu`58EKEyKH(v3&$9aXS7-nDW? zwpSdBK*m*~t^~)Xp6&pI-VSiH zoLxdJenMAWKtD3V>4n4VQV~s5-=SFBKLx*f0Rs_?MbU1!m$9*#)h+}KgysyEI0D^J#a z4^-gEh5m!^_z#-Xe`d;dxf~@PFgl3XK?d62)L`s#QVq?B} zvpC0g^J{DWDlQ2Eewyv?UAZY?rIF1#`iw>3>Wa>*Uj0G8u`uE}h&0}i^ehvbD%NZk zDXf60O3=9Y*Blbly4W=;PtOR5ubV-`%`3SMcLhgEW65a~&!@v?%W~C<2gfp(OYF9Ddl4P3&u1>T zbG@wkQn|oir$7R7KJg^=yw-m=dXL_Tuiqs~HF+ytoPT!(Jgnnyu`)=Aod=Nt`}kks zFoKR%j?Twszz*T*A3RV(Zhe0WrL<{_!+IkOZvWqTVlIK=@Q@#iPZu2$cYG6miW-g4oZ7ogF6m$Miqx^bB6zeyKsW4=-qCgs7QJhU;|2))bnS&GyUY>6*uqQj|jRSK;P(g8gZ`-V?Sh z_8B_uQQdRV?;|ohk2z`X*!JLo`MdaO@lY0`dhu|wsrc3Ebyr9b@-LZ z2uIQSV~WK2l{ZZhvRS0ZeMk5_{U@ogSHW?&)aI#c9$!yh9u8=yrZ%;}U<{PeVuXM6 zu9j_0{3Epn`_B!BME6H#UsSs?Dyyp4mKc#*ywuJ2DuSLE@$7IIga7FP5CE`kp-1;` zq>_;ewS}iwCwP)nlRKyC&+}Dj#TiZ??w3#qAYj*~_Mp{4HHFjXodz_a&4we`l%0fm z>wcc~ebg98a;85pa!2!De33(;Msc_Mjb2z;9^PN?&L>7}*ACoN(V$_u)c*Hc^3ErT zKW;1lA74JsI2~m((}#5}VQ?9pGL%VaWDmND8#6V7A}jvUai~G{q=7+Ic8KP`lf$IA z-u)dU+Bt`MuX)xP1L)64Z*ykCr#2MG_V3EnUuw&({%vNfzR_p_ z1oslRxPq>@D(~uBQ{HE|Ev4hJln{fG?qO^HSzQ=3U{NAjE-?cz6e#yNf|f;NH_*0l~^L5$zZz=8WNKwKXOa{H_d{O#XE%=-hT6#~er4 za=Ez)(WFRf>|To^X*Xr9K2N%9%sAlF)1v0MsL|o49Fde7feZ=Mqk+khj6NFGSzngu zrg2z9Lj`N~(9S?%i5P$_H1v_t)8HK#(cRK-Xa{&X zPOajMJ?1Ta%G)`+F?|q+0n_+%4y|9Rx4$IhSGzFpz_~kWNtq0Xq?HqNN{cTuOKORJ zz9Dqsrk{@f{*~A(&fvTySGI8Ysp2^%N!tirN8#^T#1l!^;{uT zef6)t>p#3@X0r3}bL(9gx_WzXKuy_K+`j)BvdlP)zHn-kcvz0zbRs(fsPD z7Wrd{kmE7^ah@<5C88`v?cA(ofhLd_XB7ZXeC*!30PtqxPHo$1(m;X62(&do;qe)z(Lo)cgkWoV;Px0iaR&^8E9#N%p|{vzrNx{wgWq zh7Yd##4WGB?B%FGvb|!HzCZi`e(Y*tRX@VvI7g0WcT?|&uN99p&OP-?{G)KeZ$_{0 zz0%9F^J|P4OH}v_ZA@;0JRQtaf$q(mjdN_8!+6Rc?*EOCpXBxtN_w}4Z3?@PZZaNe zr7AhMPQ0pi&`^3BH;!bct&Gyk3-^ZCObVo^&LekJp1NHs#INOovm1!2d3KX;CMUrT zg{xS5Z93kt2cev3lUT5}IdR~Oy%Hn#sI*t@1#eMKhwqc8WgQ?N&h1qpVX>hgbLeJC zK}|$k&BGrT3T^(M*1j{W$!*;>7IdMMW>gqO?> ztNrBeKr9D>0hg3kyR(qSRZVf>eOX)}*PR_Vh!syW`3BQYF@85R8`d@m6@5AFk$EsA z7VxtG@e{DeY-YAkE2;Qs;@8^ckx%4fTM`fh51uj=^VU%@wr+F91};ilT13QpV9dAK zBa_KjFiME~r(u41)>Bj~k@>4J17~(YG$TMCAL4eM&2|Xd8c;i^1hWd#u!5h$rVa~` zw~D(R2S|lQsKXSaqmc?K#YFRALSxh)YQE|Q0_Vl9XCf>IW9rn!<=2DK z9XX=c)skj^BNWu5j=@GMU z&9r@gKm|8xOt5m^!7iHhwl%tv3nq{qX4Yd2M8e~iu9M8`sujSEaTrx+ z70Yi!U2Ip3sn;v~e|-HrDy#>TVPnY$?5ZKjjkj3I?e;S4xBxRn)c3vm85X`i9#JZo z_op4p@vqcg*tlkWn@mz8IKABfmD3;bARzpbl-f7={zIbTlCKWAg-l!s{=^d2JC2Fn z7oZ`&?aYi89$GaYJ4kg@@QYmv) z3|hbUN+AgPE+MD6u;y@Ve6eJp>@nEJLsJ?n>cm~~iKaR>NFWHfp)WErBzkn=QrJoy zclVjjguwXto;Pz;r1?XE`|vm3GOh9MkLf)m^vP_GeOvN`sIL46h!J12{PDIcgcmFq z;P?Xh)fV8tiEIZYz%dUlhf&L*+do@Qpi64$ZXb zR%e<7YkI@TPUy|tZ0L)cq&)!p?yzq@8ETbCl9uH=nwUm>7`}tzdh>8S*W=4hA~gdi zd~qyJ(gVwWaQ=dG9E7&mDaoo6O-8wDW_h;3UyWS4D){wO^H>&dn^KIdNxgEc!Yuab zfW_P|x8(LpM8M8Dgo$GZt@GqKt8v&@{EKZ<+n^e%I51pMg!QZS9M@{3{oeuwj}{PD1Zkd zX#Y24YlugK>bWRmWAgtoDLF7OP$Q!Y*hCQyzbR%(PlKG8FT7|i+OIRvDH{|Z498&pL|G#Hb#;)%jGlXSP16tdk6f5qUYaN^GV(W|CJp|n zQyNI_(662&d}04s(I8P}!|&ruzM2`)%?R4HAM7H1=a{2k*C(?SBgIbHb)%MF-F$yF zTxR&_m&MTg&zwNuw8gPqb{6>1yW;O#E{I-q$K%ZygT0@Ux=-i*gt*wFZ35E4@53&+h(@#+*l>vn0wij4F?Xb4DfmW3{4F3$z zQtr=QNYd7GT9~&Btd^^O&P;a}630Qq}GpQlX_{=&b>J-w>_?uiO-4WfH6V+k=Q9aHePOVC+nRg;em*KEgvsTUFJC(G{ zQC%H7d)Oml_gGF}EHCVL*{O62mN+>-FA$V8=Y+z|+@dc$n?0_Qvuld~&-KSzgip1! z?ql~BEw2fK0WBT^!9n>=NrI}97Xfv5NSasqmNU`$wghTQUFn5xYEwmTj&P)9K~U`W z`zoZoZXuYxqT{hgzd3fs;J2++VCYuw!5{tw-ol4kPkWR`B02E7+oA2y{e9V=8mQM2 zZmF10=&gV92}OLjEJz79lZZPPC`K>c13@)|p|ZQ8D3@xRi(3b%ji<$%5Z?pZ^Yb*% zu<51(g&dB>f139FfBSVpEC5v+lQY@m7@F^%H)tJLF&(22@Mq;V`!eYKl$LRnZN4XN>%oIf)!ODe)%t`LEoXmmWpMFYPH<1hGEiWGDhky++)7n|GMV9k*Rlb#bR~)G)Kd ztiRQ%op8WkWxxV(ffo$`iKZ}o=C}Fz@b?GLrISrqSTAbH<;n~A34b-?UbKq4rhFBn zWXm_zyAvTxBIJ?hi`*Moj#Svf$id`^v;W0BiuNallG1U>bPSzPmFL%*oeiY`C;P;vaCSf+>es+t-(9$Yu*<{Ny5xo)m!E zesSjl_95FZ5}Ht`8?v)5&P^S!W)*n6SJK6(?)dvI7i{}UplM292Zi^58tBK31_G*Y z9eFi*cWlQyKaGxa)0BkF4&vE}Asy0U@7Zkpg4UBjjUWxht1k?hzUsuyq>ozT@#7W6zXG^BoWTl#tL;>J<37w1)lyW@h#x&5_|iR2MpKLYhKO?9%t84=&Jlp zmdBPPORpFihLN2NrB-HLGWqaVf( zCyG>k%$-OM*Z`Bj&IQIfFNTtxIa<*sF1SJ*I+OS2 zM2zHF6Wn_^F3npI*No|dsnZ)(AZ|DRzRNVWmm@t%vqLybORUTmZQ^rQGFn4SyjDC; zt4-K=Pv`0Zi;jTo)^Shiuo_}dYh2Y{c!D!-7vsfU!V&6KY}wh_Z8G+f$dyC|YfRyn zr&&N^$;IKlrQWPo)k4Wk`NL+vFGabO%1?f_`^DM?E|n%dXvi(RCIt>;_^dV=V3Re z10if;0hnF8`P@&^5g}Kdi&8I%@uwu{+n@3TDKXRu&kmT+{tlR_OPqjd+XS8|-mwQ#aH_eNhe@La#U8ahz1n?o8+ZJUT3oi~L*B`+nc zjl8XH@9Lq2U|U11$g`a31&Z}j3o_Nwe{x)VqUnrOGZB@A+?>%p zU4HQz-;qTiPYcilZ6t=l-u_q)gfj|6<~-5Gxp=Ztwqt6^*6d};D{8GJUx!=#P)88= zi{;vs;WRSwCWSH6AKLt8(5e2y6Hm0dIJ?-k-zEB(v&1(~8R;)rxQplY&zpM>h5qbPRKUydFs*9Q0!;XL1O0fm7u6`9yR<&{@Wbn8yKby zm|rBli{(Ex2e00Lx)7?HJD#=X!Ijl2H@tK7K!q^w_-l?k2XJSa6)fQ{C=A}+r3D59 zY2o1hbc+7>=5!~2bnm+=n6R7KwI5}d z)2hHc}}DMyJ>znSi}%sO{s5Hn{Rml!?{O7Q&*{hFdpGk-BPz}{qMjB zf$-T^8>O8%4zYa1nFlZv|A8#Qj(q>E|1f-NM??&5EUcS^BTEgLc})(NesOW&v7d84 z*=d&2`c22U!8AGmN344CV&&+d@+H*ji)88-Gk?$MfaXw@S@KtG4@Sl}`$k8t@&@aVIM~v_fTvG0r!9P{H%ZyI=FDQKYcvhnuI)j%>?WYIlq4y`EdpoKpKW z>0W1SV7x`%vp~ur>^qIU`AtHzftPI}x;*@CPoQN}3dB_eCqt3W308>gnfu{9=eH#x ze4xGsbIPF85oOf*~;H=Jj-P5;_?^|mg#_37Q+q4117cRa}H|fz}BGG z?rc~42n4*khb*jVK0jxzQIFL2`$(7{&k%6M-+2)r^ylV%@;DM(p7%89J8vMGP-rsen2_1k!{rUgWq_aEy1rD^_94}tX!%F<*$eFeS8 z!DcoVTKlxnu6GCD1h7TVMN-1Ss+9I!6@GW>p8g$V3PXK*KT5HZz0minkIw|UBQf3oM zRwl#R+zoyOnF!nF*6sHEOh6{G)LfYMLqPg+f^(R1@ox`kiqf$~lnsY@JgN-U>n)UZ z$gloPm@;x=^o-PaoM9;X`X@9_>by|p7Z?TQt3JEdE{5LZQDWTeiHLmrP{MEIn6(Yr zTFR!9ti&8B)nKv(*&!G}{a+MPO4C(~n`v9GnGce5mXD#Gx)t`Jtkp4!xs*gIuhmOJ zvPREz%QBZ*zbv)Xr=Dh=D>vq6;U!J=(Z85s6na^Yi2@muD=pU;=1PwOmoB8%yluPF zep6=lz1T^8Dc@#LFNS0SFNrmj)d4s12`~6QP*o!NkQ2K7NGn)v{;wl}rW4kAhq1-7 zm^=BmQ1!4sx-_9KSY-z-il`O)uDFw$V^`PhdMyev6V zp=m5^E8}77?U~szm_!PMoef_ZF0cMj{p!^6^+(n^#6JDk(N#OUKHHJbgbdSv@()`ts6^3Ed^*Lf_2PtApFE60h&Zv{*nJ(}(G=<_MPlM1&1t zrAlh#bq&sxc}n;dkvfO7b?ufp;?cP2*V@Y<736td(}rT=njH<>`CaOtVe>r}@32(**yC(+ZZc zo*O-*)<{hRZ=1XR_gL;>rHI;!ChPb~8@^-IQ?nPAXH0?S3!==oa}_XvGrtWotZ;*l z({&g8bl7xhu=LoO_f(1R_A0kOxDX=OX}hF2d#dmbrTjOQ5J{JRwF7k z?Uig1@mB#I%mI+iUF@&<6mknZY(Yn|vMYrk{j+*x1RWa~Y41g`hD#8+;6 zed+foY4h+N7K{$OE9TmXyikrd1S6{uW~-Fp-*OU5Y=xj_%9-Zpt5uForFlMMF}!vx z0&w?7yeBM-q9SSJ&K&jKG1%-2Bf$&$5qMwWvpIaBH)lJMCRJ&z`0?0<{$Iq4Jmz98 z>?TE3gkvkY;`=;HJLYMRjF~SY2?J80rQtEJf#;Ui`|>B40PKmguC3W60mRU5 z4xD<%el90S<#|f#K5D-^Uf=YiwP?frR z5Q#S^)9*#%N2r_Q#ddSCV%dn1_vZ+!rC$<;_n-~?C|2dmIj$|=Rt7Hv$Snd;RxAeq zUPK!Ku+P}Z^x&HNxbbG8w_f22&t*<7x9w<@e$dq{=TAk_RYRao@>;V?x&BglypMIp z9|+XE?u}eY-;4)Q1JZk&ed@zMTZ&f-VD5#HJ%qWnG9wnV{Mikf{c zM)UYmfTl!r^KiJO6^_yiO16n8&zC)I_X?Taw+F0~+Rgld>k&~Y?|ee@`a1L6%;b`g z@Fm8~EANE+$%X^pO}{>_jzfwN46U`QSFEE5{+|R+$7-4>FmyxZJs1^pTf^gC=7f*f z4o*KOVM*d#MSX_f6qxrZe|z6ViACY>>Ti_M*@kSpH;>Lh?8LF%q=f^E6(3I)ap z)B3hHV73(zg-n^TS#B4%cRvv*S z;IcK6?p$l+pB6ELMld}Gwg+=v!atq$iTo7KG?5Zgm&YX37eUcp(PA0PqtG>{E>C_~ zmcAPl*vUc`?SSs$TFg#r&QU5JW$aRW^!l*wM3Hjr)iZj>Can=i`{7)V9m6mIP4YYm z!zaei?den%j@j)lIW^OojNUgTPA+oq(8xoex#-+wNw;1Ld%Ltp5un(_>jhUEE6S|* z=Plh_f9)AVIPjRJ3reD<8095mo-0&3+Iw@TLM+E$;?y#OIEPOX1zVv+aE8|Qb)e)p z4Qkvqb%&+*`7#gB+8ax{I*$zBZPp44#GbyIw?CiM-j<_!YCWhnN3j$|>hHNMqU*6aCjrl7S@npH4@DB5i` z6xk}`^k)kjj?`4fCu(!w>$N70$tY0zZvXY*bdS>!Dn`TO3TYVK(LCpI@$uA&V=A)m zO`av0WIlfS!M6`7T)wp1rWDr_Ie?VvVyU@unM9jq!q*u`M?5Sx_L-&ETc1dZ#9(D; zcBe+YJ7XT@S8`txvY!(>-tEeI?Ywoihge;BJ^FGz>~61JM~vY}Nhkq;q84{Io*}pe z;>%Jl35M6q)h^XL{B`gIbe3SgP1G0Lbll}GvutZKuSA_DU$?a+El-z}|07Hzv97%L$1O zOzn7EWMif1bvI2{93=*Esxk~Yvh(8=U2X~6_S?+Z?SqV=w@mM$%D~cx?Wf=NeaMvC zAf6o8hys#tQbE@_OltO_!J_u5G-&_)#z4VB?H_((j4F9Sn>$j=VCCh2?v&`4jikJ# zs7;A&$GW@nPlV`5}=|V0uvoY;IEP70NVS6aQ+Sr|q;xKRrhepNr3pa=M(_VqF~d z4IhwRT3T655Wa+H;}KD5&hfxOKV57x5lA^Pbv+lUTfT)lUH3q=OqRd#Xs(twmgFHA77V;NU`(HXB zshi&HhU`y!RPe{Y10-j+2Iq622tXgZi@6Oi;i@iq*7E=!mUgsqC|_9puR4G7t68EKjA87= z#tWN{8a>b*e5h=tnszG}@sc?qdWX<7Fl_?;pqnCNH^EU&oCM6RA5fz-TwZU-xR}W$ z?J8?iRA9EM3WBgP8OCM9_lk@*x0E{_Z*LKXfp=mEc~&}%1ANZ;ILEws!uRhA-m83q z_N%A_XT0>e?(fJ2EVxO?O?Ee|5>HGLxCAqB>l}-WziZQhA8@Kdy3=Bd=SVkQyl`CQ z5>jYf6I6mnp##_uTa$BtP%0h=HtttcHwcyK$7;ObYHKiYKFm#?<#+}~RYp*1LLonNE3j(#<%QF*i7Uo2DtNGKdNElvuFqA60# zr$QVTo1);XneNSoJ{@+(Z(u#KVDg#tWf&-iLVN&P8ln%-Z9~C(xpH**@-d>?JK4F8?Oi6^;~R{CZqVffp`H5 zfRvwxJ2o4@aL3^*6C^pH08onsc|YUN|H%zrkNimsUR|B+`B|uQ&}`+DMrrehmInYs zqxNm~1rZA)Qk6x@l5xA@bjQpOUNxmL)J5(7zW==|2-(T$vwVdz@0fKkwdpJqbrv>& zGbQBJJG0)%IoL`DHmY|XyPpk`uB|PC50H=5@v)T#@el2`ZZ`#Lbk6kQ_EQqH>&wk0 zqmES>sL5h?5JMepm8jx-M?h9>5*<+5VLgTI)BX0!T6%Mit)3|4XR9a9;SSJ1FI|rS z&)r&GL*h--_uW|4SF=aC^1m9q`?3O?Hk)cST zjUgi#rC-(^=U8WTK+*-tV-M#;(e8!9EsABBW-(0GSH1zRur)%Leb)HJz>Ns58U2N$ zu9$I@oitjeFdo9!nUfnj=0u#F<4C`eX2l2T0DIE@Qb9^|zRpF;JsjO6>Y@7?@J8h$ zBlgc`@o%|MQwOpqxM;sO+qnEVa5^f2{;%2H588oR3+S=&C4SP90`MRUdA>tY1CtJ3 zuTOI@pMR%v;-6uT`~b5L5hF5By-`-3zS<+-s#~mE2hY1u{qTq=j57XsxLoAAqVY+O zli4#zNXcFZpCkW$r4kZ>2U&vgU@ zzi{IzY#y5&fe>k4K3kn)qNP7|vpfaUQCP5Vt{ZJGC71K;U*n&-Qb7?>m{99?B(~3N zRrn09K{vH%_g4P6=n)lwy|(qll=?M%I1BN%XT!R6NzUfuB90M=;-O2j^22+I=R__Y zTjR(IT-Iq!gE=BET6DDId!EEQ{U9QdzcRY z^*%g0#`T=c^Vm+g3=UI*MVZFK7V$Tr;ar4fI{eoh66SqW-=^7wE=iVX3rb85%h=L@ zxiR55jh zgWF$4u@-H}oC8d4Z($PrE42aY;N1W#HfaDfSjK&tN8adDOzXgI0oVIfc**478I{p6u4jNg|J?ciC5F4@wU$m0pNYDeJyd20LkxY)FyP zd{N|%nG_P@D{P-#{SnW_W(I(#HsVeC_PMI~#uZ0D4XP6yS!3P{9gj5Gqy{3X0NZ&v zHQ(jDNAc#5PF~2U9j6Uu2K}(s+&B1uR+^9M>vtM4LYL0MpB;SF7;#Xpll{Yc(E))q1U6EN1BqwSYDUlte4s^0C{AUDo?Ai<$V zL7l_<^O4#k`b=>ZI0WT!bE>~Gg);5nRsJa@^CoI^Y529Mm7}x^Ys0@8ioZhUb54N8 z;h@k9e_IFD9dc$WKDIJWT!qCwkqrQ+#%6Q@`8DD2F2+yGBIOq)n&P%$cdrtp_r~C7?<#LOqoa4`GMb<&J+Ji@? z{C;KJUEuVxj#G~kVm-3a!QNzhS9|4p93e4O%pyuszQFN&EZT(baPoYD=jwCC4dJp| z3uN6~cQI21)I^VFUd-MTT9{2C@@lZ7m&`}okJCNNCA-~BIksd|m*CT+nNj3)nfZnM zgidNq^VluEH!_bC(HOF={ZZA>(l6RHWDe#*jC=ep&@j<$t%&hlwe8Rdt-I;Qe`#_QSBT%Mu0eXOwytBg)(uAZxwa#}pe9GVq zQ81!P20V+YNGX=^O>8WEuvnQ8r46m8dD{|dJ+0Th5naUK+hWFE;cud>5*-GcTu&RL zqXSrbL+C$G`zc<#A}w<2*YKKrQ6bAk`^ytZ0*o|Lo*OD*xp=xCR^8#P+FM<{GVC)hlw(U{$1wk3U;yIQCp|dY)b-}|b zt?`Y(9JR;?qM62tL7lFX=JaA!{QDMC?LA`I$vHEkNJ3*L zA&ejxtaq=TH{LrG&n&X4G1z6$#Q`-u9C%CaNaPD#6nridKWuimHqACqwE%grR7b!p zTA~5Do^{E*iQzaHc^1s~pxl^iQGcL%Llgn*sqoGEFb};6lk?sJQa-K8vOfano`YbV zn$GmEkgJ{NaBipWiaLM!%X)oIt)N((JdfH)pXN;}cQ2}EBQoIUFB1K5lPsMP*zDDt yx$#C$GXOGN$B|hDIB?$+&vqXj~T*(R=#8`ll462{Q=^o|XYCQ9#!0x|U71GrV#ihzg#=?Vm-1_^{3K(i$R z0@4i~148H}B#=OumALmg=iW0jznOby@`rxLFY8<1T5oyY=Y7_*JGZqt5Aq*`Kp>nt zw{93gAnXhXgzeG(UErJXuW{!fkdqLd8&^$&(icW-19FtAAa{C-oL|3a;WL)WE4}P3 z5|(DzC35ZFV~3?^tHTL#ahKwZ*)92+z3bV)2oMN#rE~NE>k49RL}O=OMH=7z?_NZ6 z@I{>pQQN}UyFi+_wU$;#X>8+Ry!mtGJzHUeof zTm7X3Hb`2^C|O*)ejVp;vCaj7~5+-@Y1b!?}tn$Hq>Zq*VA$S-verk5M*u86_%sz< z*xvnLy1@B!;>rRKLYnk~sqB$OD~nvoNHTa1_~d8*%SF>wtt`Egh?E84*%_swyzpFU zp9k*`6W+|Rw`NXG!$h1&dlTJdLvx9{z&s+4-=VRO{}JVI0)Lq%BT;zMKCjt3?8X~m zN1`Jh{$7s5S6t}gdSO-i(IA7pHRl$RPNKfne4bx7o;8yGq3vF7-uAA8`8v$0G)*|p zVXAW9*H$!JJvTl&dMT*6kfPmWG}%1^Ly^2qFs0Pi!z0~A-Y&=w6mO-H*E z^K3CD*Iiffw#g1KtM4OOSZ+w8Im~v3jIPwdjtA{<_YK^?KK+SjzvkZ~DQTqk! zR7}w^h{v52!p@>+US^iMrBNc&>`#EHl)WZpz4PQ( zQ5SXcBXDn*ULdh?6wy6KvkbwWfq{Wbhaz?uBdWiFpD2Q#2;PPn?sN+;>fsau)O&6 z8|=3+y9Vj)5B<8y_{U}X!`_YxK5)qa1T5Gocm?MlOlP<2G!zcPbVKhm zwy9(B@m#2@kZS%VhL>doD2cM}r$Q?gT^ zrcG*91VkyNwPc&V%~)GoYjp%hgsom;ADHR@J{FH&(%!27MfB$xiXFOn%xbkbm-;e%;~vs4uS@h$-f!ZMrBY$vU29Qq zi@A6LHo&Y|Kk0W{T9a8H421h{=^9t~_3d!vy6$*3YC3#dP1&uaXs!Vk)fkLTd`Q?g z9Z)8}1UuF6!FeoH;oOi)~4_JRF)1e#ZEtEX?6zlNtTAuJW3xeIq+!We>$4FOl zMcjHzd=a?Ym5gpp$d(aJ7DJj{4N0#sCr^9TJ=LPjXU)bc{NSp)F|-18or&q@Ff>=1 zId8rAno)t81-lCA-Sm{TN&du_E5)d--XKpLtpCb3?!q*XZFC@5$GaQS%*dYpm^ps@ zpdz^T+69c8`SB9_?_UVET{^U2?_3w1{g{x1e&-xrBtnWAK2dmG;ph3?@*PFJ-fLmy z@2pN&*@&UtGgpSeWUib+MnDcbo`~`m#7XDuBP#Wa7ZQ~;PU~|CUl#e4#@6#u_xxSd zycb$q7dtDNzsJt_s)tTp>B4JZJB=QTgtH-W~_;4W@YaTF@WXH3hY##EorQ)lcX>E3%-UU_N z-n^p$F2=R#zk*d8D_GT+^urB5UGu7zt3%N-Bm*|R1awY5mvH4z(%8^a2(3awo&R*< z9mTjljRK^1_w(R3ebtIR&v;h{c6)?7fEis8DPlZ&k(DJPZmOK}{`?SDzFpRAd+b%J z4^fO>V2&KFH|?-Ct;kaBSqz(9r;(C$h_|l}Xef@kb((r89hsCKODa&o`Lz<^`CrJVg))u+?#b0?t^ z+dUts@PN5F*CmPZ0siF~Pn^`qLycp75!L~o zhC_~_PI@iqU`$0ydw#df0;0qt*~hM;4t@^Tpaj!E{3d`tNabi{?EQTPbtcy~`?nr0 z@f!mcdd!r#ti~`tIIw;}&op3TWsMDTyV>C4UqMM>>yaKB$4YVO@$_&nTXw<=0Z7of zf5szJM0Eu#4jI!*?GHo79fvnSN{;aw<0@^l+ktq=_iwW`^#xI*+sX$tZAS2Tyi(lQ z*jT9OwXPWRhaU37mkyy?)P&yqIjSh_QP6pt(>|Zz7A539m}ujIdxL&A2pv3ncK*AM zyPHqtp+={8HBVjvyEVj@&g!pV>N7cHu3@k;+u9w_KKDXJv;EZiQ;BQ_$|+p6v&VW|6X4SeYKBiR82_oZPjxdR_0q zHBu(5_wAIRusbjEu9$-|f9ElXO)Lo962MCA=XZSNh!JglxUoK~{;fQ372fHa*IzfM z3Sm7*{03cd>jP+v$^(MJ0_-azRpZcgqyg1)v!_5xy^SC)Ti&M}CRor}(RnNwo}QEv zP#?gr9Wf;#yv2SLSkw4c6=$j5#7|ojvu|UJBAWZE38wgZXB^@ucX+UMLu$30*~JcE z{L<}SDEvf1tJPAR=?>{5$y@tt(uYBjKol)L?`7WIte>)Wu6kzzJF|O>aH(5_3{eh9 zX>*;XO+V8k@1?vyLKqd_^1+R5b%&J)p26_1I5na*mR?kfmYE`g;Y~TV{v*0ot)GZO zRXuiUJq?x>5|i=Sh*Y780uYJcc0_4HJkN-IbrLUgRoLS5P3zN-DW-7|8J^FGcg_h82v5-^sl}u3JBL}CT)YhcS=(2B~%RIBQM@V(; zRUSI;uAq7Z46a%}D>CkW!xUrmS<+h5R`#1Lf8g<8+@rg$r`G&iUXa z@|0kc&6Z!AbsF8~`?BF=w_WH2@dwEEJbX+?rGqvRm5x zcFoYz0Bmp`^Vv`UJS_9i!idPKWXYCFj+j7WtS6>DdwkvSl-g-&ckVvH=;2fv`6_r` zMFXE!N1R5{U;O%AAy>Wg~~-w zxyuSb69F&-v9gH4HabLmHEiNiEHN%wNh(UZ>6$Wky{f8(0=&6%t@SN|F4dLLDq(iM zeq z+LlE|L@H8vd9d#tMR?-$+O4i3$DX&ACoJ!4e#Q6Il@C5Nktvs;fmU=@P+J>Oe59ar zPhW$#=eY7hpCZaU)#J9Hvd(#XdwVeCHa&3Z1_*s4z!K|Yn|Y|xbs}XgS0tVOY*tv{ z`QGlDtfx2BDV~{^kY)QmHmP(#J6>ws9Y5GQ&whs{HApK-V8U#2!=On9muB)2g*ME^ zrx}A!k^{fbNiJ&G5kLY1xP8S^~|&FM(ErolF!4xSy#5i zvj#m=a|`tWX+GknLHKhPUGz1?sBxc_)X{+CQ7IaO(J;2u6R7SD@wzy=JyBl2F;QE; z?R%bXcDC=jPR-HpdZfhDI}G{~9v>~v{V$O$lJkajs*Q_ZByUz$R?lDrh@j+Q>f^Z( z%HeTH6Wivt2t?|0AuDW8bk}e1ZfY^{SQuNPg1gPn1J9iQ4A-od3S@u^dLC57PyT`R zdY|y5lUA0qLh$cF(wnzH;E`uy6Re#RV(Z^;W4eR=)2H3im#vX_l9zSHbh52vtlijU zf!W_AGwxDuQSMvF4G+F3x;y~=uJp}S#q5XLgWpA$x3|^fh#<+1J_AdPdVmv&%n^t> zwIyDDz0C2!1&OgQnBYAvlnmi~w*0Q+CEPl7CJi?HVbVx+s&I;WCwh81DSdOEyP_p{ zblZjS&5Y=5_`t+IE>3WP|90D$cH1)Mu5OpU-tlRtktOQV(h{q73V2KAI+Au!$Du@4 z%}DHVf2ircLd7(f0=S-~^{hSOkREcDvoe}Qo85-6js+VrzSLelF^#n*&LN}s5nc<_|BVBPYaU=z@q|!D;xHzZh-|f+unUF zwk4!bw+*(}H53)6pA-PI470TlrO!`Qpv5CpbGtGXV<;*=yHh;UeBtE48msdJ^WpQl z-0A8@IyuN@A+sF;V_V0uqnm4)sHETQFAaCu`1S*|d4nW!?`A;fa}z5y_u}lEzhUG{ zuo>>go2x7L66NWzmq^!_db3wEsWuhq6J<`Jj~8Xf;F(%q*KwAgQTicAnb<-9vru>Q*+ehUlnJJq9vgOZ|$N);(mEUB3Q| zfg(hwq~<)Xl}^umbo~3aOK`I2%t7R2-1L3w9JHS&vl=lvCBGly_8DM}B)~LyF3B}E z`|D5Yh?FRO7%}W!JRld6tTr(7hPYzbwjv9_L=Y#aU`8zhsCgY`7fp;Phy5a&j*Zr{!i9f6i_2w4yNeYhy-JTYZprUP-i4*Y&?U`-XHD8H zV%d|U3{Y8dk90|r>T3d-Uz6^{WPa3={@NUtsW{e5qJFjv7J~#SfC)n)GdOXV;vQ^l zI27hRjYkVF;Mig5Zj;OR3Jeq`=8u&-=y~h9=NVsCeW=BMRsbVsMxTj=&KC?q?{Xcr zJ0M^c{L}tk$O74aSnSdIr>wJ8lcts=BWZF~1!0B8{uY=ZAWjVLR+gIVv9Y(*JEMI) zFztt9q8s1o`n9_>a+9C$Y4`rBMGa1)XTz6cmT%rVR^!c!_U@Jz2(5f5qMp{|HrZ+c zLz7mr*LoDGTGKTeG3FYNua_=HaM&Tb-Vzify}K2-3U?sdYtSXI3y?q5#U8rOu69N5 z%N}<~P;oORA@*gte>-~Ch1--XdUEXufgP5{OL+R#VRC*3&F`BjB(DBSeE|-YNTVFP zB#ZfKur-1MKi&C_Dvaf{DA| zk(4$RJ@@9?m>gQf{^3%?g;le1z1*BL2+Lx9w=QkoJn4J^S;Qi88V(B~Sx9;-@L^vY zk%HPjCyiQ#8fgf5A6sNAz0O>zaWRErnwI=GqY^Z-*8(Q15O(ks{Zy1e#fydouTJ6n z2}xWB-TZ%6)gJJ>&{-#wRoGBu7%Bh>fTEZ?sg4|iJEoOLf54XC8Zer1bCYF26C-0J z__z5En4H$Edo4J+_C^RhwQEt>RXpv6#~~wS&7q&%x=YQRjf&(f;e1iG;dc*f$8qqa zS@%!lL$?n`%7da1*so>vyn0=CeNLX)b8dxOLlRcgb{Bgwe-=1eXbK>e9EfgRzJTsQ z&(MpnJV^H{Cs_JL7&%Y|Z)taCZW0a+ObUiqeK1coge^*%Uz_4DQhOZJVMvu#T93^{ zk@2@^yP=edPRv~@yV6O`)QQ?HpM4N>;z(9iqNI(TqhF-K#>!qMDFt?yz0!Fvxi0=N zq%4Z%N%%_7cH7S)kRW5mS81k){hN#R>Z>vgI9@rw*xdnk$#nj+Rukt-DOBMOa%@BH;l>R8% z;Y4_NIHhBkk|6c#L~U^@8;cQ!cUMm9nHQK3M%#PTt*W~WYs8eu6hrL>kG+2_dq)O) zdxypQ#gpsow7m>Kf&tNwyH9cJ0Af(TZ6c>Uh-kI(-V$Se(IhacXXI%^Sma>4=7YMK&NZ{6?~7AW`L-=koMyIa-Du;~mScX6X_S{4 zX&VhPHGNwHKG4Qq+7csD+BT%gsx*~2rJ?tXXft0QfcjQyyqqzg!Q7^@7uSR@&8@BZ zTG6>|UjE~e-|q-Oq`vHIPoy#pFOp*=>p#(uk;Jl}$4lD^nF|e3V&Y!N_|Z>wjIPxt zZ^523FjN_lc<-2OUE#?WYU{fA)Y#$g;;J#lel7@Uac(z}`>?3ABF!bzR9B`QMfVob z??x$C2;GyHFjp4dp1&z)=O6p*DK^h!2zvaf)mp7ZL1q}Ww^sI9RMF0hR!oa z+K9Q{RQ^<|EMaxcE76>4hI-w7!8&F8!19Ync0C`Ciqcl z!6M|hECi*{^)ZZxL5iG-hJxrwCgUvp;(Z-l>eC5O#AVRfqOdbQV3sQ$_+?!^(^weHndHlgMDtGQBId)@F+Cv zX<6N@rp-&H^L|5le)P1zDmE)`Z8)ElbZeHXDF!&uxdbSJSKjIi#6mNRcDF{-YFz)AaY6b5S+0X(@!yv?AVj%iKw@b*7c+qXVk60Tf% zENH(t z%~Z`IV%K`%`}*-qZ(soq8~ozQ5g0el4;NOu(NE}HSA9Rpq!s~FOb04l#O>1@T zDz%<{o+U)4r0)u`*O1n8zHVJot~s~a5;EFZ3-_;o+y9j;czkzRCUbquEbz~}2vS0A zUk8pE4aIcbZJW7;IX@(#W}4akEtcaJR1yDXp`oG;!!MhqE)d%@=4$Cd z{llaaC`Zq<=&ydf?44fYedy%$82UxnCi zNSbvc56&q<>%dZs;KCunOUR*cy`QR%#_B&U4W7yqs%}-|67zVY)aMDRZuh0XU8WK} z70EX>Pdqway%--f-r6|H)+8TH)qFc|bjOgJeX@1FtZ&-?9;dWjwFIm6H~*8bF0M(o zT1Hg~2AQ8>vQ(@OCim~&-F+NbqDVz{`{Q=+Vnn@PqWCFyZmnuldk#s`h>vLgRAE~{7^amkZTn)v zHjdauG`avee2uva<6h2l4`G+3ti{}mRmXns4$w;{-$H&QdMlX7-G}8lq%EpEn0kTm zDaBu0cj>&OE`ZL_Y+39ZBI|y!dw@2-cCmw2;IF32u2vL_{=>t{QJ^iXsR^ z&0A*`UG%8u{?>?ie9TSHdd1}9K$h;ZfLs9T62L3=Ks-K;+%=q@0~_&urH= zG}H>YwD1bk88x_4++ml3+}Ekp0x5Q2=JlpWH`WRAmGdS26V3yN^IePbJxfGpQfrGwR?y$|6C-d zwT%3nBP*t)^!;>3UrD&fe6=zUWPt_sMh)p6#I)DH^(c8()!@R2HL-FIzRAz9{w8Xt?*&M(jCSZzI@A4WW0pgvI2WyXYU>Q@fwlWQ1V;V>sQH{ z(Ti(I26-R8XJBBPN3JLYZ9m?Nbk7)!ZIoPK$c&`@473@IRw?QdmwLe`>=tZVYYOp_ zVZO0=S)G&_g7^K2_hf)%C)O^>mwz>R(r|4Gi>aXMFEUZ}lWbSo1 zxJ6~UaPnb)l^24lUd+WY}Xm`Pi%Qyq)1kNEQ30cw+M)ZP9TB~5xmby$+ zv7ZEF_e5&_1x}zW-mxoTxeZ_ng}aY0+@`F|UqS9COw77lsr@uP*w8%BS7&P2ChI1T z!ap9E96sGTx#FabtuVkWieR2a1*ts@PGWoe7!;16Z-|h@=l6YeLu~Qw_Gg!t#D}Y8 zGBRv?vli;eI5t8vvJ1D%PbFsNmQqHu9pRmIi2UsmIWvX65EOFLagI?n?$fT3221Nk zq}WmJ64y~2kXx2a)dOe(iQ%Kqb@{pb*S-pgeYb$#bsZ;0*Da{>eoZ*52S=~;u=nV$ zow9t%P@{Cb5ihNr7ha???2MCRVZzm*Y<<*yBVG`vN7&Yt9Y>_G~MApqU?XIcbO`txDk z^W6~X@g0Vj0ki6e5C$ZJ7BU(Zz!`I>qH<1cmGuyIk zlyL;duTskCp3Uoj{@+H@L{EK475wNLkQ;e`)&U011+2wV1tZCc?KTMpYdi zlfIa|%?jzOqI()%84-bu#;|HTK`WDhPP2)g$2|$_rlI~3kRa8aU&RB!Hs@HS7AOID z{vTeL@kKd=9C_YgP0C#03Afa=@Vvuc6dYc8hx9Qdneruey5!vWX~LVdLlrY$wGCbI zfM}tcNPUvO=p_A93w0j6^&6&a2{QWq(jlVKZTqPB{4;mcDy|+Ar7H=X6+<|maf~ji zf~~wUzqrAVhR!PlS}9P=gVjCBoWvXGpfJlUD~y2^m21e+Iw0#h7*6U-VFW}4Y5HZp zb&Wa$Frg!MoFS_}T=! zS+~JXPEplS(TuJHX-_az9Ih~8JfLm_)Y%OU4U~@Gsod^@StB_SFr-XuVys|_`%8B- ze%AmeIOa~MYueKM&E;6{?8pfTG07e~f{H)PZsCEJ^E9Fz8UWV&N0J)6E4k|kiP&6b zIm>K(SFAFh*5>d(X$>bdE=o@F`T#a65R&Kvb619NrQ<<{9CVk zQr)cJiK}Vzj(+99*1jSj$!=_ zK^l$i#&>;#J?XYUxP(%t4+tCjQF8k_b6Khub^xKb?(c|lZEw9OgzTlFbBP3LarTKf zHl@FU-Y*VAt*ecfF~C8^$7{x}_HIaaYGDo9q;AFxc80X4FqtKH0?-p;x_r{!J=n>b zK8N=CgQCKy2)>Ps%yjQb7%~%JRB$acGq<1J5rAONlf$#>YCarE{`qx_`tjmU!*Z+q z69-o=WL@6${pfHXY3VrRch*@1k z6ro^Ago&xN$9IanY{ksJLAR4+lHu!>`t=O$y^)Ce^1r&r%(UC)Ru11fpHd%_grr$Z zPJ?+vJV11ALi;aK*3$jJKgYMWQtZLs|8HWg9rQ%hOk4DPAbR9F@+8{bDvG1g8kQ1e zd#q+uLZJTKqxJI316;2)QM!-+2gy9 z-#?&uA3HVVT=Z)0%(Po(+KtlagZb!|x9E%RCnn{UtG?K!tdqMH2x1X~&Lnw|Em=~U zaUSP61{XmWki8S1X8qna+@Cu$KL33E{Z-^Zc1piCS4K; zD|Rbfx6@m@Xq(c5d;?eLQ9ugZMksKl*)VPF2nb1$a1-4%aRjd=*VFjD6$1QbgnY!X z8!B#y3!MWc=5ysCev%FZgJ`P7il+43JiNopIJ)%%aCeUt#O5v0&_S$HLj0_=Ih6c!HwQswxZP=+G`M-V4p6}ac^WHMb~`85E<`C@WZdSUnBR7{IxWNCBm(MKD zBxJq)bZD4@&qWh#eZ$gP<>uOcc86$C$u1p?;w4_$n|Dppa=+@>BM7G1g z^s4i`HPb1>KU#6{rYPIiZ%{k;ePvs0^7bJ!i0wI6lOATQ|E|051zJmBNgV~jmG6RaY z!Zni{9XDr|zbL0o>!N`K_H3gM@4`j*qq)*UCFiS6(;xE2OV1g%VRYsgchlsYsmgmI zff5WX)r?7@$xS>OL5};7?LS4j0C&hAN9Rk)WGY%x?W?kluZVg@y-YN|?%z;>J&&Et0W)!E9Ib znM7D54py+0L@_6{{UACRB+nvfB5xzyy_~r)Ulxzba&CKZn9%|ceaL$-8yQ*& zT_ap>X@1u;SEy=IH$!UkXxDV#Fm_3_OF>(2Ma%jWK_W|7rx30*5=>{|Lt};?ad(06 zRbORLpFL;qPtvQkq?)fDd&W*cyXw1_q7rrIdXd4E@jNLR<_cK^<|10JlC|vfA}mk2 z_XsPr-Wd^zbPu+FG`E^|j@3fB6>JNc{+Tamlf=nfSCEoTSgcgFRE)!;K*d8i5S@VB zC7O6f)5}(a%+73{i9kA_w4UF7X-%|gwm|*;s}Tfg8lnSL5352RzrY%2ygF~azK1wb z<<@5OWL+7eO<7w5-J0=_|0o^-#H`O*M$m)m$(8l1m1Bw*mSvD>zVX`;^+6y2{?*dy z&!HUW-2mz(R-f$Qdm5MLG{^)@$>iQL0nZ^X+i-7C+kS9juP^ZHi=dTQFRrmwMF~Ls z37vxEr@JUWm<2MEB`OK0}`Rw^;=87n@ zjAdS7Ri-k^>zKk8@E*YDI!B9~{MDm`)Qe}evHfDh!2kS{*!sXE2OvN^IClcJ!nh(uwI=X%&wLf!P!J2H8epN5hpk9il zSE$L9mUi)s)@^31yuc8s}6)O%D2SoC+nLiuEm8#EfMc9)sd) zpvkqG1=+S-pwNp-lUwnkr&^y22 zG9{@D-7(q)G?%|xs&?B7IJ3Z$wM4(+y(9tGt&(HPwyI+*iad5@pCisq&u_nh^>^i6 z@!0)0rCNrrkVx}DaQ8dlWL)*M!i!qns#P>vMMr8Hdewm6zo`ESv6Bf?+mhF9AAhK$F1ehyptu{pDWgz2w znBpwv=RX|f`EP&2%qvggMast{{kcq4Zfcj?I>(#bL`^G;3*-u8yuURcQcTfOa3g+1 zI#j8w#p2d0-ALb8>!H$ZUNolO(gy!4;f=?#v>;O}N^uh_y+rG~X>L<;hY)dnKDn>1 zU=3pMe;~(Qzh>gBUv9NpR^(SWykt_J*uzl6aLWCnsusIh$xaza1$velb#KQaTHOr7 z?tY)Sc@6fOa>|+e!v8(>S=h#;J}E_tF7;%P0C`vxcv)h`xAxwBuD8@m9da5II!yhe1(!^}~<-$c3HR*F$Q{-Ob{5 zLDI^Y6RqCf+OlwI4KYqx-y4&x_rR&GA#IXdYo=&94@=YSCXK}X&k=X;+=`!O!*KnP z#=odfRw5n$C-qqt8(56=Fwz|@6c#d_Fu$3G$iwz=B9J0VkjOPqEkGcpb8~ZgBU$qN z<~^RKgQd|SV=7B*fkB-=*It|*l72^V%%0j=5Xzwtiah=T*a6A;RBRNR(n%K0`urcH zh3p@gXNJ`NrJ*kxVMi8pMdH%pc+U4%4@C5yU+62x(Ivn8i?-%Z9qN5tg@3jy3jMx9 zKh&vch?$2>b>!(`$W0T_CioQAZP}aH63%C!9O{Iz!7>>Pw>J7go8&PG5N?H+7zm;8 zEf0ub(oW+Q5tPuco>$Y;?-QVIEN%K*g6I;5Nl{`J-Ah~pj!b1r^~=B2``tjG@j_t7 z%d&s#lRp!CnLhwGRP*or((VItqwSyS{atbg%;zL=-t{OLzBVKWAxdgb^KW78!5=L5A%dn z%^H{~NUEcEiG@3EZR8bN7ySn$bfxua8;vPc22k^`6*G*EzGhLE>1J?T7Gbd``jCX+ zzDVjX?1<-C91vN=ax1)v)89)2C0yMOWlt{vqO6WE0IOO~R5uWL4KjG!L2byBa+=*1f0D znWO}$($fRi4MZp9E60=D=Yn%QPl$%`48L-%>_&#;P69kNS`{^L9E=FSewn_>iiD+A zhCc4L_Uyavy9-%C=D$f|X+KT* zi)3gq(94svpl@Q;ZnvAXt_Cz+*(?IdpC!oisKQi!?{b-$`M5lGbR(`SdeZmMx-&un zk?l^rfYwQ(IfF`FnD6$^sL%8zq0|2kPrbn$zo(n-Txss?j9<@{3pu8kT)Ms}i}1_e zwTKqa@5-e`>4mQMh4mO}F=@|y>MbK{^~V6FYIW&m1I$j8f})e(8Q<_Ocmb>fsc<^Wk!SRxIY_3DyPBJUfV zT2oI2_%&e%^$h3cWG&_VYOzLv?*qDelCfs_oDsV2pBl%~7zL5E(K{YI;F))zeVSf% zBg}>mOY-w^=!?gfhVn%bsfdQ{(kD^Y{Wow(?Q(B19O6gCe4oZ=o#gbY^hbo)ae;q! zOZ;b<-IC{DJH*pE=VzodKbLrUJMZkeO7VX1T>^0R5Qy_8>Ws}mPLK&<0^i9FQR1tL z`-^u1yqHw`VNGxk#7l$eUjJ5o12(gJky&*clIp^hA(4sRL=Y~eJ~1N<=!!J;Sx|qW zTq$t=$ID+tLZ#iO}-1M@AmZC5R8nVuHbgmEu5%S-MeO;c%kaJN;lDIElua&y0}5 z_8Jm}*gR}=lN(Aq4e0$l5TxYORWq6NHGN-qJI zC8x7&SA^DQ?bby&;Z3GH4(}RQJ>f10(;WobswJ#Hs)&K(Qn|rrwayi5llZSB=vJc< zX_F6I?%hFE^`27DxqwaVGP-GaM$MZ1EZU9P5ou}%ih=a+-PvC7>GZhm-!c5P*N;hZ zY6v~UaJjtL>E(=wJFfy*pu|~iaQ8SEx)Zgpk=4bv z3Pls2)!JT8fvV^iTMim+HgWc0s3!CwFhc~Z1O!jN&5}(0pI%JuKo;og*D7Z^uYjLG ObhK{YD7|*?_x}O>%now^ diff --git a/openair3/NAS/TEST/MSC/NomalDetach.png b/openair3/NAS/TEST/MSC/NomalDetach.png deleted file mode 100644 index e5ca319adaa40233cc3e0ac570d547f6ebfa7093..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5844 zcmcIoc{J4f-~URbDGZ-_T@A%#GoZorQbIx;~?fb`f-sd}?<-NY%%O5t@roV_E6bAs{ z7qcsuYym(_0Mgi9+rYQ>$H-OykjXT=biqCnWvu%wA?*%uI z^(>J$!4~QKc9HFgg7@xoT{0sA9mzeQ*3MJ%pxv{AdQi3%bD@Mgj}C$29V;G%Nc^!~Rh45S?A10j<&Pt?=jf8N{_7oIydk)&U}mNRiPs zR9LWQj%lVKZKKN&!*c9u8x1zyf@dHEVm2`@HR^cff(8x|P`}IrUL1Ap-6a_w~JK^Mu|@5!-nFF!nvHd(wr2 z{u!oShlku~C-vS=?weiO*bZ`526|s&Lm48l$K{q90|{T-2tMLcRq@^SRh{>1s)V`~ zO1m7MEvdx!)l$&H6ETYOM-Abu{l6SE;DRpu1oUbJFO2;Xd~Mpdext>=pgU;(w($f_ zOwz-$fV)QoNSt$KDkY|C7BU*jjCjNwIfYd>y*GYwilT6)9$7o4p3}5j-g{m@>aAz{ zX?^WgyW>RZ2)05v;jUdReF~Ix!Q7iK8dC53JnD>3ZS-PR*q7sd^0$)nTJcg-0Wl79 z#?9@21mfMVmq_huqoiJ zuP@C)fZWAdNONgF6sYrqcX@ur>3|M(%tek^tlZl_*nf!dWw5&re=z34my22VT6RsX zudThxV=$RaR;thiZ+=z+R#CC-5B|vOGaNQqoA7NTSv8w23&J5IKHZ&KLyt_>AFUbP zyq^+ONvBXKv^sE?^clV#mH^L(h znv@Jwn$ynZXomMM4g|bk$Uda8ku|gj07eyLHbmZNq)E){THW|~%Dfy3hklwQHy?f* zPg2yxr*n#naW)0Fq!}F3#w2`8eN6iJ;5fn`T36ZxTFwKMw)xfX-$<&9n7ns{AT?yJ z%2!42O%2lei*VVE({oXMWvh25J={BB;8h?RHonZ8!XOFG=kt!R>K*B~;1$!ZVv2-| zLsx0PgYrC82IZ+l@2^_sBQ%__0|_F$A{9;tEp&+x^}5M@lcol9b&4}neIs&aN~lbAw_b$^xX~x zpZoS<%|73F+NX4z?%WLdcRT^zuu)*L+HkvBZUj|Xi-Ld<{ifyr1K`2%ep5sZ;L`)y zHf6tQI`*W5m8{?=tcxVymL@%r48){VTNr1Io5KQq`Bm4vjQcJXF>E=>k2|KO&S2^3 zG!5L|I9|fpzb@?<9p6eR$y;eax;{nRvd7-~FqjcQ{EGTB?qzy*7ux$qaGN~+D8{&5 zG}_9RjTk>u#8w=CKQ%LR=NsB=#01gQ!!AJ(jv4J}N}(Ua|Ky8AJryP_Ict3kRwmXt z@9h4L3@uq0_Qva9sw|kxsbp(NTE%zyTq9Y3L}pQbpMDXpLcFjcO4?$|KPpyD@uq#= z$qo&|UF^A>!smxlKYYIsDGjU|G<3{?b^uiAp=fT_vq8D=4i6dIS2VvNzru%J)Ba4_ zD&vVMWD2E?8ae$^>DVLeH|xvpw+e2!j?wWh&`9ZLNLAUL@CqsoCKc_sDP6j$SNEJN z=Ak0YvW-UFD?!W2j0y>FmjX?^g2QefjO@Dy&O^A9vF%DD0h{0H0cT_m4L_8ZTWhPl zOO0D^oRaMHy&a%90Pyk3+ocPiHbw6dM?sZJT#`w=I_A3LM~9DEvgKCB_pDb3ka z8isRAidJorro-ny5YP}L#B3^t7=s-5auyU^IYo={xq!J`=Yx{Y5iM-WU1%{8!& z=JmPDg{P8ZFdB&5u&Kmx_>FRGIUk*onVCIS{IG8k3SV##uwgGpdzt} zZD{9#(ign}OiO)hY19)IEmP)^b<>CIR;UWE6>_1|PBVA>P=K71u~MmjM~&NwA-D^_ z*PMjOo?$EQ%EiIdd-$et+fKNJ79eKsol4_NcZEV%Dgua#!5x=>OXFDrMt6m7wg8>@ z$s$ec!7k$qb~I&q=thR!Zt-2NrLw-y6|-@SS&IJ3r@Fj3eb(bi$xA~9$H&Ug>`UPG za}_Vr6FT6sv~PZA>hm0{p^O$RzxD-Di%NcM^lK?h-1te+;B<>aM55o*9 z$~iT!WGC`+Qfl2e`okN!)43-G;H$`6!_aF?hJe;J^J5QevL-gZ+dKGtManr|$x}_6 z4-Vlfy~*ziC3Fsh1r#86#VX=W*ubd&m~LG+I`i9PkQTwE;K(gc-u7-Vc2(~i$)8S< z(pzUGSo6X=7eChK7E>1ovOh`&ln*&ZPgoJca%0`v+R1o3tG}Y2;2^k*ckp-TPg>M1 zFiH@cfxq(njmLgK*5997A3VN?z^CfgO{i#fiU_YB)z9iEph4Xjm7 zm~*g*5vHJZU@@IjsOxG2Ga2~W3h1T_A=O{+JH)N9TPHuxVxUZApHjPFd_}e0(h1U3 zIc6vP^d02w(B!@uiX+VlL1~N4O;F9!)2yuia&PI6j5Os8s(pU228{XWW{EOI-k%Po z42PYaGyGJ$SN-*p^tJdh9EGBG{U^S(T8d&a+G7Ux8s{s!qw{FAPK5ka!Nc9DAK0hE zB3j3BM!}4$Rvah{A?Sh=BZ-R|$C99KHEyB#*Y_#Q>!f7K_*U_y96m9|WGEe}BZ#yE zF}8N~ON^)Zj^=SrIMVGz`R&d{tF+5yIX!$SH^qq+CMSp*=dT&RelC`yUsg};t8-#9 zesI^{Tcz>PB~t+4Gi58#cx$-HE%m58%yOPN& zAMMA}+lyFZw%>8z9*mL{zNYL0R$c$jkc99$INndaHakykFgs@BxO%#ZSME292TpeB zv|;_Ieq_S<@flLt&8O6rYLl4$!nutyOZ|BzbZd5jo@up-e$xe#)3B09 z2w2zvK=M(to0hTy(RpdT_`x^KL@ea0UZt*LY&PtiEG#9xKb|v|7&wOOZ!W>-KB~Ci zoc}4~R!yGcL??QH98vDdqzSy11(;D}`=RzSOC%YGK)b|oYCe=9YaI*TpVe1iRyh?2 z7(8*_1XDpS{iX6J%a!@=>GHXb&*h%z_#=HV8rfeJGvhsu*PeVeN%gw8&ZZEh{iM38 z)af6UdNDHhNdMa0{m4S6Cs5&#kw&oRAFvY=Iz4)n&$B4+>zIJs|sDD>TjHEkz2B%$t2t?bMUL= z*1TOJLt{H}Zb3+q&T~YtclU4|85vm;7^|JwAvKVl-fnVb`P=f!RAh(Sp|U2P3{9ZW z)k-eGBghuOfx8%|>fI=;TRjTCfVc5hW6h{vrQxrqo;^h-9YxxR0jo%%g&H4$vT?aw zTHWY&h9`3@O{>s?o}}HKL9X;t%`NZB{c}!P?ppN}ZDkG@R68-s4t_59! zhm;;7gjJJV8kRy%~S|2 zN6P`C>0r6X9_{R3Fj(L~J3LXGk>bb+!Cdodb_@!9QPJzv#LKbSt@&Znchb-@_WVFtpGP5R)23xH2?)s1grTs*ItOanHL&m5|W#|!DI4+ zgZw<%&++;pE=WY~>Skkt?cqTo(4k00czb}JS3C{JYxZr1l9qvE9=L__z_ z{Hz=!s``jZbVNmh735U^$K;BYKaGisPBH_FhRAeqf1*AZNvJhGj|(>Du@TyDzVN2Z zBF)6-Gn`Ys>w}Xc&=AEh-DIJc6w88FZLSFfXf7UJ^T@p72j{1^l{weW_Cs)$V{8Rf zHKMeXfsDpY+OXd>%W5qu6&}`=wP?GKYBz8X72b zJ91QA42&!zjo@XPx0LE1^{@Sbz6aR^&c8_46my>mZ+Dpu&q9);+oPOh?-G)wc1W0B zJN~MlJeiMaaTsy*y6s96e5w%Y{CTr%oz-UPMVCC4Ky& zBtCkd4cRNJ2qd>uLM50~nj!$0qk}}V4uR$aqF~?%B=KrF^^Bok){xU`tKgdZavJ!@ z=wZ;XjZeN;&$G5~kpB_&(s< ASprocess.msc - --------------------------------------------------------------------------------- - How to generate PNG file ? --------------------------------------------------------------------------------- - -Parse the MSC description file using the Python script msc_gen.py: - -./msc_gen.py ASprocess.msc - -Warning: msc_gen.py needs mscgen utility to be installed. mscgen is a C -program that uses the GD graphics library for PNG output. - diff --git a/openair3/NAS/TEST/MSC/SwitchOffDetach.png b/openair3/NAS/TEST/MSC/SwitchOffDetach.png deleted file mode 100644 index 77b28c11a52b7f5b8b6af762c6ea7bc3c77c6c93..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3697 zcmcIndo+~m+kVw9o06SMg-nONQ_c#7&=yHKG)`fLAqhDo$#undY+7n zjImzgBPY_wZ#^?=1)Gzs-p91W$TYZ%hvPEC9UhEeWqTHOa3Gm&_I}S*}4}iGo zy_Owa>E=LYSV&!y$t^JBQmc9Y_a4ZY-(O%sdzcIOXmZmmSV?IvSkJADbNr1!^H%NE zjXUHt_&66y3rCVPs|cj!i=>(5q>#(z|5c{)kM-c+Wni6(|3&0tf(7i^=qS;v}VrPI{uuIT1oqrI0P2&au+W_}3Sa8h?*Y(BeA_WP-2N@JpP0L?XA zE`3(D56pzbfJlr)3oNb9`g-fV;3Z>%Hmy2!*@jqb>=!zk6{eH_G$HFb?eydsQ}#y< z|Jv7y*R;HGd;} z(i~a#hofc=u|~BNy@gQc&FFop*6)sBUZfG&S%G{tntEr0{Sv&ayyM}NB?t&v;eV9@ znkhBR0i5B?q5MyseVPrQ2NQ{+rT1Db%bd0ptXhrBLaA=uj&HHTmyq5y)6lXK_xPO( zUs!oMEr zy`KOeEfALi=n@I#lD@U6Sz}@N`|N^w)!I2s7B_RhRvQLYB~Us|oVR*k7!~S0S8?%b zHIo(9Q7^B1gCqnq%-LNPZH%A<<;Ix?Hpb5vMZQ1sRW&TL{8PmaZpd@Zw$F1B2UQo{ zKQ*`;lPN~EYgGA?TCIij>9YBqK4k>;_akoG4hxM%s&dR@!w*9XLhmhz;UAY$0052R z*!cO>K_5kWBQZ(al6Hw3KD6$V1s3Ng6npB1z|@)aHIQokU0cM>y;o%RkG@?!B~-I$ zC2R(O#Yb!DRe~=NU~Bm!jzl03EOO}@cflsEy-d(U=P!!^-&3$ENs3s&W#ADOA{k#} z3z45!-xyN_6g;aV3amx%^2+0yLMVp34 zG}UecIb2oSA_kfz%Y|EZI8?_|vKDCFD6&JV-J&?;9>2h__qWWTGQ9EZ@v|q#xm+%P zmUGD#{1^D?Nyx2|d&hYU!x`SqCr!ze`^23}RHoXEECTOUkD;*XD+^{&5ukGRwJPkz z6o!s^Ga0w6a&)jKBo$j-3N}ZrbZ@6Ew9o0%l*$uIU4^`5T6pcL&|iB`Oa++~8@9Bd ztZ+nV*#JU;+Gw=GN>^j3>$wQ`=Iu%bXV;5m&|QVU&tTqh3Lj9(FMc`ekZsl>zLd6x z3fcX`WH#>W((3J*XL?*6aG4*0)Hu?F7v3_o_xF4bMUX|tda!8RVC&^B*f9nY-n4dXYC8Y2@BcfQE=n%Lpw^aTU`VOi^8HOGx8VFs!*kGXJzT@m0 zkF}o2N8~e=nXi6nzQHsmN4uKTHngR&>8duwszOwVRXYaSE%@Q{?2UN=#aTWJ!nqz; zR0$yWNp0iSUUMuxz_Wz}y&d4$F840L(?_R9&nJvpV@D6VP_N&=@PUY;Ip8)5?46hW zM@;ej?CCP@(R!VAWB#D?JyBRUm-i)7-~{R-`9oL{Ic^e8t|>dMpI zJy7UZ9QNwMEHAs=QSpDu*fmv#J0g{BdFlZ!$_Ux`B-=pKh1sQnzf)+A#pSAJS9aJr z?F3d$QxNM;xtr`)8`0^j>|DSMW(DKYu8fDzGFN(b<9}wPKqN_#uadL&PaZVel|;g) z-AKL8nH2Ryt-ln*_rx((BKTSd!{S3EJL@DyP}ZE+<{`~>|6KZG?EBL|ds2XYk5`z< zXyy5nyUQ{2Bm(%WGomldLIGr)`zDkC~!(Ew?4xf%wuQY!{4s4Wm z9soRhYG^iSj`$INs_pS*$}w7Z2mdb4d-Q_sYr+D3w;i_Hdzaja24ScY`Vm3u-{meQ z^?#b!6}lryRoNz^s*a^yAENvo<#|`ow2V%;>6s##F9eKDDa7`BDVIr+8IlO=iBCxO zUz&QWJ4}xP)PB~?&1OP}G&LF;Q^k*92Ms6*LPlUP;=zmuIMvefFGsmXH)eEyLNFao z#&Eg8xKK<&2z)uoCZ;VfE0Dxj%=!L@8g)EuEq~XSW6Paqw}%@o%m~!XDRH5**tlnveZj9glN=oijI60HpG%gP`%umos5w(#pN5}9W-VNwt6x?^~KlWUCFtvU6Yq6qz z*Bz-WZubPJsZqOzPV$}61yZxMe}{Af_She2k}NKQa)@=>ym2u7E7jMhPbfXs+&WMo zJ@9ZeiZ~?k_NG_Ob=ngsLip-xiVjL_(2UF2U_@awz&*9h9@G#XlCBjWP_ZfTh}LFn za(;167$>P{W1+((nZ#b}T#SFPnSxHfS<(-)2UC01DcgAJCRkqU!-VU5Zsu#vJS%)W zd7R-N10N+Li1snGaK;4Yx&=(0KYS>$Zp?9DbaE!~MHywuIV!xUyIWRMx&M<-?%2;Q z=cLE3A*~ljY2&fWh9dsCNCTq`F_EnWW8?Dn*|>X@Q~UN#@+aF`F66|msC`qoexfQ? zzp*WaUU}Tvn|ZNx_zK_N;gs#Mgi*GZsvV+Y*eJ95Kw6FAbYd>9?E*Qr$*^(B6|cBI zREOnUFk?BQ`}*elX;jtq#`vlH``L+jGZk9nM2`I&jbz7 znLMq5$ii%Vm0Pw3%cCAkitHQp^6cJsnEXP&VSL-?7=f+Bboi7Joih8aM`wb4|&~p1q$k$BsfrZJTa{&^+J<{Ezf8QtLDRJvL*en#sszD%NJ-1sSHrF;( ztJ#<;5cN&Wi(kSW5hz<|FdwaM;?vzYmKIZ(-uGMeuB*p+kbOy|BXn2!L^D>+>7^bxg0yw-`xl{ZjjA0c*P?c*8v(3rGid=DB0i`rux9qtz~#D8Tx zHmX{gs|c*f(hN*E>t`rSG>aADV&v-)Au3fS%A?s|-f9FWsTyKUymMQize0sfM+o+O zuDj1&1PN}3_gpER!PZb?r-VU&KFiLG&U`HMkNT+Rl*bp7-Bb?Wh1kWS0&{EYRqA;* zy|E3ju{f3A!iF(b1uf6d^CFT2s(F5D}d)>yXhYg%v4Oo^*6f-mG zVN6=c9Q4LyU&EW5eberzu3Or27u^vW`#4J;) z=*^-eIJL2PKKbhWL;m=qk1VY2`(UFjJ21n{%L`)tt&HOxG!0YW;>hY9Ino-!cD3fa z1vKk#jM>V|ql*f4CG04Cc}vmMrJn|e%1UhLn`Yne!&Se@8fJ<>Q%~y7+8%U#)>{=V zkc0vH6$O@}`o~8qSgH}mj7xWYIE>r(dE3haq<0!$WMB /tmp/msc_log1.txt - - -# Now, examples of how to generate a mscgen trace in a C executable: -# -First you have to declare the instance(s) of the protocol(s) that will send or receive messages. -# This is done with the following line: -# [MSC_NEW][system time][protocol_name=instance_name] -# examples: -# printf("[MSC_NEW][%s][MIH-F=%s]\n", getTimeStamp4Log(), g_mihf_id); for declaring a new instance of a protocol entity of type MIH-F -# with an instance name g_mihf_id (of type char*) -# printf("[MSC_NEW][%s][NAS=%s]\n", getTimeStamp4Log(), "nas"); other example. -# This declaration of instances of protocols is mandatory to for this script to work. -# -# -Then for tracing a message you have to log a line following this format: -# [MSC_MSG][system time][source instance_name][--- message_name --->][destination instance_name] -# Note: -# ---> means a message that has been received correctly by destination -# ---x means a message lost by destination -# example -# NOTICE("[MSC_MSG][%s][%s][--- Link_Register.indication\\n%s ---x][%s]\n",getTimeStamp4Log(),g_link_id,g_msc_gen_buf,g_mihf_id); -# - - - - -import sys -import subprocess -import re -import socket -import datetime -import os.path -from datetime import date - -MSCGEN_OUTPUT_TYPE = "png" -MAX_MESSAGES_PER_PAGE = 36 - -SYSTEM_FRAME_NUMBER_STR = 'FRAME' -MODULE_STR = 'MOD' -RADIO_BEARER_STR = 'RB' -MSC_NEW_STR = '[MSC_NEW]' -MSC_MSG_STR = '[MSC_MSG]' -MSC_NBOX_STR = '[MSC_NBOX]' -MSC_BOX_STR = '[MSC_BOX]' -MSC_ABOX_STR = '[MSC_ABOX]' -MSC_RBOX_STR = '[MSC_RBOX]' - -# This dic is filled as follow : g_entities_dic[protocol_instance_name].append(protocol_name) -# where protocol_name can be any of the following MI-USER, MIH-F, RAL, LINK-SAP -g_entities_dic = {} -g_reverse_entities_dic = {} - - -# g_messages is filled with dictionnaries: -# message_dic['entity_src'] = protocol_entity_src -# message_dic['entity_dst'] = protocol_entity_dest -# message_dic['msg'] = message -# message_dic['line_color'] = g_display_color[entity_name] -# message_dic['text_color'] = g_display_color[entity_name] -# message_dic['time'] = system_frame_number -# message_dic['seq_no'] = sequence_number_generator() -# g_messages.append(message_dic) -g_messages = [] -g_messages_dic = {} - - -# g_display_order_dic is a dictionnary where the order of the display of entities sharing the same module identifier is hardcoded -#MAC and PHY valus have to be above num max radio bearer value -#g_display_order_dic = {'MIH-USER': 0, 'MIH-F': 1, 'RAL': 3, 'NAS': 4} -g_display_order_dic = {'NAS-UE': 0, 'AS': 1, 'NAS-MME': 3} - -# Display color of messages of sending entities -g_display_color = {'IP': '\"teal\"', - 'RRC_UE': '\"red\"', - 'MIH-USER': '\"black\"', - 'MIH-F': '\"black\"', - 'RAL': '\"black\"', - 'RAL_M': '\"black\"', - 'RLC_UM': '\"navy\"', - 'RLC_TM': '\"navy\"', - 'NAS': '\"black\"', - 'MAC_eNB': '\"indigo\"', - 'PHY': '\"purple\"', - 'NAS-UE': '\"black\"', - 'NAS-MME': '\"black\"', - 'AS': '\"black\"'} - - -g_final_display_order_list = [] -g_sequence_generator = 0 - -def sequence_number_generator(): - global g_sequence_generator - l_seq = g_sequence_generator - g_sequence_generator = g_sequence_generator + 1 - return l_seq - -def parse_log_file_for_discovering_protocol_entities(filename): - global g_entities_dic - global g_entities - global g_messages - global g_final_display_order_list - #open TXT file that contain OAI filtered traces for mscgen - - fhandle = open(filename, 'r') - fcontent = fhandle.read() - fhandle.close() - - # split file content in lines - lines = fcontent.splitlines() - for line in lines: - system_time = 'unknown' - - # if line is a trace of the creation of a new protocol instance - if MSC_NEW_STR in line: - partition = line.rpartition(MSC_NEW_STR) - msc_log_string = partition[2] - #print (" %s " % msc_log_string) - partition = msc_log_string.split('[') - print ("\n\n %s \n" % partition) - #if len(partition) == 2: - - item = partition[1] - item = item.strip() - item = item.strip(']') - system_time = item.split(' ')[-1] - print ("NEW system_time %s " % system_time) - - item = partition[2] - item = item.strip() - item = item.strip(']') - protocol_entity_type = item.split('=')[0] - protocol_entity_name = item.split('=')[-1] - print ("NEW protocol_entity_type %s " % protocol_entity_type) - print ("NEW protocol_entity_name %s " % protocol_entity_name) - - if protocol_entity_name not in g_entities_dic: - g_entities_dic[protocol_entity_name] = protocol_entity_type - - if protocol_entity_type not in g_reverse_entities_dic: - g_reverse_entities_dic[protocol_entity_type] = protocol_entity_name - else: - entity_name_list = g_reverse_entities_dic[protocol_entity_type] - entity_name_list.append(protocol_entity_name) - g_reverse_entities_dic[protocol_entity_type] = entity_name_list - #print (" g_entities_dic[%d][%d].append(%s)" % (module_id_int, radio_bearer_id_int, entity_name_src)) - print (" g_entities_dic= %s\n\n" % (g_entities_dic)) - print (" g_reverse_entities_dic= %s\n\n" % (g_reverse_entities_dic)) - - #g_entities.append(protocol_entity_type) - #print (" %s \n" % protocol_entity) - - - - - -def parse_log_file(filename): - global g_entities_dic - global g_entities - global g_messages - global g_final_display_order_list - #open TXT file that contain OAI filtered traces for mscgen - fhandle = open(filename, 'r') - fcontent = fhandle.read() - fhandle.close() - - # split file content in lines - lines = fcontent.splitlines() - for line in lines: - system_time = 'unknown' - message = 'unknown' - entity_name_src = 'unknown' - entity_name_dest = 'unknown' - - - # if line is a trace of the creation of a new protocol instance - if MSC_MSG_STR in line: - partition = line.strip().rpartition(MSC_MSG_STR) - msc_log_string = partition[2].strip() - print (" ++++ %s " % msc_log_string) - partition = msc_log_string.split('[') - print (" ++++ %s " % partition) - - #if len(partition) == 9: - message_dic = {} - - system_time = partition[1].strip().split(' ')[-1].strip(']') - message_dic['display_time'] = system_time - seconds_int = int(system_time.split(':')[0]) - micro_seconds_int = int(system_time.split(':')[-1]) - system_time_int = seconds_int*1000000 + micro_seconds_int - system_time=str(system_time_int) - print ('system_time %s' % system_time) - - entity_name_src = partition[2].strip().split(' ')[-1].strip(']') - print ('entity_name_src %s' % entity_name_src) - - message = partition[3].strip().strip(']').strip() - if (message[-1] == 'x') or (message[-1] == 'X'): - message_dic['arc'] = '-x' - elif message[-1] == '>': - message_dic['arc'] = '=>' - message = message.strip('<').strip('>').strip('x').strip('X').strip('-').strip('=').strip() - print ('message %s' % message) - - entity_name_dest = partition[4].strip().split(' ')[-1].strip(']') - print ('entity_name_dest %s' % entity_name_dest) - message_dic['entity_src'] = entity_name_src - message_dic['entity_dst'] = entity_name_dest - message_dic['msg'] = message - message_dic['line_color'] = g_display_color[g_entities_dic[entity_name_src]] - message_dic['text_color'] = g_display_color[g_entities_dic[entity_name_src]] - message_dic['time'] = system_time - #message_dic['seq_no'] = sequence_number_generator() - print ('%s\n\n' % message_dic) - g_messages_dic[system_time_int] = message_dic - #g_messages.append(message_dic) - -#TODO !!! - if MSC_RBOX_STR in line: - partition = line.strip().rpartition(MSC_RBOX_STR) - msc_log_string = partition[2].strip() - print (" ==== %s " % msc_log_string) - partition = msc_log_string.split('[') - print (" ==== %s " % partition) -#TODO !!! - -def generate_sorted_message_list(): - first_time_stamp = 0 - for system_time_int in sorted(g_messages_dic.iterkeys()): - if first_time_stamp == 0: - first_time_stamp = system_time_int - message_dic = g_messages_dic[system_time_int] - message_dic['seq_no'] = sequence_number_generator() - message_dic['display_time'] = str(system_time_int - first_time_stamp) - g_messages.append(message_dic) - -def generate_sorted_entity_display_list(): - module_display_order_dic = {} - for entity_name in sorted(g_entities_dic.iterkeys()): - module_display_order_dic[g_display_order_dic[g_entities_dic[entity_name]]] = entity_name - - - print("------------------------------------") - print(" %s " % (module_display_order_dic)) - - for display_priority in sorted(module_display_order_dic.iterkeys()): - g_final_display_order_list.append(module_display_order_dic[display_priority]) - -def msc_chart_write_header(fileP): - global g_final_display_order_list - fileP.write("msc {\n") - fileP.write("width = \"2048\";\n") - - entity_line_list_str = '' - for entity in g_final_display_order_list: - entity_line_list_str = entity_line_list_str + ' ' + entity + ',' - - entity_line_list_str = entity_line_list_str.rstrip().strip(',') - fileP.write(" %s;" % (entity_line_list_str)) - - -def msc_chart_write_footer(fileP): - fileP.write("\n}\n") - -def msc_chart_generate(file_nameP): - global MSCGEN_OUTPUT_TYPE - command_line = "mscgen -T " + MSCGEN_OUTPUT_TYPE + " -i " + file_nameP + "; chmod 777 " +file_nameP + ";" - - print("Command Line: %s " % (command_line)) - fi,fo,fe=os.popen3(command_line) - for i in fe.readlines(): - print "error:",i - -def get_nem_file_descriptor(): - global g_base_file_name - global g_page_index - l_file_name = g_base_file_name + str(g_page_index)+'.txt' - l_file = open(l_file_name, "w", 0777) - return l_file - - -###### MAIN START HERE ################# -num_args = len(sys.argv) -if num_args < 2: # the program name and the arguments - # stop the program and print an error message - sys.exit("Must provide at least one file to parse") - -for i in range(1,num_args): - print sys.argv[i] - -for i in range(1,num_args): - parse_log_file_for_discovering_protocol_entities(sys.argv[i]) - -for i in range(1,num_args): - parse_log_file(sys.argv[i]) - -generate_sorted_message_list() -generate_sorted_entity_display_list() - -g_page_index = 0 -g_message_index = 0 -g_message_index_in_current_page = 0 -g_now = datetime.datetime.now() -g_now_formated = g_now.strftime("%Y-%m-%d_%H.%M.%S") -g_currentdir = os.curdir -g_resultdir = os.path.join(g_currentdir, g_now_formated) -os.mkdir(g_resultdir, 0777) -os.chdir(g_resultdir) - -g_base_file_name = 'mih_mscgen_page_' - -g_file = get_nem_file_descriptor() -msc_chart_write_header(g_file) - -for message in g_messages: - - if 'msg' in message: - print ('message %s' % message) - g_file.write(" %s%s%s [ label = \"(%d) T%s %s\", linecolour=%s , textcolour=%s ] ;\n" % (message['entity_src'], message['arc'], message['entity_dst'], message['seq_no'], message['display_time'], message['msg'], message['line_color'], message['text_color'])) - elif 'box' in message: - g_file.write(" %s %s %s [ label = \"%s\", textbgcolour=%s , textcolour=%s ] ;\n" % (message['entity_src'], message['box_type'], message['entity_dst'], message['box'], message['textbg_color'], message['text_color'])) - - g_message_index = g_message_index + 1 - g_message_index_in_current_page = g_message_index_in_current_page + 1 - - if (g_message_index_in_current_page == MAX_MESSAGES_PER_PAGE): - msc_chart_write_footer(g_file) - g_file.close() - msc_chart_generate(g_file.name) - g_page_index = g_page_index + 1 - g_message_index_in_current_page = 0 - - g_file = get_nem_file_descriptor() - msc_chart_write_header(g_file) - - -msc_chart_write_footer(g_file) -g_file.close() -if g_message_index_in_current_page >= 1: - msc_chart_generate(g_file.name) -else: - print("Removing empty seq diagram file: %s " % (g_file.name)) - os.remove(g_file.name) diff --git a/openair3/NAS/UE/EMM/Detach.c b/openair3/NAS/UE/EMM/Detach.c index 719e18dd05..b61bcdc14d 100644 --- a/openair3/NAS/UE/EMM/Detach.c +++ b/openair3/NAS/UE/EMM/Detach.c @@ -53,7 +53,6 @@ Description Defines the detach related EMM procedure executed by the #include "emm_sap.h" #include "esm_sap.h" -#include "msc.h" #include // free diff --git a/openair3/NAS/UE/EMM/Identification.c b/openair3/NAS/UE/EMM/Identification.c index b5807973a2..0364c6d22f 100644 --- a/openair3/NAS/UE/EMM/Identification.c +++ b/openair3/NAS/UE/EMM/Identification.c @@ -48,7 +48,6 @@ Description Defines the identification EMM procedure executed by the #include "emmData.h" #include "emm_sap.h" -#include "msc.h" #include "user_defs.h" #include // malloc, free diff --git a/openair3/NAS/UE/EMM/SAP/emm_as.c b/openair3/NAS/UE/EMM/SAP/emm_as.c index 6b226be380..ea4eefadeb 100644 --- a/openair3/NAS/UE/EMM/SAP/emm_as.c +++ b/openair3/NAS/UE/EMM/SAP/emm_as.c @@ -61,7 +61,6 @@ Description Defines the EMMAS Service Access Point that provides #if defined(NAS_BUILT_IN_UE) # include "nas_itti_messaging.h" #endif -#include "msc.h" /****************************************************************************/ /**************** E X T E R N A L D E F I N I T I O N S ****************/ diff --git a/openair3/NAS/UE/EMM/SecurityModeControl.c b/openair3/NAS/UE/EMM/SecurityModeControl.c index b27270fadc..f9a02b1a70 100644 --- a/openair3/NAS/UE/EMM/SecurityModeControl.c +++ b/openair3/NAS/UE/EMM/SecurityModeControl.c @@ -63,7 +63,6 @@ Description Defines the security mode control EMM procedure executed by the # include "assertions.h" #include "secu_defs.h" -#include "msc.h" #include "SecurityModeControl.h" #if defined(NAS_BUILT_IN_UE) diff --git a/openair3/NAS/UE/nas_itti_messaging.c b/openair3/NAS/UE/nas_itti_messaging.c index 8016e0d791..c6762a7128 100644 --- a/openair3/NAS/UE/nas_itti_messaging.c +++ b/openair3/NAS/UE/nas_itti_messaging.c @@ -23,7 +23,6 @@ #include "intertask_interface.h" #include "nas_itti_messaging.h" -#include "msc.h" # define TASK_ORIGIN TASK_NAS_UE @@ -104,27 +103,6 @@ int nas_itti_kenb_refresh_req(const Byte_t kenb[32], int user_id) { MessageDef *message_p; message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_KENB_REFRESH_REQ); memcpy(NAS_KENB_REFRESH_REQ(message_p).kenb, kenb, sizeof(NAS_KENB_REFRESH_REQ(message_p).kenb)); - MSC_LOG_TX_MESSAGE( - MSC_NAS_UE, - MSC_RRC_UE, - NULL,0, - "0 NAS_KENB_REFRESH_REQ KeNB " - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x", - kenb[0], kenb[1], kenb[2], kenb[3], - kenb[4], kenb[5], kenb[6], kenb[7], - kenb[8], kenb[9], kenb[10], kenb[11], - kenb[12], kenb[13], kenb[14], kenb[15], - kenb[16], kenb[17], kenb[18], kenb[19], - kenb[20], kenb[21], kenb[22], kenb[23], - kenb[24], kenb[25], kenb[26], kenb[27], - kenb[28], kenb[29], kenb[30], kenb[31]); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); } @@ -133,13 +111,6 @@ int nas_itti_cell_info_req(const plmn_t plmnID, const Byte_t rat, int user_id) { message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_CELL_SELECTION_REQ); NAS_CELL_SELECTION_REQ(message_p).plmnID = plmnID; NAS_CELL_SELECTION_REQ(message_p).rat = rat; - MSC_LOG_TX_MESSAGE( - MSC_NAS_UE, - MSC_RRC_UE, - NULL,0, - "0 NAS_CELL_SELECTION_REQ PLMN %X%X%X.%X%X%X", - plmnID.MCCdigit1, plmnID.MCCdigit2, plmnID.MCCdigit3, - plmnID.MNCdigit1, plmnID.MNCdigit2, plmnID.MNCdigit3); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); } @@ -152,14 +123,6 @@ int nas_itti_nas_establish_req(as_cause_t cause, as_call_type_t type, as_stmsi_t NAS_CONN_ESTABLI_REQ(message_p).plmnID = plmnID; NAS_CONN_ESTABLI_REQ(message_p).initialNasMsg.data = data; NAS_CONN_ESTABLI_REQ(message_p).initialNasMsg.length = length; - MSC_LOG_TX_MESSAGE( - MSC_NAS_UE, - MSC_RRC_UE, - NULL,0, - "0 NAS_CONN_ESTABLI_REQ MME code %u m-TMSI %u PLMN %X%X%X.%X%X%X", - s_tmsi.MMEcode, s_tmsi.m_tmsi, - plmnID.MCCdigit1, plmnID.MCCdigit2, plmnID.MCCdigit3, - plmnID.MNCdigit1, plmnID.MNCdigit2, plmnID.MNCdigit3); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); } @@ -178,11 +141,5 @@ int nas_itti_rab_establish_rsp(const as_stmsi_t s_tmsi, const as_rab_id_t rabID, NAS_RAB_ESTABLI_RSP(message_p).s_tmsi = s_tmsi; NAS_RAB_ESTABLI_RSP(message_p).rabID = rabID; NAS_RAB_ESTABLI_RSP(message_p).errCode = errCode; - MSC_LOG_TX_MESSAGE( - MSC_NAS_UE, - MSC_RRC_UE, - NULL,0, - "0 NAS_RAB_ESTABLI_RSP MME code %u m-TMSI %u rb id %u status %u", - s_tmsi.MMEcode, s_tmsi.m_tmsi,rabID, errCode ); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); } diff --git a/openair3/NAS/UE/nas_itti_messaging.h b/openair3/NAS/UE/nas_itti_messaging.h index 967bbb3059..79b70394f0 100644 --- a/openair3/NAS/UE/nas_itti_messaging.h +++ b/openair3/NAS/UE/nas_itti_messaging.h @@ -26,7 +26,6 @@ #include "assertions.h" #include "intertask_interface.h" #include "esm_proc.h" -#include "msc.h" #ifndef NAS_ITTI_MESSAGING_H_ #define NAS_ITTI_MESSAGING_H_ diff --git a/openair3/NAS/UE/nas_proc.c b/openair3/NAS/UE/nas_proc.c index 6312a7dc97..9350590788 100644 --- a/openair3/NAS/UE/nas_proc.c +++ b/openair3/NAS/UE/nas_proc.c @@ -46,7 +46,6 @@ Description NAS procedure call manager #include "esm_main.h" #include "esm_sap.h" -#include "msc.h" #include // sprintf diff --git a/openair3/NAS/UE/nas_ue_task.c b/openair3/NAS/UE/nas_ue_task.c index 88938c3c37..a94445349c 100644 --- a/openair3/NAS/UE/nas_ue_task.c +++ b/openair3/NAS/UE/nas_ue_task.c @@ -29,12 +29,9 @@ # include "user_api.h" # include "nas_parser.h" # include "nas_proc.h" -# include "msc.h" # include "memory.h" #include "nas_user.h" -#include - // FIXME make command line option for NAS_UE_AUTOSTART # define NAS_UE_AUTOSTART 1 @@ -97,7 +94,6 @@ void *nas_ue_task(void *args_p) nas_user_container_t *users=args_p; itti_mark_task_ready (TASK_NAS_UE); - MSC_START_USE(); LOG_I(NAS, "ue_idx_standalone val:: %u\n", ue_idx_standalone); /* Initialize UE NAS (EURECOM-NAS) */ // Intead of for loop for standalone mode diff --git a/openair3/NGAP/ngap_gNB.c b/openair3/NGAP/ngap_gNB.c index a5dfc88b35..9d6bd7f07f 100644 --- a/openair3/NGAP/ngap_gNB.c +++ b/openair3/NGAP/ngap_gNB.c @@ -57,7 +57,6 @@ #include "ngap_gNB_itti_messaging.h" #include "ngap_gNB_ue_context.h" // test, to be removed -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -273,7 +272,6 @@ void ngap_gNB_init(void) { NGAP_DEBUG("Starting NGAP layer\n"); ngap_gNB_prepare_internal_data(); itti_mark_task_ready(TASK_NGAP); - MSC_START_USE(); } void *ngap_gNB_process_itti_msg(void *notUsed) { diff --git a/openair3/NGAP/ngap_gNB_context_management_procedures.c b/openair3/NGAP/ngap_gNB_context_management_procedures.c index 73e4498f19..ea22c91bc2 100644 --- a/openair3/NGAP/ngap_gNB_context_management_procedures.c +++ b/openair3/NGAP/ngap_gNB_context_management_procedures.c @@ -50,7 +50,6 @@ #include "ngap_gNB_management_procedures.h" #include "ngap_gNB_context_management_procedures.h" #include "NGAP_PDUSessionResourceItemCxtRelReq.h" -#include "msc.h" int ngap_ue_context_release_complete(instance_t instance, @@ -116,16 +115,6 @@ int ngap_ue_context_release_complete(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - buffer, - length, - MSC_AS_TIME_FMT" UEContextRelease successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %lu", - 0,0, //MSC_AS_TIME_ARGS(ctxt_pP), - ue_release_complete_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); - /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -267,16 +256,6 @@ int ngap_ue_context_release_req(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - buffer, - length, - MSC_AS_TIME_FMT" UEContextReleaseRequest initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %lu", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_release_req_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); - /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index 2b0e8aab7c..4692d2cd32 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -48,7 +48,6 @@ #include "assertions.h" #include "conversions.h" -#include "msc.h" #include "NGAP_NonDynamic5QIDescriptor.h" static @@ -1208,14 +1207,6 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id, case NGAP_UE_NGAP_IDs_PR_uE_NGAP_ID_pair: gnb_ue_ngap_id = ie->value.choice.UE_NGAP_IDs.choice.uE_NGAP_ID_pair->rAN_UE_NGAP_ID; asn_INTEGER2ulong(&(ie->value.choice.UE_NGAP_IDs.choice.uE_NGAP_ID_pair->aMF_UE_NGAP_ID), &amf_ue_ngap_id); - MSC_LOG_RX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - NULL,0, - "0 UEContextRelease/%s gNB_ue_ngap_id "NGAP_UE_ID_FMT" amf_ue_ngap_id "NGAP_UE_ID_FMT" len %u", - ngap_direction2String(pdu->present - 1), - gnb_ue_ngap_id, - amf_ue_ngap_id); if ((ue_desc_p = ngap_gNB_get_ue_context(amf_desc_p->ngap_gNB_instance, gnb_ue_ngap_id)) == NULL) { @@ -1225,12 +1216,6 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id, gnb_ue_ngap_id); return -1; } else { - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_RRC_GNB, - NULL,0, - "0 NGAP_UE_CONTEXT_RELEASE_COMMAND/%d gNB_ue_ngap_id "NGAP_UE_ID_FMT" ", - gnb_ue_ngap_id); message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_UE_CONTEXT_RELEASE_COMMAND); if (ue_desc_p->amf_ue_ngap_id == 0) { // case of Detach Request and switch off from RRC_IDLE mode diff --git a/openair3/NGAP/ngap_gNB_nas_procedures.c b/openair3/NGAP/ngap_gNB_nas_procedures.c index 6686f8c19e..a40e8328da 100644 --- a/openair3/NGAP/ngap_gNB_nas_procedures.c +++ b/openair3/NGAP/ngap_gNB_nas_procedures.c @@ -48,7 +48,6 @@ #include "ngap_gNB_ue_context.h" #include "ngap_gNB_nas_procedures.h" #include "ngap_gNB_management_procedures.h" -#include "msc.h" //------------------------------------------------------------------------------ int ngap_gNB_handle_nas_first_req( @@ -312,14 +311,6 @@ int ngap_gNB_handle_nas_first_req( } ue_desc_p->tx_stream = amf_desc_p->nextstream; - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" initialUEMessage initiatingMessage gNB_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_desc_p->gNB_ue_ngap_id); /* Send encoded message over sctp */ ngap_gNB_itti_send_sctp_data_req(instance_p->instance, amf_desc_p->assoc_id, buffer, length, ue_desc_p->tx_stream); @@ -371,14 +362,6 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id, if ((ue_desc_p = ngap_gNB_get_ue_context(ngap_gNB_instance, gnb_ue_ngap_id)) == NULL) { - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - NULL, - 0, - MSC_AS_TIME_FMT" downlinkNASTransport gNB_ue_ngap_id %u amf_ue_ngap_id %u", - gnb_ue_ngap_id, - amf_ue_ngap_id); NGAP_ERROR("[SCTP %d] Received NAS downlink message for non existing UE context gNB_UE_NGAP_ID: 0x%lx\n", assoc_id, gnb_ue_ngap_id); @@ -410,15 +393,6 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id, } } - MSC_LOG_RX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - NULL, - 0, - MSC_AS_TIME_FMT" downlinkNASTransport gNB_ue_ngap_id %u amf_ue_ngap_id %u", - assoc_id, - amf_ue_ngap_id); - NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_DownlinkNASTransport_IEs_t, ie, container, NGAP_ProtocolIE_ID_id_NAS_PDU, true); /* Forward the NAS PDU to NR-RRC */ @@ -532,15 +506,6 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_ return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" uplinkNASTransport initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -571,10 +536,6 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance, /* The context for this gNB ue ngap id doesn't exist in the map of gNB UEs */ NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: %08x\n", ngap_nas_non_delivery_ind->gNB_ue_ngap_id); - MSC_LOG_EVENT( - MSC_NGAP_GNB, - MSC_AS_TIME_FMT" Sent of NAS_NON_DELIVERY_IND to AMF failed, no context for gNB_ue_ngap_id %08x", - ngap_nas_non_delivery_ind->gNB_ue_ngap_id); return -1; } @@ -621,21 +582,9 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance, if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) { NGAP_ERROR("Failed to encode NAS NON delivery indication\n"); /* Encode procedure has failed... */ - MSC_LOG_EVENT( - MSC_NGAP_GNB, - MSC_AS_TIME_FMT" Sent of NAS_NON_DELIVERY_IND to AMF failed (encoding)"); return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" NASNonDeliveryIndication initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %lu", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -868,15 +817,6 @@ int ngap_gNB_initial_ctxt_resp( return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" InitialContextSetup successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - initial_ctxt_resp_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ LOG_I(NR_RRC,"Send message to sctp: NGAP_InitialContextSetupResponse\n"); ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, @@ -961,15 +901,6 @@ int ngap_gNB_ue_capabilities(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" UECapabilityInfoIndication initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_cap_info_ind_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -1179,15 +1110,6 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" PduSession Setup successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - pdusession_setup_resp_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -1353,15 +1275,6 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Modify successful Outcome gNB_ue_ngap_id %u amf_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - pdusession_modify_resp_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -1464,15 +1377,6 @@ int ngap_gNB_pdusession_release_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Release successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %lu", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - pdusession_release_resp_p->gNB_ue_ngap_id, - (uint64_t)ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, diff --git a/openair3/S1AP/s1ap_eNB.c b/openair3/S1AP/s1ap_eNB.c index e528c9e53e..5f30386bb3 100644 --- a/openair3/S1AP/s1ap_eNB.c +++ b/openair3/S1AP/s1ap_eNB.c @@ -56,7 +56,6 @@ #include "s1ap_eNB_itti_messaging.h" #include "s1ap_eNB_ue_context.h" // test, to be removed -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -507,7 +506,6 @@ void s1ap_eNB_init(void) { S1AP_DEBUG("Starting S1AP layer\n"); s1ap_eNB_prepare_internal_data(); itti_mark_task_ready(TASK_S1AP); - MSC_START_USE(); } void *s1ap_eNB_process_itti_msg(void *notUsed) { diff --git a/openair3/S1AP/s1ap_eNB_context_management_procedures.c b/openair3/S1AP/s1ap_eNB_context_management_procedures.c index 374da7272f..6255abb14d 100644 --- a/openair3/S1AP/s1ap_eNB_context_management_procedures.c +++ b/openair3/S1AP/s1ap_eNB_context_management_procedures.c @@ -47,7 +47,6 @@ #include "s1ap_eNB_nas_procedures.h" #include "s1ap_eNB_management_procedures.h" #include "s1ap_eNB_context_management_procedures.h" -#include "msc.h" int s1ap_ue_context_release_complete(instance_t instance, @@ -111,16 +110,6 @@ int s1ap_ue_context_release_complete(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - buffer, - length, - MSC_AS_TIME_FMT" UEContextRelease successfulOutcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0, //MSC_AS_TIME_ARGS(ctxt_pP), - ue_release_complete_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); - /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -246,16 +235,6 @@ int s1ap_ue_context_release_req(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - buffer, - length, - MSC_AS_TIME_FMT" UEContextReleaseRequest initiatingMessage eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_release_req_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); - /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, diff --git a/openair3/S1AP/s1ap_eNB_handlers.c b/openair3/S1AP/s1ap_eNB_handlers.c index 9ee3287b94..b3b38e7017 100644 --- a/openair3/S1AP/s1ap_eNB_handlers.c +++ b/openair3/S1AP/s1ap_eNB_handlers.c @@ -51,7 +51,6 @@ #include "assertions.h" #include "conversions.h" -#include "msc.h" static int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id, @@ -1025,14 +1024,6 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id, case S1AP_UE_S1AP_IDs_PR_uE_S1AP_ID_pair: enb_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.uE_S1AP_ID_pair.eNB_UE_S1AP_ID; mme_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID; - MSC_LOG_RX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - NULL,0, - "0 UEContextRelease/%s eNB_ue_s1ap_id "S1AP_UE_ID_FMT" mme_ue_s1ap_id "S1AP_UE_ID_FMT" len %u", - s1ap_direction2String(pdu->present - 1), - enb_ue_s1ap_id, - mme_ue_s1ap_id); if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance, enb_ue_s1ap_id)) == NULL) { @@ -1042,12 +1033,6 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id, enb_ue_s1ap_id); return -1; } else { - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_RRC_ENB, - NULL,0, - "0 S1AP_UE_CONTEXT_RELEASE_COMMAND/%d eNB_ue_s1ap_id "S1AP_UE_ID_FMT" ", - enb_ue_s1ap_id); message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_UE_CONTEXT_RELEASE_COMMAND); if (ue_desc_p->mme_ue_s1ap_id == 0) { // case of Detach Request and switch off from RRC_IDLE mode diff --git a/openair3/S1AP/s1ap_eNB_nas_procedures.c b/openair3/S1AP/s1ap_eNB_nas_procedures.c index b55bc06e11..0b56d31211 100644 --- a/openair3/S1AP/s1ap_eNB_nas_procedures.c +++ b/openair3/S1AP/s1ap_eNB_nas_procedures.c @@ -46,7 +46,6 @@ #include "s1ap_eNB_ue_context.h" #include "s1ap_eNB_nas_procedures.h" #include "s1ap_eNB_management_procedures.h" -#include "msc.h" //------------------------------------------------------------------------------ int s1ap_eNB_handle_nas_first_req( @@ -310,14 +309,6 @@ int s1ap_eNB_handle_nas_first_req( } ue_desc_p->tx_stream = mme_desc_p->nextstream; - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" initialUEMessage initiatingMessage eNB_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_desc_p->eNB_ue_s1ap_id); /* Send encoded message over sctp */ s1ap_eNB_itti_send_sctp_data_req(instance_p->instance, mme_desc_p->assoc_id, buffer, length, ue_desc_p->tx_stream); @@ -374,14 +365,6 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id, if ((ue_desc_p = s1ap_eNB_get_ue_context(s1ap_eNB_instance, enb_ue_s1ap_id)) == NULL) { - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - NULL, - 0, - MSC_AS_TIME_FMT" downlinkNASTransport eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - enb_ue_s1ap_id, - mme_ue_s1ap_id); S1AP_ERROR("[SCTP %d] Received NAS downlink message for non existing UE context eNB_UE_S1AP_ID: 0x%lx\n", assoc_id, enb_ue_s1ap_id); @@ -413,15 +396,6 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id, } } - MSC_LOG_RX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - NULL, - 0, - MSC_AS_TIME_FMT" downlinkNASTransport eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - assoc_id, - mme_ue_s1ap_id); - S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container, S1AP_ProtocolIE_ID_id_NAS_PDU, true); if(ie == NULL) @@ -536,15 +510,6 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_ return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" uplinkNASTransport initiatingMessage eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -574,10 +539,6 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance, /* The context for this eNB ue s1ap id doesn't exist in the map of eNB UEs */ S1AP_WARN("Failed to find ue context associated with eNB ue s1ap id: %06x\n", s1ap_nas_non_delivery_ind->eNB_ue_s1ap_id); - MSC_LOG_EVENT( - MSC_S1AP_ENB, - MSC_AS_TIME_FMT" Sent of NAS_NON_DELIVERY_IND to MME failed, no context for eNB_ue_s1ap_id %06x", - s1ap_nas_non_delivery_ind->eNB_ue_s1ap_id); return -1; } @@ -623,21 +584,9 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance, if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) { S1AP_ERROR("Failed to encode NAS NON delivery indication\n"); /* Encode procedure has failed... */ - MSC_LOG_EVENT( - MSC_S1AP_ENB, - MSC_AS_TIME_FMT" Sent of NAS_NON_DELIVERY_IND to MME failed (encoding)"); return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" NASNonDeliveryIndication initiatingMessage eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -802,15 +751,6 @@ int s1ap_eNB_initial_ctxt_resp( return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" InitialContextSetup successfulOutcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - initial_ctxt_resp_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -891,15 +831,6 @@ int s1ap_eNB_ue_capabilities(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" UECapabilityInfoIndication initiatingMessage eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_cap_info_ind_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -1075,15 +1006,6 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Setup successfulOutcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - e_rab_setup_resp_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -1238,15 +1160,6 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Modify successful Outcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - e_rab_modify_resp_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -1378,15 +1291,6 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Release successfulOutcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - e_rab_release_resp_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -1615,16 +1519,6 @@ int s1ap_eNB_path_switch_req(instance_t instance, ue_context_p->tx_stream = mme_desc_p->nextstream; - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Setup successfulOutcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->eNB_ue_s1ap_id, - path_switch_req_p->mme_ue_s1ap_id); - /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, mme_desc_p->assoc_id, buffer, diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index 8d0166f805..ab49125856 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -48,7 +48,6 @@ #include "sctp_default_values.h" #include "sctp_common.h" #include "sctp_eNB_itti_messaging.h" -#include "msc.h" /* Used to format an uint32_t containing an ipv4 address */ #define IPV4_ADDR "%u.%u.%u.%u" @@ -1097,8 +1096,6 @@ void sctp_eNB_init(void) STAILQ_INIT(&sctp_cnx_list); itti_mark_task_ready(TASK_SCTP); - MSC_START_USE(); - } //------------------------------------------------------------------------------ diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index c4674e8901..fe132fd2f5 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -44,7 +44,6 @@ #include "s1ap_common.h" #include "play_scenario_s1ap_eNB_defs.h" #include "play_scenario.h" -#include "msc.h" //------------------------------------------------------------------------------ s1ap_eNB_internal_data_t s1ap_eNB_internal_data; RB_GENERATE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry, et_s1ap_eNB_compare_assoc_id); @@ -1084,7 +1083,6 @@ void *et_s1ap_eNB_task(void *arg) et_s1ap_eNB_prepare_internal_data(); itti_mark_task_ready(TASK_S1AP); - MSC_START_USE(); while (1) { itti_receive_msg(TASK_S1AP, &received_msg); diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index bc7ca6afbd..40654fc771 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -49,7 +49,6 @@ #include "s1ap_common.h" #include "play_scenario_s1ap_eNB_defs.h" #include "play_scenario.h" -#include "msc.h" //------------------------------------------------------------------------------ extern et_scenario_t *g_scenario; extern uint32_t g_constraints; diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c index 8b9fc77bb1..470d6a7942 100644 --- a/openair3/UDP/udp_eNB_task.c +++ b/openair3/UDP/udp_eNB_task.c @@ -44,7 +44,6 @@ #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" -#include "msc.h" #define IPV4_ADDR "%u.%u.%u.%u" @@ -309,7 +308,6 @@ void *udp_eNB_task(void *args_p) udp_enb_init(); itti_mark_task_ready(TASK_UDP); - MSC_START_USE(); while(1) { itti_receive_msg(TASK_UDP, &received_message_p); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 8ad610f1af..15b4319260 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -48,7 +48,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" -#include "msc.h" #include "PHY/defs_common.h" #include "PHY/types.h" #include "PHY/INIT/phy_init.h" diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 85e493f194..3420182bfe 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -34,13 +34,9 @@ #define _GNU_SOURCE /* See feature_test_macros(7) */ #include -#include - - #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" -#include "msc.h" #include "PHY/types.h" @@ -555,13 +551,7 @@ int main ( int argc, char **argv ) cpuf=get_cpu_freq_GHz(); printf("ITTI init, useMME: %i\n",EPC_MODE_ENABLED); itti_init(TASK_MAX, tasks_info); - // allows to forward in wireshark L2 protocol for decoding - // initialize mscgen log after ITTI - if (get_softmodem_params()->start_msc) { - load_module_shlib("msc",NULL,0,&msc_interface); - } - MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); init_opt(); // to make a graceful exit when ctrl-c is pressed set_softmodem_sighandler(); diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index cf35a13fe9..ba024f75d2 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -23,7 +23,6 @@ #include "../../ARCH/COMMON/common_lib.h" //#undef MALLOC #include "assertions.h" -#include "msc.h" #include "PHY/types.h" #include "PHY/defs_eNB.h" #include "PHY/defs_UE.h" diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 4395694bf4..2b39bd3f0f 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -37,7 +37,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" -#include "msc.h" #include "PHY/types.h" @@ -596,12 +595,6 @@ int main( int argc, char **argv ) { printf("ITTI init\n"); itti_init(TASK_MAX, tasks_info); - // initialize mscgen log after ITTI - if (get_softmodem_params()->start_msc) { - load_module_shlib("msc",NULL,0,&msc_interface); - } - - MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); init_opt(); ue_id_g = (node_number == 0) ? 0 : node_number-2; //ue_id_g = 0, 1, ..., if(node_number == 0) diff --git a/targets/RT/USER/ru_control.c b/targets/RT/USER/ru_control.c index 7280c78523..083b5f91ef 100644 --- a/targets/RT/USER/ru_control.c +++ b/targets/RT/USER/ru_control.c @@ -46,7 +46,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" -#include "msc.h" #include "PHY/types.h" diff --git a/targets/SCRIPTS/msc_gen.py b/targets/SCRIPTS/msc_gen.py deleted file mode 100755 index ed5d337fc2..0000000000 --- a/targets/SCRIPTS/msc_gen.py +++ /dev/null @@ -1,329 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# The aim of this script is to collect some traces from oai stack and generate a sequence diagram image (png or jpeg). -# -# It is supposed that a protocol name (MSC_NEW_STR) starts with...its name (RRC, MAC, NAS, S1AP, etc) then is followed by an underscore and whatever (RRC_UE, RRC_eNB) -# Like this it is possible to distinguish between PDUS, SDUs or other messages only by reading source ans destination - -import sys -import subprocess -import re -import socket -import datetime -from datetime import date -import os, errno -import argparse - - - - -parser = argparse.ArgumentParser() -parser.add_argument("--diag_rlc_um", "-u", type=str,help="Try to find RLC protocol diagnostics", default="no") -parser.add_argument("--dir", "-d", type=str,help="Directory where msc logs can be found", default="/tmp") -parser.add_argument("--profile", "-p", type=str,help="E_UTRAN, EPC", default="EPC") -parser.add_argument("--no_message", "-M", type=str,help="Trace PDUs, not messages, SDUs", default="no") -parser.add_argument("--no_pdu", "-P", type=str,help="Trace messages, SDUs, not PDUs", default="no") -parser.add_argument("--no_event", "-E", type=str,help="Do not trace events", default="no") -args = parser.parse_args() - -MSCGEN_OUTPUT_TYPE = "png" -MAX_MESSAGES_PER_PAGE = 36 - -MSC_NEW_STR = '[PROTO]' -MSC_MSG_STR = '[MESSAGE]' -MSC_BOX_STR = '[EVENT]' - - -# This list is filled as follow : g_proto_names[module_id_int] = (proto_name), example RRC_UE -g_proto_names = [] -# This list is filled as follow : g_proto_names[module_id_int] = (basename proto_name) example: RRC -g_proto_types = [] - - - -# list of messages -g_messages = {} - - -# Display color of messages of sending entities -g_display_color = ['\"teal\"', # To check in msc.h: MSC_NAS_UE - '\"red\"', # To check in msc.h: MSC_RRC_UE - '\"red\"', # To check in msc.h: MSC_NAS_UE - '\"red\"', # To check in msc.h: MSC_PDCP_UE - '\"red\"', # To check in msc.h: MSC_RLC_UE - '\"red\"', # To check in msc.h: MSC_MAC_UE - '\"red\"', # To check in msc.h: MSC_PHY_UE - '\"indigo\"', # To check in msc.h: MSC_PHY_ENB - '\"indigo\"', # To check in msc.h: MSC_MAC_ENB - '\"indigo\"', # To check in msc.h: MSC_RLC_ENB - '\"indigo\"', # To check in msc.h: MSC_PDCP_ENB - '\"orange\"', # To check in msc.h: MSC_RRC_ENB - '\"black\"', # To check in msc.h: MSC_IP_ENB - '\"black\"', # To check in msc.h: MSC_S1AP_ENB - '\"black\"', # To check in msc.h: MSC_GTPU_ENB - '\"black\"', # To check in msc.h: MSC_GTPU_SGW - '\"black\"', # To check in msc.h: MSC_S1AP_MME - '\"black\"', # To check in msc.h: MSC_MMEAPP_MME - '\"black\"', # To check in msc.h: MSC_NAS_MME - '\"black\"', # To check in msc.h: MSC_NAS_EMM_MME - '\"black\"', # To check in msc.h: MSC_NAS_ESM_MME - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"'] - - -# helper for diagnostic of RLC -g_diag_rlc_sn = {} - -g_sequence_generator = 0 - - -g_filenames = [] -if "E_UTRAN" == args.profile.strip(): - g_filenames = [ - args.dir+'/openair.msc.0.log', - args.dir+'/openair.msc.1.log'] -elif "EPC" == args.profile.strip(): - g_filenames = [ - args.dir+'/openair.msc.2.log', - args.dir+'/openair.msc.3.log', - args.dir+'/openair.msc.4.log'] - -def sequence_number_generator(): - global g_sequence_generator - l_seq = g_sequence_generator - g_sequence_generator = g_sequence_generator + 1 - return l_seq - -def file_is_empty(fpath): - return False if os.path.isfile(fpath) and os.path.getsize(fpath) > 0 else True - -def parse_oai_log_files(): - global g_entities_dic - global g_entities - global g_messages - global g_final_display_order_list - #open TXT file that contain OAI filtered traces for mscgen - - # we may insert diagnostic events - event_id_offset = 0 - for filename in g_filenames: - if file_is_empty(filename): - continue - try: - fhandle = open(filename, 'r') - fcontent = fhandle.read() - fhandle.close() - - # split file content in lines - lines = fcontent.splitlines() - for line in lines: - print ("INPUT LINE: %s " % line) - if line.strip() != "" and not line.strip().startswith('#'): - partition = line.split(' ',3) - event_id = int(partition[0]) + event_id_offset - event_type = partition[1] - entity_id = int(partition[2]) - if MSC_NEW_STR == event_type: - entity_name = partition[3] - if len(g_proto_names) <= entity_id: - for i in range(len(g_proto_names),(entity_id +1)): - g_proto_names.append("NotDeclared") - g_proto_types.append("NotDeclared") - g_proto_names[entity_id] = entity_name - partition_name1 = entity_name.split('_',1); - partition_name2 = partition_name1[0].split('-',1); - partition_name3 = partition_name2[0].split(); - g_proto_types[entity_id] = partition_name3 - print ("entity name %s , entity type %s" % (g_proto_names[entity_id],g_proto_types[entity_id]) ) - # if line is a trace of a message between 2 protocol entities or layers - elif MSC_MSG_STR == event_type: - #print ("partition[3]:%s" % partition[3]) - sub_partition = partition[3].split(' ',4) - arrow = sub_partition[0] - entity2_id = int(sub_partition[1]) - mac = int(sub_partition[2]) - time = sub_partition[3] - message = sub_partition[4] - Message = {} - Message['mac'] = mac - Message['time'] = time - Message['message'] = message - Message['line_color'] = g_display_color[entity_id] - Message['text_color'] = g_display_color[entity_id] - if arrow == '<-': - if "yes" == args.diag_rlc_um.strip() and "DATA SN " in message and "RB UM " in message: - rlc_key = re.match(r"[^[]*\[([^]]*)\]", message).groups()[0] - sn_info = message.partition("SN")[2] - if sn_info.strip() != "": - sn_str = sn_info.strip().partition(" ")[0] - sn = int(sn_str) - if rlc_key in g_diag_rlc_sn: - previous_sn = g_diag_rlc_sn[rlc_key] - if (previous_sn + 1) % 1024 != sn: - print ("DIAG missing SN: %s " % line) - MessageDiag = {} - MessageDiag['type'] = "box" - MessageDiag['tx'] = entity_id - MessageDiag['rx'] = entity_id - MessageDiag['discarded'] = False - MessageDiag['time'] = time - MessageDiag['message'] = "Missing SN "+ sn_str + " detected" - MessageDiag['line_color'] = '\"red\"' - MessageDiag['text_color'] = '\"red\"' - g_messages[event_id + event_id_offset] = MessageDiag - event_id_offset = event_id_offset + 1 - g_diag_rlc_sn[rlc_key] = int(sn) - Message['type'] = "rx" - Message['tx'] = entity2_id - Message['rx'] = entity_id - Message['discarded'] = False - g_messages[event_id + event_id_offset] = Message - - elif arrow == '->': - Message['type'] = "tx" - Message['tx'] = entity_id - Message['rx'] = entity2_id - Message['discarded'] = False - g_messages[event_id + event_id_offset] = Message - elif arrow == 'x-': - Message['type'] = "rx" - Message['tx'] = entity2_id - Message['rx'] = entity_id - Message['discarded'] = True - g_messages[event_id + event_id_offset] = Message - elif arrow == '-x': - Message['type'] = "tx" - Message['tx'] = entity_id - Message['rx'] = entity2_id - Message['discarded'] = True - g_messages[event_id + event_id_offset] = Message - - elif MSC_BOX_STR == event_type: - sub_partition = partition[3].split(' ',1) - time = sub_partition[0] - message = sub_partition[1] - Message = {} - Message['type'] = "box" - Message['tx'] = entity_id - Message['rx'] = entity_id - Message['discarded'] = False - Message['time'] = time - Message['message'] = message - Message['line_color'] = g_display_color[entity_id] - Message['text_color'] = g_display_color[entity_id] - g_messages[event_id + event_id_offset] = Message - - except IOError, e: - print ("File %s INPUT LINE: %s " % (filename, line)) - print 'err message' - - #print("------------------------------------") - #print (" %s " % ( g_messages ) ) - -# for event_id_int in sorted(g_messages.iterkeys()): - - - -def msc_chart_write_header(fileP): - global g_final_display_order_list - fileP.write("msc {\n") - fileP.write("width = \"2048\";\n") - - entity_line_list_str = '' - #print (" %s " % ( g_proto_names ) ) - for entity in g_proto_names: - if entity != 'NotDeclared': - entity_line_list_str = entity_line_list_str + ' ' + entity + ',' - - entity_line_list_str = entity_line_list_str.rstrip().strip(',') - fileP.write(" %s;\n" % (entity_line_list_str)) - - -def msc_chart_write_footer(fileP): - fileP.write("\n}\n") - -def msc_chart_generate(file_nameP): - global MSCGEN_OUTPUT_TYPE - print "Generating sequence diagram for ",file_nameP - command_line = "mscgen -T " + MSCGEN_OUTPUT_TYPE + " -i " + file_nameP - fi,fo,fe=os.popen3(command_line) - for i in fe.readlines(): - print "error:",i - -def get_new_file_descriptor(): - global g_base_file_name - global g_page_index - l_file_name = g_base_file_name + str(g_page_index)+'.txt' - l_file = open(l_file_name, "wb") - print "Generating mscgen input file ",l_file_name; - return l_file - - -###### MAIN STAR HERE ################# -parse_oai_log_files() - -g_page_index = 0 -g_message_index = 0 -g_now = datetime.datetime.now() -g_now_formated = 'mscgen_' + args.profile.strip() + '_'+ g_now.strftime("%Y-%m-%d_%H.%M.%S") -#g_currentdir = os.curdir -g_resultdir = os.path.join(args.dir, g_now_formated) -os.mkdir(g_resultdir) -os.chdir(g_resultdir) - -g_base_file_name = args.profile.strip() + '_mscgen_page_' - -g_file = get_new_file_descriptor() -msc_chart_write_header(g_file) - -for event_id_int in sorted(g_messages.iterkeys()): - message = g_messages[event_id_int] - if 'tx' in message['type']: - if "yes" == args.no_message.strip(): - if g_proto_types[message['tx']] != g_proto_types[message['rx']]: - continue - if "yes" == args.no_pdu.strip(): - if g_proto_types[message['tx']] == g_proto_types[message['rx']]: - continue - g_file.write(" %s=>%s [ label = \"(%d|%s) %s\", linecolour=%s , textcolour=%s ] ;\n" % (g_proto_names[message['tx']], g_proto_names[message['rx']], event_id_int, message['time'], message['message'], message['line_color'], message['text_color'])) - - elif 'rx' in message['type']: - if "yes" == args.no_message.strip(): - if g_proto_types[message['tx']] != g_proto_types[message['rx']]: - continue - if "yes" == args.no_pdu.strip(): - if g_proto_types[message['tx']] == g_proto_types[message['rx']]: - continue - g_file.write(" %s<=%s [ label = \"(%d|%s) %s\", linecolour=%s , textcolour=%s ] ;\n" % (g_proto_names[message['rx']], g_proto_names[message['tx']], event_id_int, message['time'], message['message'], message['line_color'], message['text_color'])) - - elif 'box' in message['type']: - if "yes" == args.no_event.strip(): - continue - g_file.write(" %s note %s [ label = \"%s\", textcolour=%s ] ;\n" % (g_proto_names[message['tx']], g_proto_names[message['rx']], message['message'], message['text_color'])) - - g_message_index = g_message_index + 1 - - if ((g_message_index % MAX_MESSAGES_PER_PAGE) == 0): - msc_chart_write_footer(g_file) - g_file.close() - msc_chart_generate(g_file.name) - g_page_index = g_page_index + 1 - - g_file = get_new_file_descriptor() - msc_chart_write_header(g_file) - - -msc_chart_write_footer(g_file) -g_file.close() -msc_chart_generate(g_file.name) From a1520aacd18bd37d07e66de2c5c51ce7bc6841a6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 26 Jan 2022 19:17:24 +0100 Subject: [PATCH 102/196] Remove useless MSCGEN macro --- openair3/NAS/TEST/AS_SIMULATOR/as_data.h | 8 ---- openair3/NAS/TEST/AS_SIMULATOR/as_process.c | 42 +++++++++---------- openair3/NAS/TEST/AS_SIMULATOR/as_simulator.c | 6 +-- 3 files changed, 24 insertions(+), 32 deletions(-) diff --git a/openair3/NAS/TEST/AS_SIMULATOR/as_data.h b/openair3/NAS/TEST/AS_SIMULATOR/as_data.h index 24c6473730..9888db69ac 100644 --- a/openair3/NAS/TEST/AS_SIMULATOR/as_data.h +++ b/openair3/NAS/TEST/AS_SIMULATOR/as_data.h @@ -47,14 +47,6 @@ Description Defines constants and functions used by the AS simulator /********************* G L O B A L C O N S T A N T S *******************/ /****************************************************************************/ -/* - * Constansts used for MSCGEN (Message Sequence Chart Generator) - */ -#define MSCGEN(args...) fprintf(stderr, ##args); -#define _ue_id "UE" -#define _mme_id "MME" -#define _as_id "AS" - /****************************************************************************/ /************************ G L O B A L T Y P E S ************************/ /****************************************************************************/ diff --git a/openair3/NAS/TEST/AS_SIMULATOR/as_process.c b/openair3/NAS/TEST/AS_SIMULATOR/as_process.c index 21e484e40a..9a9b4da5bb 100644 --- a/openair3/NAS/TEST/AS_SIMULATOR/as_process.c +++ b/openair3/NAS/TEST/AS_SIMULATOR/as_process.c @@ -102,7 +102,7 @@ int process_cell_info_req(int msg_id, const cell_info_req_t* req, index += _process_plmn(_mscgen_buffer, &req->plmnID, MSCGEN_BUFFER_SIZE); snprintf(_mscgen_buffer + index, MSCGEN_BUFFER_SIZE - index, ", rat = 0x%x%c", req->rat, '\0'); - MSCGEN("[MSC_MSG][%s][%s][--- Cell Information Request (0x%.4x)\\n%s --->][%s]\n", + printf("[%s][%s][--- Cell Information Request (0x%.4x)\\n%s --->][%s]\n", getTime(), _ue_id, msg_id, _mscgen_buffer, _as_id); /* Setup cell information confirm message */ @@ -116,7 +116,7 @@ int process_cell_info_req(int msg_id, const cell_info_req_t* req, snprintf(_mscgen_buffer, MSCGEN_BUFFER_SIZE, "tac = 0x%.4x, cellID = 0x%.8x, rat = 0x%x, RSRQ = %u, RSRP = %u%c", cnf->tac, cnf->cellID, cnf->rat, cnf->rsrq, cnf->rsrp, '\0'); - MSCGEN("[MSC_MSG][%s][%s][--- Cell Information Confirm (0x%.4x)\\n%s --->][%s]\n", + printf("[%s][%s][--- Cell Information Confirm (0x%.4x)\\n%s --->][%s]\n", getTime(), _as_id, AS_CELL_INFO_CNF, _mscgen_buffer, _ue_id); printf("INFO\t: %s - Send cell informtion confirm\n", __FUNCTION__); @@ -146,13 +146,13 @@ int process_nas_establish_req(int msg_id, const nas_establish_req_t* req, "cause = %s, type = %s, tmsi = {MMEcode = %d, m_tmsi = %u}%c", rrcCause(req->cause), rrcType(req->type), req->s_tmsi.MMEcode, req->s_tmsi.m_tmsi, '\0'); - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment Request " + printf("[%s][%s][--- NAS Signalling Connection Establishment Request " "(0x%.4x)\\n%s --->][%s]\n", getTime(), _ue_id, msg_id, _mscgen_buffer, _as_id); _process_dump(_mscgen_buffer, MSCGEN_BUFFER_SIZE, (char*)req->initialNasMsg.data, req->initialNasMsg.length); - MSCGEN("[MSC_RBOX][%s][%s][%s]\n", _ue_id, _as_id, _mscgen_buffer); + printf("[%s][%s][%s]\n", _ue_id, _as_id, _mscgen_buffer); /* Process initial NAS message */ bytes = nas_process(_mscgen_buffer, MSCGEN_BUFFER_SIZE, @@ -160,7 +160,7 @@ int process_nas_establish_req(int msg_id, const nas_establish_req_t* req, req->initialNasMsg.length); if (bytes < 0) { - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment " + printf("[%s][%s][--- NAS Signalling Connection Establishment " "Indication (0x%.4x)\\ntac = 0x%.4x\\n%s ---x][%s]\n", getTime(), _as_id, AS_NAS_ESTABLISH_IND, ind->tac, _mscgen_buffer, _mme_id); /* Setup NAS signalling connection establishment confirmation message */ @@ -190,7 +190,7 @@ int process_nas_establish_req(int msg_id, const nas_establish_req_t* req, // Transmission failure of Attach Request message //cnf->errCode = AS_FAILURE; // UE DEBUG - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment Indication " + printf("[%s][%s][--- NAS Signalling Connection Establishment Indication " "(0x%.4x)\\nUEid = %u, tac = 0x%.4x\\n%s --->][%s]\n", getTime(), _as_id, AS_NAS_ESTABLISH_IND, ind->UEid, ind->tac, _mscgen_buffer, _mme_id); @@ -224,13 +224,13 @@ int process_ul_info_transfer_req(int msg_id, const ul_info_transfer_req_t* req, snprintf(_mscgen_buffer, MSCGEN_BUFFER_SIZE, "tmsi = {MMEcode = %d, m_tmsi = %u}%c", req->s_tmsi.MMEcode, req->s_tmsi.m_tmsi, '\0'); - MSCGEN("[MSC_MSG][%s][%s][--- Uplink Information Request " + printf("[%s][%s][--- Uplink Information Request " "(0x%.4x)\\n%s --->][%s]\n", getTime(), _ue_id, msg_id, _mscgen_buffer, _as_id); _process_dump(_mscgen_buffer, MSCGEN_BUFFER_SIZE, (char*)req->nasMsg.data, req->nasMsg.length); - MSCGEN("[MSC_RBOX][%s][%s][%s]\n", _ue_id, _as_id, _mscgen_buffer); + printf("[%s][%s][%s]\n", _ue_id, _as_id, _mscgen_buffer); /* Process NAS message */ bytes = nas_process(_mscgen_buffer, MSCGEN_BUFFER_SIZE, @@ -238,7 +238,7 @@ int process_ul_info_transfer_req(int msg_id, const ul_info_transfer_req_t* req, req->nasMsg.length); if (bytes < 0) { - MSCGEN("[MSC_MSG][%s][%s][--- Uplink Information Indication " + printf("[%s][%s][--- Uplink Information Indication " "(0x%.4x)\\n%s ---x][%s]\n", getTime(), _as_id, AS_UL_INFO_TRANSFER_IND, _mscgen_buffer, _mme_id); /* Setup uplink information confirmation message */ @@ -279,7 +279,7 @@ int process_ul_info_transfer_req(int msg_id, const ul_info_transfer_req_t* req, // cnf->errCode = AS_FAILURE; // UE DEBUG //} - MSCGEN("[MSC_MSG][%s][%s][--- Uplink Information Indication " + printf("[%s][%s][--- Uplink Information Indication " "(0x%.4x), UEid = %u\\n%s --->][%s]\n", getTime(), _as_id, AS_UL_INFO_TRANSFER_IND, ind->UEid, _mscgen_buffer, _mme_id); @@ -297,7 +297,7 @@ int process_nas_release_req(int msg_id, const nas_release_req_t* req) printf("INFO\t: %s - Process NAS signalling connection release request\n", __FUNCTION__); - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Release Request " + printf("[%s][%s][--- NAS Signalling Release Request " "(0x%.4x), tmsi = {MMEcode = %d, m_tmsi = %u}, " "cause = %s (%u) --->][%s]\n", getTime(), _ue_id, msg_id, req->s_tmsi.MMEcode, req->s_tmsi.m_tmsi, @@ -332,14 +332,14 @@ int process_nas_establish_rsp(int msg_id, const nas_establish_rsp_t* rsp, //rsp->nasMsg.data[21] = 0xc4; // MME DEBUG (Send ESM status) //} - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment " + printf("[%s][%s][--- NAS Signalling Connection Establishment " "Response (0x%.4x)\\nerrCode = %s, UEid = %u --->][%s]\n", getTime(), _mme_id, msg_id, rrcErrCode(rsp->errCode), rsp->UEid, _as_id); _process_dump(_mscgen_buffer, MSCGEN_BUFFER_SIZE, (char*)rsp->nasMsg.data, rsp->nasMsg.length); - MSCGEN("[MSC_RBOX][%s][%s][%s]\n", _mme_id, _as_id, _mscgen_buffer); + printf("[%s][%s][%s]\n", _mme_id, _as_id, _mscgen_buffer); // Discard Attach Accept message //return (0); // UE DEBUG @@ -350,7 +350,7 @@ int process_nas_establish_rsp(int msg_id, const nas_establish_rsp_t* rsp, rsp->nasMsg.length); if (bytes < 0) { - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment " + printf("[%s][%s][--- NAS Signalling Connection Establishment " "Confirm (0x%.4x)\\n%s ---x][%s]\n", getTime(), _as_id, AS_NAS_ESTABLISH_CNF, _mscgen_buffer, _ue_id); return (0); @@ -369,7 +369,7 @@ int process_nas_establish_rsp(int msg_id, const nas_establish_rsp_t* rsp, } } - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment " + printf("[%s][%s][--- NAS Signalling Connection Establishment " "Confirm (0x%.4x)\\n%s --->][%s]\n", getTime(), _as_id, AS_NAS_ESTABLISH_CNF, _mscgen_buffer, _ue_id); @@ -401,13 +401,13 @@ int process_dl_info_transfer_req(int msg_id, const dl_info_transfer_req_t* req, // req->nasMsg.data[6] = 0x02; // UE DEBUG //} - MSCGEN("[MSC_MSG][%s][%s][--- Downlink Information Request " + printf("[%s][%s][--- Downlink Information Request " "(0x%.4x), UEid = %u --->][%s]\n", getTime(), _mme_id, msg_id, req->UEid, _as_id); _process_dump(_mscgen_buffer, MSCGEN_BUFFER_SIZE, (char*)req->nasMsg.data, req->nasMsg.length); - MSCGEN("[MSC_RBOX][%s][%s][%s]\n", _mme_id, _as_id, _mscgen_buffer); + printf("[%s][%s][%s]\n", _mme_id, _as_id, _mscgen_buffer); /* Process NAS message */ bytes = nas_process(_mscgen_buffer, MSCGEN_BUFFER_SIZE, @@ -415,7 +415,7 @@ int process_dl_info_transfer_req(int msg_id, const dl_info_transfer_req_t* req, req->nasMsg.length); if (bytes < 0) { - MSCGEN("[MSC_MSG][%s][%s][--- Downlink Information Indication " + printf("[%s][%s][--- Downlink Information Indication " "(0x%.4x)\\n%s ---x][%s]\n", getTime(), _as_id, AS_DL_INFO_TRANSFER_IND, _mscgen_buffer, _ue_id); /* Setup downlink information confirmation message */ @@ -445,7 +445,7 @@ int process_dl_info_transfer_req(int msg_id, const dl_info_transfer_req_t* req, // return (0); // MME DEBUG //} - MSCGEN("[MSC_MSG][%s][%s][--- Downlink Information Indication " + printf("[%s][%s][--- Downlink Information Indication " "(0x%.4x)\\n%s --->][%s]\n", getTime(), _as_id, AS_DL_INFO_TRANSFER_IND, _mscgen_buffer, _ue_id); @@ -464,14 +464,14 @@ int process_nas_release_ind(int msg_id, const nas_release_req_t* req, printf("INFO\t: %s - Process NAS signalling connection release request\n", __FUNCTION__); - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Release Request " + printf("[%s][%s][--- NAS Signalling Connection Release Request " "(0x%.4x), UEid = %u, cause = %s (%u) --->][%s]\n", getTime(), _mme_id, msg_id, req->UEid, rrcReleaseCause(req->cause), req->cause, _as_id); /* Forward NAS release indication to the UE */ ind->cause = req->cause; - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Release Indication " + printf("[%s][%s][--- NAS Signalling Connection Release Indication " "(0x%.4x), cause = %s (%u) --->][%s]\n", getTime(), _as_id, msg_id, rrcReleaseCause(req->cause), ind->cause, _ue_id); diff --git a/openair3/NAS/TEST/AS_SIMULATOR/as_simulator.c b/openair3/NAS/TEST/AS_SIMULATOR/as_simulator.c index efe2c1af72..bbc37d18a3 100644 --- a/openair3/NAS/TEST/AS_SIMULATOR/as_simulator.c +++ b/openair3/NAS/TEST/AS_SIMULATOR/as_simulator.c @@ -193,7 +193,7 @@ int main (int argc, const char* argv[]) printf("INFO\t: %s - The RRC Simulator is now connected to %s/%s (%d)\n", __FUNCTION__, mhost, mport, socket_get_fd(_as_simulator_mme_sid)); - MSCGEN("[MSC_NEW][%s][AS=%s]\n", getTime(), _as_id); + printf("[%s][AS=%s]\n", getTime(), _as_id); /* * Set up signal handler @@ -325,7 +325,7 @@ static void* _as_simulator_ue_mngr(void* args) printf("INFO\t: %s - UE connection manager started\n", __FUNCTION__); - MSCGEN("[MSC_NEW][%s][NAS-UE=%s]\n", getTime(), _ue_id); + printf("[%s][NAS-UE=%s]\n", getTime(), _ue_id); /* Receiving loop */ while (_as_simulator_ue_is_running) { @@ -407,7 +407,7 @@ static void* _as_simulator_mme_mngr(void* args) printf("INFO\t: %s - MME connection manager started\n", __FUNCTION__); - MSCGEN("[MSC_NEW][%s][NAS-MME=%s]\n", getTime(), _mme_id); + printf("[%s][NAS-MME=%s]\n", getTime(), _mme_id); /* Receiving loop */ while (_as_simulator_mme_is_running) { From 8c5059214e7b3305d8b4725532f92b0c93bb2c01 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 26 Jan 2022 19:19:18 +0100 Subject: [PATCH 103/196] Remove log verbosity level from all conf files: it is not used --- ci-scripts/conf_files/benetel-4g.conf | 7 ----- ci-scripts/conf_files/benetel-5g.conf | 7 ----- .../conf_files/cu.band7.tm1.100PRB.conf | 5 ---- ci-scripts/conf_files/cu.band7.tm1.25PRB.conf | 5 ---- ci-scripts/conf_files/cu.band7.tm1.50PRB.conf | 5 ---- .../du.band7.tm1.100PRB.usrpb210.conf | 6 ----- .../du.band7.tm1.25PRB.usrpb210.conf | 6 ----- .../du.band7.tm1.50PRB.usrpb210.conf | 6 ----- .../enb.band13.tm1.25PRB.usrpb210.conf | 7 ----- .../conf_files/enb.band13.tm1.50PRB.emtc.conf | 14 ---------- .../enb.band17.tm1.25PRB.usrpb210.conf | 7 ----- .../enb.band17.tm1.mbms.25PRB.usrpb210.conf | 7 ----- .../enb.band38.lte_2x2.100PRB.usrpn310.conf | 7 ----- ...nb.band38.lte_2x2_tm2.100PRB.usrpn310.conf | 7 ----- .../enb.band38.nsa_2x2.100PRB.usrpn310.conf | 7 ----- ...d40.tm1.100PRB.FairScheduler.usrpb210.conf | 7 ----- ...nd40.tm1.25PRB.FairScheduler.usrpb210.conf | 7 ----- ...nd40.tm1.50PRB.FairScheduler.usrpb210.conf | 7 ----- ...nd40.tm2.25PRB.FairScheduler.usrpb210.conf | 7 ----- .../enb.band7.tm1.100PRB.usrpb210.conf | 7 ----- .../enb.band7.tm1.25PRB.slave.usrpb210.conf | 7 ----- .../enb.band7.tm1.25PRB.usrpb210.conf | 7 ----- .../enb.band7.tm1.50PRB.usrpb210.conf | 7 ----- .../enb.band7.tm1.fr1.25PRB.usrpb210.conf | 7 ----- .../enb.band7.tm2.25PRB.usrpb210.conf | 7 ----- .../enb.slave.band13.tm1.25PRB.usrpb210.conf | 7 ----- ...sci_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 8 ------ .../conf_files/episci/episci_nr-ue.nfapi.conf | 7 ----- .../episci/episci_nr-ue0.nfapi.conf | 7 ----- .../episci/episci_nr-ue1.nfapi.conf | 7 ----- .../episci/episci_nr-ue2.nfapi.conf | 7 ----- .../episci/episci_nr-ue3.nfapi.conf | 7 ----- .../episci/episci_rcc.band7.tm1.nfapi.conf | 7 ----- .../episci_rcc.band78.tm1.106PRB.nfapi.conf | 7 ----- .../conf_files/episci/episci_ue.nfapi.conf | 7 ----- ...oxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 8 ------ .../conf_files/episci/proxy_nr-ue.nfapi.conf | 7 ----- .../episci/proxy_rcc.band7.tm1.nfapi.conf | 7 ----- .../proxy_rcc.band78.tm1.106PRB.nfapi.conf | 7 ----- .../conf_files/episci/proxy_ue.nfapi.conf | 7 ----- ci-scripts/conf_files/gNB_SA_CU.conf | 9 ------- ci-scripts/conf_files/gNB_SA_DU.conf | 9 ------- .../gNB_SA_n78_106PRB.2x2_usrpn310.conf | 8 ------ .../gNB_SA_n78_133PRB.2x2_usrpn310.conf | 8 ------ .../gnb.band261.tm1.32PRB.usrpn300.conf | 7 ----- .../gnb.band66.tm1.106PRB.usrpn300.conf | 7 ----- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 7 ----- ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 8 ------ .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 8 ------ ...gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 8 ------ .../gnb.band78.tm1.106PRB.usrpn300.conf | 7 ----- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 7 ----- .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 7 ----- ci-scripts/conf_files/lte-fdd-basic-sim.conf | 7 ----- .../conf_files/lte-fdd-fembms-basic-sim.conf | 7 ----- .../conf_files/lte-fdd-mbms-basic-sim.conf | 7 ----- ci-scripts/conf_files/lte-tdd-basic-sim.conf | 7 ----- ci-scripts/conf_files/nr-ue.nfapi.conf | 7 ----- .../rcc.band38.tm1.50PRB.multi.rru.conf | 7 ----- ...d40.tm1.100PRB.FairScheduler.usrpb210.conf | 7 ----- ...nd40.tm1.25PRB.FairScheduler.usrpb210.conf | 7 ----- ...nd40.tm1.50PRB.FairScheduler.usrpb210.conf | 7 ----- ...cc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf | 7 ----- ...rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf | 7 ----- ...rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf | 7 ----- ...cc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf | 7 ----- .../rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf | 7 ----- .../conf_files/rcc.band7.tm1.nfapi.conf | 7 ----- .../conf_files/rru.band38.tm1.master.conf | 7 ----- .../conf_files/rru.band38.tm1.slave.conf | 7 ----- ci-scripts/conf_files/rru.fdd.band7.conf | 7 ----- ci-scripts/conf_files/rru.tdd.band40.conf | 7 ----- ci-scripts/conf_files/ue.nfapi.conf | 7 ----- .../enb.band38.tm1.usrpb210.tdd.10MHz.conf | 7 ----- .../enb.band38.tm1.usrpb210.tdd.20MHz.conf | 7 ----- .../enb.band38.tm1.usrpb210.tdd.5MHz.conf | 7 ----- .../enb.band7.tm1.usrpb210.fdd.10MHz.conf | 7 ----- .../enb.band7.tm1.usrpb210.fdd.20MHz.conf | 7 ----- .../enb.band7.tm1.usrpb210.fdd.5MHz.conf | 7 ----- .../v2/config/rcc.band7.tm1.if4p5.10MHz.conf | 7 ----- .../v2/config/rcc.band7.tm1.if4p5.20MHz.conf | 7 ----- .../v2/config/rcc.band7.tm1.if4p5.5MHz.conf | 7 ----- ...ru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf | 7 ----- ...ru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf | 7 ----- ...rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf | 7 ----- configuration/bladeRF/enb-band7-5mhz.conf | 14 ---------- doc/testing_gnb_w_cots_ue_resources/enb.conf | 14 ---------- doc/testing_gnb_w_cots_ue_resources/gnb.conf | 7 ----- executables/softmodem-common.h | 1 - .../enb.band7.tm1.usrpb210.epc.local.conf | 9 ------- .../TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf | 8 ------ .../CONF/enb.centos.memphis.conf | 8 ------ .../GENERIC-LTE-EPC/CONF/benetel-4g.conf | 7 ----- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 7 ----- .../PROJECTS/GENERIC-LTE-EPC/CONF/cu.lte.conf | 5 ---- .../CONF/du.lte.band7.10MHz.if4p5.conf | 6 ----- .../CONF/enb.band13.tm1.50PRB.emtc.conf | 25 ------------------ .../CONF/enb.band38.tm1.100PRB.usrpx310.conf | 7 ----- .../CONF/enb.band38.tm1.25PRB.iris030.conf | 7 ----- .../CONF/enb.band38.tm1.usrpx310.conf | 7 ----- .../CONF/enb.band42.tm1.25PRB.iris030.conf | 7 ----- .../CONF/enb.band7.master.conf | 7 ----- .../CONF/enb.band7.tm1.100PRB.usrpx310.conf | 7 ----- .../CONF/enb.band7.tm1.25PRB.iris030.conf | 7 ----- .../enb.band7.tm1.25PRB.usrpb210.replay.conf | 26 ------------------- .../enb.band7.tm1.50PRB.usrpb210-d2d.conf | 7 ----- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 7 ----- ...band7.tm1.50PRB.usrpb210_ue_expansion.conf | 7 ----- .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 7 ----- .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 7 ----- .../gnb.band78.106PRB.30kHz,usrpb2x0.conf | 7 ----- .../CONF/gnb.band78.106PRB.slave.conf | 7 ----- .../CONF/gnb.band78.slave.conf | 7 ----- .../gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 7 ----- .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 7 ----- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 7 ----- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 7 ----- .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 7 ----- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 7 ----- .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 7 ----- .../CONF/oaiL1.nfapi.usrpb210.conf | 7 ----- .../CONF/oaiL1.nfapi.usrpx300.conf | 7 ----- .../CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf | 7 ----- .../CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf | 7 ----- .../CONF/rcc.band7.tm1.50PRB.nfapi.conf | 7 ----- .../CONF/rcc.band7.tm1.if4p5.50PRB.conf | 7 ----- .../CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf | 7 ----- .../CONF/rcc.band78.tm1.106PRB.nfapi.conf | 7 ----- .../CONF/rcc_b38_if5_ENDC.conf | 7 ----- .../GENERIC-LTE-EPC/CONF/rru.oaisim.conf | 7 ----- .../GENERIC-LTE-EPC/CONF/rru.oaisim.tdd.conf | 7 ----- .../CONF/testing_eNB_band13.conf | 26 ------------------- .../GENERIC-LTE-EPC/CONF/testing_enb.conf | 26 ------------------- .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 7 ----- .../CONF/testing_gnb_24PRB.conf | 7 ----- .../CONF/testing_gnb_n310.conf | 7 ----- .../CONF/testing_gnb_nsa_n310.conf | 7 ----- .../PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf | 9 ------- .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 9 ------- ...b.band78.tm1.106PRB.usrpn300.gtp-itti.conf | 8 ------ .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 8 ------ ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 9 ------- .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 8 ------ ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 8 ------ 151 files changed, 1160 deletions(-) diff --git a/ci-scripts/conf_files/benetel-4g.conf b/ci-scripts/conf_files/benetel-4g.conf index 9423ebe56e..e2974a171d 100644 --- a/ci-scripts/conf_files/benetel-4g.conf +++ b/ci-scripts/conf_files/benetel-4g.conf @@ -269,17 +269,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 79b2f7f877..651fe459d9 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -262,18 +262,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf b/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf index e2c94b14ab..1102528cd3 100644 --- a/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf +++ b/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf @@ -201,15 +201,10 @@ eNBs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; pdcp_log_level = "info"; - pdcp_log_verbosity = "high"; rrc_log_level = "info"; - rrc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; gtp_log_level = "info"; - gtp_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf b/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf index 5b994ed29b..ec7620a724 100644 --- a/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf +++ b/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf @@ -201,15 +201,10 @@ eNBs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; pdcp_log_level = "info"; - pdcp_log_verbosity = "high"; rrc_log_level = "info"; - rrc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; gtp_log_level = "info"; - gtp_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf b/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf index 148c5a9903..7e64ad8039 100644 --- a/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf +++ b/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf @@ -201,15 +201,10 @@ eNBs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; pdcp_log_level = "info"; - pdcp_log_verbosity = "high"; rrc_log_level = "info"; - rrc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; gtp_log_level = "info"; - gtp_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf b/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf index a3ecffb9be..217c694055 100644 --- a/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf @@ -96,17 +96,11 @@ RUs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; hw_log_level = "info"; - hw_log_verbosity = "medium"; phy_log_level = "info"; - phy_log_verbosity = "medium"; mac_log_level = "info"; - mac_log_verbosity = "high"; rlc_log_level = "info"; - rlc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf index 1920992d70..61d4cff51b 100644 --- a/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf @@ -96,17 +96,11 @@ RUs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; hw_log_level = "info"; - hw_log_verbosity = "medium"; phy_log_level = "info"; - phy_log_verbosity = "medium"; mac_log_level = "info"; - mac_log_verbosity = "high"; rlc_log_level = "info"; - rlc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf index 5df8da05a3..4342e8f4b4 100644 --- a/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf @@ -96,17 +96,11 @@ RUs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; hw_log_level = "info"; - hw_log_verbosity = "medium"; phy_log_level = "info"; - phy_log_verbosity = "medium"; mac_log_level = "info"; - mac_log_verbosity = "high"; rlc_log_level = "info"; - rlc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf index e70ca78205..122654df26 100644 --- a/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf @@ -257,18 +257,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf b/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf index 400d1a6c9d..ae572f9e05 100644 --- a/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf +++ b/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf @@ -385,19 +385,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); @@ -457,17 +450,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf index bd2999b5d5..5a4be9f187 100644 --- a/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf @@ -260,18 +260,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf index 19ef6d0797..7ac056b75e 100644 --- a/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf @@ -404,18 +404,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index d2e91fb872..24c35dedbf 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -264,18 +264,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf index f116c3708d..4a16a64105 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf @@ -264,18 +264,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 6c8d5ba6f0..bccd37abe9 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -264,18 +264,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf index f34878c569..0633d233ef 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf index e2e482a7c7..4de8a3f759 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf index bfea139e92..df902faf8b 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf index 4e0025770b..0da4b1181a 100644 --- a/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf @@ -163,19 +163,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf index 1627d21e1a..bd7e19ca60 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf @@ -256,18 +256,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf index efa1fa64b8..fdd2304ba5 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf @@ -265,18 +265,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index 6fc8401236..5b05627700 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -263,18 +263,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf index 087ee37f01..44d22a8953 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf @@ -263,19 +263,12 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; @include "channelmod_rfsimu.conf" diff --git a/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf index 64bcb4b35f..38cd90cd44 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf @@ -264,18 +264,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf index 72754165d0..c8223d0c42 100644 --- a/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf @@ -258,17 +258,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf index da65aad775..609d76d720 100644 --- a/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf @@ -262,18 +262,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf index 01add06e3a..8114a530db 100644 --- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -306,20 +306,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf index f5563ecc02..22ffb4cd3d 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf index f5563ecc02..22ffb4cd3d 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf index 5df3ccf6cc..3d1c008f23 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf index b1ce5fee8d..73c3292809 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf index aea5104f1c..1f8f7306c6 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf index 4e596f81b5..81951e5219 100644 --- a/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf @@ -231,17 +231,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf index b64b88ddea..9b3f205a0f 100644 --- a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf @@ -248,18 +248,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/episci_ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_ue.nfapi.conf index 0170a46655..8f7c8ee68a 100644 --- a/ci-scripts/conf_files/episci/episci_ue.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf index ab0cf5f469..f86d4f98a8 100644 --- a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -307,20 +307,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf index 8411ed8fc6..b6c0e9b5a1 100644 --- a/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf +++ b/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf index d4c72d6c14..50ece56b23 100644 --- a/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf @@ -231,17 +231,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf index 0ef317d63e..3410104199 100644 --- a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf +++ b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf @@ -288,18 +288,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf b/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf index 3f227d573c..51c30fb42d 100644 --- a/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf +++ b/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; diff --git a/ci-scripts/conf_files/gNB_SA_CU.conf b/ci-scripts/conf_files/gNB_SA_CU.conf index d3cfbfc973..1e84e479bc 100644 --- a/ci-scripts/conf_files/gNB_SA_CU.conf +++ b/ci-scripts/conf_files/gNB_SA_CU.conf @@ -254,22 +254,13 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf index b03758a006..240627d04a 100644 --- a/ci-scripts/conf_files/gNB_SA_DU.conf +++ b/ci-scripts/conf_files/gNB_SA_DU.conf @@ -273,22 +273,13 @@ serveraddr = "server"; log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 16f72c68e5..40752e2206 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -291,19 +291,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 1a940a51c4..d118676bb2 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -287,19 +287,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index 4338c00b36..5965ca38e7 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -266,18 +266,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 1c2133bebe..d0624e2e9a 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -259,18 +259,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b0a757c9d0..c047fc6837 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -266,18 +266,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 16456f939c..9163946aaa 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -293,19 +293,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 70892930c9..55060873d0 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -298,19 +298,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 70892930c9..55060873d0 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -298,19 +298,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 6ade355053..6667d0f1e7 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -255,18 +255,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index b7a04b1f36..9cfd9acfc3 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -263,19 +263,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; uicc: { diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index 3aa8696234..764514c385 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -265,19 +265,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; uicc: { diff --git a/ci-scripts/conf_files/lte-fdd-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-basic-sim.conf index a4d8e007dc..6c81d512a6 100644 --- a/ci-scripts/conf_files/lte-fdd-basic-sim.conf +++ b/ci-scripts/conf_files/lte-fdd-basic-sim.conf @@ -257,17 +257,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf index 458ab7cf89..c2f6ab9d6c 100644 --- a/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf +++ b/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf @@ -406,19 +406,12 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; //rfsimulator : diff --git a/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf index e80ff2b9cb..9c74d2e328 100644 --- a/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf +++ b/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf @@ -406,19 +406,12 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; //rfsimulator : diff --git a/ci-scripts/conf_files/lte-tdd-basic-sim.conf b/ci-scripts/conf_files/lte-tdd-basic-sim.conf index f443a907f2..ddfdddda83 100644 --- a/ci-scripts/conf_files/lte-tdd-basic-sim.conf +++ b/ci-scripts/conf_files/lte-tdd-basic-sim.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/nr-ue.nfapi.conf b/ci-scripts/conf_files/nr-ue.nfapi.conf index b12e0c8d05..90798702cf 100644 --- a/ci-scripts/conf_files/nr-ue.nfapi.conf +++ b/ci-scripts/conf_files/nr-ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; diff --git a/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf b/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf index 502e3c548a..6651f380e4 100644 --- a/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf +++ b/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf @@ -227,17 +227,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf index d01e4e1c4e..47bcc35cb3 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -168,19 +168,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf index 7f6bff304d..660478ca11 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -168,19 +168,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf index d4f2eb9ef2..6997c80234 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -168,19 +168,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf index 683fff0bc8..798871edce 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf @@ -263,17 +263,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf index 574c8b2545..628188aea2 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf @@ -263,17 +263,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf index 49365a1f61..75d947c009 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf @@ -263,17 +263,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf b/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf index 640b85930a..1bcd26b931 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf @@ -365,17 +365,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf b/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf index 7fe682f29e..e398310a35 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf @@ -365,17 +365,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf index 281f7433af..6f7a5d2dfd 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf @@ -230,17 +230,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rru.band38.tm1.master.conf b/ci-scripts/conf_files/rru.band38.tm1.master.conf index 101ce83892..e6bd0b75aa 100644 --- a/ci-scripts/conf_files/rru.band38.tm1.master.conf +++ b/ci-scripts/conf_files/rru.band38.tm1.master.conf @@ -30,18 +30,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rru.band38.tm1.slave.conf b/ci-scripts/conf_files/rru.band38.tm1.slave.conf index d5efe6bd61..2bc79028b4 100644 --- a/ci-scripts/conf_files/rru.band38.tm1.slave.conf +++ b/ci-scripts/conf_files/rru.band38.tm1.slave.conf @@ -30,18 +30,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rru.fdd.band7.conf b/ci-scripts/conf_files/rru.fdd.band7.conf index 057f518046..a3b297049d 100644 --- a/ci-scripts/conf_files/rru.fdd.band7.conf +++ b/ci-scripts/conf_files/rru.fdd.band7.conf @@ -31,17 +31,10 @@ THREAD_STRUCT = log_config = { global_log_level ="error"; - global_log_verbosity ="medium"; hw_log_level ="error"; - hw_log_verbosity ="medium"; phy_log_level ="error"; - phy_log_verbosity ="medium"; mac_log_level ="error"; - mac_log_verbosity ="high"; rlc_log_level ="error"; - rlc_log_verbosity ="medium"; pdcp_log_level ="error"; - pdcp_log_verbosity ="medium"; rrc_log_level ="error"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rru.tdd.band40.conf b/ci-scripts/conf_files/rru.tdd.band40.conf index 5ce3a515f5..40af241cca 100644 --- a/ci-scripts/conf_files/rru.tdd.band40.conf +++ b/ci-scripts/conf_files/rru.tdd.band40.conf @@ -31,17 +31,10 @@ THREAD_STRUCT = log_config = { global_log_level ="error"; - global_log_verbosity ="medium"; hw_log_level ="error"; - hw_log_verbosity ="medium"; phy_log_level ="error"; - phy_log_verbosity ="medium"; mac_log_level ="error"; - mac_log_verbosity ="high"; rlc_log_level ="error"; - rlc_log_verbosity ="medium"; pdcp_log_level ="error"; - pdcp_log_verbosity ="medium"; rrc_log_level ="error"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/ue.nfapi.conf b/ci-scripts/conf_files/ue.nfapi.conf index 2b602cbcf2..09ad7529b1 100644 --- a/ci-scripts/conf_files/ue.nfapi.conf +++ b/ci-scripts/conf_files/ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf index 7158790b28..df4ec5d01c 100755 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf index 70819d0e29..f9bb8338bf 100755 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf index 7381fefc1a..5c3d9214bc 100755 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf index 8eecfa2ac5..f214f12783 100755 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf index ce2b71bdd2..f9f70281ca 100755 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf index 11e6e24418..87deb03172 100755 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf index 11f6adbb4d..039b1d8aa3 100755 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf @@ -182,19 +182,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf index 3bf79f94bf..3c70040bfc 100755 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf @@ -182,19 +182,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf index 67a2bae08c..f9d3da2c35 100755 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf @@ -182,19 +182,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf index 02f29c4c2e..c4b3e00a75 100755 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf @@ -184,19 +184,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf index 71a479a512..e2786ef21c 100755 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf @@ -184,19 +184,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf index 09958d62e4..8cd9bd6c67 100755 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf @@ -184,19 +184,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/configuration/bladeRF/enb-band7-5mhz.conf b/configuration/bladeRF/enb-band7-5mhz.conf index 9d19207522..985f4eb378 100644 --- a/configuration/bladeRF/enb-band7-5mhz.conf +++ b/configuration/bladeRF/enb-band7-5mhz.conf @@ -206,19 +206,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } @@ -267,17 +260,10 @@ RUs = ( log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/doc/testing_gnb_w_cots_ue_resources/enb.conf b/doc/testing_gnb_w_cots_ue_resources/enb.conf index a6bbd98bda..027b6f2499 100755 --- a/doc/testing_gnb_w_cots_ue_resources/enb.conf +++ b/doc/testing_gnb_w_cots_ue_resources/enb.conf @@ -206,19 +206,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } @@ -267,17 +260,10 @@ RUs = ( log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/doc/testing_gnb_w_cots_ue_resources/gnb.conf b/doc/testing_gnb_w_cots_ue_resources/gnb.conf index aae22a92ba..c96d207445 100755 --- a/doc/testing_gnb_w_cots_ue_resources/gnb.conf +++ b/doc/testing_gnb_w_cots_ue_resources/gnb.conf @@ -258,18 +258,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index 47d5556c17..16014c6024 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -171,7 +171,6 @@ extern int usrp_tx_thread; #define CONFIG_HLP_NSA "Enable NSA mode \n" #define CONFIG_HLP_FLOG "Enable online log \n" #define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n" -#define CONFIG_HLP_LOGV "Set the global log verbosity \n" #define CONFIG_HLP_TELN "Start embedded telnet server \n" #define CONFIG_FLOG_OPT "R" #define CONFIG_LOGL_OPT "g" diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf index 85cee4dda0..ad6c81f56b 100644 --- a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf +++ b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf @@ -148,23 +148,14 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; gtpu_log_level ="info"; - gtpu_log_verbosity ="medium"; udp_log_level ="info"; - udp_log_verbosity ="medium"; }; } diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf index df06231e4a..9ffed9c5fe 100644 --- a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf +++ b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf @@ -148,19 +148,11 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf index 84c669571c..0e88f49021 100644 --- a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf +++ b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf @@ -70,23 +70,15 @@ eNBs = ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; # available options for level: error, warn, notice, info, debug, trace -# available options for verbosity: none, low, medium, high, full log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="debug"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="debug"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-4g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-4g.conf index aab3876d96..0561c563dd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-4g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-4g.conf @@ -269,17 +269,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index c6a4a90a14..4b775fce30 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -263,18 +263,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/cu.lte.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/cu.lte.conf index 38d3f5eac9..0e1080043a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/cu.lte.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/cu.lte.conf @@ -200,15 +200,10 @@ eNBs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; pdcp_log_level = "info"; - pdcp_log_verbosity = "high"; rrc_log_level = "info"; - rrc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; gtp_log_level = "info"; - gtp_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/du.lte.band7.10MHz.if4p5.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/du.lte.band7.10MHz.if4p5.conf index 8e786be5e9..0485957a8a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/du.lte.band7.10MHz.if4p5.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/du.lte.band7.10MHz.if4p5.conf @@ -96,17 +96,11 @@ RUs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; hw_log_level = "info"; - hw_log_verbosity = "medium"; phy_log_level = "info"; - phy_log_verbosity = "medium"; mac_log_level = "info"; - mac_log_verbosity = "high"; rlc_log_level = "info"; - rlc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index 67044f38d9..cc8df8185a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -382,24 +382,6 @@ eNBs = ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.2/24"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; } ); @@ -438,17 +420,10 @@ RUs = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf index e044c186b9..4723fd3cba 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf @@ -176,19 +176,12 @@ THREAD_STRUCT = ( log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf index 5a547622ab..d811fb068e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf @@ -256,17 +256,10 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf index 27826e5ce2..6669cef9a6 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf @@ -176,19 +176,12 @@ THREAD_STRUCT = ( log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf index 5df0f107ea..1b4224da08 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf @@ -256,17 +256,10 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.master.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.master.conf index cb50cccf2b..ad95557bb9 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.master.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.master.conf @@ -284,17 +284,10 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf index 245e4ecf94..8c0f57c65d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf @@ -212,18 +212,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf index 86b481f9d8..506966d167 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf @@ -256,17 +256,10 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf index 1eb5da6a18..177cddec12 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf @@ -251,41 +251,15 @@ THREAD_STRUCT = ( worker_config = "WORKER_ENABLE"; } ); -/* - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; -*/ log_config : { global_log_level ="crit"; - global_log_verbosity ="crit"; hw_log_level ="crit"; - hw_log_verbosity ="crit"; phy_log_level ="crit"; - phy_log_verbosity ="crit"; mac_log_level ="crit"; - mac_log_verbosity ="crit"; rlc_log_level ="crit"; - rlc_log_verbosity ="crit"; pdcp_log_level ="crit"; - pdcp_log_verbosity ="crit"; rrc_log_level ="crit"; - rrc_log_verbosity ="crit"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf index a929c439be..aac2ec5f5e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf @@ -244,18 +244,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 43288ba324..07cebbe75b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -298,18 +298,11 @@ rfsimulator : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf index 92f2d4e6f1..222b203f71 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf @@ -211,18 +211,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index fd9399f89e..96414d6a1d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -265,18 +265,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 59e71a6225..4bbb9ef506 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -251,18 +251,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index 3fc81c0d6c..21f6da23b9 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -245,18 +245,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index a40a93c789..26ee3cc12d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -265,18 +265,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index 3860aba935..1d555c863c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -257,18 +257,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index 7c527e07c8..f2eb7a8d8b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -257,18 +257,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf index a171f2aae0..683cdaeb2c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf @@ -258,18 +258,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 4f8c785baa..8d5e15a1aa 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -262,17 +262,10 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf index 012f46401e..e1c9e9e167 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf @@ -260,17 +260,10 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index b6b9252560..4e4c0252fb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -303,17 +303,10 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index 0817d7373e..f457ca0d6e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -254,18 +254,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index fd4c23cfdb..ab076ab492 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -253,18 +253,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 965408332c..21d0c636bf 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -253,18 +253,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index e36748a3a9..c23ce26ed8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -270,18 +270,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7b2d369919..3ccef009ef 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -245,18 +245,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index dbf4f58348..0b71da2c5c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -255,18 +255,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6d23726a78..83e4f68ab2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -253,18 +253,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index c3fa56f15e..0835db0474 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -253,18 +253,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index 15aa368fdf..46620ceeb5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -246,18 +246,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf index b13962aee9..a52841158c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="debug"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="debug"; - rrc_log_verbosity ="full"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf index 06ae5af066..c9658fc0eb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="debug"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="debug"; - rrc_log_verbosity ="full"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf index e05c64b4e8..4554a32a18 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf @@ -217,17 +217,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf index 1ef71bedc2..c8bca91ccd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf @@ -200,19 +200,12 @@ THREAD_STRUCT = ( log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="debug"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="high"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf index 9ce9f28cc2..1f72077ba3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf @@ -239,17 +239,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf index 30cb852a28..401c42e503 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf @@ -217,17 +217,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf index 519305b68d..22da6735a2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf @@ -218,17 +218,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="debug"; - phy_log_verbosity ="medium"; mac_log_level ="debug"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf index 1583e07ca1..004ad4db78 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf @@ -235,18 +235,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc_b38_if5_ENDC.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc_b38_if5_ENDC.conf index 9b611b3f07..6a76028d25 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc_b38_if5_ENDC.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc_b38_if5_ENDC.conf @@ -168,19 +168,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf index 3dc8e7dd32..c14cc9589a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf @@ -29,18 +29,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.tdd.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.tdd.conf index 494086defd..4f1a7fee30 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.tdd.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.tdd.conf @@ -29,18 +29,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_eNB_band13.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_eNB_band13.conf index 1d8f61e442..d2ef01392b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_eNB_band13.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_eNB_band13.conf @@ -204,25 +204,6 @@ eNBs = ENB_IPV4_ADDRESS_FOR_X2C = "192.168.18.199/24"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="high"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="debug"; - rlc_log_verbosity ="high"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } ); @@ -269,17 +250,10 @@ RUs = ( log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf index 6df25273c8..d493f29906 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf @@ -205,25 +205,6 @@ eNBs = ENB_IPV4_ADDRESS_FOR_X2C = "192.168.18.199/24"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="high"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="debug"; - rlc_log_verbosity ="high"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } ); @@ -270,17 +251,10 @@ RUs = ( log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 8dfcfb2b88..88628f9cfc 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -263,18 +263,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index d01b0947c0..057444953d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -272,18 +272,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf index 198ad8471c..57aa459d49 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf @@ -261,18 +261,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2f4839fd3b..407211ead4 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -258,18 +258,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf index 680a6cb4ae..43c2ab20ad 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf @@ -78,22 +78,13 @@ gNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 01050b0d00..2112be3996 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -254,22 +254,13 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf index ab4713f8b5..b0e02ff2bc 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf @@ -265,20 +265,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="info"; - ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 9238ea1809..2c5b6dbe27 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -281,20 +281,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 9717462176..10e78b648d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -281,21 +281,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index d9b62064c1..639182f755 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -281,20 +281,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index e9577ee265..fa0f86772e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -287,20 +287,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; From aa47fa4c41786dcc16d9c9059bb836d8b96108d6 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 27 Jan 2022 11:57:19 +0100 Subject: [PATCH 104/196] remove F1-U protobuf implementation --- cmake_targets/CMakeLists.txt | 55 +- executables/nr-softmodem.c | 36 +- executables/nr-softmodem.h | 2 +- openair2/ENB_APP/enb_config.c | 1 - openair2/F1AP/f1ap_cu_task.c | 1 - openair2/F1AP/f1ap_du_task.c | 1 - openair2/GNB_APP/gnb_app.c | 30 +- openair2/LAYER2/PROTO_AGENT/cu_test.c | 172 ----- openair2/LAYER2/PROTO_AGENT/du_test.c | 163 ---- openair2/LAYER2/PROTO_AGENT/proto_agent.c | 278 ------- openair2/LAYER2/PROTO_AGENT/proto_agent.h | 49 -- .../LAYER2/PROTO_AGENT/proto_agent_async.c | 93 --- .../LAYER2/PROTO_AGENT/proto_agent_async.h | 56 -- .../LAYER2/PROTO_AGENT/proto_agent_common.c | 719 ------------------ .../LAYER2/PROTO_AGENT/proto_agent_common.h | 138 ---- .../LAYER2/PROTO_AGENT/proto_agent_defs.h | 118 --- .../LAYER2/PROTO_AGENT/proto_agent_handler.c | 138 ---- .../LAYER2/PROTO_AGENT/proto_agent_net_comm.c | 152 ---- .../LAYER2/PROTO_AGENT/proto_agent_net_comm.h | 82 -- .../LAYER2/RLC/rlc_proto_agent_primitives.h | 16 - openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 2 - openair2/MCE_APP/mce_config.c | 2 - openair3/MME_APP/mme_config.c | 1 - targets/RT/USER/lte-softmodem.c | 2 - targets/RT/USER/lte-softmodem.h | 1 - 25 files changed, 13 insertions(+), 2295 deletions(-) delete mode 100644 openair2/LAYER2/PROTO_AGENT/cu_test.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/du_test.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent.h delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_async.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_async.h delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_common.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_common.h delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h delete mode 100644 openair2/LAYER2/RLC/rlc_proto_agent_primitives.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index ff6169b704..51aef0446d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1109,7 +1109,6 @@ include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/S1AP") include_directories("${OPENAIR2_DIR}/UTIL/OSA") include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc") include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc") -include_directories("${OPENAIR2_DIR}/LAYER2/PROTO_AGENT") include_directories("${OPENAIR2_DIR}/UTIL/MEM") include_directories("${OPENAIR2_DIR}/UTIL/LISTS") include_directories("${OPENAIR2_DIR}/UTIL/FIFO") @@ -1275,18 +1274,6 @@ include_directories (${FSPT_C_DIR}) # set(ASYNC_IF_LIB ASYNC_IF) # include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF) -add_library(PROTO_AGENT - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c - ) -set(PROTO_AGENT_LIB PROTO_AGENT) -include_directories(${OPENAIR2_DIR}/LAYER2/PROTO_AGENT) - - - set(PROTOBUF_LIB "protobuf-c") #set(PROTOBUF_LIB "protobuf") #for Cpp @@ -2780,7 +2767,7 @@ target_link_libraries (lte-softmodem -Wl,--start-group RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7 - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} + ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} -Wl,--end-group z dl) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) @@ -2824,38 +2811,10 @@ target_link_libraries (ocp-enb RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} + ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} -Wl,--end-group z dl) target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB}) -add_executable(cu_test - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/cu_test.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c - ${T_SOURCE} -) -target_link_libraries(cu_test - ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FSPT_MSG_LIB} ${PROTOBUF_LIB} - ${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ITTI -) - -add_executable(du_test - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/du_test.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c - ${T_SOURCE} -) -target_link_libraries(du_test - ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FSPT_MSG_LIB} ${PROTOBUF_LIB} - ${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ITTI -) - add_executable(oairu ${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/ru_control.c @@ -2922,7 +2881,7 @@ target_link_libraries (lte-uesoftmodem -Wl,--end-group z dl) target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${T_LIB}) @@ -2963,7 +2922,7 @@ target_link_libraries (nr-softmodem UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} + X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB} -Wl,--end-group z dl) target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES}) @@ -3053,7 +3012,7 @@ target_link_libraries (nr-uesoftmodem -Wl,--end-group z dl) target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (nr-uesoftmodem ${T_LIB}) @@ -3364,7 +3323,7 @@ if (${T_TRACER}) PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB - ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts) + ldpc_orig ldpc_optim ldpc_optim8seg ldpc dfts) if (TARGET ${i}) add_dependencies(${i} generate_T) endif() @@ -3474,7 +3433,7 @@ target_link_libraries (nr-ittisim UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} + X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB} PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE -Wl,--end-group z dl) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 184b9caa8f..159b46b6cc 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -589,48 +589,20 @@ static void wait_nfapi_init(char *thread_name) { } void init_pdcp(void) { + uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? + PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT: + LINK_ENB_PDCP_TO_GTPV1U_BIT; + if (!get_softmodem_params()->nsa) { if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) { - //pdcp_layer_init(); - uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? - (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; - - if (IS_SOFTMODEM_NOS1) { - printf("IS_SOFTMODEM_NOS1 option enabled \n"); - pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT; - } - nr_pdcp_module_init(pdcp_initmask, 0); - - if (NODE_IS_CU(RC.nrrrc[0]->node_type)) { - LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n"); - pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req); - } else { - LOG_I(PDCP, "node is gNB \n"); - pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req); - pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind); - } - } else { - LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n"); - pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind); } } else { pdcp_layer_init(); - uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? - (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; - - if (IS_SOFTMODEM_NOS1) { - printf("IS_SOFTMODEM_NOS1 option enabled \n"); - pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT; - } - nr_pdcp_module_init(pdcp_initmask, 0); - pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req); - pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind); } } - int main( int argc, char **argv ) { int ru_id, CC_id = 0; start_background_system(); diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h index 4190a6074b..834e89b403 100644 --- a/executables/nr-softmodem.h +++ b/executables/nr-softmodem.h @@ -5,7 +5,6 @@ #include "flexran_agent.h" #include "PHY/defs_gNB.h" -#include "proto_agent.h" #define DEFAULT_DLF 2680000000 @@ -65,5 +64,6 @@ void init_gNB_afterRU(void); extern int stop_L1L2(module_id_t gnb_id); extern int restart_L1L2(module_id_t gnb_id); +void init_pdcp(void); #endif diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index f5493a839a..f4550f63a1 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -55,7 +55,6 @@ #include "common/config/config_userapi.h" #include "RRC_config_tools.h" #include "enb_paramdef.h" -#include "proto_agent.h" #include "executables/thread-common.h" #include diff --git a/openair2/F1AP/f1ap_cu_task.c b/openair2/F1AP/f1ap_cu_task.c index 8d4f896250..b3c7363ca4 100644 --- a/openair2/F1AP/f1ap_cu_task.c +++ b/openair2/F1AP/f1ap_cu_task.c @@ -35,7 +35,6 @@ #include "f1ap_cu_rrc_message_transfer.h" #include "f1ap_cu_ue_context_management.h" #include "f1ap_cu_task.h" -#include "proto_agent.h" #include //Fixme: Uniq dirty DU instance, by global var, datamodel need better management diff --git a/openair2/F1AP/f1ap_du_task.c b/openair2/F1AP/f1ap_du_task.c index 1d5d24f5ca..c8cfadb999 100644 --- a/openair2/F1AP/f1ap_du_task.c +++ b/openair2/F1AP/f1ap_du_task.c @@ -35,7 +35,6 @@ #include "f1ap_du_ue_context_management.h" #include "f1ap_du_rrc_message_transfer.h" #include "f1ap_du_task.h" -#include "proto_agent.h" #include //Fixme: Uniq dirty DU instance, by global var, datamodel need better management diff --git a/openair2/GNB_APP/gnb_app.c b/openair2/GNB_APP/gnb_app.c index 7d51d95840..821e2def84 100644 --- a/openair2/GNB_APP/gnb_app.c +++ b/openair2/GNB_APP/gnb_app.c @@ -31,8 +31,8 @@ #include #include #include +#include #include -#include #include "gnb_app.h" #include "gnb_config.h" @@ -135,34 +135,6 @@ static uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end) /*------------------------------------------------------------------------------*/ -static void init_pdcp(void) { - if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) { - pdcp_layer_init(); - uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? - (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; - if (IS_SOFTMODEM_NOS1) { - LOG_I(PDCP, "IS_SOFTMODEM_NOS1 option enabled\n"); - pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT; - } - - nr_pdcp_module_init(pdcp_initmask, 0); - - if (NODE_IS_CU(RC.nrrrc[0]->node_type)) { - LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n"); - pdcp_set_rlc_data_req_func(proto_agent_send_rlc_data_req); - } else { - LOG_I(PDCP, "node is gNB \n"); - pdcp_set_rlc_data_req_func(rlc_data_req); - pdcp_set_pdcp_data_ind_func(pdcp_data_ind); - } - } else { - LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n"); - pdcp_set_pdcp_data_ind_func(proto_agent_send_pdcp_data_ind); - } -} - -/*------------------------------------------------------------------------------*/ - void *gNB_app_task(void *args_p) { diff --git a/openair2/LAYER2/PROTO_AGENT/cu_test.c b/openair2/LAYER2/PROTO_AGENT/cu_test.c deleted file mode 100644 index a26b06dd41..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/cu_test.c +++ /dev/null @@ -1,172 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "ENB_APP/enb_paramdef.h" -#include "LAYER2/PROTO_AGENT/proto_agent.h" -#define BUF_MAX 1400 - -int recv_client = 0; -FILE *output; - -void usage(char *prg_name) { - fprintf(stderr, "usage: %s \n", prg_name); - fprintf(stderr, " - is stdin\n"); - fprintf(stderr, " received packets are written to stdout\n"); -} - -long uelapsed(struct timeval *s, struct timeval *e) { - return e->tv_sec * 1000000 + e->tv_usec - (s->tv_sec * 1000000 + s->tv_usec); -} - -boolean_t -pdcp_data_ind( - const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, - const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, - const sdu_size_t sdu_buffer_sizeP, - mem_block_t *const sdu_buffer_pP -) { - fwrite(sdu_buffer_pP->data, sdu_buffer_sizeP, 1, stdout); - fflush(stdout); - free_mem_block(sdu_buffer_pP, __func__); - /* cannot free because of const */ - //free(ctxt_pP); - recv_client = 1; - return 0; -} - -void close_proto_agent(void) { - proto_agent_stop(0); -} - -int main(int argc, char *argv[]) { - const cudu_params_t params = { - .local_ipv4_address = "192.168.12.45", - .local_port = 6464, - .remote_ipv4_address = "192.168.12.45", - .remote_port = 6465 - }; - protocol_ctxt_t p; - memset(&p, 0, sizeof p); - mem_block_t mem; - char s[BUF_MAX]; - size_t size, totsize = 0; - struct timeval t_start, t_end; - FILE *f; - - if (argc != 2) { - usage(argv[0]); - return 1; - } - - if (strcmp(argv[1], "-") == 0) { - f = stdin; - } else { - f = fopen(argv[1], "r"); - } - - if (!f) { - fprintf(stderr, "cannot open %s: %s\n", argv[1], strerror(errno)); - return 2; - } - - pool_buffer_init(); - - if (proto_agent_start(0, ¶ms) != 0) { - fprintf(stderr, "error on proto_agent_start()\n"); - fclose(f); - return 3; - } - - atexit(close_proto_agent); - - /* wait for first packet of client */ - while (!recv_client) sleep(1); - - fprintf(stderr, "reading file\n"); - /* now send back at the same time */ - gettimeofday(&t_start, NULL); - - while ((size = fread(s, 1, BUF_MAX, f)) > 0) { - usleep(10); - totsize += size; - mem.data = &s[0]; - proto_agent_send_rlc_data_req(&p, 0, 0, 0, 0, 0, size, &mem); - } - - gettimeofday(&t_end, NULL); - fclose(f); - long us = uelapsed(&t_start, &t_end); - fprintf(stderr, "read %zu bytes in %ld ms -> %.3fMB/s, %.3fMbps\n", - totsize, us / 1000, ((float) totsize ) / us, - ((float) totsize) / us * 8); - fprintf(stderr, "check files using 'diff afile bfile'\n"); - /* give some time in case the other direction is slower */ - sleep(5); - return 0; -} - -/* - ********************************************************* - * arbitrary functions, needed for linking (used or not) * - ********************************************************* - */ - -rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, - const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, - const mui_t muiP, - confirm_t confirmP, - sdu_size_t sdu_sizeP, - mem_block_t *sdu_pP, - const uint32_t *const sourceL2Id, - const uint32_t *const destinationL2Id - ) { - fprintf(stderr, "This should never be called on the CU\n"); - exit(1); -} - -pthread_t new_thread(void *(*f)(void *), void *b) { - pthread_t t; - pthread_attr_t att; - - if (pthread_attr_init(&att)) { - fprintf(stderr, "pthread_attr_init err\n"); - exit(1); - } - - if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) { - fprintf(stderr, "pthread_attr_setdetachstate err\n"); - exit(1); - } - - if (pthread_create(&t, &att, f, b)) { - fprintf(stderr, "pthread_create err\n"); - exit(1); - } - - if (pthread_attr_destroy(&att)) { - fprintf(stderr, "pthread_attr_destroy err\n"); - exit(1); - } - - return t; -} - -int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) { - return 0; -} - -int config_get(paramdef_t *params,int numparams, char *prefix) { - return 0; -} - -int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) { - return 0; -} diff --git a/openair2/LAYER2/PROTO_AGENT/du_test.c b/openair2/LAYER2/PROTO_AGENT/du_test.c deleted file mode 100644 index ee62298438..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/du_test.c +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "ENB_APP/enb_paramdef.h" -#include "LAYER2/PROTO_AGENT/proto_agent.h" - -#define BUF_MAX 1400 - -void usage(char *prg_name) { - fprintf(stderr, "usage: %s \n", prg_name); - fprintf(stderr, " - is stdin\n"); - fprintf(stderr, " received packets are written to stdout\n"); -} - -long uelapsed(struct timeval *s, struct timeval *e) { - return e->tv_sec * 1000000 + e->tv_usec - (s->tv_sec * 1000000 + s->tv_usec); -} - - -rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, - const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, - const mui_t muiP, - confirm_t confirmP, - sdu_size_t sdu_sizeP, - mem_block_t *sdu_pP, - const uint32_t *const sourceL2Id, - const uint32_t *const destinationL2Id - ) { - fwrite(sdu_pP->data, sdu_sizeP, 1, stdout); - fflush(stdout); - free_mem_block(sdu_pP, __func__); - //free(ctxt_pP); - return 0; -} - -void close_proto_agent(void) { - proto_agent_stop(0); -} - -int main(int argc, char *argv[]) { - const cudu_params_t params = { - .local_ipv4_address = "192.168.12.45", - .local_port = 6465, - .remote_ipv4_address = "192.168.12.45", - .remote_port = 6464 - }; - protocol_ctxt_t p; - memset(&p, 0, sizeof p); - mem_block_t mem; - char s[BUF_MAX]; - size_t size, totsize = 0; - struct timeval t_start, t_end; - FILE *f; - - if (argc != 2) { - usage(argv[0]); - return 1; - } - - if (strcmp(argv[1], "-") == 0) { - f = stdin; - } else { - f = fopen(argv[1], "r"); - } - - if (!f) { - fprintf(stderr, "cannot open %s: %s\n", argv[1], strerror(errno)); - return 2; - } - - pool_buffer_init(); - - if (proto_agent_start(0, ¶ms) != 0) { - fprintf(stderr, "error on proto_agent_start()\n"); - fclose(f); - return 3; - } - - atexit(close_proto_agent); - gettimeofday(&t_start, NULL); - - while ((size = fread(s, 1, BUF_MAX, f)) > 0) { - usleep(10); - totsize += size; - mem.data = &s[0]; - proto_agent_send_pdcp_data_ind(&p, 0, 0, 0, size, &mem); - } - - gettimeofday(&t_end, NULL); - fclose(f); - long us = uelapsed(&t_start, &t_end); - fprintf(stderr, "read %zu bytes in %ld ms -> %.3fMB/s, %.3fMbps\n", - totsize, us / 1000, ((float) totsize ) / us, - ((float) totsize) / us * 8); - fprintf(stderr, "check files using 'diff afile bfile'\n"); - /* wait, we are possibly receiving data */ - sleep(5); - return 0; -} - -/* - ********************************************************* - * arbitrary functions, needed for linking (used or not) * - ********************************************************* - */ - -boolean_t -pdcp_data_ind( - const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, - const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, - const sdu_size_t sdu_buffer_sizeP, - mem_block_t *const sdu_buffer_pP -) { - fprintf(stderr, "This should never be called on the DU\n"); - exit(1); -} - -pthread_t new_thread(void *(*f)(void *), void *b) { - pthread_t t; - pthread_attr_t att; - - if (pthread_attr_init(&att)) { - fprintf(stderr, "pthread_attr_init err\n"); - exit(1); - } - - if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) { - fprintf(stderr, "pthread_attr_setdetachstate err\n"); - exit(1); - } - - if (pthread_create(&t, &att, f, b)) { - fprintf(stderr, "pthread_create err\n"); - exit(1); - } - - if (pthread_attr_destroy(&att)) { - fprintf(stderr, "pthread_attr_destroy err\n"); - exit(1); - } - - return t; -} - -int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) { - return 0; -} - -int config_get(paramdef_t *params,int numparams, char *prefix) { - return 0; -} - -int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) { - return 0; -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent.c b/openair2/LAYER2/PROTO_AGENT/proto_agent.c deleted file mode 100644 index 5cf71b826d..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent.c +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file enb_agent.h - * \brief top level enb agent receive thread and itti task - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ -#define _GNU_SOURCE -#include "proto_agent_common.h" -#include "common/utils/LOG/log.h" -#include "proto_agent.h" -#include "assertions.h" -#include "proto_agent_net_comm.h" -#include "proto_agent_async.h" -#include -#include - -#define ENB_AGENT_MAX 9 - -proto_agent_instance_t proto_agent[MAX_DU]; - -//pthread_t new_thread(void *(*f)(void *), void *b); - -Protocol__FlexsplitMessage *proto_agent_timeout_fsp(void *args); - -#define TEST_MOD 0 - -#define ECHO - -/* Server side function; upon a new connection - reception, sends the hello packets -*/ -int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) { - int channel_id; - // RS: CUDU does not work! - //DevAssert(p->local_interface); - //DevAssert(p->local_ipv4_address); - //DevAssert(p->local_port > 1024); // "unprivileged" port - //DevAssert(p->remote_ipv4_address); - //DevAssert(p->remote_port > 1024); // "unprivileged" port - proto_agent[mod_id].mod_id = mod_id; - proto_agent[mod_id].exit = 0; - /* Initialize the channel container */ - /* TODO only initialize the first time */ - proto_agent_init_channel_container(); - /*Create the async channel info*/ - proto_agent_async_channel_t *channel_info; - channel_info = proto_agent_async_channel_info(mod_id, p->local_ipv4_address, p->local_port, - p->remote_ipv4_address, p->remote_port); - - if (!channel_info) goto error; - - /* Create a channel using the async channel info */ - channel_id = proto_agent_create_channel((void *) channel_info, - proto_agent_async_msg_send, - proto_agent_async_msg_recv, - proto_agent_async_release); - - if (channel_id <= 0) goto error; - - proto_agent_channel_t *channel = proto_agent_get_channel(channel_id); - - if (!channel) goto error; - - proto_agent[mod_id].channel = channel; - /* Register the channel for all underlying agents (use ENB_AGENT_MAX) */ - proto_agent_register_channel(mod_id, channel, ENB_AGENT_MAX); - // Code for sending the HELLO/ECHO_REQ message once a connection is established - //uint8_t *msg = NULL; - //Protocol__FlexsplitMessage *init_msg=NULL; - //if (udp == 0) - //{ - // // If the comm is not UDP, allow the server to send the first packet over the channel - // //printf( "Proto agent Server: Calling the echo_request packet constructor\n"); - // msg_flag = proto_agent_echo_request(mod_id, NULL, &init_msg); - // if (msg_flag != 0) - // goto error; - // - // int msgsize = 0; - // if (init_msg != NULL) - // msg = proto_agent_pack_message(init_msg, &msgsize); - // if (msg!= NULL) - // { - // LOG_D(PROTO_AGENT, "Server sending the message over the async channel\n"); - // proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, (void *) channel_info); - // } - // /* After sending the message, wait for any replies; - // the server thread blocks until it reads any data - // over the channel - // */ - //} - //proto_agent[mod_id].recv_thread = new_thread(proto_agent_receive, &proto_agent[mod_id]); - threadCreate(&proto_agent[mod_id].recv_thread, proto_agent_receive, &proto_agent[mod_id], "proto", -1, OAI_PRIORITY_RT_LOW); - fprintf(stderr, "[PROTO_AGENT] server started at port %s:%d\n", p->local_ipv4_address, p->local_port); - return 0; -error: - LOG_E(PROTO_AGENT, "there was an error\n"); - return 1; -} - -void proto_agent_stop(mod_id_t mod_id) { - if (!proto_agent[mod_id].channel) return; - - /* unlock the independent read thread proto_agent_receive() */ - proto_agent[mod_id].exit = 1; - proto_agent_async_msg_recv_unlock(proto_agent[mod_id].channel->channel_info); - proto_agent_async_release(proto_agent[mod_id].channel); - proto_agent_destroy_channel(proto_agent[mod_id].channel->channel_id); - free(proto_agent[mod_id].channel); - proto_agent[mod_id].channel = NULL; - LOG_W(PROTO_AGENT, "server stopped\n"); -} - -//void -//proto_agent_send_hello(void) -//{ -// uint8_t *msg = NULL; -// Protocol__FlexsplitMessage *init_msg=NULL; -// int msg_flag = 0; -// -// -// //printf( "PDCP agent: Calling the HELLO packet constructor\n"); -// msg_flag = proto_agent_hello(proto_agent[TEST_MOD].mod_id, NULL, &init_msg); -// -// int msgsize = 0; -// if (msg_flag == 0) -// { -// proto_agent_serialize_message(init_msg, &msg, &msgsize); -// } -// -// LOG_D(PROTO_AGENT, "Agent sending the message over the async channel\n"); -// proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, (void *) client_channel[TEST_MOD]); -//} - - - -rlc_op_status_t proto_agent_send_rlc_data_req(const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, const mui_t muiP, - confirm_t confirmP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP,const uint32_t *const SrcID, const uint32_t *const DstID) { - uint8_t *msg = NULL; - Protocol__FlexsplitMessage *init_msg=NULL; - int msg_flag = 0; - int msgsize = 0; - mod_id_t mod_id = ctxt_pP->module_id; - data_req_args args; - DevAssert(proto_agent[mod_id].channel); - DevAssert(proto_agent[mod_id].channel->channel_info); - args.ctxt = ctxt_pP; - args.srb_flag = srb_flagP; - args.MBMS_flag = MBMS_flagP; - args.rb_id = rb_idP; - args.mui = muiP; - args.confirm = confirmP; - args.sdu_size = sdu_sizeP; - args.sdu_p = sdu_pP; - msg_flag = proto_agent_pdcp_data_req(mod_id, (void *) &args, &init_msg); - - if (msg_flag != 0 || !init_msg) goto error; - - msg = proto_agent_pack_message(init_msg, &msgsize); - - if (!msg) goto error; - - proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info); - free_mem_block(sdu_pP, __func__); - return RLC_OP_STATUS_OK; -error: - LOG_E(PROTO_AGENT, "PROTO_AGENT there was an error\n"); - return RLC_OP_STATUS_INTERNAL_ERROR; -} - - -boolean_t proto_agent_send_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP, const srb_flag_t srb_flagP, - const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, - sdu_size_t sdu_sizeP, mem_block_t *sdu_pP, - const uint32_t *const SrcID, const uint32_t *const DstID) { - uint8_t *msg = NULL; - Protocol__FlexsplitMessage *init_msg = NULL; - int msg_flag = 0; - int msgsize = 0; - mod_id_t mod_id = ctxt_pP->module_id; - data_req_args args; - DevAssert(proto_agent[mod_id].channel); - DevAssert(proto_agent[mod_id].channel->channel_info); - args.ctxt = ctxt_pP; - args.srb_flag = srb_flagP; - args.MBMS_flag = MBMS_flagP; - args.rb_id = rb_idP; - args.sdu_size = sdu_sizeP; - args.sdu_p = sdu_pP; - msg_flag = proto_agent_pdcp_data_ind(mod_id, (void *) &args, &init_msg); - - if (msg_flag != 0 || !init_msg) goto error; - - msg = proto_agent_pack_message(init_msg, &msgsize); - - if (!msg) goto error; - - proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info); - free_mem_block(sdu_pP, __func__); - return TRUE; -error: - LOG_E(PROTO_AGENT, "there was an error in %s\n", __func__); - return FALSE; -} - -void * -proto_agent_receive(void *args) { - proto_agent_instance_t *inst = args; - void *data = NULL; - int size; - int priority; - err_code_t err_code; - pthread_setname_np(pthread_self(), "proto_rx"); - Protocol__FlexsplitMessage *msg; - uint8_t *ser_msg; - - while (1) { - msg = NULL; - ser_msg = NULL; - - if ((size = proto_agent_async_msg_recv(&data, &priority, inst->channel->channel_info)) < 0) { - err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENQUEUING; - goto error; - } - - if (inst->exit) break; - - LOG_D(PROTO_AGENT, "Server side Received message with size %d and priority %d, calling message handle\n", size, priority); - msg = proto_agent_handle_message(inst->mod_id, data, size); - - if (!msg) { - LOG_D(PROTO_AGENT, "msg to send back is NULL\n"); - continue; - } - - ser_msg = proto_agent_pack_message(msg, &size); - - if (!ser_msg) { - continue; - } - - LOG_D(PROTO_AGENT, "Server sending the reply message over the async channel\n"); - - if (proto_agent_async_msg_send((void *)ser_msg, (int) size, 1, inst->channel->channel_info)) { - err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENQUEUING; - goto error; - } - - LOG_D(PROTO_AGENT, "sent message with size %d\n", size); - } - - return NULL; -error: - LOG_E(PROTO_AGENT, "proto_agent_receive(): error %d occured\n",err_code); - return NULL; -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent.h b/openair2/LAYER2/PROTO_AGENT/proto_agent.h deleted file mode 100644 index 4badda43b7..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file proto_agent.h - * \brief top level protocol agent - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - -#ifndef PROTO_AGENT_H_ -#define PROTO_AGENT_H_ -#include "ENB_APP/enb_config.h" // for enb properties -#include "proto_agent_common.h" -#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" -#include "RRC/NR/nr_rrc_defs.h" - - -void *proto_agent_receive(void *args); - -int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p); -void proto_agent_stop(mod_id_t mod_id); - -rlc_op_status_t proto_agent_send_rlc_data_req( const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, const mui_t muiP, confirm_t confirmP, - sdu_size_t sdu_sizeP, mem_block_t *sdu_pP,const uint32_t *const SrcID, const uint32_t *const DstID); - -pdcp_data_ind_t proto_agent_send_pdcp_data_ind; - -#endif diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_async.c deleted file mode 100644 index df3684ee27..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -#include "proto_agent_async.h" -#include "proto_agent_defs.h" - - -#include "common/utils/LOG/log.h" - -proto_agent_async_channel_t * -proto_agent_async_channel_info(mod_id_t mod_id, const char *bind_ip, uint16_t bind_port, - const char* peer_ip, uint16_t peer_port) -{ - proto_agent_async_channel_t *channel; - channel = malloc(sizeof(proto_agent_async_channel_t)); - - if (channel == NULL) - goto error; - - channel->enb_id = mod_id; - channel->link = new_link_udp_server(bind_ip, bind_port); - - if (channel->link == NULL) goto error; - - channel->send_queue = new_message_queue(); - if (channel->send_queue == NULL) goto error; - channel->receive_queue = new_message_queue(); - if (channel->receive_queue == NULL) goto error; - - channel->manager = create_link_manager(channel->send_queue, - channel->receive_queue, - channel->link); - /* manually set remote IP&port for UDP server remote end */ - channel->manager->peer_port = peer_port; - channel->manager->peer_addr = peer_ip; - - if (channel->manager == NULL) goto error; - - return channel; - - error: - if (channel) - free(channel); - LOG_E(PROTO_AGENT, "error creating proto_agent_async_channel_t\n"); - return NULL; -} - -int proto_agent_async_msg_send(void *data, int size, int priority, void *channel_info) -{ - proto_agent_async_channel_t *channel = channel_info; - return message_put(channel->send_queue, data, size, priority); -} - -int proto_agent_async_msg_recv(void **data, int *priority, void *channel_info) -{ - proto_agent_async_channel_t *channel = channel_info; - return message_get(channel->receive_queue, data, priority); -} - -void proto_agent_async_msg_recv_unlock(proto_agent_async_channel_t *channel) { - message_get_unlock(channel->receive_queue); -} - -void proto_agent_async_release(proto_agent_channel_t *channel) -{ - proto_agent_async_channel_t *channel_info = channel->channel_info; - - destroy_link_manager(channel_info->manager); - - destroy_message_queue(channel_info->send_queue); - destroy_message_queue(channel_info->receive_queue); - - close_link(channel_info->link); - free(channel_info); -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_async.h deleted file mode 100644 index 6bc952e804..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file enb_agent_async.h - * \brief channel implementation for async interface - * \author Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - -#ifndef PROTO_AGENT_ASYNC_H_ -#define PROTO_AGENT_ASYNC_H_ - -#include "proto_agent_net_comm.h" - -typedef struct proto_agent_async_channel_s { - mod_id_t enb_id; - socket_link_t *link; - message_queue_t *send_queue; - message_queue_t *receive_queue; - link_manager_t *manager; -} proto_agent_async_channel_t; - -proto_agent_async_channel_t * -proto_agent_async_channel_info(mod_id_t mod_id, const char *bind_ip, uint16_t bind_port, - const char *peer_ip, uint16_t peer_port); - -int proto_agent_async_msg_send(void *data, int size, int priority, void *channel_info); - -int proto_agent_async_msg_recv(void **data, int *priority, void *channel_info); - -/* unlocks a running proto_agent_async_msg_recv() */ -void proto_agent_async_msg_recv_unlock(proto_agent_async_channel_t *channel); - -void proto_agent_async_release(proto_agent_channel_t *channel); - - -#endif /*PROTO_AGENT_ASYNC_H_*/ diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c deleted file mode 100644 index d3d00d1ada..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c +++ /dev/null @@ -1,719 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file proto_agent_common.c - * \brief common primitives for all agents - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - -#include -#include -#include - -#include "PHY/phy_extern.h" -#include "proto_agent_common.h" -#include "common/utils/LOG/log.h" -#include "common/ran_context.h" - -extern RAN_CONTEXT_t RC; - -/* - * message primitives - */ - -// Function to fill in the dl_data header (32bits) with the appropriate fields (doing bitwise operations) -void fill_dl_data_header(int pdu_type, int spare, int seq_no, uint32_t *header) { - uint32_t type = pdu_type; - uint32_t spare_ = spare; - uint32_t seq = seq_no; - type = type << 28; - spare_ = spare_ << 24; - *header = (type | spare_); - *header = (*header | seq); - return; -} - - -// Function to retrieve data from the dl_data header (32bits) (doing bitwise operations) -void read_dl_data_header(int *pdu_type, int *spare, int *seqno, uint32_t header) { - *pdu_type = header; - *spare = header; - *seqno = header; - *pdu_type = *pdu_type >> 28; - *spare = *spare << 4; - *spare = *spare >> 28; - *seqno = *seqno << 8; - *seqno = *seqno >> 8; - return; -} - -int f1u_serialize_message(Protocol__F1uMessage *msg, void **buf,int *size) { - *size = protocol__f1u_message__get_packed_size(msg); - *buf = malloc(*size); - - if (!(*buf)) - goto error; - - protocol__f1u_message__pack(msg, *buf); - return 0; -error: - LOG_E(F1U, "an error occured\n"); - return -1; -} - -int f1u_deserialize_message(void *data, int size, Protocol__F1uMessage **msg) { - *msg = protocol__f1u_message__unpack(NULL, size, data); - - if (*msg == NULL) - goto error; - - return 0; -error: - LOG_E(F1U, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int f1u_dl_data_create_header(uint32_t pdu_type, uint32_t f1u_sn, Protocol__DlDataHeader **header) { - *header = malloc(sizeof(Protocol__DlDataHeader)); - - if(*header == NULL) - goto error; - - protocol__dl_data_header__init(*header); - LOG_D(F1U, "Initialized the DL Data User header\n"); - fill_dl_data_header(pdu_type, 0, f1u_sn, &(*header)->fields); - return 0; -error: - LOG_E(F1U, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int f1u_dl_data(const void *params, Protocol__F1uMessage **msg) { - // Initialize the PDCP params - dl_data_args *args = (dl_data_args *)params; - Protocol__DlDataHeader *header; - - if (f1u_dl_data_create_header(args->pdu_type, args->sn, &header) != 0) - goto error; - - Protocol__DlUserData *dl_data = NULL; - *msg = malloc(sizeof(Protocol__DlUserData)); - - if(*msg == NULL) - goto error; - - // FIXME: Is the following used? It seems to be overwritten by the function - // protocol__dl_user_data__init() anyway - //dl_data = *msg; - protocol__dl_user_data__init(dl_data); - // Copy data to the bytes structure - dl_data->pdu.data = malloc(args->sdu_size); - dl_data->pdu.len = args->sdu_size; - memcpy(dl_data->pdu.data, args->sdu_p, args->sdu_size); - dl_data->frame = args->frame; - dl_data->subframe = args->subframe; - dl_data->rnti = args->rnti; - dl_data->header = header; - return 0; -error: - - if(header != NULL) - free(header); - - if(*msg != NULL) - free(*msg); - - LOG_E(F1U, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_serialize_message(Protocol__FlexsplitMessage *msg, uint8_t **buf, int *size) { - *size = protocol__flexsplit_message__get_packed_size(msg); - *buf = malloc(*size); - - if (!(*buf)) - goto error; - - protocol__flexsplit_message__pack(msg, *buf); - return 0; -error: - LOG_E(MAC, "an error occured\n"); - return -1; -} - -/* We assume that the buffer size is equal to the message size. - Should be chekced durint Tx/Rx */ -int proto_agent_deserialize_message(void *data, int size, Protocol__FlexsplitMessage **msg) { - *msg = protocol__flexsplit_message__unpack(NULL, size, data); - - if (*msg == NULL) - goto error; - - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int fsp_create_header(xid_t xid, Protocol__FspType type, Protocol__FspHeader **header) { - *header = malloc(sizeof(Protocol__FspHeader)); - - if(*header == NULL) - goto error; - - protocol__fsp_header__init(*header); - LOG_D(PROTO_AGENT, "Initialized the PROTOBUF message header\n"); - (*header)->version = FLEXSPLIT_VERSION; - LOG_D(PROTO_AGENT, "Set the vversion to FLEXSPLIT_VERSION\n"); - (*header)->has_version = 1; - (*header)->type = type; - (*header)->has_type = 1; - (*header)->xid = xid; - (*header)->has_xid = 1; - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int just_print(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - return 1; -} - -int proto_agent_pdcp_data_req(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - Protocol__FspCtxt *ctxt = NULL; - Protocol__FspRlcPdu *pdu = NULL; - Protocol__FspRlcData *rlc_data = NULL; - Protocol__FspRlcDataReq *data_req = NULL; - // Initialize the PDCP params - data_req_args *args = (data_req_args *)params; - // Create the protobuf header - Protocol__FspHeader *header; - xid_t xid = mod_id; - LOG_D(PROTO_AGENT, "creating the data_req message\n"); - - if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_RLC_DATA_REQ, &header) != 0) - goto error; - - /* Begin constructing the messages. They are defined as follows: - * 1) fspRlcPdu is storing the bytes of the packet - * 2) Message fspRlcData is packing the packet + the context of the PDCP (separate message) - * 3) Messge fspRlcDataReq is packing the header, enb_id and fspRlcData - */ - ctxt = malloc(sizeof(Protocol__FspCtxt)); - pdu = malloc(sizeof(Protocol__FspRlcPdu)); - rlc_data = malloc(sizeof(Protocol__FspRlcData)); - data_req = malloc(sizeof(Protocol__FspRlcDataReq)); - protocol__fsp_ctxt__init(ctxt); - protocol__fsp_rlc_pdu__init(pdu); - protocol__fsp_rlc_data__init(rlc_data); - protocol__fsp_rlc_data_req__init(data_req); - // Copy data to the RlcPdu structure - pdu->fsp_pdu_data.data = malloc(args->sdu_size); - pdu->fsp_pdu_data.len = args->sdu_size; - memcpy(pdu->fsp_pdu_data.data, args->sdu_p->data, args->sdu_size); - pdu->has_fsp_pdu_data = 1; - // Copy data to the ctxt structure - ctxt->fsp_mod_id = args->ctxt->module_id; - ctxt->fsp_enb_flag = args->ctxt->enb_flag; - ctxt->fsp_instance = args->ctxt->instance; - ctxt->fsp_rnti = args->ctxt->rnti; - ctxt->fsp_frame = args->ctxt->frame; - ctxt->fsp_subframe = args->ctxt->subframe; - ctxt->fsp_enb_index = args->ctxt->eNB_index; - ctxt->has_fsp_mod_id = 1; - ctxt->has_fsp_enb_flag = 1; - ctxt->has_fsp_instance = 1; - ctxt->has_fsp_rnti = 1; - ctxt->has_fsp_frame = 1; - ctxt->has_fsp_subframe = 1; - ctxt->has_fsp_enb_index = 1; - rlc_data->fsp_ctxt = ctxt; - rlc_data->fsp_srb_flag = args->srb_flag; - rlc_data->fsp_mbms_flag = args->MBMS_flag; - rlc_data->fsp_rb_id = args->rb_id; - rlc_data->fsp_muip = args->mui; - rlc_data->fsp_confirm = args->confirm; - rlc_data->fsp_sdu_buffer_size = args->sdu_size; - rlc_data->fsp_pdu = pdu; - rlc_data->has_fsp_srb_flag = 1; - rlc_data->has_fsp_mbms_flag = 1; - rlc_data->has_fsp_rb_id = 1; - rlc_data->has_fsp_muip = 1; - rlc_data->has_fsp_confirm = 1; - rlc_data->has_fsp_sdu_buffer_size = 1; - // Up to here, everything is a signle message that is packed inside another. The final data_req - // will be created later, after the setting of all variables - data_req->header = header; - data_req->enb_id = mod_id; - data_req->has_enb_id = 1; - data_req->pdcp_data = rlc_data; - *msg = malloc(sizeof(Protocol__FlexsplitMessage)); - - if(*msg == NULL) - goto error; - - protocol__flexsplit_message__init(*msg); - (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_MSG; - (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE; //we will be waiting for the ACK - (*msg)->has_msg_dir = 1; - (*msg)->data_req_msg = data_req; - return 0; -error: - - if(header != NULL) - free(header); - - if(pdu!=NULL) - free(pdu); - - if(rlc_data!=NULL) - free(rlc_data); - - if(data_req!= NULL) - free(data_req); - - if(*msg != NULL) - free(*msg); - - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_destroy_pdcp_data_req(Protocol__FlexsplitMessage *msg) { - if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_MSG) - goto error; - - free(msg->data_req_msg->header); - free(msg->data_req_msg->pdcp_data->fsp_pdu->fsp_pdu_data.data); - free(msg->data_req_msg->pdcp_data->fsp_pdu); - free(msg->data_req_msg->pdcp_data->fsp_ctxt); - free(msg->data_req_msg->pdcp_data); - free(msg->data_req_msg); - free(msg); - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_get_ack_result(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { -/* code useless in this status: return 0 anyways - rlc_op_status_t result = 0; - printf("PROTO_AGENT: handling the data_req_ack message\n"); - Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params; - Protocol__FspRlcDataReqAck *data_ack = input->data_req_ack; - result = data_ack->result; - printf("PROTO_AGENT: ACK RESULT IS %u\n", result); - ack_result = result; -*/ - return 0; -} - - -int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - rlc_op_status_t result = 0; - Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params; - Protocol__FspRlcDataReq *data_req = input->data_req_msg; - Protocol__FspCtxt *ctxt = NULL; - Protocol__FspRlcData *rlc_data = NULL; - rlc_data = data_req->pdcp_data; - ctxt = rlc_data->fsp_ctxt; - protocol_ctxt_t ctxt_pP; - srb_flag_t srb_flagP = 0; - rb_id_t rb_idP = 0; - mui_t muiP = 0; - confirm_t confirmP = 0; - MBMS_flag_t flag_MBMS = 0; - sdu_size_t pdcp_pdu_size = 0; - mem_block_t *pdcp_pdu_p = NULL; - // Create a new protocol context for handling the packet - ctxt_pP.module_id = ctxt->fsp_mod_id; - ctxt_pP.enb_flag = ctxt->fsp_enb_flag; - ctxt_pP.instance = ctxt->fsp_instance; - ctxt_pP.rnti = ctxt->fsp_rnti; - ctxt_pP.frame = ctxt->fsp_frame; - ctxt_pP.subframe = ctxt->fsp_subframe; - ctxt_pP.eNB_index = ctxt->fsp_enb_index; - srb_flagP = rlc_data->fsp_srb_flag; - flag_MBMS = rlc_data->fsp_mbms_flag; - rb_idP = rlc_data->fsp_rb_id; - muiP = rlc_data->fsp_muip; - confirmP = rlc_data->fsp_confirm; - pdcp_pdu_size = rlc_data->fsp_pdu->fsp_pdu_data.len; - pdcp_pdu_p = get_free_mem_block(pdcp_pdu_size, __func__); - - if (!pdcp_pdu_p) { - LOG_E(PROTO_AGENT, "%s: an error occured\n", __FUNCTION__); - return -1; - } - - memcpy(pdcp_pdu_p->data, rlc_data->fsp_pdu->fsp_pdu_data.data, pdcp_pdu_size); - if (RC.nrrrc) { - LOG_D(PROTO_AGENT, "proto_agent received pdcp_data_req \n"); - // for (int i = 0; i < pdcp_pdu_size; i++) - // printf(" %2.2x", (unsigned char)pdcp_pdu_p->data[i]); - // printf("\n"); - du_rlc_data_req(&ctxt_pP, srb_flagP, flag_MBMS, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p); - result = 1; - } else { - result = rlc_data_req(&ctxt_pP, srb_flagP, flag_MBMS, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p, NULL, NULL); - } - return result; -} - -int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg) { - if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG) - goto error; - - free(msg->data_ind_msg->header); - free(msg->data_ind_msg->rlc_data->fsp_pdu->fsp_pdu_data.data); - free(msg->data_ind_msg->rlc_data->fsp_pdu); - free(msg->data_ind_msg->rlc_data->fsp_ctxt); - free(msg->data_ind_msg->rlc_data); - free(msg->data_ind_msg); - free(msg); - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_pdcp_data_ind(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - Protocol__FspCtxt *ctxt = NULL; - Protocol__FspRlcPdu *pdu = NULL; - Protocol__FspRlcData *rlc_data = NULL; - Protocol__FspPdcpDataInd *data_ind = NULL; - // Initialize the PDCP params - data_req_args *args = (data_req_args *)params; - // Create the protobuf header - Protocol__FspHeader *header; - xid_t xid = mod_id; - LOG_D(PROTO_AGENT, "creating the data_ind message\n"); - - if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_PDCP_DATA_IND, &header) != 0) - goto error; - - /* Begin constructing the messages. They are defined as follows: - * 1) fspRlcPdu is storing the bytes of the packet - * 2) Message fspRlcData is packing the packet + the context of the PDCP (separate message) - * 3) Messge fspRlcDataReq is packing the header, enb_id and fspRlcData - */ - ctxt = malloc(sizeof(Protocol__FspCtxt)); - pdu = malloc(sizeof(Protocol__FspRlcPdu)); - rlc_data = malloc(sizeof(Protocol__FspRlcData)); - data_ind = malloc(sizeof(Protocol__FspPdcpDataInd)); - protocol__fsp_ctxt__init(ctxt); - protocol__fsp_rlc_pdu__init(pdu); - protocol__fsp_rlc_data__init(rlc_data); - protocol__fsp_pdcp_data_ind__init(data_ind); - // Copy data to the RlcPdu structure - pdu->fsp_pdu_data.data = malloc(args->sdu_size); - pdu->fsp_pdu_data.len = args->sdu_size; - memcpy(pdu->fsp_pdu_data.data, args->sdu_p->data, args->sdu_size); - pdu->has_fsp_pdu_data = 1; - // Copy data to the ctxt structure - ctxt->fsp_mod_id = args->ctxt->module_id; - ctxt->fsp_enb_flag = args->ctxt->enb_flag; - ctxt->fsp_instance = args->ctxt->instance; - ctxt->fsp_rnti = args->ctxt->rnti; - ctxt->fsp_frame = args->ctxt->frame; - ctxt->fsp_subframe = args->ctxt->subframe; - ctxt->fsp_enb_index = args->ctxt->eNB_index; - ctxt->has_fsp_mod_id = 1; - ctxt->has_fsp_enb_flag = 1; - ctxt->has_fsp_instance = 1; - ctxt->has_fsp_rnti = 1; - ctxt->has_fsp_frame = 1; - ctxt->has_fsp_subframe = 1; - ctxt->has_fsp_enb_index = 1; - rlc_data->fsp_ctxt = ctxt; - rlc_data->fsp_srb_flag = args->srb_flag; - rlc_data->fsp_mbms_flag = args->MBMS_flag; - rlc_data->fsp_rb_id = args->rb_id; - rlc_data->fsp_sdu_buffer_size = args->sdu_size; - rlc_data->fsp_pdu = pdu; - rlc_data->has_fsp_srb_flag = 1; - rlc_data->has_fsp_mbms_flag = 1; - rlc_data->has_fsp_rb_id = 1; - rlc_data->has_fsp_sdu_buffer_size = 1; - // Up to here, everything is a signle message that is packed inside another. The final data_req - // will be created later, after the setting of all variables - data_ind->header = header; - data_ind->enb_id = mod_id; - data_ind->has_enb_id = 1; - data_ind->rlc_data = rlc_data; - *msg = malloc(sizeof(Protocol__FlexsplitMessage)); - - if(*msg == NULL) - goto error; - - protocol__flexsplit_message__init(*msg); - LOG_D(PROTO_AGENT,"setting the message case to %d\n", PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG); - (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG; - (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE; //we will be waiting for the ACK - (*msg)->has_msg_dir = 1; - (*msg)->data_ind_msg = data_ind; //data_req; - return 0; -error: - - if(header != NULL) - free(header); - - if(pdu!=NULL) - free(pdu); - - if(rlc_data!=NULL) - free(rlc_data); - - if(data_ind!= NULL) - free(data_ind); - - if(*msg != NULL) - free(*msg); - - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - boolean_t result = 0; - Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params; - Protocol__FspPdcpDataInd *data_ind = input->data_ind_msg; - Protocol__FspCtxt *ctxt = NULL; - Protocol__FspRlcData *rlc_data = NULL; - rlc_data = data_ind->rlc_data; - ctxt = rlc_data->fsp_ctxt; - protocol_ctxt_t ctxt_pP; - srb_flag_t srb_flagP = 0; - rb_id_t rb_idP = 0; - sdu_size_t pdcp_pdu_size = 0; - MBMS_flag_t flag_MBMS = 0; - mem_block_t *pdcp_pdu_p = NULL; - // Create a new protocol context for handling the packet - ctxt_pP.module_id = ctxt->fsp_mod_id; - ctxt_pP.enb_flag = ctxt->fsp_enb_flag; - ctxt_pP.instance = ctxt->fsp_instance; - ctxt_pP.rnti = ctxt->fsp_rnti; - ctxt_pP.frame = ctxt->fsp_frame; - ctxt_pP.subframe = ctxt->fsp_subframe; - ctxt_pP.brOption = 0; - ctxt_pP.eNB_index = ctxt->fsp_enb_index; - srb_flagP = rlc_data->fsp_srb_flag; - flag_MBMS = rlc_data->fsp_mbms_flag; - rb_idP = rlc_data->fsp_rb_id; - pdcp_pdu_size = rlc_data->fsp_pdu->fsp_pdu_data.len; - pdcp_pdu_p = get_free_mem_block(pdcp_pdu_size, __func__); - - if (!pdcp_pdu_p) goto error; - - memcpy(pdcp_pdu_p->data, rlc_data->fsp_pdu->fsp_pdu_data.data, pdcp_pdu_size); - // if (xid == 1) - // pdcp_data_ind_wifi((const protocol_ctxt_t*) ctxt_pP, (const srb_flag_t) srb_flagP, (const MBMS_flag_t) flag_MBMS, (const rb_id_t) rb_idP, pdcp_pdu_size, pdcp_pdu_p); - // else if (xid == 0) // FIXME: USE a preprocessed definition - LOG_D(PROTO_AGENT, "[inst %ld] Received PDCP PDU with size %d for UE RNTI %x RB %ld, Calling pdcp_data_ind\n", ctxt_pP.instance, pdcp_pdu_size,ctxt_pP.rnti,rb_idP); - result = pdcp_data_ind(&ctxt_pP, - srb_flagP, - flag_MBMS, - rb_idP, - pdcp_pdu_size, - pdcp_pdu_p, NULL, NULL); - return result; -error: - - if (pdcp_pdu_p) - free_mem_block(pdcp_pdu_p, __func__); - - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_hello(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - Protocol__FspHeader *header; - Protocol__FspHello *hello_msg = NULL; - /*TODO: Need to set random xid or xid from received hello message*/ - xid_t xid = mod_id; - - if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_HELLO, &header) != 0) - goto error; - - LOG_D(PROTO_AGENT, "creating the HELLO message\n"); - hello_msg = malloc(sizeof(Protocol__FspHello)); - - if(hello_msg == NULL) - goto error; - - protocol__fsp_hello__init(hello_msg); - hello_msg->header = header; - *msg = malloc(sizeof(Protocol__FlexsplitMessage)); - - if(*msg == NULL) - goto error; - - protocol__flexsplit_message__init(*msg); - (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_HELLO_MSG; - (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__SUCCESSFUL_OUTCOME; - (*msg)->has_msg_dir = 1; - (*msg)->hello_msg = hello_msg; - return 0; -error: - - if(header != NULL) - free(header); - - if(hello_msg!=NULL) - free(hello_msg); - - if(*msg != NULL) - free(*msg); - - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - - -int proto_agent_destroy_hello(Protocol__FlexsplitMessage *msg) { - if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_HELLO_MSG) - goto error; - - free(msg->hello_msg->header); - free(msg->hello_msg); - free(msg); - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_echo_request(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - Protocol__FspHeader *header; - Protocol__FspEchoRequest *echo_request_msg = NULL; - xid_t xid = mod_id; - - if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_ECHO_REQUEST, &header) != 0) - goto error; - - LOG_D(PROTO_AGENT, "creating the echo request message\n"); - echo_request_msg = malloc(sizeof(Protocol__FspEchoRequest)); - - if(echo_request_msg == NULL) - goto error; - - protocol__fsp_echo_request__init(echo_request_msg); - echo_request_msg->header = header; - *msg = malloc(sizeof(Protocol__FlexsplitMessage)); - - if(*msg == NULL) - goto error; - - protocol__flexsplit_message__init(*msg); - LOG_D(PROTO_AGENT,"setting the message direction to %d\n", PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG); - (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG; - (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE; - (*msg)->has_msg_dir = 1; - (*msg)->echo_request_msg = echo_request_msg; - return 0; -error: - - if(header != NULL) - free(header); - - if(echo_request_msg != NULL) - free(echo_request_msg); - - if(*msg != NULL) - free(*msg); - - return -1; -} - -int proto_agent_destroy_echo_request(Protocol__FlexsplitMessage *msg) { - if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG) - goto error; - - free(msg->echo_request_msg->header); - free(msg->echo_request_msg); - free(msg); - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_echo_reply(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - xid_t xid; - Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params; - Protocol__FspEchoRequest *echo_req = input->echo_request_msg; - Protocol__FspEchoReply *echo_reply_msg = NULL; - xid = (echo_req->header)->xid; - LOG_D(PROTO_AGENT, "creating the echo reply message\n"); - Protocol__FspHeader *header; - - if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_ECHO_REPLY, &header) != 0) - goto error; - - echo_reply_msg = malloc(sizeof(Protocol__FspEchoReply)); - - if(echo_reply_msg == NULL) - goto error; - - protocol__fsp_echo_reply__init(echo_reply_msg); - echo_reply_msg->header = header; - *msg = malloc(sizeof(Protocol__FlexsplitMessage)); - - if(*msg == NULL) - goto error; - - protocol__flexsplit_message__init(*msg); - (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REPLY_MSG; - (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__SUCCESSFUL_OUTCOME; - (*msg)->has_msg_dir = 1; - (*msg)->echo_reply_msg = echo_reply_msg; - return 0; -error: - - if(header != NULL) - free(header); - - if(echo_reply_msg != NULL) - free(echo_reply_msg); - - if(*msg != NULL) - free(*msg); - - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_destroy_echo_reply(Protocol__FlexsplitMessage *msg) { - if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REPLY_MSG) - goto error; - - free(msg->echo_reply_msg->header); - free(msg->echo_reply_msg); - free(msg); - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.h deleted file mode 100644 index 8f553e05e1..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file enb_agent_common.h - * \brief common message primitves and utilities - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - - - -#ifndef PROTO_AGENT_COMMON_H_ -#define PROTO_AGENT_COMMON_H_ - -#include - -#include "flexsplit.pb-c.h" - -// Do not need these -//#include "stats_messages.pb-c.h" -//#include "stats_common.pb-c.h" - -#include "proto_agent_defs.h" -//#include "ENB_APP/enb_config.h" -#include "UTIL/MEM/mem_block.h" - -//#include "LAYER2/MAC/extern.h" -//#include "LAYER2/RLC/rlc.h" - -# include "tree.h" -# include "intertask_interface.h" - -#define FLEXSPLIT_VERSION 0 - -typedef int (*proto_agent_message_decoded_callback)( - mod_id_t mod_id, - const void *params, - Protocol__FlexsplitMessage **msg -); - -typedef int (*proto_agent_message_destruction_callback)( - Protocol__FlexsplitMessage *msg -); - - - -/********************************** - * progRAN protocol messages helper - * functions and generic handlers - **********************************/ - -int proto_agent_serialize_message(Protocol__FlexsplitMessage *msg, uint8_t **buf, int *size); -int proto_agent_deserialize_message(void *data, int size, Protocol__FlexsplitMessage **msg); - -uint8_t *proto_agent_pack_message(Protocol__FlexsplitMessage *msg, int *size); - -err_code_t proto_agent_destroy_flexsplit_message(Protocol__FlexsplitMessage *msg); - -int fsp_create_header(xid_t xid, Protocol__FspType type, Protocol__FspHeader **header); - -int proto_agent_hello(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_destroy_hello(Protocol__FlexsplitMessage *msg); -int proto_agent_echo_request(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_destroy_echo_request(Protocol__FlexsplitMessage *msg); -int proto_agent_echo_reply(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_destroy_echo_reply(Protocol__FlexsplitMessage *msg); - -int proto_agent_pdcp_data_req(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_destroy_pdcp_data_req(Protocol__FlexsplitMessage *msg); -int proto_agent_pdcp_data_ind(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg); -int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); - -int just_print(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); - - -int proto_agent_get_ack_result(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); - - -Protocol__FlexsplitMessage* proto_agent_handle_message (mod_id_t mod_id, - uint8_t *data, - int size); - -Protocol__FlexsplitMessage *proto_agent_handle_timed_task(void *args); - -typedef struct _data_req_args data_req_args; -typedef struct _dl_data_args dl_data_args; - -struct _data_req_args{ - const protocol_ctxt_t* ctxt; - srb_flag_t srb_flag; - MBMS_flag_t MBMS_flag; - rb_id_t rb_id; - mui_t mui; - confirm_t confirm; - sdu_size_t sdu_size; - mem_block_t *sdu_p; -}; - -struct _dl_data_args{ - uint8_t pdu_type; - uint32_t sn; - frame_t frame; - sub_frame_t subframe; - rnti_t rnti; - sdu_size_t sdu_size; - mem_block_t *sdu_p; -}; - - -#endif - - - - - - - diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h deleted file mode 100644 index cd730a6de8..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file enb_agent_defs.h - * \brief enb agent common definitions - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ -#ifndef PROTO_AGENT_DEFS_H_ -#define PROTO_AGENT_DEFS_H_ - -#include -#include -#include -#include - -#include "openairinterface5g_limits.h" -#include "UTIL/ASYNC_IF/link_manager.h" - -#define DEFAULT_PROTO_AGENT_IPv4_ADDRESS "127.0.0.1" -#define DEFAULT_PROTO_AGENT_PORT 2210 -#define DEFAULT_PROTO_AGENT_CACHE "/mnt/oai_agent_cache" - -typedef enum { - - PROTO_AGENT_DEFAULT=0, - - ENB_AGENT_PHY=1, - ENB_AGENT_MAC=2, - ENB_AGENT_RLC=3, - ENB_AGENT_PDCP=4, - ENB_AGENT_RRC=5, - ENB_AGENT_S1AP=6, - ENB_AGENT_GTP=7, - ENB_AGENT_X2AP=8, - - ENB_AGENT_MAX=9, - -} proto_agent_id_t; - -/* -typedef enum { - ENB_AGENT_ACTION_NONE = 0x0, - - ENB_AGENT_ACTION_SEND = 0x1, - - ENB_AGENT_ACTION_APPLY = 0x2, - - ENB_AGENT_ACTION_CLEAR = 0x4, - - ENB_AGENT_ACTION_WRITE = 0x8, - - ENB_AGENT_ACTION_FILTER = 0x10, - - ENB_AGENT_ACTION_PREPROCESS = 0x20, - - ENB_AGENT_ACTION_METER = 0x40, - - ENB_AGENT_ACTION_MAX = 0x7f, -} agent_action_t; -*/ -/* -typedef enum { - - RAN_LTE_OAI= 0, - - RAN_NAME_MAX = 0x7f, -} ran_name_t; -*/ -typedef uint8_t xid_t; -typedef uint8_t mod_id_t; // module or enb id -typedef uint8_t lcid_t; -typedef int32_t err_code_t; - -typedef struct { - /* general info */ - - /* stats */ - - uint32_t total_rx_msg; - uint32_t total_tx_msg; - - uint32_t rx_msg[NUMBER_OF_eNB_MAX]; - uint32_t tx_msg[NUMBER_OF_eNB_MAX]; - -} proto_agent_info_t; - -/* forward declaration */ -struct proto_agent_channel_s; - -typedef struct proto_agent_instance_s { - mod_id_t mod_id; - proto_agent_info_t agent_info; - struct proto_agent_channel_s *channel; - pthread_t recv_thread; - uint8_t exit; -} proto_agent_instance_t; - -#endif diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c deleted file mode 100644 index 82f7849717..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file enb_agent_handler.c - * \brief enb agent tx and rx message handler - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - - -#include "proto_agent_common.h" -#include "common/utils/LOG/log.h" -#include "assertions.h" - -proto_agent_message_decoded_callback proto_agent_messages_callback[][3] = { - {proto_agent_hello, 0, 0}, /* agent hello */ - {proto_agent_echo_reply, 0, 0}, /* echo */ - {0, just_print, 0}, /* just print */ - {proto_agent_pdcp_data_req_process, proto_agent_pdcp_data_req_process, 0}, /* PDCP data REQ */ - {0, proto_agent_get_ack_result, 0}, /* get ACK result */ - {proto_agent_pdcp_data_ind_process, proto_agent_pdcp_data_ind_process, 0}, /* PDCP data IND */ - {0, just_print, 0}, /* just print */ -}; - -proto_agent_message_destruction_callback proto_message_destruction_callback[] = { - proto_agent_destroy_hello, - proto_agent_destroy_echo_request, - proto_agent_destroy_echo_reply, - proto_agent_destroy_pdcp_data_req, - 0, - proto_agent_destroy_pdcp_data_ind, - 0, -}; - -//static const char *proto_agent_direction2String[] = { -// "", /* not_set */ -// "originating message", /* originating message */ -// "successfull outcome", /* successfull outcome */ -// "unsuccessfull outcome", /* unsuccessfull outcome */ -//}; - - -Protocol__FlexsplitMessage* proto_agent_handle_message (mod_id_t mod_id, - uint8_t *data, - int size){ - - Protocol__FlexsplitMessage *decoded_message = NULL; - Protocol__FlexsplitMessage *reply_message = NULL; - err_code_t err_code; - DevAssert(data != NULL); - - LOG_D(PROTO_AGENT, "Deserializing message with size %u \n", size); - if (proto_agent_deserialize_message(data, (int) size, &decoded_message) < 0) { - err_code= PROTOCOL__FLEXSPLIT_ERR__MSG_DECODING; - goto error; - } - /* after deserialization, we don't need the original data memory anymore */ - free(data); - Protocol__FspHeader *header = (Protocol__FspHeader*) decoded_message; - if (header->has_type) - { - LOG_D(PROTO_AGENT, "Deserialized MSG type is %d and %u\n", decoded_message->msg_case, decoded_message->msg_dir); - } - - if ((decoded_message->msg_case > sizeof(proto_agent_messages_callback) / (3*sizeof(proto_agent_message_decoded_callback))) || - (decoded_message->msg_dir > PROTOCOL__FLEXSPLIT_DIRECTION__UNSUCCESSFUL_OUTCOME)) - { - err_code= PROTOCOL__FLEXSPLIT_ERR__MSG_NOT_HANDLED; - LOG_D(PROTO_AGENT,"Handling message: MSG NOT handled, going to error\n"); - goto error; - } - - - err_code = ((*proto_agent_messages_callback[decoded_message->msg_case-1][decoded_message->msg_dir-1])(mod_id, (void *) decoded_message, &reply_message)); - - if ( err_code < 0 ) - { - LOG_I(PROTO_AGENT, "decoded_message case : %d, direction : %d \n", decoded_message->msg_case-1, decoded_message->msg_dir-1); - goto error; - } - - protocol__flexsplit_message__free_unpacked(decoded_message, NULL); - LOG_D(PROTO_AGENT,"Returning REPLY message after the callback\n"); - return reply_message; - - error: - LOG_E(PROTO_AGENT,"errno %d occured\n",err_code); - return NULL; -} - - - -uint8_t *proto_agent_pack_message(Protocol__FlexsplitMessage *msg, int *size) -{ - uint8_t *buffer; - err_code_t err_code = PROTOCOL__FLEXSPLIT_ERR__NO_ERR; - - if (proto_agent_serialize_message(msg, &buffer, size) < 0 ) { - err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENCODING; - goto error; - } - - if (proto_message_destruction_callback[msg->msg_case-1]) - err_code = ((*proto_message_destruction_callback[msg->msg_case-1])(msg)); - - DevAssert(buffer !=NULL); - - LOG_D(PROTO_AGENT,"Serialized the enb mac stats reply (size %d)\n", *size); - return buffer; - - error : - LOG_E(PROTO_AGENT,"errno %d occured\n",err_code); - - return NULL; -} - -err_code_t proto_agent_destroy_flexsplit_message(Protocol__FlexsplitMessage *msg) { - return ((*proto_message_destruction_callback[msg->msg_case-1])(msg)); -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c deleted file mode 100644 index 925c11c8f8..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file enb_agent_net_comm.c - * \brief enb agent network interface abstraction - * \author Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - -#include "proto_agent_net_comm.h" -#include "common/utils/LOG/log.h" - -proto_agent_channel_t *proto_channel[NUMBER_OF_eNB_MAX][ENB_AGENT_MAX]; -static proto_agent_channel_instance_t channel_instance; -int proto_agent_channel_id = 0; - -int proto_agent_register_channel(mod_id_t mod_id, proto_agent_channel_t *channel, proto_agent_id_t agent_id) { - int i; - - if (channel == NULL) { - return -1; - } - - if (agent_id == ENB_AGENT_MAX) { - for (i = 0; i < ENB_AGENT_MAX; i++) { - proto_channel[mod_id][i] = channel; - } - } else { - proto_channel[mod_id][agent_id] = channel; - } - return 0; -} - -void proto_agent_unregister_channel(mod_id_t mod_id, proto_agent_id_t agent_id) { - int i; - - if (agent_id == ENB_AGENT_MAX) { - for (i = 0; i < ENB_AGENT_MAX; i++) { - proto_channel[mod_id][i] = NULL; - } - } else { - proto_channel[mod_id][agent_id] = NULL; - } -} - -int proto_agent_create_channel(void *channel_info, - int (*msg_send)(void *data, int size, int priority, void *channel_info), - int (*msg_recv)(void **data, int *priority, void *channel_info), - void (*release)(proto_agent_channel_t *channel)) { - - int channel_id = ++proto_agent_channel_id; - proto_agent_channel_t *channel = (proto_agent_channel_t *) malloc(sizeof(proto_agent_channel_t)); - channel->channel_id = channel_id; - channel->channel_info = channel_info; - channel->msg_send = msg_send; - channel->msg_recv = msg_recv; - channel->release = release; - - /*element should be a real pointer*/ - RB_INSERT(proto_agent_channel_map, &channel_instance.proto_agent_head, channel); - - LOG_D(PROTO_AGENT, "Created a new channel with id 0x%x\n", channel->channel_id); - - return channel_id; -} - -int proto_agent_destroy_channel(int channel_id) { - int i, j; - - /*Check to see if channel exists*/ - struct proto_agent_channel_s *e = NULL; - struct proto_agent_channel_s search; - memset(&search, 0, sizeof(struct proto_agent_channel_s)); - - e = RB_FIND(proto_agent_channel_map, &channel_instance.proto_agent_head, &search); - - if (e == NULL) { - return -1; - } - - /*Unregister the channel from all agents*/ - for (i = 0; i < NUMBER_OF_eNB_MAX; i++) { - for (j = 0; j < ENB_AGENT_MAX; j++) { - if (proto_channel[i][j] != NULL) { - if (proto_channel[i][j]->channel_id == e->channel_id) { - proto_channel[i][j] = NULL; - } - } - } - } - - /*Remove the channel from the tree and free memory*/ - RB_REMOVE(proto_agent_channel_map, &channel_instance.proto_agent_head, e); - e->release(e); - free(e); - - return 0; -} - -err_code_t proto_agent_init_channel_container(void) { - int i, j; - LOG_D(PROTO_AGENT, "init RB tree for channel container\n"); - - RB_INIT(&channel_instance.proto_agent_head); - - for (i = 0; i < NUMBER_OF_eNB_MAX; i++) { - for (j = 0; j < ENB_AGENT_MAX; j++) { - proto_channel[i][j] = NULL; - } - } - - return 0; -} - -RB_GENERATE(proto_agent_channel_map,proto_agent_channel_s, entry, proto_agent_compare_channel); - -int proto_agent_compare_channel(struct proto_agent_channel_s *a, struct proto_agent_channel_s *b) { - if (a->channel_id < b->channel_id) return -1; - if (a->channel_id > b->channel_id) return 1; - - // equal timers - return 0; -} - -proto_agent_channel_t * proto_agent_get_channel(int channel_id) { - - struct proto_agent_channel_s search; - memset(&search, 0, sizeof(struct proto_agent_channel_s)); - search.channel_id = channel_id; - - return RB_FIND(proto_agent_channel_map, &channel_instance.proto_agent_head, &search); - -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h deleted file mode 100644 index 55fca5a928..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file enb_agent_net_comm.h - * \brief enb agent network interface abstraction - * \autho Xenofon Foukas - * \date 2016 - * \version 0.1 - */ -#ifndef PROTO_AGENT_NET_COMM_H_ -#define PROTO_AGENT_NET_COMM_H_ - -#include "proto_agent_defs.h" - -#include "tree.h" -#define ENB_AGENT_MAX 9 - -/* forward declaration */ -struct proto_agent_async_channel_s; - -/*Channel related information used for Tx/Rx of protocol messages*/ -typedef struct proto_agent_channel_s { - RB_ENTRY(proto_agent_channel_s) entry; - int channel_id; - struct proto_agent_async_channel_s *channel_info; - /*Callbacks for channel message Tx and Rx*/ - int (*msg_send)(void *data, int size, int priority, void *channel_info); - int (*msg_recv)(void **data, int *priority, void *channel_info); - void (*release)(struct proto_agent_channel_s *channel); -} proto_agent_channel_t; - -typedef struct proto_agent_channel_instance_s{ - RB_HEAD(proto_agent_channel_map, proto_agent_channel_s) proto_agent_head; -} proto_agent_channel_instance_t; - - -/*Register a channel to an agent. Use ENB_AGENT_MAX to register the - *same channel to all agents*/ -int proto_agent_register_channel(mod_id_t mod_id, proto_agent_channel_t *channel, proto_agent_id_t agent_id); - -/*Unregister the current channel of an agent. Use ENB_AGENT_MAX to unregister all channels*/ -void proto_agent_unregister_channel(mod_id_t mod_id, proto_agent_id_t agent_id); - -/*Create a new channel. Returns the id of the new channel or negative number otherwise*/ -int proto_agent_create_channel(void *channel_info, - int (*msg_send)(void *data, int size, int priority, void *channel_info), - int (*msg_recv)(void **data, int *priority, void *channel_info), - void (*release)(proto_agent_channel_t *channel)); - -/*Unregister a channel from all agents and destroy it. Returns 0 in case of success*/ -int proto_agent_destroy_channel(int channel_id); - -/*Return an agent communication channel based on its id*/ -proto_agent_channel_t * proto_agent_get_channel(int channel_id); - -/*Should be called before performing any channel operations*/ -err_code_t proto_agent_init_channel_container(void); - -int proto_agent_compare_channel(struct proto_agent_channel_s *a, struct proto_agent_channel_s *b); - -/* RB_PROTOTYPE is for .h files */ -RB_PROTOTYPE(proto_agent_channel_map, proto_agent_channel_s, entry, proto_agent_compare_channel); - -#endif /*ENB_AGENT_COMM_H_*/ diff --git a/openair2/LAYER2/RLC/rlc_proto_agent_primitives.h b/openair2/LAYER2/RLC/rlc_proto_agent_primitives.h deleted file mode 100644 index 75ccc9fcdd..0000000000 --- a/openair2/LAYER2/RLC/rlc_proto_agent_primitives.h +++ /dev/null @@ -1,16 +0,0 @@ - -#ifndef __PROTO_AGENT_RLC_PRIMITIVES_H__ -#define __PROTO_AGENT_RLC_PRIMITIVES_H__ - -#include "RRC/LTE/rrc_defs.h" -#include "LAYER2/PROTO_AGENT/proto_agent.h" -// PROTO AGENT -pthread_t async_server_thread; -int async_server_thread_finalize (void); -void async_server_thread_init (void); - -pthread_mutex_t async_server_lock; -pthread_cond_t async_server_notify; -int async_server_shutdown; - -#endif diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index dcf2694d1a..baae1fa436 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -40,8 +40,6 @@ #include "openair2/F1AP/f1ap_du_rrc_message_transfer.h" -#include "openair2/LAYER2/PROTO_AGENT/proto_agent.h" - extern RAN_CONTEXT_t RC; #include diff --git a/openair2/MCE_APP/mce_config.c b/openair2/MCE_APP/mce_config.c index 439f2d2061..9d9d9028e5 100644 --- a/openair2/MCE_APP/mce_config.c +++ b/openair2/MCE_APP/mce_config.c @@ -54,8 +54,6 @@ #include "common/config/config_userapi.h" #include "RRC_config_tools.h" #include "enb_paramdef.h" -#include "proto_agent.h" - #include "m3ap_MCE.h" diff --git a/openair3/MME_APP/mme_config.c b/openair3/MME_APP/mme_config.c index 3b4074f553..8005b85fd4 100644 --- a/openair3/MME_APP/mme_config.c +++ b/openair3/MME_APP/mme_config.c @@ -54,7 +54,6 @@ #include "common/config/config_userapi.h" #include "RRC_config_tools.h" #include "enb_paramdef.h" -#include "proto_agent.h" int RCconfig_MME(void ) { //int num_enbs = 0; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 85e493f194..91b652e630 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -499,8 +499,6 @@ static void init_pdcp(void) { pdcp_set_rlc_data_req_func(rlc_data_req); pdcp_set_pdcp_data_ind_func(pdcp_data_ind); } - } else { - pdcp_set_pdcp_data_ind_func(proto_agent_send_pdcp_data_ind); } } diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index cf35a13fe9..278054861e 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -30,7 +30,6 @@ #include "flexran_agent.h" #include "s1ap_eNB.h" #include "SIMULATION/ETH_TRANSPORT/proto.h" -#include "proto_agent.h" #include "executables/softmodem-common.h" From 284734ba86ee3eecdfc93ca3c8e428f337fc59ac Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Feb 2022 08:39:25 +0100 Subject: [PATCH 105/196] Add 5G FDD RFsim test --- .../gnb.sa.band66.fr1.106PRB.usrpn300.conf | 299 ++++++++++++++++++ .../xml_files/container_5g_fdd_rfsim.xml | 116 +++++++ .../xml_files/container_5g_fdd_rfsim_down.xml | 38 +++ .../5g_fdd_rfsimulator/amf-healthcheck.sh | 57 ++++ .../5g_fdd_rfsimulator/docker-compose.yaml | 298 +++++++++++++++++ .../5g_fdd_rfsimulator/mysql-healthcheck.sh | 46 +++ .../5g_fdd_rfsimulator/nrf-healthcheck.sh | 20 ++ .../5g_fdd_rfsimulator/oai-smf.conf | 133 ++++++++ .../yaml_files/5g_fdd_rfsimulator/oai_db.sql | 217 +++++++++++++ .../5g_fdd_rfsimulator/smf-healthcheck.sh | 21 ++ .../5g_fdd_rfsimulator/spgwu-healthcheck.sh | 28 ++ docker/scripts/gnb_entrypoint.sh | 1 + docker/scripts/gnb_parameters.yaml | 30 ++ 13 files changed, 1304 insertions(+) create mode 100644 ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf create mode 100644 ci-scripts/xml_files/container_5g_fdd_rfsim.xml create mode 100644 ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh create mode 100644 ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh create mode 100644 ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh diff --git a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf new file mode 100644 index 0000000000..21bdb4e9d2 --- /dev/null +++ b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -0,0 +1,299 @@ +Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-Eurecom-5GNRBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 95; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 2; + sd = 2; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + min_rxtxtime = 6; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 433096; + dl_frequencyBand = 66; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 430000; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 13475; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 66; + ul_absoluteFrequencyPointA = 350000; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 13475; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -118; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + ulsch_max_slots_inactivity = 100; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + }; + diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml new file mode 100644 index 0000000000..44be29cca4 --- /dev/null +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -0,0 +1,116 @@ + + + rfsim-5gnr + Testing 5G NR RF sim - Monolithic gNB + wrench + 4 + + 100011 + 000010 + 000011 + 000012 + 000013 + 020011 + 020012 + 100011 + + + + + + DeployGenObject + Deploy MySql Database + yaml_files/5g_fdd_rfsimulator + mysql + 1 + + + + DeployGenObject + Deploy OAI 5G CoreNetwork + yaml_files/5g_fdd_rfsimulator + oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn + 6 + + + + DeployGenObject + Deploy OAI 5G gNB RF sim SA + yaml_files/5g_fdd_rfsimulator + oai-gnb + 7 + + + + DeployGenObject + Deploy OAI 5G NR-UE RF sim SA + yaml_files/5g_fdd_rfsimulator + oai-nr-ue + 8 + + + + PingFromContainer + Ping ext-dn from NR-UE + rfsim5g-oai-nr-ue + -I oaitun_ue1 -c 20 192.168.72.135 + 5 + + + + PingFromContainer + Ping NR-UE from ext-dn + rfsim5g-oai-ext-dn + -c 20 12.1.1.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + rfsim5g-oai-nr-ue + rfsim5g-oai-ext-dn + -B 12.1.1.2 -u -i 1 -s + -c 12.1.1.2 -u -i 1 -t 30 -b 3M + + + + IperfFromContainer + Iperf UDP Uplink + rfsim5g-oai-ext-dn + rfsim5g-oai-nr-ue + -u -i 1 -s + -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M + + + + UndeployGenObject + Undeploy all OAI 5G stack + yaml_files/5g_fdd_rfsimulator + + + diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml new file mode 100644 index 0000000000..c9e9a99d7b --- /dev/null +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml @@ -0,0 +1,38 @@ + + + rfsim-5gnr-down + CleanUp 5G RF - Monolithic gNB + trash + + 100012 + + + + + UndeployGenObject + Undeploy all OAI 5G stack + yaml_files/5g_fdd_rfsimulator + + + diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh new file mode 100755 index 0000000000..8bfdee2aac --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh @@ -0,0 +1,57 @@ +#!/bin/bash +set -eo pipefail + +STATUS=0 +AMF_PORT_FOR_NGAP=38412 +AMF_PORT_FOR_N11_HTTP=80 +AMF_IP_NGAP_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_NGAP | grep inet | awk {'print $2'}) +AMF_IP_N11_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_N11 | grep inet | awk {'print $2'}) +N2_PORT_STATUS=$(netstat -Snpl | grep -o "$AMF_IP_NGAP_INTERFACE:$AMF_PORT_FOR_NGAP") +N11_PORT_STATUS=$(netstat -tnpl | grep -o "$AMF_IP_N11_INTERFACE:$AMF_PORT_FOR_N11_HTTP") +#Check if entrypoint properly configured the conf file and no parameter is unset (optional) +NB_UNREPLACED_AT=`cat /openair-amf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true` + +if [ $NB_UNREPLACED_AT -ne 0 ]; then + STATUS=1 + echo "Healthcheck error: configuration file is not configured properly" +fi + +if [[ -z $N2_PORT_STATUS ]]; then + STATUS=1 + echo "Healthcheck error: N2 SCTP port $AMF_PORT_FOR_NGAP is not listening" +fi + +if [[ -z $N11_PORT_STATUS ]]; then + STATUS=1 + echo "Healthcheck error: N11/SBI TCP/HTTP port $AMF_PORT_FOR_N11_HTTP is not listening" +fi + +#host="${MYSQL_SERVER}" +#user="${MYSQL_USER:-root}" +#export MYSQL_PWD="${MYSQL_PASS}" + +#args=( +# -h"$host" +# -u"$user" +# --silent +#) + +#if ! command -v mysql &> /dev/null; then +# echo "Installing mysql command" +# apt update +# apt-get -y install mysql-client +#else +# if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then +# database_check=$(mysql -h$host -u$user -D oai_db --silent -e "SELECT * FROM users;") +# if [[ -z $database_check ]]; then +# echo "Healthcheck error: oai_db not populated" +# STATUS=1 +# fi +# STATUS=0 +# else +# echo "Healthcheck error: Mysql port inactive" +# STATUS=1 +# fi +#fi + +exit $STATUS diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml new file mode 100644 index 0000000000..bf75828ed1 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml @@ -0,0 +1,298 @@ +version: '3.8' +services: + oai-nrf: + container_name: "rfsim5g-oai-nrf" + image: oai-nrf:latest + environment: + - NRF_INTERFACE_NAME_FOR_SBI=eth0 + - NRF_INTERFACE_PORT_FOR_SBI=80 + - NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 + - NRF_API_VERSION=v1 + - INSTANCE=0 + - PID_DIRECTORY=/var/run + networks: + public_net: + ipv4_address: 192.168.71.130 + volumes: + - ./nrf-healthcheck.sh:/openair-nrf/bin/nrf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-nrf/bin/nrf-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + mysql: + container_name: "rfsim5g-mysql" + image: mysql:5.7 + volumes: + - ./oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql + - ./mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh + environment: + - TZ=Europe/Paris + - MYSQL_DATABASE=oai_db + - MYSQL_USER=test + - MYSQL_PASSWORD=test + - MYSQL_ROOT_PASSWORD=linux + healthcheck: + test: /bin/bash -c "/tmp/mysql-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.131 + oai-amf: + container_name: "rfsim5g-oai-amf" + image: oai-amf:latest + environment: + - TZ=Europe/paris + - INSTANCE=0 + - PID_DIRECTORY=/var/run + - MCC=208 + - MNC=99 + - REGION_ID=128 + - AMF_SET_ID=1 + - SERVED_GUAMI_MCC_0=208 + - SERVED_GUAMI_MNC_0=99 + - SERVED_GUAMI_REGION_ID_0=128 + - SERVED_GUAMI_AMF_SET_ID_0=1 + - SERVED_GUAMI_MCC_1=460 + - SERVED_GUAMI_MNC_1=11 + - SERVED_GUAMI_REGION_ID_1=10 + - SERVED_GUAMI_AMF_SET_ID_1=1 + - PLMN_SUPPORT_MCC=208 + - PLMN_SUPPORT_MNC=99 + - PLMN_SUPPORT_TAC=0x0001 + - SST_0=1 + - SD_0=1 + - SST_1=1 + - SD_1=12 + - AMF_INTERFACE_NAME_FOR_NGAP=eth0 + - AMF_INTERFACE_NAME_FOR_N11=eth0 + - SMF_INSTANCE_ID_0=1 + - SMF_FQDN_0=oai-smf + - SMF_IPV4_ADDR_0=0.0.0.0 + - SMF_HTTP_VERSION_0=v1 + - SELECTED_0=true + - SMF_INSTANCE_ID_1=2 + - SMF_FQDN_1=oai-smf + - SMF_IPV4_ADDR_1=0.0.0.0 + - SMF_HTTP_VERSION_1=v1 + - SELECTED_1=false + - MYSQL_SERVER=192.168.71.131 + - MYSQL_USER=root + - MYSQL_PASS=linux + - MYSQL_DB=oai_db + - OPERATOR_KEY=c42449363bbad02b66d16bc975d77cc1 + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NF_REGISTRATION=yes + - SMF_SELECTION=yes + - USE_FQDN_DNS=yes + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - EXTERNAL_AUSF=no + - AUSF_IPV4_ADDRESS=0.0.0.0 + - AUSF_PORT=80 + - AUSF_API_VERSION=v1 + - AUSF_FQDN=localhost + depends_on: + - oai-nrf + - mysql + volumes: + - ./amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh" + interval: 10s + timeout: 15s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.132 + oai-smf: + container_name: "rfsim5g-oai-smf" + image: oai-smf:latest + entrypoint: /bin/bash -c "/openair-smf/bin/oai_smf -c /openair-smf/bin/oai-smf.conf -o" + environment: + - TZ=Europe/Paris + - INSTANCE=0 + - PID_DIRECTORY=/var/run + - SMF_INTERFACE_NAME_FOR_N4=eth0 + - SMF_INTERFACE_NAME_FOR_SBI=eth0 + - SMF_INTERFACE_PORT_FOR_SBI=80 + - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 + - SMF_API_VERSION=v1 + - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4 + - AMF_IPV4_ADDRESS=0.0.0.0 + - AMF_PORT=80 + - AMF_API_VERSION=v1 + - AMF_FQDN=oai-amf + - UDM_IPV4_ADDRESS=127.0.0.1 + - UDM_PORT=80 + - UDM_API_VERSION=v1 + - UDM_FQDN=localhost + - UPF_IPV4_ADDRESS=192.168.71.134 + - UPF_FQDN_0=oai-spgwu + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - REGISTER_NRF=yes + - DISCOVER_UPF=yes + - USE_FQDN_DNS=yes + depends_on: + - oai-nrf + - oai-amf + volumes: + - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh + - ./oai-smf.conf:/openair-smf/bin/oai-smf.conf + healthcheck: + test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.133 + oai-spgwu: + container_name: "rfsim5g-oai-spgwu" + image: oai-spgwu-tiny:latest + environment: + - TZ=Europe/Paris + - PID_DIRECTORY=/var/run + - SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP=eth0 + - SGW_INTERFACE_NAME_FOR_SX=eth0 + - PGW_INTERFACE_NAME_FOR_SGI=eth0 + - NETWORK_UE_NAT_OPTION=yes + - NETWORK_UE_IP=12.1.1.0/24 + - SPGWC0_IP_ADDRESS=192.168.71.133 + - BYPASS_UL_PFCP_RULES=no + - MCC=208 + - MNC=99 + - MNC03=099 + - TAC=1 + - GTP_EXTENSION_HEADER_PRESENT=yes + - GW_ID=1 + - REALM=openairinterface.org + - ENABLE_5G_FEATURES=yes + - REGISTER_NRF=yes + - USE_FQDN_NRF=yes + - UPF_FQDN_5G=oai-spgwu + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - NSSAI_SST_0=1 + - NSSAI_SD_0=1 + - DNN_0=oai + depends_on: + - oai-nrf + - oai-smf + cap_add: + - NET_ADMIN + - SYS_ADMIN + cap_drop: + - ALL + privileged: true + volumes: + - ./spgwu-healthcheck.sh:/openair-spgwu-tiny/bin/spgwu-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-spgwu-tiny/bin/spgwu-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.134 + traffic_net: + ipv4_address: 192.168.72.134 + oai-ext-dn: + image: ubuntu:bionic + privileged: true + container_name: rfsim5g-oai-ext-dn + entrypoint: /bin/bash -c \ + "apt update; apt install -y procps iptables iproute2 iperf iputils-ping;"\ + "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ + "ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity" + depends_on: + - oai-spgwu + networks: + traffic_net: + ipv4_address: 192.168.72.135 + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.72.134" + interval: 10s + timeout: 5s + retries: 5 + oai-gnb: + image: oai-gnb:develop + privileged: true + container_name: rfsim5g-oai-gnb + environment: + RFSIMULATOR: server + USE_SA_FDD_MONO: 'yes' + GNB_NAME: gnb-rfsim + TAC: 1 + MCC: '208' + MNC: '99' + MNC_LENGTH: 2 + NSSAI_SST: 1 + NSSAI_SD0: 1 + NSSAI_SD1: 112233 + AMF_IP_ADDRESS: 192.168.71.132 + GNB_NGA_IF_NAME: eth0 + GNB_NGA_IP_ADDRESS: 192.168.71.136 + GNB_NGU_IF_NAME: eth0 + GNB_NGU_IP_ADDRESS: 192.168.71.136 + USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time + depends_on: + - oai-ext-dn + networks: + public_net: + ipv4_address: 192.168.71.136 + healthcheck: + test: /bin/bash -c "pgrep nr-softmodem" + interval: 10s + timeout: 5s + retries: 5 + oai-nr-ue: + image: oai-nr-ue:develop + privileged: true + container_name: rfsim5g-oai-nr-ue + environment: + RFSIMULATOR: 192.168.71.136 + FULL_IMSI: '208990100001100' + FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'C42449363BBAD02B66D16BC975D77CC1' + DNN: oai + NSSAI_SST: 1 + NSSAI_SD: 1 + USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --band 66 -C 2169080000 --CO -400000000 -s 396 --nokrnmod --log_config.global_log_options level,nocolor,time + depends_on: + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.71.137 + healthcheck: + test: /bin/bash -c "pgrep nr-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + public_net: + driver: bridge + name: rfsim5g-oai-public-net + ipam: + config: + - subnet: 192.168.71.128/26 + driver_opts: + com.docker.network.bridge.name: "rfsim5g-public" + traffic_net: + driver: bridge + name: rfsim5g-oai-traffic-net + ipam: + config: + - subnet: 192.168.72.128/26 + driver_opts: + com.docker.network.bridge.name: "rfsim5g-traffic" diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh new file mode 100755 index 0000000000..c92efb9f00 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -eo pipefail + +if [ "$MYSQL_ROOT_PASSWORD" ] && [ -z "$MYSQL_USER" ] && [ -z "$MYSQL_PASSWORD" ]; then + echo >&2 'Healthcheck error: cannot determine root password (and MYSQL_USER and MYSQL_PASSWORD were not set)' + exit 0 +fi + +host="$(hostname --ip-address || echo '127.0.0.1')" +user="${MYSQL_USER:-root}" +export MYSQL_PWD="${MYSQL_PASSWORD:-$MYSQL_ROOT_PASSWORD}" + +args=( + # force mysql to not use the local "mysqld.sock" (test "external" connectivity) + -h"$host" + -u"$user" + --silent +) + +STATUS=0 +if command -v mysqladmin &> /dev/null; then + if mysqladmin "${args[@]}" ping > /dev/null; then + database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;") + if [[ -z $database_check ]]; then + echo "Healthcheck error: oai_db not populated" + STATUS=1 + fi + STATUS=0 + else + echo "Healthcheck error: Mysql port inactive" + STATUS=1 + fi +else + if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then + database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;") + if [[ -z $database_check ]]; then + echo "Healthcheck error: oai_db not populated" + STATUS=1 + fi + STATUS=0 + else + echo "Healthcheck error: Mysql port inactive" + STATUS=1 + fi +fi +exit $STATUS diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh new file mode 100755 index 0000000000..3479c092e8 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -eo pipefail + +STATUS=0 +NRF_IP_SBI_INTERFACE=$(ifconfig $NRF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'}) +NRF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$NRF_IP_SBI_INTERFACE:$NRF_INTERFACE_PORT_FOR_SBI") +#Check if entrypoint properly configured the conf file and no parameter is unset(optional) +NB_UNREPLACED_AT=`cat /openair-nrf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true` + +if [ $NB_UNREPLACED_AT -ne 0 ]; then + STATUS=1 + echo "Healthcheck error: UNHEALTHY configuration file is not configured properly" +fi + +if [[ -z $NRF_SBI_PORT_STATUS ]]; then + STATUS=1 + echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $NRF_INTERFACE_PORT_FOR_SBI is not listening." +fi + +exit $STATUS \ No newline at end of file diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf new file mode 100644 index 0000000000..0c83ab8be9 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf @@ -0,0 +1,133 @@ +################################################################################ +# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The OpenAirInterface Software Alliance licenses this file to You under +# the OAI Public License, Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.openairinterface.org/?page_id=698 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +# For more information about the OpenAirInterface (OAI) Software Alliance: +# contact@openairinterface.org +################################################################################ + +SMF = +{ + FQDN = "oai-smf-svc"; + INSTANCE = 0; # 0 is the default + PID_DIRECTORY = "/var/run"; # /var/run is the default + + INTERFACES : + { + N4 : + { + # SMF binded interface for N4 communication (UPF) + INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE + IPV4_ADDRESS = "read"; + }; + + SBI : + { + # SMF binded interface for SBI interface (e.g., communication with AMF, UDM) + INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE + IPV4_ADDRESS = "read"; + PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80) + HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE + API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE + }; + + }; + + + # Pool of UE assigned IP addresses + # Do not make IP pools overlap + # first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF + IP_ADDRESS_POOL : + { + IPV4_LIST = ( + {RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. + {RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. + {RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. + + ); + IPV6_LIST = ( + {PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. + {PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. + {PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. + ); + }; + + DNN_LIST = ( + # IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6} + {DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1}, + {DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1}, + {DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1} + ); + + # DNS address communicated to UEs + DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE + DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE + DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE + DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE + + SUPPORT_FEATURES: + { + # STRING, {"yes", "no"}, + REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF + DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection + FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no", + # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling + USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM + USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN + } + + AMF : + { + IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE + PORT = 80; # YOUR AMF CONFIG HERE (default: 80) + API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE + FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE + }; + + UDM : + { + IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE + PORT = 80; # YOUR UDM CONFIG HERE (default: 80) + API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE + FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE + }; + + NRF : + { + IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE + PORT = 80; # YOUR NRF CONFIG HERE (default: 80) + API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE + FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE + }; + + UPF_LIST = ( + {IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE + ); + + LOCAL_CONFIGURATION : + { + SESSION_MANAGEMENT_SUBSCRIPTION_LIST = ( + { NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, + QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", + QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}, + { NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, + QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", + QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"} + ); + }; + +}; + diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql new file mode 100755 index 0000000000..fbd7907a71 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql @@ -0,0 +1,217 @@ +-- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (x86_64) +-- +-- Host: localhost Database: oai_db +-- ------------------------------------------------------ +-- Server version 5.5.46-0ubuntu0.14.04.2 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `apn` +-- + +DROP TABLE IF EXISTS `apn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `apn` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `apn-name` varchar(60) NOT NULL, + `pdn-type` enum('IPv4','IPv6','IPv4v6','IPv4_or_IPv6') NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `apn-name` (`apn-name`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `apn` +-- + +LOCK TABLES `apn` WRITE; +/*!40000 ALTER TABLE `apn` DISABLE KEYS */; +/*!40000 ALTER TABLE `apn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `mmeidentity` +-- + +DROP TABLE IF EXISTS `mmeidentity`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mmeidentity` ( + `idmmeidentity` int(11) NOT NULL AUTO_INCREMENT, + `mmehost` varchar(255) DEFAULT NULL, + `mmerealm` varchar(200) DEFAULT NULL, + `UE-Reachability` tinyint(1) NOT NULL COMMENT 'Indicates whether the MME supports UE Reachability Notifcation', + PRIMARY KEY (`idmmeidentity`) +) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `mmeidentity` +-- + +LOCK TABLES `mmeidentity` WRITE; +/*!40000 ALTER TABLE `mmeidentity` DISABLE KEYS */; +INSERT INTO `mmeidentity` VALUES (2,'mme2.openair4G.eur','openair4G.eur',0),(1,'nano.openair4G.eur','openair4G.eur',0),(5,'abeille.openair4G.eur','openair4G.eur',0),(4,'yang.openair4G.eur','openair4G.eur',0),(3,'mme3.openair4G.eur','openair4G.eur',0),(6,'calisson.openair4G.eur','openair4G.eur',0); +/*!40000 ALTER TABLE `mmeidentity` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pdn` +-- + +DROP TABLE IF EXISTS `pdn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pdn` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `apn` varchar(60) NOT NULL, + `pdn_type` enum('IPv4','IPv6','IPv4v6','IPv4_or_IPv6') NOT NULL DEFAULT 'IPv4', + `pdn_ipv4` varchar(15) DEFAULT '0.0.0.0', + `pdn_ipv6` varchar(45) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT '0:0:0:0:0:0:0:0', + `aggregate_ambr_ul` int(10) unsigned DEFAULT '50000000', + `aggregate_ambr_dl` int(10) unsigned DEFAULT '100000000', + `pgw_id` int(11) NOT NULL, + `users_imsi` varchar(15) NOT NULL, + `qci` tinyint(3) unsigned NOT NULL DEFAULT '9', + `priority_level` tinyint(3) unsigned NOT NULL DEFAULT '15', + `pre_emp_cap` enum('ENABLED','DISABLED') DEFAULT 'DISABLED', + `pre_emp_vul` enum('ENABLED','DISABLED') DEFAULT 'DISABLED', + `LIPA-Permissions` enum('LIPA-prohibited','LIPA-only','LIPA-conditional') NOT NULL DEFAULT 'LIPA-only', + PRIMARY KEY (`id`,`pgw_id`,`users_imsi`), + KEY `fk_pdn_pgw1_idx` (`pgw_id`), + KEY `fk_pdn_users1_idx` (`users_imsi`) +) ENGINE=MyISAM AUTO_INCREMENT=60 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pdn` +-- + +LOCK TABLES `pdn` WRITE; +/*!40000 ALTER TABLE `pdn` DISABLE KEYS */; +INSERT INTO `pdn` VALUES (1,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(41,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'20834123456789',9,15,'DISABLED','ENABLED','LIPA-only'),(40,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'20810000001234',9,15,'DISABLED','ENABLED','LIPA-only'),(42,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'31002890832150',9,15,'DISABLED','ENABLED','LIPA-only'),(16,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(43,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'001010123456789',9,15,'DISABLED','ENABLED','LIPA-only'),(2,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(3,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(4,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(5,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(6,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(7,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(8,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(9,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(10,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(11,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(12,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(13,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(14,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(15,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(17,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(18,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(19,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(20,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(21,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(22,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001100',9,15,'DISABLED','ENABLED','LIPA-only'),(23,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001101',9,15,'DISABLED','ENABLED','LIPA-only'),(24,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001102',9,15,'DISABLED','ENABLED','LIPA-only'),(25,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001103',9,15,'DISABLED','ENABLED','LIPA-only'),(26,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001104',9,15,'DISABLED','ENABLED','LIPA-only'),(27,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001105',9,15,'DISABLED','ENABLED','LIPA-only'),(28,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001106',9,15,'DISABLED','ENABLED','LIPA-only'),(29,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001107',9,15,'DISABLED','ENABLED','LIPA-only'),(30,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001108',9,15,'DISABLED','ENABLED','LIPA-only'),(31,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001109',9,15,'DISABLED','ENABLED','LIPA-only'),(32,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001110',9,15,'DISABLED','ENABLED','LIPA-only'),(33,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001111',9,15,'DISABLED','ENABLED','LIPA-only'),(34,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001112',9,15,'DISABLED','ENABLED','LIPA-only'),(35,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001113',9,15,'DISABLED','ENABLED','LIPA-only'),(44,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001113',9,15,'DISABLED','ENABLED','LIPA-only'),(45,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001112',9,15,'DISABLED','ENABLED','LIPA-only'),(46,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001111',9,15,'DISABLED','ENABLED','LIPA-only'),(47,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(48,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000008',9,15,'DISABLED','ENABLED','LIPA-only'),(49,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000009',9,15,'DISABLED','ENABLED','LIPA-only'),(50,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000010',9,15,'DISABLED','ENABLED','LIPA-only'),(51,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000011',9,15,'DISABLED','ENABLED','LIPA-only'),(52,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000012',9,15,'DISABLED','ENABLED','LIPA-only'),(53,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000013',9,15,'DISABLED','ENABLED','LIPA-only'),(54,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000014',9,15,'DISABLED','ENABLED','LIPA-only'),(55,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000015',9,15,'DISABLED','ENABLED','LIPA-only'),(56,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001118',9,15,'DISABLED','ENABLED','LIPA-only'),(57,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001121',9,15,'DISABLED','ENABLED','LIPA-only'),(58,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001120',9,15,'DISABLED','ENABLED','LIPA-only'),(59,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001119',9,15,'DISABLED','ENABLED','LIPA-only'); +/*!40000 ALTER TABLE `pdn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pgw` +-- + +DROP TABLE IF EXISTS `pgw`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pgw` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ipv4` varchar(15) NOT NULL, + `ipv6` varchar(39) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ipv4` (`ipv4`), + UNIQUE KEY `ipv6` (`ipv6`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pgw` +-- + +LOCK TABLES `pgw` WRITE; +/*!40000 ALTER TABLE `pgw` DISABLE KEYS */; +INSERT INTO `pgw` VALUES (1,'127.0.0.1','0:0:0:0:0:0:0:1'),(2,'192.168.56.101',''),(3,'10.0.0.2','0'); +/*!40000 ALTER TABLE `pgw` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `terminal-info` +-- + +DROP TABLE IF EXISTS `terminal-info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `terminal-info` ( + `imei` varchar(15) NOT NULL, + `sv` varchar(2) NOT NULL, + UNIQUE KEY `imei` (`imei`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `terminal-info` +-- + +LOCK TABLES `terminal-info` WRITE; +/*!40000 ALTER TABLE `terminal-info` DISABLE KEYS */; +/*!40000 ALTER TABLE `terminal-info` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `imsi` varchar(15) NOT NULL COMMENT 'IMSI is the main reference key.', + `msisdn` varchar(46) DEFAULT NULL COMMENT 'The basic MSISDN of the UE (Presence of MSISDN is optional).', + `imei` varchar(15) DEFAULT NULL COMMENT 'International Mobile Equipment Identity', + `imei_sv` varchar(2) DEFAULT NULL COMMENT 'International Mobile Equipment Identity Software Version Number', + `ms_ps_status` enum('PURGED','NOT_PURGED') DEFAULT 'PURGED' COMMENT 'Indicates that ESM and EMM status are purged from MME', + `rau_tau_timer` int(10) unsigned DEFAULT '120', + `ue_ambr_ul` bigint(20) unsigned DEFAULT '50000000' COMMENT 'The Maximum Aggregated uplink MBRs to be shared across all Non-GBR bearers according to the subscription of the user.', + `ue_ambr_dl` bigint(20) unsigned DEFAULT '100000000' COMMENT 'The Maximum Aggregated downlink MBRs to be shared across all Non-GBR bearers according to the subscription of the user.', + `access_restriction` int(10) unsigned DEFAULT '60' COMMENT 'Indicates the access restriction subscription information. 3GPP TS.29272 #7.3.31', + `mme_cap` int(10) unsigned zerofill DEFAULT NULL COMMENT 'Indicates the capabilities of the MME with respect to core functionality e.g. regional access restrictions.', + `mmeidentity_idmmeidentity` int(11) NOT NULL DEFAULT '0', + `key` varbinary(16) NOT NULL DEFAULT '0' COMMENT 'UE security key', + `RFSP-Index` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'An index to specific RRM configuration in the E-UTRAN. Possible values from 1 to 256', + `urrp_mme` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'UE Reachability Request Parameter indicating that UE activity notification from MME has been requested by the HSS.', + `sqn` bigint(20) unsigned zerofill NOT NULL, + `rand` varbinary(16) NOT NULL, + `OPc` varbinary(16) DEFAULT NULL COMMENT 'Can be computed by HSS', + PRIMARY KEY (`imsi`,`mmeidentity_idmmeidentity`), + KEY `fk_users_mmeidentity_idx1` (`mmeidentity_idmmeidentity`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `users` +-- + +LOCK TABLES `users` WRITE; +/*!40000 ALTER TABLE `users` DISABLE KEYS */; +INSERT INTO `users` VALUES ('20834123456789','380561234567','35609204079300',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,'+�E��ų\0�,IH��H',0,0,00000000000000000096,'Px�X \Z1��x��','^��K�����FeU���'),('20810000001234','33611123456','35609204079299',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000281454575616225,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','�4�s@���z��~�'),('31002890832150','33638060059','35611302209414',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012416,'`�F�݆��D��ϛ���','�4�s@���z��~�'),('001010123456789','33600101789','35609204079298',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'\0 \n \r',1,0,00000000000000000351,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','L�*\\�����^��]� '),('208930000000001','33638030001','35609204079301',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208950000000002','33638050002','35609204079502',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000020471,'\0 \n \r','�4�s@���z��~�'),('208950000000003','33638050003','35609204079503',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012343,'\0 \n \r','�4�s@���z��~�'),('208950000000004','33638050004','35609204079504',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000005','33638050005','35609204079505',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000001','33638050001','35609204079501',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208950000000006','33638050006','35609204079506',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000007','33638050007','35609204079507',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208930000000002','33638030002','35609204079302',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000003','33638030003','35609204079303',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000004','33638030004','35609204079304',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000005','33638030005','35609204079305',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000006','33638030006','35609204079306',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000007','33638030007','35609204079307',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000007','33638040007','35609204079407',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000006','33638040006','35609204079406',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000005','33638040005','35609204079405',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000004','33638040004','35609204079404',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000003','33638040003','35609204079403',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000002','33638040002','35609204079402',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000001','33638040001','35609204079401',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208920100001100','33638020001','35609204079201',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001101','33638020001','35609204079201',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204937234,'\0 \n \r','�$I6;��+f�k�u�|�'),('208920100001102','33638020002','35609204079202',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001103','33638020003','35609204079203',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001104','33638020004','35609204079204',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001105','33638020005','35609204079205',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001106','33638020006','35609204079206',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000000000000006103,'ebd07771ace8677a','�$I6;��+f�k�u�|�'),('208920100001107','33638020007','35609204079207',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001108','33638020008','35609204079208',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001109','33638020009','35609204079209',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001110','33638020010','35609204079210',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001111','33638030011','35609304079211',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001112','33638030012','35609304079212',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001113','33638030013','35609304079213',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006263,'�SNܒ�Iv��e�6','�4�s@���z��~�'),('208950000000008','33638050008','35609204079508',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000009','33638050009','35609204079509',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000010','33638050010','35609204079510',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000011','33638050011','35609204079511',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000012','33638050012','35609204079512',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000013','33638050013','35609204079513',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000014','33638050014','35609204079514',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000015','33638050015','35609204079515',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000000000,'3536663032363164','�4�s@���z��~�'),('208920100001118','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204934762,'~?03�u-%�ey�y�','�$I6;��+f�k�u�|�'),('208920100001121','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'&��@xg�]���\n��Vp','�$I6;��+f�k�u�|�'),('208920100001119','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'269482407867805d','�$I6;��+f�k�u�|�'),('208920100001120','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'3236393438323430','�$I6;��+f�k�u�|�'); +INSERT INTO `users` VALUES ('208990100001100','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1); +INSERT INTO `users` VALUES ('208950000000031','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000032','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000033','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000034','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000035','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000036','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000037','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000038','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000039','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000040','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +/*!40000 ALTER TABLE `users` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2016-06-28 11:41:40 diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh new file mode 100755 index 0000000000..d9ff7608e8 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -eo pipefail + +STATUS=0 +SMF_IP_SBI_INTERFACE=$(ifconfig $SMF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'}) +SMF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$SMF_IP_SBI_INTERFACE:$SMF_INTERFACE_PORT_FOR_SBI") + +#Check if entrypoint properly configured the conf file and no parameter is unset(optional) +#NB_UNREPLACED_AT=`cat /openair-smf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true` + +#if [ $NB_UNREPLACED_AT -ne 0 ]; then +# STATUS=-1 +# echo "Healthcheck error: UNHEALTHY configuration file is not configured properly" +#fi +# +if [[ -z $SMF_SBI_PORT_STATUS ]]; then + STATUS=-1 + echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $SMF_INTERFACE_PORT_FOR_SBI is not listening." +fi + +exit $STATUS diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh new file mode 100755 index 0000000000..0e3b67ee7e --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -eo pipefail + +STATUS=0 +SGW_PORT_FOR_S1U_S12_S4_UP=2152 +SGW_PORT_FOR_SX=8805 +SGW_IP_S1U_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP | grep inet | awk {'print $2'}) +SGW_IP_SX_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_SX | grep inet | awk {'print $2'}) +S1U_S12_S4_UP_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_S1U_INTERFACE:$SGW_PORT_FOR_S1U_S12_S4_UP") +SX_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_SX_INTERFACE:$SGW_PORT_FOR_SX") +#Check if entrypoint properly configured the conf file and no parameter is unset (optional) +NB_UNREPLACED_AT=`cat /openair-spgwu/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true` +if [ $NB_UNREPLACED_AT -ne 0 ]; then + STATUS=1 + echo "Healthcheck error: UNHEALTHY configuration file is not configured properly" +fi + +if [[ -z $S1U_S12_S4_UP_PORT_STATUS ]]; then + STATUS=1 + echo "Healthcheck error: UNHEALTHY S1U port $SGW_PORT_FOR_S1U_S12_S4_UP is not listening." +fi + +if [[ -z $SX_PORT_STATUS ]]; then + STATUS=1 + echo "Healthcheck error: UNHEALTHY SX port $SGW_PORT_FOR_SX is not listening." +fi + +exit $STATUS \ No newline at end of file diff --git a/docker/scripts/gnb_entrypoint.sh b/docker/scripts/gnb_entrypoint.sh index 79d6c6dc37..aec5c48050 100755 --- a/docker/scripts/gnb_entrypoint.sh +++ b/docker/scripts/gnb_entrypoint.sh @@ -10,6 +10,7 @@ THREAD_PARALLEL_CONFIG=${THREAD_PARALLEL_CONFIG:-PARALLEL_SINGLE_THREAD} if [[ -v USE_NSA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.nsa.tdd.conf $PREFIX/etc/gnb.conf; fi if [[ -v USE_SA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.tdd.conf $PREFIX/etc/gnb.conf; fi +if [[ -v USE_SA_FDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.fdd.conf $PREFIX/etc/gnb.conf; fi if [[ -v USE_SA_CU ]]; then ln -s $PREFIX/etc/gnb.sa.cu.conf $PREFIX/etc/gnb.conf; fi if [[ -v USE_SA_TDD_CU ]]; then cp $PREFIX/etc/gnb.sa.du.tdd.conf $PREFIX/etc/gnb.conf; fi # Sometimes, the templates are not enough. We mount a conf file on $PREFIX/etc. It can be a template itself. diff --git a/docker/scripts/gnb_parameters.yaml b/docker/scripts/gnb_parameters.yaml index 2f150d394a..8547d48e67 100644 --- a/docker/scripts/gnb_parameters.yaml +++ b/docker/scripts/gnb_parameters.yaml @@ -94,6 +94,36 @@ - key: parallel_config env: "@THREAD_PARALLEL_CONFIG@" + - filePrefix: gnb.sa.band66.fr1.106PRB.usrpn300.conf + outputfilename: "gnb.sa.fdd.conf" + config: + - key: Active_gNBs + env: "@GNB_NAME@" + - key: gNB_name + env: "@GNB_NAME@" + - key: mcc + env: "@MCC@" + - key: mnc + env: "@MNC@" + - key: mnc_length + env: "@MNC_LENGTH@" + - key: tracking_area_code + env: "@TAC@" + - key: sst + env: "@NSSAI_SST@" + - key: ipv4 + env: "@AMF_IP_ADDRESS@" + - key: GNB_INTERFACE_NAME_FOR_NG_AMF + env: "@GNB_NGA_IF_NAME@" + - key: GNB_IPV4_ADDRESS_FOR_NG_AMF + env: "@GNB_NGA_IP_ADDRESS@" + - key: GNB_INTERFACE_NAME_FOR_NGU + env: "@GNB_NGU_IF_NAME@" + - key: GNB_IPV4_ADDRESS_FOR_NGU + env: "@GNB_NGU_IP_ADDRESS@" + - key: parallel_config + env: "@THREAD_PARALLEL_CONFIG@" + - filePrefix: gNB_SA_CU.conf outputfilename: "gnb.sa.cu.conf" config: From 00483797b4ce7aa41a992b9df295dde6a047a801 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 7 Feb 2022 10:02:08 +0100 Subject: [PATCH 106/196] code review comment --- openair3/ocp-gtpu/gtp_itf.cpp | 67 +++++++++++++++-------------- openair3/ocp-gtpu/gtp_itf.h | 12 +++--- openair3/ocp-gtpu/gtpv1u_eNB_task.h | 26 +++++------ openair3/ocp-gtpu/gtpv1u_gNB_task.h | 6 +-- 4 files changed, 57 insertions(+), 54 deletions(-) diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index 379ec415dc..cc41de3550 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -79,7 +79,7 @@ class gtpEndPoint { // this allow using non standard gtp port number (different from 2152) // and so, for example tu run 4G and 5G cores on one system tcp_udp_port_t get_dstport() { - return (tcp_udp_port_t)atol(addr.destinationService); + return (tcp_udp_port_t)atol(addr.destinationService); } }; @@ -106,10 +106,10 @@ instance_t legacyInstanceMapping=0; #define compatInst(a) ((a)==0 || (a)==INSTANCE_DEFAULT?legacyInstanceMapping:a) #define GTPV1U_HEADER_SIZE (8) - - - static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, int msgType, teid_t teid, uint8_t *Msg,int msgLen, - bool seqNumFlag, bool npduNumFlag, bool extHdrFlag, int seqNum, int npduNum, int extHdrType) { + + +static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, int msgType, teid_t teid, uint8_t *Msg,int msgLen, + bool seqNumFlag, bool npduNumFlag, bool extHdrFlag, int seqNum, int npduNum, int extHdrType) { AssertFatal(extHdrFlag==false,"Not developped"); int headerAdditional=0; @@ -149,6 +149,7 @@ instance_t legacyInstanceMapping=0; to.sin_addr.s_addr = peerIp ; LOG_D(GTPU,"sending packet size: %d to %s\n",fullSize, inet_ntoa(to.sin_addr) ); int ret; + if ((ret=sendto(h, (void *)buffer, (size_t)fullSize, 0,(struct sockaddr *)&to, sizeof(to) )) != fullSize ) { LOG_E(GTPU, "[SD %d] Failed to send data to " IPV4_ADDR " on port %d, buffer size %u, ret: %d, errno: %d\n", h, IPV4_ADDR_FORMAT(peerIp), peerPort, fullSize, ret, errno); @@ -196,7 +197,7 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b gtpv1uCreateAndSendMsg(compatInst(instance), tmp.outgoing_ip_addr, tmp.outgoing_port, - GTP_GPDU, + GTP_GPDU, tmp.teid_outgoing, buffer, length, seqNumFlag, npduNumFlag, false, tmp.seqNum, tmp.npduNum, 0) ; } @@ -239,7 +240,7 @@ static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req, gtpv1uCreateAndSendMsg(compatInst(instance), tmp.outgoing_ip_addr, tmp.outgoing_port, - GTP_GPDU, + GTP_GPDU, tmp.teid_outgoing, buffer, length, seqNumFlag, npduNumFlag, false, tmp.seqNum, tmp.npduNum, 0) ; } @@ -309,6 +310,7 @@ static int udpServerSocket(openAddr_s addr) { LOG_E(GTPU,"getaddrinfo error: %s\n", gai_strerror(status)); return -1; } + int sockfd=-1; // loop through all the results and bind to the first we can @@ -488,20 +490,20 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer } int gtpv1u_create_s1u_tunnel(instance_t instance, - const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, - gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) { + const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, + gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) { LOG_D(GTPU, "[%ld] Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x\n", instance, create_tunnel_req->rnti, create_tunnel_req->num_tunnels, create_tunnel_req->sgw_S1u_teid[0]); tcp_udp_port_t dstport=globGtp.instances[compatInst(instance)].get_dstport(); + for (int i = 0; i < create_tunnel_req->num_tunnels; i++) { AssertFatal(create_tunnel_req->eps_bearer_id[i] > 4, "From legacy code not clear, seems impossible (bearer=%d)\n", create_tunnel_req->eps_bearer_id[i]); int incoming_rb_id=create_tunnel_req->eps_bearer_id[i]-4; - teid_t teid=newGtpuCreateTunnel(compatInst(instance), create_tunnel_req->rnti, incoming_rb_id, create_tunnel_req->eps_bearer_id[i], @@ -565,11 +567,12 @@ int gtpv1u_create_ngu_tunnel( const instance_t instance, create_tunnel_req->num_tunnels, create_tunnel_req->outgoing_teid[0]); tcp_udp_port_t dstport=globGtp.instances[compatInst(instance)].get_dstport(); + for (int i = 0; i < create_tunnel_req->num_tunnels; i++) { teid_t teid=newGtpuCreateTunnel(instance, create_tunnel_req->rnti, create_tunnel_req->incoming_rb_id[i], create_tunnel_req->pdusession_id[i], - create_tunnel_req->outgoing_teid[i], + create_tunnel_req->outgoing_teid[i], create_tunnel_req->dst_addr[i], dstport, sdap_gnb_data_req); create_tunnel_resp->status=0; @@ -600,7 +603,7 @@ int gtpv1u_create_x2u_tunnel( AssertFatal( false, "to be developped\n"); } - int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) { +int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) { LOG_D(GTPU, "[%ld] Start delete tunnels for RNTI %x\n", instance, rnti); pthread_mutex_lock(&globGtp.gtp_lock); @@ -627,15 +630,15 @@ int gtpv1u_create_x2u_tunnel( LOG_I(GTPU, "[%ld] Deleted all tunnels for RNTI %x (%d tunnels deleted)\n", instance, rnti, nb); return !GTPNOK; } - - // Legacy delete tunnel finish by deleting all the rnti - // so the list of bearer provided is only a design bug - int gtpv1u_delete_s1u_tunnel( const instance_t instance, - const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + +// Legacy delete tunnel finish by deleting all the rnti +// so the list of bearer provided is only a design bug +int gtpv1u_delete_s1u_tunnel( const instance_t instance, + const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { return newGtpuDeleteAllTunnels(instance, req_pP->rnti); } - - int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id) { + +int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id) { LOG_D(GTPU, "[%ld] Start delete tunnels for RNTI %x\n", instance, rnti); pthread_mutex_lock(&globGtp.gtp_lock); @@ -652,6 +655,7 @@ int gtpv1u_create_x2u_tunnel( for (int i=0; isecond.bearers.find(pdusession_id[i]); + if ( ptr2 == ptrRNTI->second.bearers.end() ) { LOG_E(GTPU,"[%ld] GTP-U instance: delete of not existing tunnel RNTI:RAB: %x/%x\n", instance, rnti,pdusession_id[i]); } else { @@ -659,33 +663,34 @@ int gtpv1u_create_x2u_tunnel( nb++; } } - + if (ptrRNTI->second.bearers.size() == 0 ) // no tunnels on this rnti, erase the ue entry inst->ue2te_mapping.erase(ptrRNTI); + pthread_mutex_unlock(&globGtp.gtp_lock); LOG_I(GTPU, "[%ld] Deleted all tunnels for RNTI %x (%d tunnels deleted)\n", instance, rnti, nb); return !GTPNOK; - } - +} + int gtpv1u_delete_x2u_tunnel( const instance_t instanceP, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { LOG_E(GTPU,"x2 tunnel not implemented\n"); return 0; } - + int gtpv1u_delete_ngu_tunnel( const instance_t instance, - gtpv1u_gnb_delete_tunnel_req_t * req) { + gtpv1u_gnb_delete_tunnel_req_t *req) { return newGtpuDeleteTunnels(instance, req->rnti, req->num_pdusession, req->pdusession_id); } - + static int Gtpv1uHandleEchoReq(int h, uint8_t *msgBuf, uint32_t msgBufLen, uint16_t peerPort, uint32_t peerIp) { Gtpv1uMsgHeaderT *msgHdr = (Gtpv1uMsgHeaderT *) msgBuf; - + if ( msgHdr->version != 1 || msgHdr->PT != 1 ) { LOG_E(GTPU, "[%d] Received a packet that is not GTP header\n", h); return GTPNOK; @@ -696,14 +701,12 @@ static int Gtpv1uHandleEchoReq(int h, return GTPNOK; } - uint16_t seq=ntohs(*(uint16_t*)(msgHdr+1)); + uint16_t seq=ntohs(*(uint16_t *)(msgHdr+1)); LOG_D(GTPU, "[%d] Received a echo request, TEID: %d, seq: %hu\n", h, msgHdr->teid, seq); - uint8_t recovery[2]={14,0}; - + uint8_t recovery[2]= {14,0}; return gtpv1uCreateAndSendMsg(h, peerIp, peerPort, GTP_ECHO_RSP, ntohl(msgHdr->teid), - recovery, sizeof recovery, - 1, 0, 0, seq, 0, 0); - + recovery, sizeof recovery, + 1, 0, 0, seq, 0, 0); } static int Gtpv1uHandleError(int h, diff --git a/openair3/ocp-gtpu/gtp_itf.h b/openair3/ocp-gtpu/gtp_itf.h index 22a86bc887..ba6cf0f8bb 100644 --- a/openair3/ocp-gtpu/gtp_itf.h +++ b/openair3/ocp-gtpu/gtp_itf.h @@ -19,7 +19,7 @@ typedef boolean_t (*gtpCallback)( const pdcp_transmission_mode_t modeP, const uint32_t *sourceL2Id, const uint32_t *destinationL2Id); - + typedef struct openAddr_s { char originHost[HOST_NAME_MAX]; char originService[HOST_NAME_MAX]; @@ -33,11 +33,11 @@ typedef struct openAddr_s { void gtpv1uReceiver(int h); void gtpv1uProcessTimeout(int handle,void *arg); int gtpv1u_create_s1u_tunnel(const instance_t instance, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, - gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp); + gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp); int gtpv1u_update_s1u_tunnel(const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req_pP, - const rnti_t prior_rnti - ); + const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req_pP, + const rnti_t prior_rnti + ); int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); @@ -52,7 +52,7 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer transport_layer_addr_t remoteAddr, int port, gtpCallback callBack); void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer_id, teid_t newOutgoingTeid); int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti); - int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id); +int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id); instance_t gtpv1Init(openAddr_t context); void *gtpv1uTask(void *args); diff --git a/openair3/ocp-gtpu/gtpv1u_eNB_task.h b/openair3/ocp-gtpu/gtpv1u_eNB_task.h index dbfb6ae917..e764eb143b 100644 --- a/openair3/ocp-gtpu/gtpv1u_eNB_task.h +++ b/openair3/ocp-gtpu/gtpv1u_eNB_task.h @@ -30,8 +30,8 @@ #define GTPV1U_ENB_TASK_H_ typedef struct gtpv1u_data_s { - /* RB tree of UEs */ - hash_table_t *ue_mapping; + /* RB tree of UEs */ + hash_table_t *ue_mapping; } gtpv1u_data_t; #define GTPV1U_BEARER_OFFSET 3 @@ -53,8 +53,8 @@ typedef struct fixMe_gtpv1u_bearer_s { in_addr_t sgw_ip_addr; struct in6_addr sgw_ip6_addr; teid_t teid_teNB; - in_addr_t tenb_ip_addr; ///< target eNB ipv4 - struct in6_addr tenb_ip6_addr; ///< target eNB ipv6 + in_addr_t tenb_ip_addr; ///< target eNB ipv4 + struct in6_addr tenb_ip6_addr; ///< target eNB ipv6 tcp_udp_port_t port; //NwGtpv1uStackSessionHandleT stack_session; bearer_state_t state; @@ -86,28 +86,28 @@ gtpv1u_new_data_req( uint32_t buf_offset);*/ int gtpv1u_eNB_init(void); -void *gtpv1u_eNB_process_itti_msg(void*); +void *gtpv1u_eNB_process_itti_msg(void *); void *gtpv1u_eNB_task(void *args); int gtpv1u_create_x2u_tunnel( const instance_t instanceP, - const gtpv1u_enb_create_x2u_tunnel_req_t * const create_tunnel_req_pP, - gtpv1u_enb_create_x2u_tunnel_resp_t * const create_tunnel_resp_pP); + const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP, + gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP); int gtpv1u_create_s1u_tunnel( const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, - gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP); + const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP, + gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP); int gtpv1u_update_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, - const rnti_t prior_rnti); + const instance_t instanceP, + const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP, + const rnti_t prior_rnti); int gtpv1u_delete_x2u_tunnel( const instance_t instanceP, - const gtpv1u_enb_delete_tunnel_req_t * const req_pP); + const gtpv1u_enb_delete_tunnel_req_t *const req_pP); #endif /* GTPV1U_ENB_TASK_H_ */ diff --git a/openair3/ocp-gtpu/gtpv1u_gNB_task.h b/openair3/ocp-gtpu/gtpv1u_gNB_task.h index cc36ee26fc..817d0109ba 100644 --- a/openair3/ocp-gtpu/gtpv1u_gNB_task.h +++ b/openair3/ocp-gtpu/gtpv1u_gNB_task.h @@ -37,8 +37,8 @@ void *nr_gtpv1u_gNB_task(void *args); int gtpv1u_create_ngu_tunnel( const instance_t instanceP, - const gtpv1u_gnb_create_tunnel_req_t * const create_tunnel_req_pP, - gtpv1u_gnb_create_tunnel_resp_t * const create_tunnel_resp_pP); + const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP, + gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp_pP); int gtpv1u_update_ngu_tunnel( @@ -48,7 +48,7 @@ gtpv1u_update_ngu_tunnel( ); int gtpv1u_delete_ngu_tunnel( const instance_t instance, - gtpv1u_gnb_delete_tunnel_req_t *req); + gtpv1u_gnb_delete_tunnel_req_t *req); #endif /* GTPV1U_GNB_TASK_H_ */ From ef2fedfc5bf1979b7ee92c5a5e3e02de40fdd7e2 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 7 Feb 2022 23:50:01 +0100 Subject: [PATCH 107/196] fix existing bug in pucchsim.c and in random_channel.c --- openair1/SIMULATION/NR_PHY/pucchsim.c | 4 ++-- openair1/SIMULATION/TOOLS/random_channel.c | 2 +- openair2/RRC/NR/nr_rrc_proto.h | 3 --- openair2/RRC/NR/rrc_gNB.c | 21 --------------------- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 213924e5fd..251f4c6751 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -689,8 +689,8 @@ int main(int argc, char **argv) ack_nack_errors+=((actual_payload^payload_received)&1) + (((actual_payload^payload_received)&2)>>1); } else if (format==2) { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t uci_pdu; - nfapi_nr_pucch_pdu_t pucch_pdu; + nfapi_nr_uci_pucch_pdu_format_2_3_4_t uci_pdu={0}; + nfapi_nr_pucch_pdu_t pucch_pdu={0}; pucch_pdu.rnti = 0x1234; pucch_pdu.subcarrier_spacing = 1; pucch_pdu.group_hop_flag = PUCCH_GroupHopping&1; diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index f09d1a7ce1..b00f6e31d5 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -125,7 +125,7 @@ void fill_channel_desc(channel_desc_t *chan_desc, chan_desc->ch[i] = (struct complexd *) malloc(channel_length * sizeof(struct complexd)); for (i = 0; ichF[i] = (struct complexd *) malloc(1200 * sizeof(struct complexd)); // allocate for up to 100 RBs, 12 samples per RB + chan_desc->chF[i] = (struct complexd *) malloc(12*257 * sizeof(struct complexd)); // allocate for up to 257 RBs, 12 samples per RB LOG_D(OCM,"[CHANNEL] Filling a (nb_taps %d)\n",nb_taps); diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 22109c3029..ca8c4991a7 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -110,9 +110,6 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *const ue_context_pP, const protocol_ctxt_t *const ctxt_pP ); -void apply_pdcp_config(rrc_gNB_ue_context_t *const ue_context_pP, - const protocol_ctxt_t *const ctxt_pP ); - void rrc_gNB_generate_RRCSetup( const protocol_ctxt_t *const ctxt_pP, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 5b370d3614..542aecf5aa 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -107,27 +107,6 @@ extern RAN_CONTEXT_t RC; -extern boolean_t nr_rrc_pdcp_config_asn1_req( - const protocol_ctxt_t *const ctxt_pP, - NR_SRB_ToAddModList_t *const srb2add_list, - NR_DRB_ToAddModList_t *const drb2add_list, - NR_DRB_ToReleaseList_t *const drb2release_list, - const uint8_t security_modeP, - uint8_t *const kRRCenc, - uint8_t *const kRRCint, - uint8_t *const kUPenc, - uint8_t *const kUPint - ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 - ,rb_id_t *const defaultDRB, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - -extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, - const NR_SRB_ToAddModList_t * const srb2add_listP, - const NR_DRB_ToAddModList_t * const drb2add_listP, - const NR_DRB_ToReleaseList_t * const drb2release_listP, - const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - static inline uint64_t bitStr_to_uint64(BIT_STRING_t *asn); mui_t rrc_gNB_mui = 0; From 8b4ae5ef2b05c2ea97bdf2614f61dd25128f4a02 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 7 Feb 2022 15:14:22 -0800 Subject: [PATCH 108/196] Remove the new UL_INFO local variable in the VNF. This struct is used to store the uplink 5G nFAPI messages between the proxy and the gNB MAC layer. The original OAI implementation utilizes a similarly named variable (UL_info) to store the uplink 5G nFAPI messages between the PHY and MAC layer. This commit will utilize the original UL_info variable prior to calling the handle functions. These changes allow us to make minimal changes to the nFAPI handle functions and modifies the NR_UL_Indication parent function instead. --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 530 ++++++++++++----------- 1 file changed, 270 insertions(+), 260 deletions(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 57bb411dcc..b94b22282c 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -63,7 +63,7 @@ extern uint16_t sl_ahead; void handle_nr_rach(NR_UL_IND_t *UL_info) { - if(NFAPI_MODE == NFAPI_MODE_PNF) { + if (NFAPI_MODE == NFAPI_MODE_PNF) { if (UL_info->rach_ind.number_of_pdus > 0) { LOG_D(PHY,"UL_info->UL_info->rach_ind.number_of_pdus:%d SFN/Slot:%d.%d \n", UL_info->rach_ind.number_of_pdus, UL_info->rach_ind.sfn,UL_info->rach_ind.slot); oai_nfapi_nr_rach_indication(&UL_info->rach_ind); @@ -71,69 +71,29 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) } return; } - NR_UL_IND_t UL_INFO; - nfapi_nr_rach_indication_t *rach_ind = NULL; - if (get_softmodem_params()->emulate_l1) - { - if (gnb_rach_ind_queue.num_items == 0) - return; - LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); - rach_ind = get_queue(&gnb_rach_ind_queue); - UL_INFO.rach_ind = *rach_ind; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; - } - else - { - UL_INFO.rach_ind = UL_info->rach_ind; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; - } - - int frame_diff = UL_info->frame - UL_INFO.rach_ind.sfn; - if (frame_diff < 0) - { + int frame_diff = UL_info->frame - UL_info->rach_ind.sfn; + if (frame_diff < 0) { frame_diff += 1024; } bool in_timewindow = frame_diff == 0 || (frame_diff == 1 && UL_info->slot < 7); - if (UL_INFO.rach_ind.number_of_pdus>0 && in_timewindow) { + if (UL_info->rach_ind.number_of_pdus > 0 && in_timewindow) { LOG_A(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n", - UL_info->frame, UL_info->slot, UL_INFO.rach_ind.sfn, UL_INFO.rach_ind.slot); - int npdus = UL_INFO.rach_ind.number_of_pdus; - for(int i = 0; i < npdus; i++) { - UL_INFO.rach_ind.number_of_pdus--; + UL_info->frame, UL_info->slot, UL_info->rach_ind.sfn, UL_info->rach_ind.slot); + for (int i = 0; i < UL_info->rach_ind.number_of_pdus; i++) { UL_info->rach_ind.number_of_pdus--; - if (UL_INFO.rach_ind.pdu_list[i].num_preamble>0) - AssertFatal(UL_INFO.rach_ind.pdu_list[i].num_preamble==1, - "More than 1 preamble not supported\n"); - - nr_initiate_ra_proc(UL_INFO.module_id, - UL_INFO.CC_id, - UL_INFO.rach_ind.sfn, - UL_INFO.rach_ind.slot, - UL_INFO.rach_ind.pdu_list[i].preamble_list[0].preamble_index, - UL_INFO.rach_ind.pdu_list[i].freq_index, - UL_INFO.rach_ind.pdu_list[i].symbol_index, - UL_INFO.rach_ind.pdu_list[i].preamble_list[0].timing_advance); + AssertFatal(UL_info->rach_ind.pdu_list[i].num_preamble == 1, "More than 1 preamble not supported\n"); + nr_initiate_ra_proc(UL_info->module_id, + UL_info->CC_id, + UL_info->rach_ind.sfn, + UL_info->rach_ind.slot, + UL_info->rach_ind.pdu_list[i].preamble_list[0].preamble_index, + UL_info->rach_ind.pdu_list[i].freq_index, + UL_info->rach_ind.pdu_list[i].symbol_index, + UL_info->rach_ind.pdu_list[i].preamble_list[0].timing_advance); } } - if (get_softmodem_params()->emulate_l1) - { - if (rach_ind && rach_ind->number_of_pdus > 0) - { - for(int i = 0; i < rach_ind->number_of_pdus; i++) - { - free(rach_ind->pdu_list[i].preamble_list); - rach_ind->pdu_list[i].preamble_list = NULL; - } - free(rach_ind->pdu_list); - rach_ind->pdu_list = NULL; - } - free(rach_ind); - rach_ind = NULL; - } } @@ -148,26 +108,11 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) return; } - NR_UL_IND_t UL_INFO; - nfapi_nr_uci_indication_t *uci_ind = NULL; - if (get_softmodem_params()->emulate_l1) - { - if (gnb_uci_ind_queue.num_items == 0) - return; - LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); - uci_ind = get_queue(&gnb_uci_ind_queue); - UL_INFO.uci_ind = *uci_ind; - } - else - { - UL_INFO.uci_ind = UL_info->uci_ind; - } - const module_id_t mod_id = UL_info->module_id; - const frame_t frame = UL_INFO.uci_ind.sfn; - const sub_frame_t slot = UL_INFO.uci_ind.slot; - int num_ucis = UL_INFO.uci_ind.num_ucis; - nfapi_nr_uci_t *uci_list = UL_INFO.uci_ind.uci_list; + const frame_t frame = UL_info->uci_ind.sfn; + const sub_frame_t slot = UL_info->uci_ind.slot; + int num_ucis = UL_info->uci_ind.num_ucis; + nfapi_nr_uci_t *uci_list = UL_info->uci_ind.uci_list; for (int i = 0; i < num_ucis; i++) { switch (uci_list[i].pdu_type) { @@ -178,7 +123,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1; LOG_D(NR_MAC, "The received uci has sfn slot %d %d, num_ucis %d and pdu_size %d\n", - UL_INFO.uci_ind.sfn, UL_INFO.uci_ind.slot, num_ucis, uci_list[i].pdu_size); + UL_info->uci_ind.sfn, UL_info->uci_ind.slot, num_ucis, uci_list[i].pdu_size); handle_nr_uci_pucch_0_1(mod_id, frame, slot, uci_pdu); break; } @@ -192,39 +137,8 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) } } - if (get_softmodem_params()->emulate_l1) - { - for (int i = 0; i < num_ucis; i++) { - switch (uci_list[i].pdu_type) { - case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: - if (uci_list[i].pucch_pdu_format_0_1.harq) { - free(uci_list[i].pucch_pdu_format_0_1.harq->harq_list); - uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL; - } - free(uci_list[i].pucch_pdu_format_0_1.harq); - uci_list[i].pucch_pdu_format_0_1.harq = NULL; - free(uci_list[i].pucch_pdu_format_0_1.sr); - uci_list[i].pucch_pdu_format_0_1.sr = NULL; - break; + UL_info->uci_ind.num_ucis = 0; - case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: - free(uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); - free(uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); - free(uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); - break; - } - } - if (uci_ind && num_ucis > 0) { - free(uci_list); - uci_list = NULL; - } - free(uci_ind); - uci_ind = NULL; - } - else - { - UL_info->uci_ind.num_ucis = 0; - } } static bool crc_sfn_slot_matcher(void *wanted, void *candidate) @@ -264,173 +178,226 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) return; } - NR_UL_IND_t UL_INFO; - nfapi_nr_rx_data_indication_t *rx_ind = NULL; - nfapi_nr_crc_indication_t *crc_ind = NULL; - if (get_softmodem_params()->emulate_l1) - { - rx_ind = get_queue(&gnb_rx_ind_queue); - if (!rx_ind) - { - LOG_D(NR_PHY, "No rx data indication (empty gnb_rx_ind_queue)\n"); - return; + if (UL_info->rx_ind.number_of_pdus > 0 && UL_info->crc_ind.number_crcs > 0) { + AssertFatal(UL_info->rx_ind.number_of_pdus == UL_info->crc_ind.number_crcs, + "number_of_pdus %d, number_crcs %d\n", + UL_info->rx_ind.number_of_pdus, UL_info->crc_ind.number_crcs); + for (int i = 0; i < UL_info->rx_ind.number_of_pdus; i++) { + const nfapi_nr_rx_data_pdu_t *rx = &UL_info->rx_ind.pdu_list[i]; + const nfapi_nr_crc_t *crc = &UL_info->crc_ind.crc_list[i]; + LOG_I(NR_PHY, "UL_info->crc_ind.pdu_list[%d].rnti:%04x " + "UL_info->rx_ind.pdu_list[%d].rnti:%04x\n", + i, crc->rnti, i, rx->rnti); + + AssertFatal(crc->rnti == rx->rnti, "mis-match between CRC RNTI %04x and RX RNTI %04x\n", + crc->rnti, rx->rnti); + + LOG_D(NR_MAC, + "%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n", + UL_info->frame, + UL_info->slot, + crc->tb_crc_status ? "error" : "ok", + crc->tb_crc_status); + + /* if CRC passes, pass PDU, otherwise pass NULL as error indication */ + nr_rx_sdu(UL_info->module_id, + UL_info->CC_id, + UL_info->rx_ind.sfn, + UL_info->rx_ind.slot, + rx->rnti, + crc->tb_crc_status ? NULL : rx->pdu, + rx->pdu_length, + rx->timing_advance, + rx->ul_cqi, + rx->rssi); + handle_nr_ul_harq(UL_info->CC_id, UL_info->module_id, UL_info->frame, UL_info->slot, crc); } - - int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot); - - crc_ind = unqueue_matching(&gnb_crc_ind_queue, - MAX_QUEUE_SIZE, - crc_sfn_slot_matcher, - &sfn_slot); - if (!crc_ind) - { - LOG_D(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot); - put_queue(&gnb_rx_ind_queue, rx_ind); - return; - } - - UL_INFO.rx_ind = *rx_ind; - UL_INFO.crc_ind = *crc_ind; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; } - else + UL_info->rx_ind.number_of_pdus = 0; + UL_info->crc_ind.number_crcs = 0; +} + +static void free_unqueued_nfapi_indications(nfapi_nr_rach_indication_t *rach_ind, + nfapi_nr_uci_indication_t *uci_ind, + nfapi_nr_rx_data_indication_t *rx_ind, + nfapi_nr_crc_indication_t *crc_ind) { + if (rach_ind && rach_ind->number_of_pdus > 0) { - UL_INFO.rx_ind = UL_info->rx_ind; - UL_INFO.crc_ind = UL_info->crc_ind; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; + for(int i = 0; i < rach_ind->number_of_pdus; i++) + { + free(rach_ind->pdu_list[i].preamble_list); + rach_ind->pdu_list[i].preamble_list = NULL; + } + free(rach_ind->pdu_list); + rach_ind->pdu_list = NULL; + free(rach_ind); + rach_ind = NULL; } + if (uci_ind && uci_ind->num_ucis > 0) + { + for (int i = 0; i < uci_ind->num_ucis; i++) { + switch (uci_ind->uci_list[i].pdu_type) { + case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: + if (uci_ind->uci_list[i].pucch_pdu_format_0_1.harq) { + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list); + uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL; + } + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq); + uci_ind->uci_list[i].pucch_pdu_format_0_1.harq = NULL; + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr); + uci_ind->uci_list[i].pucch_pdu_format_0_1.sr = NULL; + break; - UL_INFO.frame = UL_INFO.rx_ind.sfn; - UL_INFO.slot = UL_INFO.rx_ind.slot; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; - LOG_D(NR_MAC, " UL_info frame slot vs rx_ind frame slot vs crc_ind slot frame slot = %u %u vs %u %u vs %u %u\n", - UL_info->frame, UL_info->slot, - UL_INFO.rx_ind.sfn, UL_INFO.rx_ind.slot, - UL_INFO.crc_ind.sfn, UL_INFO.crc_ind.slot - ); + case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: + free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); + free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); + free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); + break; + } + } + free(uci_ind->uci_list); + uci_ind->uci_list = NULL; + free(uci_ind); + uci_ind = NULL; + } + if (rx_ind && rx_ind->number_of_pdus > 0) + { + free(rx_ind->pdu_list); + rx_ind->pdu_list = NULL; + free(rx_ind); + rx_ind = NULL; + } + if (crc_ind && crc_ind->number_crcs > 0) + { + free(crc_ind->crc_list); + crc_ind->crc_list = NULL; + free(crc_ind); + crc_ind = NULL; + } +} - if (UL_INFO.rx_ind.number_of_pdus > 0 && UL_INFO.crc_ind.number_crcs > 0) { - for (int i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) { - int j; - for (j = 0; j < UL_INFO.crc_ind.number_crcs; j++) { - // find crc_indication j corresponding rx_indication i - const nfapi_nr_rx_data_pdu_t *rx = &UL_INFO.rx_ind.pdu_list[i]; - const nfapi_nr_crc_t *crc = &UL_INFO.crc_ind.crc_list[j]; - LOG_D(NR_PHY, - "UL_INFO.crc_ind.pdu_list[%d].rnti:%04x " - "UL_INFO.rx_ind.pdu_list[%d].rnti:%04x\n", - j, - crc->rnti, - i, - rx->rnti); +static void remove_crc_pdu(nfapi_nr_crc_indication_t *crc_ind, int index) { + AssertFatal(index >= 0, "Invalid index %d\n", index); + AssertFatal(index < crc_ind->number_crcs, "Invalid index %d\n", index); + AssertFatal(crc_ind->number_crcs > 0, "Invalid crc_ind->number_crcs %d\n", crc_ind->number_crcs); - if (crc->rnti != rx->rnti) - { - LOG_D(NR_MAC, "mis-match between CRC rnti %04x and RX rnit %04x\n", crc->rnti, rx->rnti); - continue; - } + memmove(crc_ind->crc_list + index, + crc_ind->crc_list + index + 1, + sizeof(*crc_ind->crc_list) * (crc_ind->number_crcs - index - 1)); + crc_ind->number_crcs--; +} - LOG_D(NR_MAC, - "%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n", - UL_INFO.frame, - UL_INFO.slot, - crc->tb_crc_status ? "error" : "ok", - crc->tb_crc_status); +static void remove_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, int index) { + AssertFatal(index >= 0, "Invalid index %d\n", index); + AssertFatal(index < rx_ind->number_of_pdus, "Invalid index %d\n", index); + AssertFatal(rx_ind->number_of_pdus > 0, "Invalid rx_ind->number_of_pdus %d\n", rx_ind->number_of_pdus); - /* if CRC passes, pass PDU, otherwise pass NULL as error indication */ - nr_rx_sdu(UL_INFO.module_id, - UL_INFO.CC_id, - UL_INFO.rx_ind.sfn, - UL_INFO.rx_ind.slot, - rx->rnti, - crc->tb_crc_status ? NULL : rx->pdu, - rx->pdu_length, - rx->timing_advance, - rx->ul_cqi, - rx->rssi); - handle_nr_ul_harq(UL_INFO.CC_id, UL_INFO.module_id, UL_INFO.frame, UL_INFO.slot, crc); + memmove(rx_ind->pdu_list + index, + rx_ind->pdu_list + index + 1, + sizeof(*rx_ind->pdu_list) * (rx_ind->number_of_pdus - index - 1)); + rx_ind->number_of_pdus--; +} + +static bool crc_ind_has_rnti(nfapi_nr_crc_indication_t *crc_ind, uint16_t rnti) { + for (int i = 0; i < crc_ind->number_crcs; i++) { + if (rnti == crc_ind->crc_list[i].rnti) { + return true; + } + } + return false; +} + +static bool rx_ind_has_rnti(nfapi_nr_rx_data_indication_t *rx_ind, uint16_t rnti) { + for (int i = 0; i < rx_ind->number_of_pdus; i++) { + if (rnti == rx_ind->pdu_list[i].rnti) { + return true; + } + } + return false; +} + +static void match_crc_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, nfapi_nr_crc_indication_t *crc_ind) { + AssertFatal(crc_ind->number_crcs > 0 && rx_ind->number_of_pdus > 0, + "Invalid number of crc_ind->number_crcs %d or rx_ind->number_of_pdus %d\n", + crc_ind->number_crcs, rx_ind->number_of_pdus); + if (crc_ind->number_crcs > rx_ind->number_of_pdus) { + nfapi_nr_crc_indication_t *crc_ind_unmatched = calloc(1, sizeof(*crc_ind_unmatched)); + crc_ind_unmatched->header = crc_ind->header; + crc_ind_unmatched->sfn = crc_ind->sfn; + crc_ind_unmatched->slot = crc_ind->slot; + crc_ind_unmatched->number_crcs = 0; + crc_ind_unmatched->crc_list = NULL; + for (int i = 0; i < crc_ind->number_crcs; i++) { + if (!rx_ind_has_rnti(rx_ind, crc_ind->crc_list[i].rnti)) { + LOG_I(NR_MAC, "crc_ind->crc_list[%d].rnti %x does not match any rx_ind pdu rnti\n", + i, crc_ind->crc_list[i].rnti); + crc_ind_unmatched->number_crcs++; + if (crc_ind_unmatched->crc_list == NULL) { + crc_ind_unmatched->crc_list = malloc(sizeof(nfapi_nr_crc_t)); + } + else { + crc_ind_unmatched->crc_list = realloc(crc_ind_unmatched->crc_list, + sizeof(nfapi_nr_crc_t) * crc_ind_unmatched->number_crcs); + } + crc_ind_unmatched->crc_list[crc_ind_unmatched->number_crcs - 1] = crc_ind->crc_list[i]; + remove_crc_pdu(crc_ind, i); + } + if (crc_ind->number_crcs == rx_ind->number_of_pdus) { break; - } // for (j=0;jemulate_l1) - { - int last = UL_INFO.crc_ind.number_crcs - 1; - if (j < last) - { - crc_ind->crc_list[j] = crc_ind->crc_list[last]; - UL_INFO.crc_ind.number_crcs--; - } - else if (j == last) - { - UL_INFO.crc_ind.number_crcs--; - } - - last = UL_INFO.rx_ind.number_of_pdus - 1; - if (i < last) - { - rx_ind->pdu_list[i] = rx_ind->pdu_list[last]; - UL_INFO.rx_ind.number_of_pdus--; - i--; - } - else if (i == last) - { - UL_INFO.rx_ind.number_of_pdus--; - } - } - } // for (i=0;iemulate_l1) - { - if (UL_INFO.crc_ind.number_crcs > 0) - { - crc_ind->number_crcs = UL_INFO.crc_ind.number_crcs; - requeue(&gnb_crc_ind_queue, crc_ind); - } - - if (UL_INFO.rx_ind.number_of_pdus > 0) - { - rx_ind->number_of_pdus = UL_INFO.rx_ind.number_of_pdus; - requeue(&gnb_rx_ind_queue, rx_ind); - } - - if (UL_INFO.crc_ind.number_crcs == 0) - { - free(crc_ind->crc_list); - crc_ind->crc_list = NULL; - free(crc_ind); - crc_ind = NULL; - } - if (UL_INFO.rx_ind.number_of_pdus == 0) - { - free(rx_ind->pdu_list); - rx_ind->pdu_list = NULL; - free(rx_ind); - rx_ind = NULL; } } - else + AssertFatal(crc_ind_unmatched->number_crcs > 0, "The nubmer of unmatched crc_ind pdus %d <= 0\n", + crc_ind_unmatched->number_crcs); + if (!requeue(&gnb_crc_ind_queue, crc_ind_unmatched)) { - UL_info->crc_ind.number_crcs = 0; - UL_info->rx_ind.number_of_pdus = 0; + LOG_E(NR_PHY, "requeue failed for crc_ind_unmatched.\n"); + free(crc_ind_unmatched); + crc_ind_unmatched = NULL; } - } else if ((UL_INFO.rx_ind.number_of_pdus != 0) - || (UL_INFO.crc_ind.number_crcs != 0)) { - LOG_E(NR_PHY, - "hoping not to have mis-match between CRC ind and RX ind - " - "hopefully the missing message is coming shortly " - "rx_ind:%d(SFN/SL:%d/%d) crc_ind:%d(SFN/SL:%d/%d) \n", - UL_INFO.rx_ind.number_of_pdus, - UL_INFO.rx_ind.sfn, - UL_INFO.rx_ind.slot, - UL_INFO.crc_ind.number_crcs, - UL_INFO.crc_ind.sfn, - UL_INFO.crc_ind.slot); + } + else if (crc_ind->number_crcs < rx_ind->number_of_pdus) { + nfapi_nr_rx_data_indication_t *rx_ind_unmatched = calloc(1, sizeof(*rx_ind_unmatched)); + rx_ind_unmatched->header = rx_ind->header; + rx_ind_unmatched->sfn = rx_ind->sfn; + rx_ind_unmatched->slot = rx_ind->slot; + rx_ind_unmatched->number_of_pdus = 0; + rx_ind_unmatched->pdu_list = NULL; + for (int i = 0; i < rx_ind->number_of_pdus; i++) { + if (!crc_ind_has_rnti(crc_ind, rx_ind->pdu_list[i].rnti)) { + LOG_I(NR_MAC, "rx_ind->pdu_list[%d].rnti %d does not match any crc_ind pdu rnti\n", + i, rx_ind->pdu_list[i].rnti); + rx_ind_unmatched->number_of_pdus++; + if (rx_ind_unmatched->pdu_list == NULL) { + rx_ind_unmatched->pdu_list = malloc(sizeof(nfapi_nr_rx_data_pdu_t)); + } + else { + rx_ind_unmatched->pdu_list = realloc(rx_ind_unmatched->pdu_list, + sizeof(nfapi_nr_rx_data_pdu_t) * rx_ind_unmatched->number_of_pdus); + } + rx_ind_unmatched->pdu_list[rx_ind_unmatched->number_of_pdus - 1] = rx_ind->pdu_list[i]; + remove_rx_pdu(rx_ind, i); + } + if (rx_ind->number_of_pdus == crc_ind->number_crcs) { + break; + } + } + AssertFatal(rx_ind_unmatched->number_of_pdus > 0, "The nubmer of unmatched rx_ind pdus %d <= 0\n", + rx_ind_unmatched->number_of_pdus); + if (!requeue(&gnb_rx_ind_queue, rx_ind_unmatched)) + { + LOG_E(NR_PHY, "requeue failed for rx_ind_unmatched.\n"); + free(rx_ind_unmatched); + rx_ind_unmatched = NULL; + } + } + else { + LOG_E(NR_MAC, "The number of crc pdus %d = the number of rx pdus %d\n", + crc_ind->number_crcs, rx_ind->number_of_pdus); } } void NR_UL_indication(NR_UL_IND_t *UL_info) { - AssertFatal(UL_info!=NULL,"UL_INFO is null\n"); + AssertFatal(UL_info!=NULL,"UL_info is null\n"); #ifdef DUMP_FAPI dump_ul(UL_info); #endif @@ -440,17 +407,60 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { NR_IF_Module_t *ifi = nr_if_inst[module_id]; gNB_MAC_INST *mac = RC.nrmac[module_id]; LOG_D(NR_PHY,"SFN/SLOT:%d.%d module_id:%d CC_id:%d UL_info[rach_pdus:%zu rx_ind:%zu crcs:%zu]\n", - UL_info->frame,UL_info->slot, - module_id,CC_id, gnb_rach_ind_queue.num_items, - gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items); + UL_info->frame, UL_info->slot, + module_id, CC_id, + gnb_rach_ind_queue.num_items, + gnb_rx_ind_queue.num_items, + gnb_crc_ind_queue.num_items); + + nfapi_nr_rach_indication_t *rach_ind = NULL; + nfapi_nr_uci_indication_t *uci_ind = NULL; + nfapi_nr_rx_data_indication_t *rx_ind = NULL; + nfapi_nr_crc_indication_t *crc_ind = NULL; + if (get_softmodem_params()->emulate_l1) + { + if (gnb_rach_ind_queue.num_items > 0) { + LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); + rach_ind = get_queue(&gnb_rach_ind_queue); + UL_info->rach_ind = *rach_ind; + } + if (gnb_uci_ind_queue.num_items > 0) { + LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); + uci_ind = get_queue(&gnb_uci_ind_queue); + UL_info->uci_ind = *uci_ind; + } + if (gnb_rx_ind_queue.num_items > 0 && gnb_crc_ind_queue.num_items > 0) { + LOG_I(NR_MAC, "gnb_rx_ind_queue size = %zu and gnb_crc_ind_queue size = %zu\n", + gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items); + rx_ind = get_queue(&gnb_rx_ind_queue); + int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot); + crc_ind = unqueue_matching(&gnb_crc_ind_queue, + MAX_QUEUE_SIZE, + crc_sfn_slot_matcher, + &sfn_slot); + if (!crc_ind) { + LOG_I(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot); + requeue(&gnb_rx_ind_queue, rx_ind); + } + else { + UL_info->rx_ind = *rx_ind; + UL_info->crc_ind = *crc_ind; + if (crc_ind->number_crcs != rx_ind->number_of_pdus) { + match_crc_rx_pdu(&UL_info->rx_ind, &UL_info->crc_ind); + } + } + } + } handle_nr_rach(UL_info); - handle_nr_uci(UL_info); // clear UL DCI prior to handling ULSCH mac->UL_dci_req[CC_id].numPdus = 0; handle_nr_ulsch(UL_info); + if (get_softmodem_params()->emulate_l1) { + free_unqueued_nfapi_indications(rach_ind, uci_ind, rx_ind, crc_ind); + } if (NFAPI_MODE != NFAPI_MODE_PNF) { if (ifi->CC_mask==0) { From ae7e68baea6af63e9e5e5a4b1d3862d39cc2f593 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 8 Feb 2022 11:06:25 +0100 Subject: [PATCH 109/196] fix(ci): fix CN5G deployment with latest images Signed-off-by: Raphael Defosseux --- .../5g_fdd_rfsimulator/docker-compose.yaml | 4 +- .../5g_fdd_rfsimulator/oai-smf.conf | 133 ------------------ 2 files changed, 2 insertions(+), 135 deletions(-) delete mode 100644 ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml index bf75828ed1..587722f2ef 100644 --- a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml @@ -111,7 +111,6 @@ services: oai-smf: container_name: "rfsim5g-oai-smf" image: oai-smf:latest - entrypoint: /bin/bash -c "/openair-smf/bin/oai_smf -c /openair-smf/bin/oai-smf.conf -o" environment: - TZ=Europe/Paris - INSTANCE=0 @@ -140,12 +139,13 @@ services: - REGISTER_NRF=yes - DISCOVER_UPF=yes - USE_FQDN_DNS=yes + - DNN_NI0=oai + - DNN_NI2=oai.ipv4 depends_on: - oai-nrf - oai-amf volumes: - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh - - ./oai-smf.conf:/openair-smf/bin/oai-smf.conf healthcheck: test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" interval: 10s diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf deleted file mode 100644 index 0c83ab8be9..0000000000 --- a/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf +++ /dev/null @@ -1,133 +0,0 @@ -################################################################################ -# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The OpenAirInterface Software Alliance licenses this file to You under -# the OAI Public License, Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.openairinterface.org/?page_id=698 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#------------------------------------------------------------------------------- -# For more information about the OpenAirInterface (OAI) Software Alliance: -# contact@openairinterface.org -################################################################################ - -SMF = -{ - FQDN = "oai-smf-svc"; - INSTANCE = 0; # 0 is the default - PID_DIRECTORY = "/var/run"; # /var/run is the default - - INTERFACES : - { - N4 : - { - # SMF binded interface for N4 communication (UPF) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - }; - - SBI : - { - # SMF binded interface for SBI interface (e.g., communication with AMF, UDM) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80) - HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE - API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE - }; - - }; - - - # Pool of UE assigned IP addresses - # Do not make IP pools overlap - # first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF - IP_ADDRESS_POOL : - { - IPV4_LIST = ( - {RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - - ); - IPV6_LIST = ( - {PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - ); - }; - - DNN_LIST = ( - # IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6} - {DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1}, - {DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1}, - {DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1} - ); - - # DNS address communicated to UEs - DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE - - SUPPORT_FEATURES: - { - # STRING, {"yes", "no"}, - REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF - DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection - FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no", - # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling - USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM - USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN - } - - AMF : - { - IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE - PORT = 80; # YOUR AMF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE - }; - - UDM : - { - IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE - PORT = 80; # YOUR UDM CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE - FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE - }; - - NRF : - { - IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE - PORT = 80; # YOUR NRF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE - }; - - UPF_LIST = ( - {IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE - ); - - LOCAL_CONFIGURATION : - { - SESSION_MANAGEMENT_SUBSCRIPTION_LIST = ( - { NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}, - { NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"} - ); - }; - -}; - From eca14f6ec9562b49771726954897d5418fa5c168 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 3 Feb 2022 15:00:21 +0100 Subject: [PATCH 110/196] Schedule UL 5 RBs at MCS 10 on inactivity --- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index 827d95dba5..2220f8065f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -2769,13 +2769,12 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP, UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 5; UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10; } else { - // assigne RBS( 3 RBs) -/* - first_rb[CC_id] = first_rb[CC_id] + 3; - UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul = 3; - UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 2; + // assigne RBS( 5 RBs) + first_rb[CC_id] = first_rb[CC_id] + 5; + UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul = 5; + UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 4; UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10; -*/ } + } } } else if ( ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_INACTIVE ) { // assigne RBS( 3 RBs) From 759314a12572799ddecf6f1538fcbf561621e9f7 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Feb 2022 16:00:47 +0100 Subject: [PATCH 111/196] Enrich assert in ULSCH decoding --- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index ae8c666d18..fceff580a3 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -601,7 +601,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB, G = G - Q_RI - Q_CQI; ulsch_harq->G = G; AssertFatal((int)G > 0, - "FATAL: ulsch_decoding.c G < 0 (%u) : Q_RI %u, Q_CQI %u\n",G,Q_RI,Q_CQI); + "FATAL: ulsch_decoding.c G < 0 (%u) : Q_RI %u, Q_CQI %u, nb_rb %u, Q_m %u, ulsch_harq->Nsymb_pusch %u, Qprime %u\n", + G, Q_RI, Q_CQI, nb_rb, Q_m, ulsch_harq->Nsymb_pusch, Qprime); H = G + Q_CQI; Hprime = H/Q_m; // Demultiplexing/Deinterleaving of PUSCH/ACK/RI/CQI From 388cfafea8cd93fd85bcc78ae4fa564e96a16e42 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Feb 2022 16:31:44 +0100 Subject: [PATCH 112/196] Stop scheduling in UL after ul_failure_timer --- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index 2220f8065f..bb013906f7 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -2241,7 +2241,8 @@ void ulsch_scheduler_pre_ue_select_fairRR( if (UE_info->UE_template[CC_id][UE_id].configured == FALSE) continue; - if (UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 + || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; // UL DCI @@ -2403,7 +2404,8 @@ void ulsch_scheduler_pre_ue_select_fairRR( if (UE_info->UE_template[CC_id][UE_id].configured == FALSE) continue; - if (UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 + || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; if ( (ulsch_ue_select[CC_id].ue_num >= ulsch_ue_max_num[CC_id]) || (cc_id_flag[CC_id] == 1) ) { From 5bdaeb571840acbb861adeea6b37a419f023140c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Feb 2022 18:39:06 +0100 Subject: [PATCH 113/196] Stop scheduling DL on UL failure or out of sync --- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index bb013906f7..6c9ffabd4f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -220,6 +220,11 @@ void dlsch_scheduler_pre_ue_select_fairRR( continue; } + + if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 + || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + continue; + if(mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) { continue; } @@ -335,6 +340,10 @@ void dlsch_scheduler_pre_ue_select_fairRR( if (rnti == NOT_A_RNTI) continue; + if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 + || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + continue; + if(mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) { continue; } @@ -459,6 +468,10 @@ void dlsch_scheduler_pre_ue_select_fairRR( if (rnti == NOT_A_RNTI) continue; + if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 + || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + continue; + if(mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) { continue; } From 8e6e4d82370cbf2758238e317be8b2a11c30f2e0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 8 Feb 2022 10:58:04 +0100 Subject: [PATCH 114/196] Log inactivity timer --- openair2/LAYER2/MAC/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index a4e924c68b..4554b247f5 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -68,7 +68,7 @@ void *mac_stats_thread(void *param) { else { total_bler = (double)UE_scheduling_control->pusch_rx_error_num[CC_id] / (double)(UE_scheduling_control->pusch_rx_error_num[CC_id] + UE_scheduling_control->pusch_rx_num[CC_id]) * 100; } - fprintf(fd,"MAC UE rnti %x : %s, PHR %d DLCQI %d PUSCH %d PUCCH %d RLC disc %d UL-stat rcv %lu err %lu bler %lf (%lf/%lf) total_bler %lf mcsoff %d pre_allocated nb_rb %d, mcs %d, bsr %u sched %u tbs %lu cnt %u , DL-stat tbs %lu cnt %u rb %u buf %u 1st %u ret %u ri %d\n", + fprintf(fd,"MAC UE rnti %x : %s, PHR %d DLCQI %d PUSCH %d PUCCH %d RLC disc %d UL-stat rcv %lu err %lu bler %lf (%lf/%lf) total_bler %lf mcsoff %d pre_allocated nb_rb %d, mcs %d, bsr %u sched %u tbs %lu cnt %u , DL-stat tbs %lu cnt %u rb %u buf %u 1st %u ret %u ri %d inactivity timer %d\n", rnti, UE_scheduling_control->ul_out_of_sync == 0 ? "in synch" : "out of sync", UE_info->UE_template[CC_id][UE_id].phr_info, @@ -97,7 +97,8 @@ void *mac_stats_thread(void *param) { #endif UE_scheduling_control->first_cnt[CC_id], UE_scheduling_control->ret_cnt[CC_id], - UE_scheduling_control->aperiodic_ri_received[CC_id] + UE_scheduling_control->aperiodic_ri_received[CC_id], + UE_scheduling_control->ul_inactivity_timer ); fprintf(fd," ULSCH rounds %d/%d/%d/%d, DLSCH rounds %d/%d/%d/%d, ULSCH errors %d, DLSCH errors %d\n", UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[0], From b897287d1f65caeba94da4bf6614db7b616bacd0 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 8 Feb 2022 11:51:49 -0800 Subject: [PATCH 115/196] Changes made to gNB cause emulated-L1 mode not to work for multiple UEs. It seems that the RA procedure in the gNB was modified so the RAR is sent in a single tx_data_req. The emualted mode was not previously handling this. We now only process the PDU in the rx_ind that has a matching preamble. If any other PDUs exist, we ignore them and only build Msg3 based on this single matching RAR PDU. Also, two bug fixes applied here in the emulate-l1 mode. --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 12 ++++++++++++ openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 85bb10290a..b5680a9bf8 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3809,6 +3809,18 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t LOG_A(NR_MAC, "[UE %d][RAPROC][%d.%d] Found RAR with the intended RAPID %d\n", mod_id, frame, slot, rarh->RAPID); rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR)); ra->RA_RAPID_found = 1; + if (get_softmodem_params()->emulate_l1) { + LOG_I(NR_MAC, "If we found the RAR, the other PDUs are for other UEs and we dont need to process. " + "Only save rx_indication_body[%d] as only PDU in RX_indication\n", pdu_id); + dl_info->rx_ind->number_pdus = 1; + if (pdu_id != 0) { + memcpy(&dl_info->rx_ind->rx_indication_body[0], + &dl_info->rx_ind->rx_indication_body[pdu_id], + sizeof(fapi_nr_rx_indication_body_t)); + } + mac->nr_ue_emul_l1.expected_rar = false; + memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(mac->nr_ue_emul_l1.index_has_rar)); + } break; } if (rarh->E == 0) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index c7b54950d7..b98a9c8789 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -292,11 +292,11 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ { NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); mac->nr_ue_emul_l1.expected_sib = false; - memset(mac->nr_ue_emul_l1.index_has_sib, 0, sizeof(*mac->nr_ue_emul_l1.index_has_sib)); + memset(mac->nr_ue_emul_l1.index_has_sib, 0, sizeof(mac->nr_ue_emul_l1.index_has_sib)); mac->nr_ue_emul_l1.expected_rar = false; - memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(*mac->nr_ue_emul_l1.index_has_rar)); + memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(mac->nr_ue_emul_l1.index_has_rar)); mac->nr_ue_emul_l1.expected_dci = false; - memset(mac->nr_ue_emul_l1.index_has_dci, 0, sizeof(*mac->nr_ue_emul_l1.index_has_dci)); + memset(mac->nr_ue_emul_l1.index_has_dci, 0, sizeof(mac->nr_ue_emul_l1.index_has_dci)); int pdu_idx = 0; int num_pdus = dl_tti_request->dl_tti_request_body.nPDUs; @@ -420,7 +420,7 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi if (!dl_info->rx_ind) { - dl_info->rx_ind = CALLOC(1, sizeof(fapi_nr_rx_indication_t)); + dl_info->rx_ind = CALLOC(num_pdus, sizeof(fapi_nr_rx_indication_t)); } AssertFatal(dl_info->rx_ind != NULL, "%s: Out of memory in calloc", __FUNCTION__); fapi_nr_rx_indication_t *rx_ind = dl_info->rx_ind; From 92a021a15992d75865dd3b43dc4836e5daf173a5 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 10 Feb 2022 15:45:44 +0100 Subject: [PATCH 116/196] fix(docker): SA FDD template file not generated; cosmetics changes on the CI side Signed-off-by: Raphael Defosseux --- ci-scripts/xml_files/container_5g_fdd_rfsim.xml | 4 ++-- ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml | 4 ++-- ci-scripts/xml_files/container_5g_rfsim.xml | 4 ++-- ci-scripts/xml_files/container_5g_rfsim_down.xml | 2 +- .../yaml_files/5g_fdd_rfsimulator/docker-compose.yaml | 10 +++++----- docker/scripts/generateTemplate.py | 1 + 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml index 44be29cca4..28269b2d03 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -21,8 +21,8 @@ --> - rfsim-5gnr - Testing 5G NR RF sim - Monolithic gNB + rfsim-5gnr-fdd + Testing 5G NR RF sim - Monolithic FDD gNB wrench 4 diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml index c9e9a99d7b..d960949f7d 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml @@ -21,8 +21,8 @@ --> - rfsim-5gnr-down - CleanUp 5G RF - Monolithic gNB + rfsim-5gnr-fdd-down + CleanUp 5G RF - Monolithic FDD gNB trash 100012 diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index d1114616a8..7485b1f8ba 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -21,8 +21,8 @@ --> - rfsim-5gnr - Testing 5G NR RF sim - Monolithic gNB + rfsim-5gnr-tdd + Testing 5G NR RF sim - Monolithic TDD gNB wrench 4 diff --git a/ci-scripts/xml_files/container_5g_rfsim_down.xml b/ci-scripts/xml_files/container_5g_rfsim_down.xml index 9acc3f85a1..b369b1fad8 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_down.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_down.xml @@ -22,7 +22,7 @@ --> rfsim-5gnr-down - CleanUp 5G RF - Monolithic gNB + CleanUp 5G RF - Monolithic TDD gNB trash 100002 diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml index 587722f2ef..3e46adb9e7 100644 --- a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml @@ -241,15 +241,15 @@ services: NSSAI_SD1: 112233 AMF_IP_ADDRESS: 192.168.71.132 GNB_NGA_IF_NAME: eth0 - GNB_NGA_IP_ADDRESS: 192.168.71.136 + GNB_NGA_IP_ADDRESS: 192.168.71.140 GNB_NGU_IF_NAME: eth0 - GNB_NGU_IP_ADDRESS: 192.168.71.136 + GNB_NGU_IP_ADDRESS: 192.168.71.140 USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time depends_on: - oai-ext-dn networks: public_net: - ipv4_address: 192.168.71.136 + ipv4_address: 192.168.71.140 healthcheck: test: /bin/bash -c "pgrep nr-softmodem" interval: 10s @@ -260,7 +260,7 @@ services: privileged: true container_name: rfsim5g-oai-nr-ue environment: - RFSIMULATOR: 192.168.71.136 + RFSIMULATOR: 192.168.71.140 FULL_IMSI: '208990100001100' FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' OPC: 'C42449363BBAD02B66D16BC975D77CC1' @@ -272,7 +272,7 @@ services: - oai-gnb networks: public_net: - ipv4_address: 192.168.71.137 + ipv4_address: 192.168.71.150 healthcheck: test: /bin/bash -c "pgrep nr-uesoftmodem" interval: 10s diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py index 3d037294e6..297c202a03 100644 --- a/docker/scripts/generateTemplate.py +++ b/docker/scripts/generateTemplate.py @@ -55,6 +55,7 @@ def main(): "rcc.band40.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "gnb.band78.tm1.fr1.106PRB.usrpb210.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "gnb.band78.sa.fr1.106PRB.usrpn310.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "gnb.sa.band66.fr1.106PRB.usrpn300.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "gNB_SA_CU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "gNB_SA_DU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', From 11d80b93a9bde17e27637f5bc6903f520a249ea0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 10 Feb 2022 15:55:26 +0100 Subject: [PATCH 117/196] Increase LTE 2x2 ping test threshold to 40ms --- ci-scripts/xml_files/lte_2x2_tm1_quectel.xml | 2 +- ci-scripts/xml_files/lte_2x2_tm2_quectel.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml index 6cb7b2883b..11c4abce1b 100644 --- a/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml @@ -96,7 +96,7 @@ nrmodule2_quectel -c 100 -s 1024 -i 0,2 1 - 30 + 40 diff --git a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml index fcc772b8f4..6b5698698a 100644 --- a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml @@ -96,7 +96,7 @@ nrmodule2_quectel -c 100 -s 1024 -i 0,2 1 - 30 + 40 From f1260a09e6365d52f325228c03d55f78c51dcdb5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 14 Feb 2022 17:40:57 +0100 Subject: [PATCH 118/196] some fixes for phy-test mode --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 4 +++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 4 +++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index e9672144c2..fddf084a38 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -519,12 +519,14 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ sched_ctrl->coreset, Y); - if (sched_ctrl->cce_index < 0) { + if (CCEIndex < 0) { LOG_E(MAC, "%s(): CCE list not empty, couldn't schedule PUSCH\n", __func__); nr_mac->pdcch_cand[cid]--; return false; } + sched_ctrl->cce_index = CCEIndex; + const int mcs = target_ul_mcs; NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; sched_pusch->mcs = mcs; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index d3b6d1c24a..90c6e04a5d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -579,7 +579,8 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ps->nrOfLayers = 1; } else { - if (ps->nrOfLayers != layers) { + if (ps->nrOfLayers != layers || + ps->numDmrsCdmGrpsNoData == 0) { reset_dmrs = true; ps->nrOfLayers = layers; set_dl_dmrs_ports(ps); @@ -587,6 +588,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, } ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); + if (reset_dmrs) { ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type, ps->frontloaded_symb); ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 1374e584de..c757479a41 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -711,8 +711,9 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, UE_info->mac_stats[UE_id].ulsch_DTX++; } if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { - LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", - UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); + if (get_softmodem_params()->phy_test==0) + LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", + UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); UE_info->UE_sched_ctrl[UE_id].ul_failure = 1; nr_mac_gNB_rrc_ul_failure(gnb_mod_idP,CC_idP,frameP,slotP,rntiP); } From c645c12db4fcf8144a52f1f7b608d7f6c3b0d369 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 20 Jan 2022 18:56:44 +0100 Subject: [PATCH 119/196] using uid also in SA --- openair2/RRC/NR/L2_nr_interface.c | 18 +++++++++--------- openair2/RRC/NR/MESSAGES/asn1_msg.c | 15 ++++++--------- openair2/RRC/NR/MESSAGES/asn1_msg.h | 14 ++++++-------- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 -- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index cf7dcf1b64..4f54b9978d 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -325,7 +325,15 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, NR_ServingCellConfigCommon_t *scc=RC.nrrrc[module_idP]->carrier.servingcellconfigcommon; memset(&cellGroupConfig,0,sizeof(cellGroupConfig)); - fill_initial_cellGroupConfig(rntiP,-1,&cellGroupConfig,scc,&RC.nrrrc[module_idP]->carrier); + struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(RC.nrrrc[module_idP]); + ue_context_p->ue_id_rnti = rntiP; + ue_context_p->ue_context.rnti = rntiP; + ue_context_p->ue_context.random_ue_identity = rntiP; + ue_context_p->ue_context.Srb0.Active = 1; + RB_INSERT(rrc_nr_ue_tree_s, &RC.nrrrc[module_idP]->rrc_ue_head, ue_context_p); + + fill_initial_cellGroupConfig(ue_context_p->local_uid,&cellGroupConfig,scc,&RC.nrrrc[module_idP]->carrier); + MessageDef* tmp=itti_alloc_new_message_sized(TASK_RRC_GNB, 0, F1AP_INITIAL_UL_RRC_MESSAGE, sizeof(f1ap_initial_ul_rrc_message_t) + sdu_lenP); f1ap_initial_ul_rrc_message_t *msg = &F1AP_INITIAL_UL_RRC_MESSAGE(tmp); @@ -346,14 +354,6 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, memcpy(msg->rrc_container, sduP, sdu_lenP); msg->rrc_container_length=sdu_lenP; itti_send_msg_to_task(TASK_DU_F1, 0, tmp); - - struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(RC.nrrrc[module_idP]); - ue_context_p->ue_id_rnti = rntiP; - ue_context_p->ue_context.rnti = rntiP; - ue_context_p->ue_context.random_ue_identity = rntiP; - ue_context_p->ue_context.Srb0.Active = 1; - RB_INSERT(rrc_nr_ue_tree_s, &RC.nrrrc[module_idP]->rrc_ue_head, ue_context_p); - return(0); } diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index bbc05da506..fcf156a76e 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1002,8 +1002,7 @@ long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS) { return c_srs; } -void fill_initial_SpCellConfig(rnti_t rnti, - int uid, +void fill_initial_SpCellConfig(int uid, NR_SpCellConfig_t *SpCellConfig, NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier) { @@ -1042,9 +1041,8 @@ void fill_initial_SpCellConfig(rnti_t rnti, // one symbol (13) NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); pucchres0->pucch_ResourceId=0; - //pucchres0->startingPRB=0; - pucchres0->startingPRB=(8+rnti) % curr_bwp; - LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp); + pucchres0->startingPRB=(8+uid) % curr_bwp; + LOG_D(NR_RRC, "pucchres0->startPRB %ld uid %d curr_bwp %d\n", pucchres0->startingPRB, uid, curr_bwp); pucchres0->intraSlotFrequencyHopping=NULL; pucchres0->secondHopPRB=NULL; pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0; @@ -1448,8 +1446,7 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb); } -void fill_initial_cellGroupConfig(rnti_t rnti, - int uid, +void fill_initial_cellGroupConfig(int uid, NR_CellGroupConfig_t *cellGroupConfig, NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier) { @@ -1543,7 +1540,7 @@ void fill_initial_cellGroupConfig(rnti_t rnti, cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig)); - fill_initial_SpCellConfig(rnti,uid,cellGroupConfig->spCellConfig,scc,carrier); + fill_initial_SpCellConfig(uid,cellGroupConfig->spCellConfig,scc,carrier); cellGroupConfig->sCellToAddModList = NULL; cellGroupConfig->sCellToReleaseList = NULL; @@ -1622,7 +1619,7 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, } else { cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t)); - fill_initial_cellGroupConfig(ue_context_pP->ue_context.rnti,ue_context_pP->local_uid,cellGroupConfig,scc,carrier); + fill_initial_cellGroupConfig(ue_context_pP->local_uid,cellGroupConfig,scc,carrier); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index ca92652c6c..cb971acd60 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -100,16 +100,14 @@ void do_SpCellConfig(gNB_RRC_INST *rrc, uint8_t do_RRCReject(uint8_t Mod_id, uint8_t *const buffer); -void fill_initial_SpCellConfig(rnti_t rnti, - int uid, - NR_SpCellConfig_t *SpCellConfig, - NR_ServingCellConfigCommon_t *scc, +void fill_initial_SpCellConfig(int uid, + NR_SpCellConfig_t *SpCellConfig, + NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier); -void fill_initial_cellGroupConfig(rnti_t rnti, - int uid, - NR_CellGroupConfig_t *cellGroupConfig, - NR_ServingCellConfigCommon_t *scc, +void fill_initial_cellGroupConfig(int uid, + NR_CellGroupConfig_t *cellGroupConfig, + NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier); void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index db4dc2d579..3a28409aea 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -914,9 +914,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList)); pucch_Config->resourceToReleaseList = NULL; NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); - NR_PUCCH_Resource_t *pucchres1=calloc(1,sizeof(*pucchres1)); NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2)); - NR_PUCCH_Resource_t *pucchres3=calloc(1,sizeof(*pucchres3)); pucchres0->pucch_ResourceId=1; pucchres0->startingPRB= (8 + uid) % curr_bwp; From 6de93fbb59208a5f0ba795675ffbac13cc652719 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 14 Feb 2022 16:15:39 -0800 Subject: [PATCH 120/196] Only assigning harq_pid in emulated L1 mode. --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index b98a9c8789..146e2aa348 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1034,7 +1034,8 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t // Note: sdu should always be processed because data and timing advance updates are transmitted by the UE int8_t handle_dlsch(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment, int pdu_id){ - dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; + if (get_softmodem_params()->emulate_l1) + dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; update_harq_status(dl_info->module_id, dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid, From 39d9febc0c376bcf800afbbdf2715c80c25a8eb6 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 15 Feb 2022 08:39:55 -0800 Subject: [PATCH 121/196] Hardcoding TI and UL_CQI in stub function. Also, the allocation of the eNB measurement report keeps getting commented out becasue the compiler throws an error. I have un-commented the allocation of memory (becasue it breaks NSA mode) and added a memset to ensure we are using the allocated memory. This gets rid of the warning and ensures NSA mode still works. --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 6 +++--- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 4f4757ec5a..5b13b2e9d0 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -90,8 +90,8 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu)); memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu)); rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti; - rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; - rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi; + rx_ind->pdu_list[j].timing_advance = 31; + rx_ind->pdu_list[j].ul_cqi = 255; char buffer[1024]; hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer)); LOG_D(NR_MAC, "Hexdump of pdu %s before queuing rx_ind\n", @@ -113,7 +113,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response crc_ind->crc_list[j].num_cb = pusch_config_pdu->pusch_data.num_cb; crc_ind->crc_list[j].rnti = pusch_config_pdu->rnti; crc_ind->crc_list[j].tb_crc_status = 0; - crc_ind->crc_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; + crc_ind->crc_list[j].timing_advance = 31; crc_ind->crc_list[j].ul_cqi = 255; } diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index b069591316..349441544d 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,9 +4293,8 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; - //asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); - //measresult_cgi2->cellGlobalId= {0}; - //measresult_cgi2->trackingAreaCode= {0}; + asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + memset(measresult_cgi2, 0, sizeof(LTE_CellGlobalIdEUTRA_t)); struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; asn1cCallocOne(measResult->rsrpResult, rsrp_tar); asn1cCallocOne(measResult->rsrqResult, rsrq_tar); From ff8c47d3aa38efa6966c9703eb497669c43119e4 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 15 Feb 2022 17:04:50 +0000 Subject: [PATCH 122/196] Fix scramblingID and gold sequence for PDCCH and PDSCH --- openair1/PHY/INIT/nr_init_ue.c | 9 --------- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b571afe416..5e6c148325 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -272,9 +272,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } } - ue->scramblingID_pdcch = fp->Nid_cell; - nr_gold_pdcch(ue,fp->Nid_cell); - //PDSCH DMRS init (eNB offset = 0) ue->nr_gold_pdsch[0] = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***)); uint32_t ****pdsch_dmrs = ue->nr_gold_pdsch[0]; @@ -294,12 +291,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } } - // initializing the scrambling IDs for PDSCH DMRS - for (int i=0; i<2; i++) - ue->scramblingID[i]=fp->Nid_cell; - - nr_gold_pdsch(ue,ue->scramblingID); - // DLSCH for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { for (th_id=0; th_idofdm_symbol_size + fp->nb_prefix_samples0)+(ue->symbol_offset-n_symb_prefix0)*(fp->ofdm_symbol_size + fp->nb_prefix_samples); // for a correct computation of frame number to sync with the one decoded at MIB we need to take into account in which of the n_frames we got sync ue->init_sync_frame = n_frames - 1 - is; + + // compute the scramblingID_pdcch and the gold pdcch + ue->scramblingID_pdcch = fp->Nid_cell; + nr_gold_pdcch(ue,fp->Nid_cell); + + // compute the scrambling IDs for PDSCH DMRS + for (int i=0; i<2; i++) + ue->scramblingID[i]=fp->Nid_cell; + + nr_gold_pdsch(ue,ue->scramblingID); + // we also need to take into account the shift by samples_per_frame in case the if is true if (ue->ssb_offset < sync_pos_frame){ ue->rx_offset = fp->samples_per_frame - sync_pos_frame + ue->ssb_offset; From 679816c3c1b1fb24903677327c37960b63b5b5f5 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 15 Feb 2022 15:05:04 -0800 Subject: [PATCH 123/196] Added comment around asn1cCalloc memory leak --- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 349441544d..d271eecd5c 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,8 +4293,9 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; + /* TODO: This asn1cCalloc leaks memory but also masks a bug. + If we delete this asn1cCalloc statement, eNB will crash in NSA mode. */ asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); - memset(measresult_cgi2, 0, sizeof(LTE_CellGlobalIdEUTRA_t)); struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; asn1cCallocOne(measResult->rsrpResult, rsrp_tar); asn1cCallocOne(measResult->rsrqResult, rsrq_tar); From 9691946845ac9d70aa2e82b802f1691201361c5d Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 16 Feb 2022 00:52:57 +0000 Subject: [PATCH 124/196] Fix Nid_cell in PUSCH dmrs and scrambling --- openair1/PHY/INIT/nr_init_ue.c | 4 ---- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 5 +++++ openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 5 ++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 5e6c148325..3ca4ac0c18 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -134,8 +134,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int gNB_id; int th_id; uint32_t ****pusch_dmrs; - uint16_t N_n_scid[2] = {0,1}; // [HOTFIX] This is a temporary implementation of scramblingID0 and scramblingID1 which are given by DMRS-UplinkConfig - int n_scid; abstraction_flag = 0; LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx); //LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST); @@ -192,7 +190,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, /////////// ue->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***)); pusch_dmrs = ue->nr_gold_pusch_dmrs; - n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization for (slot=0; slotslots_per_frame; slot++) { pusch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **)); @@ -209,7 +206,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } } - nr_init_pusch_dmrs(ue, N_n_scid, n_scid); /////////// //////////////////////////////////////////////////////////////////////////////////////////// diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 19e4abdf9e..203be1bd24 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -315,6 +315,11 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, nr_gold_pdsch(ue,ue->scramblingID); + // initialize the pusch dmrs + uint16_t N_n_scid[2] = {fp->Nid_cell,fp->Nid_cell}; + int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization + nr_init_pusch_dmrs(ue, N_n_scid, n_scid); + // we also need to take into account the shift by samples_per_frame in case the if is true if (ue->ssb_offset < sync_pos_frame){ ue->rx_offset = fp->samples_per_frame - sync_pos_frame + ue->ssb_offset; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 0c188e9119..41cf9c2ffa 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -128,7 +128,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id]; uint8_t num_of_codewords = 1; // tmp assumption - int Nid_cell = 0; int N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig uint16_t number_dmrs_symbols = 0; @@ -153,7 +152,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if (start_sc >= frame_parms->ofdm_symbol_size) start_sc -= frame_parms->ofdm_symbol_size; - ulsch_ue->Nid_cell = Nid_cell; + ulsch_ue->Nid_cell = frame_parms->Nid_cell; for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) { if((ul_dmrs_symb_pos >> i) & 0x01) @@ -391,7 +390,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, // Perform this on gold sequence, not required when SC FDMA operation is done, LOG_D(PHY,"DMRS in symbol %d\n",l); nr_modulation(pusch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated - + } else { dmrs_idx = 0; } From fd40aa2666db8a58ad7403bfe718933b37a18ee6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 9 Feb 2022 20:09:51 +0000 Subject: [PATCH 125/196] Make nr_find_nb_rb() take minimum RBsize Fixes a bug when scheduling multiple UEs --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 ++++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 5 +++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 5 ++++- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index cb76c22292..0a21391162 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -598,6 +598,7 @@ bool allocate_dl_retransmission(module_id_t module_id, temp_ps.nrOfSymbols, temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT, retInfo->tb_size, + 1, /* minimum of 1RB: need to find exact TBS, don't preclude any number */ rbSize, &new_tbs, &new_rbSize); @@ -739,8 +740,9 @@ void pf_dl(module_id_t module_id, } } + const int min_rbSize = 5; /* Loop UE_sched to find max coeff and allocate transmission */ - while (max_num_ue > 0 && n_rb_sched > 0 && UE_sched.head >= 0) { + while (max_num_ue > 0 && n_rb_sched >= min_rbSize && UE_sched.head >= 0) { /* Find max coeff from UE_sched*/ int *max = &UE_sched.head; /* assume head is max */ @@ -859,6 +861,7 @@ void pf_dl(module_id_t module_id, ps->nrOfSymbols, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, sched_ctrl->num_total_bytes + oh, + min_rbSize, max_rbSize, &TBS, &rbSize); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index a1dfc7c833..4028f85b2a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -388,6 +388,7 @@ bool nr_find_nb_rb(uint16_t Qm, uint16_t nb_symb_sch, uint16_t nb_dmrs_prb, uint32_t bytes, + uint16_t nb_rb_min, uint16_t nb_rb_max, uint32_t *tbs, uint16_t *nb_rb) @@ -403,7 +404,7 @@ bool nr_find_nb_rb(uint16_t Qm, return true; /* is the minimum enough? */ - *nb_rb = 5; + *nb_rb = nb_rb_min; *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; if (bytes <= *tbs) return true; @@ -411,7 +412,7 @@ bool nr_find_nb_rb(uint16_t Qm, /* perform binary search to allocate all bytes within a TBS up to nb_rb_max * RBs */ int hi = nb_rb_max; - int lo = 1; + int lo = nb_rb_min; for (int p = (hi + lo) / 2; lo + 1 < hi; p = (hi + lo) / 2) { const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; if (bytes == TBS) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 0a18731c0a..96ffb7e2a3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1004,6 +1004,7 @@ bool allocate_ul_retransmission(module_id_t module_id, temp_ps.nrOfSymbols, temp_ps.N_PRB_DMRS * temp_ps.num_dmrs_symb, retInfo->tb_size, + 1, /* minimum of 1RB: need to find exact TBS, don't preclude any number */ rbSize, &new_tbs, &new_rbSize); @@ -1256,8 +1257,9 @@ void pf_ul(module_id_t module_id, } + const int min_rbSize = 5; /* Loop UE_sched to find max coeff and allocate transmission */ - while (UE_sched.head >= 0 && max_num_ue> 0 && n_rb_sched > 0) { + while (UE_sched.head >= 0 && max_num_ue> 0 && n_rb_sched >= min_rbSize) { /* Find max coeff */ int *max = &UE_sched.head; /* Find max coeff: assume head is max */ int *p = &UE_sched.next[*max]; @@ -1349,6 +1351,7 @@ void pf_ul(module_id_t module_id, ps->nrOfSymbols, ps->N_PRB_DMRS * ps->num_dmrs_symb, B, + min_rbSize, max_rbSize, &TBS, &rbSize); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 9afd2a4083..d9767367dc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -463,6 +463,7 @@ bool nr_find_nb_rb(uint16_t Qm, uint16_t nb_symb_sch, uint16_t nb_dmrs_prb, uint32_t bytes, + uint16_t nb_rb_min, uint16_t nb_rb_max, uint32_t *tbs, uint16_t *nb_rb); From e890cee31cd508eb605c11b6b6a949ddaebc4d6f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 10 Feb 2022 12:04:07 +0100 Subject: [PATCH 126/196] Reduce max_num_ue after successful PUCCH alloc --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 10 ++++++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0a21391162..bf29fd0e01 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -802,9 +802,6 @@ void pf_dl(module_id_t module_id, LOG_D(NR_MAC, "%4d.%2d could not find CCE for DL DCI UE %d/RNTI %04x\n", frame, slot, UE_id, rnti); continue; } - /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */ - max_num_ue--; - if (max_num_ue < 0) return; /* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH * allocation after CCE alloc fail would be more complex) */ @@ -818,9 +815,14 @@ void pf_dl(module_id_t module_id, frame, slot); mac->pdcch_cand[cid]--; - return; + continue; } + /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE + * and PUCCH */ + max_num_ue--; + AssertFatal(max_num_ue >= 0, "Illegal max_num_ue %d\n", max_num_ue); + sched_ctrl->cce_index = CCEIndex; fill_pdcch_vrb_map(mac, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 96ffb7e2a3..b0b49565be 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1305,8 +1305,7 @@ void pf_ul(module_id_t module_id, /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */ max_num_ue--; - if (max_num_ue < 0) - return; + AssertFatal(max_num_ue >= 0, "Illegal max_num_ue %d\n", max_num_ue); NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; From 63989e8a694485b3e1ccb0d0763d754a57c13103 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 17 Feb 2022 19:53:33 +0100 Subject: [PATCH 127/196] Fix for F1 RFsim fail We compute the preferred DL TDAs when receiving the cellGroup from the RRC. However, in F1 and the RFsim, it seems that the scheduler tries to access the preferred DL TDAs before they have been set after receiving the cellGroup. In this commit, add a simple check to verify the preferred TDA has been set up. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0d857a0ba9..cd34a543c7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -895,7 +895,10 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t /* This is temporary and it assumes all UEs have the same BWP and TDA*/ int UE_id = UE_info->list.head; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; + const int bwp_id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0; + if (!RC.nrmac[module_id]->preferred_dl_tda[bwp_id]) + return; + const int tda = RC.nrmac[module_id]->preferred_dl_tda[bwp_id][slot]; int startSymbolIndex, nrOfSymbols; const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : From 9b302d04322d18233e9ff7874846803ca2589609 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 12:20:06 +0100 Subject: [PATCH 128/196] Fix DU default config, increase 5G F1 RFsim throughput requirements --- ci-scripts/conf_files/gNB_SA_DU.conf | 2 +- ci-scripts/xml_files/container_5g_f1_rfsim.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf index adcbcd45d0..64f2dd5d0e 100644 --- a/ci-scripts/conf_files/gNB_SA_DU.conf +++ b/ci-scripts/conf_files/gNB_SA_DU.conf @@ -280,7 +280,7 @@ serveraddr = "server"; phy_log_verbosity ="medium"; mac_log_level ="info"; mac_log_verbosity ="high"; - rlc_log_level ="debug"; + rlc_log_level ="info"; rlc_log_verbosity ="medium"; pdcp_log_level ="info"; pdcp_log_verbosity ="medium"; diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml index 501f2fe46f..fc24a3d67c 100644 --- a/ci-scripts/xml_files/container_5g_f1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml @@ -100,7 +100,7 @@ rfsim5g-oai-nr-ue rfsim5g-oai-ext-dn -B 12.1.1.2 -u -i 1 -s - -c 12.1.1.2 -u -i 1 -t 30 -b 200K + -c 12.1.1.2 -u -i 1 -t 30 -b 3M @@ -109,7 +109,7 @@ rfsim5g-oai-ext-dn rfsim5g-oai-nr-ue -u -i 1 -s - -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 5K + -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M From 6569fd76148051ff92bb8ef370d277526d38dff5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 12:52:45 +0100 Subject: [PATCH 129/196] Do not prematurely overwrite scheduler information Overwriting sched_pusch information at that stage would in particular lose information on the current frame/slot. Overwriting sched_pusch with the retInfo structure is already done at the end of allocate_ul_retransmission(), and is therefore not necessary at this stage. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index c757479a41..397630bae6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1020,9 +1020,6 @@ bool allocate_ul_retransmission(module_id_t module_id, retInfo->rbSize = new_rbSize; retInfo->time_domain_allocation = tda; sched_ctrl->pusch_semi_static = temp_ps; - - // Get previous PUSCH filed info - sched_ctrl->sched_pusch = *retInfo; } /* Find a free CCE */ From 0a59bffbb129f459a646005b97c86ed367447adc Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 18 Feb 2022 13:38:45 +0100 Subject: [PATCH 130/196] fix phy-test check --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index c757479a41..1257d80f10 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -710,10 +710,9 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt++; UE_info->mac_stats[UE_id].ulsch_DTX++; } - if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { - if (get_softmodem_params()->phy_test==0) - LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", - UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); + if (!get_softmodem_params()->phy_test && UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { + LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", + UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); UE_info->UE_sched_ctrl[UE_id].ul_failure = 1; nr_mac_gNB_rrc_ul_failure(gnb_mod_idP,CC_idP,frameP,slotP,rntiP); } From a1aae8292513672f3637bcc06db2baa279a489e8 Mon Sep 17 00:00:00 2001 From: alblf Date: Fri, 18 Feb 2022 18:22:14 +0100 Subject: [PATCH 131/196] Fix duplicated memory allocation when replaying using mmap, add use_mmap parameter for the record player device fix assertion when replaying without using mmap --- targets/ARCH/COMMON/record_player.c | 7 +++--- targets/ARCH/COMMON/record_player.h | 13 ++++++----- targets/ARCH/iqplayer/iqplayer_lib.c | 33 ++++++++++++++-------------- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/targets/ARCH/COMMON/record_player.c b/targets/ARCH/COMMON/record_player.c index 522f6b6d16..37f985b6b2 100644 --- a/targets/ARCH/COMMON/record_player.c +++ b/targets/ARCH/COMMON/record_player.c @@ -58,10 +58,9 @@ int read_recplayconfig(recplay_conf_t **recplay_conf, recplay_state_t **recplay_ // Use mmap for IQ files for systems with less than 6GB total RAM sysinfo(&systeminfo); - if (systeminfo.totalram < 6144000000) { - (*recplay_state)->use_mmap = 0; - } else { - (*recplay_state)->use_mmap = 1; + if (systeminfo.totalram < 6144000000 && ((*recplay_conf)->use_mmap == 1)) { + LOG_W(HW,"System with %f GB of mem (<6GB), mmap usage disabled\n",systeminfo.totalram/10E9); + (*recplay_conf)->use_mmap = 0; } } else { /* record player enabled */ free(*recplay_conf); diff --git a/targets/ARCH/COMMON/record_player.h b/targets/ARCH/COMMON/record_player.h index d91da68323..9310355e5b 100644 --- a/targets/ARCH/COMMON/record_player.h +++ b/targets/ARCH/COMMON/record_player.h @@ -78,7 +78,7 @@ typedef struct { #define CONFIG_HLP_SF_LOOPS "Number of loops to replay of the entire subframes file" #define CONFIG_HLP_SF_RDELAY "Delay in microseconds to read a subframe in replay mode" #define CONFIG_HLP_SF_WDELAY "Delay in microseconds to write a subframe in replay mode" - +#define CONFIG_HLP_USE_MMAP "In replay mode, map iq file in memory before replaying" /* keyword strings for config options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */ #define CONFIG_OPT_SF_FILE "subframes-file" #define CONFIG_OPT_SF_REC "subframes-record" @@ -87,7 +87,7 @@ typedef struct { #define CONFIG_OPT_SF_LOOPS "subframes-loops" #define CONFIG_OPT_SF_RDELAY "subframes-read-delay" #define CONFIG_OPT_SF_WDELAY "subframes-write-delay" - +#define CONFIG_OPT_USE_MMAP "use-mmap" #define DEVICE_RECPLAY_SECTION "device.recplay" /* For information only - the macro is not usable in C++ */ /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ @@ -95,13 +95,14 @@ typedef struct { /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define DEVICE_RECPLAY_PARAMS_DESC { \ - {CONFIG_OPT_SF_FILE, CONFIG_HLP_SF_FILE, 0, strptr:(char **)((*recplay_conf)->u_sf_filename), defstrval:DEF_SF_FILE, TYPE_STRING, 1024}, \ - {CONFIG_OPT_SF_REC, CONFIG_HLP_SF_REC, PARAMFLAG_BOOL, uptr:&(u_sf_record), defuintval:0, TYPE_UINT, 0}, \ - {CONFIG_OPT_SF_REP, CONFIG_HLP_SF_REP, PARAMFLAG_BOOL, uptr:&(u_sf_replay), defuintval:0, TYPE_UINT, 0}, \ + {CONFIG_OPT_SF_FILE, CONFIG_HLP_SF_FILE, 0, strptr:(char **)((*recplay_conf)->u_sf_filename), defstrval:DEF_SF_FILE, TYPE_STRING, 1024}, \ + {CONFIG_OPT_SF_REC, CONFIG_HLP_SF_REC, PARAMFLAG_BOOL, uptr:&(u_sf_record), defuintval:0, TYPE_UINT, 0}, \ + {CONFIG_OPT_SF_REP, CONFIG_HLP_SF_REP, PARAMFLAG_BOOL, uptr:&(u_sf_replay), defuintval:0, TYPE_UINT, 0}, \ {CONFIG_OPT_SF_MAX, CONFIG_HLP_SF_MAX, 0, uptr:&((*recplay_conf)->u_sf_max), defintval:DEF_NB_SF, TYPE_UINT, 0}, \ {CONFIG_OPT_SF_LOOPS, CONFIG_HLP_SF_LOOPS, 0, uptr:&((*recplay_conf)->u_sf_loops), defintval:DEF_SF_NB_LOOP, TYPE_UINT, 0}, \ {CONFIG_OPT_SF_RDELAY, CONFIG_HLP_SF_RDELAY, 0, uptr:&((*recplay_conf)->u_sf_read_delay), defintval:DEF_SF_DELAY_READ, TYPE_UINT, 0}, \ {CONFIG_OPT_SF_WDELAY, CONFIG_HLP_SF_WDELAY, 0, uptr:&((*recplay_conf)->u_sf_write_delay), defintval:DEF_SF_DELAY_WRITE, TYPE_UINT, 0}, \ + {CONFIG_OPT_USE_MMAP, CONFIG_HLP_USE_MMAP, PARAMFLAG_BOOL, uptr:&((*recplay_conf)->use_mmap), defuintval:1, TYPE_UINT, 0}, \ }/*! \brief Record Player Configuration and state */ typedef struct { char u_sf_filename[1024]; // subframes file path @@ -109,10 +110,10 @@ typedef struct { unsigned int u_sf_loops ; // number of loops in replay mode unsigned int u_sf_read_delay; // read delay in replay mode unsigned int u_sf_write_delay ; // write delay in replay mode + unsigned int use_mmap; // default is to use mmap } recplay_conf_t; typedef struct { - int use_mmap; // default is to use mmap size_t mapsize; FILE *pFile; int fd; diff --git a/targets/ARCH/iqplayer/iqplayer_lib.c b/targets/ARCH/iqplayer/iqplayer_lib.c index 8b6844f9d3..b62c1935d3 100644 --- a/targets/ARCH/iqplayer/iqplayer_lib.c +++ b/targets/ARCH/iqplayer/iqplayer_lib.c @@ -68,19 +68,18 @@ static int iqplayer_loadfile(openair0_device *device, openair0_config_t *openair exit(-1); } - if (s->use_mmap) { + if (c->use_mmap) { // use mmap s->mapsize=sb.st_size; LOG_I(HW,"Loading subframes using mmap() from %s size=%lu bytes ...\n",c->u_sf_filename, (uint64_t)sb.st_size ); void *mptr = mmap(NULL, sb.st_size, PROT_WRITE, MAP_PRIVATE, s->fd, 0) ; - s->ms_sample = (iqrec_t *) ( mmap(NULL, sb.st_size, PROT_WRITE, MAP_PRIVATE, s->fd, 0) + sizeof(iqfile_header_t)); - if (mptr != MAP_FAILED) { + s->ms_sample = (iqrec_t *) ( mptr + sizeof(iqfile_header_t)); parse_iqfile_header(device, (iqfile_header_t *)mptr); s->ms_sample = (iqrec_t *)((char *)mptr + sizeof(iqfile_header_t)); LOG_I(HW,"Loaded %u subframes.\n",s->nbSamplesBlocks ); } else { - LOG_E(HW,"Cannot mmap file, exiting.\n"); + LOG_E(HW,"Cannot mmap file, exiting, errnor %s\n",strerror(errno)); close(s->fd); exit(-1); } @@ -108,7 +107,7 @@ static int iqplayer_loadfile(openair0_device *device, openair0_config_t *openair if (lseek(s->fd,sizeof(iqfile_header_t), SEEK_SET) == 0) { LOG_I(HW,"Initial seek at beginning of the file\n" ); } else { - LOG_I(HW,"Problem initial seek at beginning of the file\n"); + LOG_I(HW,"Problem initial seek at beginning of the file, %s\n",strerror(errno)); } } else { LOG_E(HW,"Cannot read header in %s exiting.\n",c->u_sf_filename ); @@ -134,11 +133,10 @@ static int trx_iqplayer_start(openair0_device *device) { static void trx_iqplayer_end(openair0_device *device) { if (device == NULL) return; - if (device->recplay_state == NULL) return; - if (device->recplay_state->use_mmap) { + if (device->openair0_cfg->recplay_conf->use_mmap) { if (device->recplay_state->ms_sample != MAP_FAILED) { munmap(device->recplay_state->ms_sample, device->recplay_state->mapsize); } @@ -201,21 +199,22 @@ static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimes LOG_I(HW,"go back at the beginning of IQ file"); device->recplay_state->currentPtr=(uint8_t *)device->recplay_state->ms_sample; - if (!s->use_mmap) { - if (lseek(device->recplay_state->fd, 0, SEEK_SET) != 0) { - LOG_E(HW, "Problem seeking at the beginning of IQ file"); - } + if (!(device->openair0_cfg->recplay_conf->use_mmap) ) { + close(device->recplay_state->fd); + iqplayer_loadfile(device, device->openair0_cfg); + // LOG_E(HW, "Problem seeking at the beginning of IQ file %s\n",strerror(errno)); + } } - if (!s->use_mmap) { + if (!(device->openair0_cfg->recplay_conf->use_mmap)) { // read sample from file if (read(s->fd, s->ms_sample, sizeof(iqrec_t)) != sizeof(iqrec_t)) { - LOG_E(HW,"pb reading iqfile at index %lu\n",sizeof(iqrec_t)*s->curSamplesBlock ); + LOG_E(HW,"pb reading iqfile at index %lu %s\n",sizeof(iqrec_t)*s->curSamplesBlock, strerror(errno) ); exit(-1); } else { if (read(s->fd, s->ms_sample+1, s->ms_sample->nbBytes) != s->ms_sample->nbBytes) { - LOG_E(HW,"pb reading iqfile at index %lu\n",sizeof(iqrec_t)*s->curSamplesBlock ); + LOG_E(HW,"pb reading iqfile at index %lu %s\n",sizeof(iqrec_t)*s->curSamplesBlock, strerror(errno) ); exit(-1); } } @@ -225,7 +224,9 @@ static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimes AssertFatal(curHeader->header==BELL_LABS_IQ_HEADER,"" ); // the current timestamp is the stored timestamp until we wrap on input // USRP shifts 1 sample time to time - AssertFatal(s->wrap_count !=0 || abs(curHeader->ts-s->currentTs) < 5 ,""); + if (s->wrap_count !=0 && device->openair0_cfg->recplay_conf->use_mmap) + AssertFatal( abs(curHeader->ts-s->currentTs) < 5 , + "wrap_count=%li, ts %lu %lu",s->wrap_count,curHeader->ts,s->currentTs); AssertFatal(nsamps*4==curHeader->nbBytes,""); *ptimestamp = s->currentTs; memcpy(buff[0], curHeader+1, nsamps*4); @@ -233,7 +234,7 @@ static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimes // Prepare for next read s->currentTs+=nsamps; - if (s->use_mmap) + if (device->openair0_cfg->recplay_conf->use_mmap) s->currentPtr+=sizeof(iqrec_t)+s->ms_sample->nbBytes; struct timespec req; From 3d577aa0fcb8f60adcba36ee4a08cd59848aa4bc Mon Sep 17 00:00:00 2001 From: alblf Date: Fri, 18 Feb 2022 18:40:56 +0100 Subject: [PATCH 132/196] doc update --- targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md b/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md index a6e4138e8e..f68f800047 100644 --- a/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md +++ b/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md @@ -75,7 +75,7 @@ U[HW]I ru thread Writing file header to /tmp/iqfile ``` ### Playback/replay mode -The option works only for 5MHz bandwidth because the information stored in the iq's file header regarding bandwidth is not yet properly processed. +When replaying iq's received by eNB or gNB The option works only for 5MHz bandwidth because the information stored in the iq's file header regarding bandwidth is not yet properly processed. In this version, mismatch between file content and run time parameters might lead to unpredictable results. In addition a file recorded on a AVX2-capable processor cannot be replayed on a non-AVX2-capable processor (this is to be further investigated). options for replay mode are: * `subframes-replay` Activate replay mode @@ -83,6 +83,7 @@ options for replay mode are: * `subframes-loops` Number of iterations to replay the entire subframes file (default is 5) * `subframes-read-delay` Delay in microseconds to read a subframe in replay mode (default 200) * `subframes-write-delay` Delay in milliseconds to write a subframe in replay mode (default 15) +* `use-mmap` Boolean, set to 1 (true) by default, iq file is map to memory if true, otherwise iq's are read from file. >iq player session example: ```bash From cffb27b086756589bac22783b0ae877243cce7d6 Mon Sep 17 00:00:00 2001 From: Francois TABURET Date: Fri, 18 Feb 2022 17:46:08 +0000 Subject: [PATCH 133/196] Update iqrecordplayer_usage.md --- targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md b/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md index f68f800047..6ccdca3bfa 100644 --- a/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md +++ b/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md @@ -1,7 +1,7 @@ # I/Q record-playback ## using the iq recorder or iq player -This feature provides I/Q record-playback as presented in the 4th OAI workshop. Tests have only been performed with a eNB, but the implementation should allow any softmodem executable to use the iq's record/player. +This feature provides I/Q record-playback as presented in the 4th OAI workshop. The implementation allows any softmodem executable to use the iq's record/player. The I/Q record/playback feature is briefly described hereafter, it allows you to: * record subframes received by the USRP board in a file while the system is operating (for example you can record a full UE connection/traffic/ disconnection sequence). Today the oai USRP device is the only one supporting the recording feature. * replay subframes from a file to operate the system (possibly in multiple loops if the recorded sequence is convenient from the logical point of view). From 7c652df820ad6cc646da1303699d8403054ae09e Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sun, 20 Feb 2022 15:56:56 +0100 Subject: [PATCH 134/196] nr rlc: bugfix - so_end was used instead of sn_end --- openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c index d7923e5490..aaa4faf58c 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c @@ -1044,7 +1044,7 @@ next_pdu: set_end_different_sdu: /* don't go more than rx_highest_status - 1 */ if (sn_compare_rx(entity, entity->rx_highest_status, cur->sn) <= 0) { - ret.so_end = (entity->rx_highest_status - 1 + entity->sn_modulus) % + ret.sn_end = (entity->rx_highest_status - 1 + entity->sn_modulus) % entity->sn_modulus; ret.so_end = 0xffff; return ret; From 78f0c8ff29796ee67cb53f88f4e8ae25c321011d Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sun, 20 Feb 2022 16:00:54 +0100 Subject: [PATCH 135/196] nr rlc: harmonize computation of sn_count Functions generate_missing() and missing_size() had different computations of sn_count. Not sure if it is a problem or not, but let's do the same in both functions. Hopefully the computation is correct. --- openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c index aaa4faf58c..af8cb5715a 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c @@ -1305,9 +1305,8 @@ static int missing_size(nr_rlc_entity_am_t *entity, missing_data_t *m, missing_data_t m_nack; /* be careful to limit a range to 255 SNs, that is: cut if needed */ - sn_count = m->sn_end - m->sn_start + 1; - if (sn_count < 0) - sn_count += entity->sn_modulus; + sn_count = (m->sn_end - m->sn_start + entity->sn_modulus) + % entity->sn_modulus + 1; sn_start = m->sn_start; From 67b299e3410acb59924e182e4aa1ff705161efc2 Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Mon, 21 Feb 2022 10:29:06 +0100 Subject: [PATCH 136/196] fix a warning in assertions.h, appear only with some gcc versions --- common/utils/assertions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/assertions.h b/common/utils/assertions.h index 57c50a65e0..c80a306645 100644 --- a/common/utils/assertions.h +++ b/common/utils/assertions.h @@ -35,7 +35,7 @@ char tmp [1000]; \ sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d > /tmp/full_stacks.%d < /dev/null", \ getpid(), getpid()); \ - system(tmp); \ + __attribute__((unused)) int dummy=system(tmp); \ } \ fprintf(stderr, "\nExiting execution\n"); \ fflush(stdout); \ From 923edebd3cc6f823441ceaf7c8a6183b6d21751c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 17:00:35 +0100 Subject: [PATCH 137/196] Enable Address Sanitizer on physical simulators - install libasan in physim containers - run physim containers with SYS_CAP_PTRACE capability - remove static-libasan: not available in RHEL8: The physims are tested in a container environment on top of RHEL8. To my knowledge, no package provides the static ASan library there. Therefore, remove it here to be able to run these tests. --- charts/physims/charts/dlsim/values.yaml | 4 +++- charts/physims/charts/ldpctest/values.yaml | 4 +++- charts/physims/charts/nr-dlschsim/values.yaml | 4 +++- charts/physims/charts/nr-dlsim/values.yaml | 4 +++- charts/physims/charts/nr-pbchsim/values.yaml | 4 +++- charts/physims/charts/nr-prachsim/values.yaml | 4 +++- charts/physims/charts/nr-pucchsim/values.yaml | 4 +++- charts/physims/charts/nr-ulschsim/values.yaml | 4 +++- charts/physims/charts/nr-ulsim/values.yaml | 4 +++- charts/physims/charts/polartest/values.yaml | 4 +++- charts/physims/charts/smallblocktest/values.yaml | 4 +++- charts/physims/charts/ulsim/values.yaml | 4 +++- cmake_targets/CMakeLists.txt | 4 ++-- docker/Dockerfile.phySim.rhel8.2 | 6 +++++- 14 files changed, 43 insertions(+), 15 deletions(-) diff --git a/charts/physims/charts/dlsim/values.yaml b/charts/physims/charts/dlsim/values.yaml index c0142b50ae..d78fbb7409 100644 --- a/charts/physims/charts/dlsim/values.yaml +++ b/charts/physims/charts/dlsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/ldpctest/values.yaml b/charts/physims/charts/ldpctest/values.yaml index 91eab91af5..e2e6467923 100644 --- a/charts/physims/charts/ldpctest/values.yaml +++ b/charts/physims/charts/ldpctest/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-dlschsim/values.yaml b/charts/physims/charts/nr-dlschsim/values.yaml index e96541102c..8944e7e724 100644 --- a/charts/physims/charts/nr-dlschsim/values.yaml +++ b/charts/physims/charts/nr-dlschsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-dlsim/values.yaml b/charts/physims/charts/nr-dlsim/values.yaml index c86fc96cff..573e8630de 100644 --- a/charts/physims/charts/nr-dlsim/values.yaml +++ b/charts/physims/charts/nr-dlsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-pbchsim/values.yaml b/charts/physims/charts/nr-pbchsim/values.yaml index 62d89f9632..28c4678334 100644 --- a/charts/physims/charts/nr-pbchsim/values.yaml +++ b/charts/physims/charts/nr-pbchsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-prachsim/values.yaml b/charts/physims/charts/nr-prachsim/values.yaml index 3ea9787f7a..9e3c68b54d 100644 --- a/charts/physims/charts/nr-prachsim/values.yaml +++ b/charts/physims/charts/nr-prachsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-pucchsim/values.yaml b/charts/physims/charts/nr-pucchsim/values.yaml index cf50c0bd3c..449670f713 100644 --- a/charts/physims/charts/nr-pucchsim/values.yaml +++ b/charts/physims/charts/nr-pucchsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-ulschsim/values.yaml b/charts/physims/charts/nr-ulschsim/values.yaml index 420b154596..a3afc090e8 100644 --- a/charts/physims/charts/nr-ulschsim/values.yaml +++ b/charts/physims/charts/nr-ulschsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-ulsim/values.yaml b/charts/physims/charts/nr-ulsim/values.yaml index 7eb8e33fcb..2bf96498e8 100644 --- a/charts/physims/charts/nr-ulsim/values.yaml +++ b/charts/physims/charts/nr-ulsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/polartest/values.yaml b/charts/physims/charts/polartest/values.yaml index 496dc8afba..e0a532fdd8 100644 --- a/charts/physims/charts/polartest/values.yaml +++ b/charts/physims/charts/polartest/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/smallblocktest/values.yaml b/charts/physims/charts/smallblocktest/values.yaml index 9dd791265f..f2f113d9b6 100644 --- a/charts/physims/charts/smallblocktest/values.yaml +++ b/charts/physims/charts/smallblocktest/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/ulsim/values.yaml b/charts/physims/charts/ulsim/values.yaml index f5110989d8..35dc14d596 100644 --- a/charts/physims/charts/ulsim/values.yaml +++ b/charts/physims/charts/ulsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 82022da78f..a4624066ae 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -343,8 +343,8 @@ set(CMAKE_CXX_FLAGS if (SANITIZE_ADDRESS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common") endif () add_definitions("-DASN_DISABLE_OER_SUPPORT") diff --git a/docker/Dockerfile.phySim.rhel8.2 b/docker/Dockerfile.phySim.rhel8.2 index 9f4b27ec0e..15a363b05b 100644 --- a/docker/Dockerfile.phySim.rhel8.2 +++ b/docker/Dockerfile.phySim.rhel8.2 @@ -31,11 +31,14 @@ RUN rm -Rf /oai-ran WORKDIR /oai-ran COPY . . +#only install address sanitizer for this container, the others don't need it +RUN yum install -y libasan + #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - ./build_oai --phy_simulators --ninja --verbose-ci + ./build_oai --phy_simulators -g --ninja --verbose-ci --sanitize-address #start from scratch for target executable FROM registry.access.redhat.com/ubi8/ubi:latest as oai-physim @@ -85,6 +88,7 @@ COPY --from=phy-sim-build \ /lib64/liblapack.so.3 \ /lib64/libexslt.so.0 \ /lib64/libxslt.so.1 \ + /usr/lib64/libasan.so.5 \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ /oai-ran/cmake_targets/ran_build/build/libSIMU.so \ /oai-ran/cmake_targets/ran_build/build/libldpc.so \ From ac0af5a84ed9950547720ae79f0cee216c179849 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 13 Feb 2022 15:48:36 +0100 Subject: [PATCH 138/196] Fix shlib loaded: free memory, handle lib reload - introduce loader_reset() that frees all memory - resolve memory leak in loader_format_shlibpath() - correctly handle library reload: check if a function has been retrieved already. Don't leak memory (strdup()), and handle multiple reloads of different functions from the same SO --- common/utils/load_module_shlib.c | 71 ++++++++++++++++++++------- common/utils/load_module_shlib.h | 2 + openair1/SIMULATION/NR_PHY/dlschsim.c | 3 ++ 3 files changed, 58 insertions(+), 18 deletions(-) diff --git a/common/utils/load_module_shlib.c b/common/utils/load_module_shlib.c index 2b0d339358..f5a52d0626 100644 --- a/common/utils/load_module_shlib.c +++ b/common/utils/load_module_shlib.c @@ -69,7 +69,6 @@ char *loader_format_shlibpath(char *modname, char *version) char *tmpstr; char *shlibpath =NULL; char *shlibversion=NULL; -char *cfgprefix; paramdef_t LoaderParams[] ={{"shlibpath", NULL, 0, strptr:&shlibpath, defstrval:NULL, TYPE_STRING, 0, NULL}, {"shlibversion", NULL, 0, strptr:&shlibversion, defstrval:"", TYPE_STRING, 0, NULL}}; @@ -81,16 +80,11 @@ int ret; /* looks for specific path for this module in the config file */ /* specific value for a module path and version is located in a modname subsection of the loader section */ /* shared lib name is formatted as lib.so */ - cfgprefix = malloc(sizeof(LOADER_CONFIG_PREFIX)+strlen(modname)+16); - if (cfgprefix == NULL) { - fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno)); - exit_fun("[LOADER] unrecoverable error"); - } else { - sprintf(cfgprefix,LOADER_CONFIG_PREFIX ".%s",modname); - int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),cfgprefix); - if (ret <0) { - fprintf(stderr,"[LOADER] %s %d couldn't retrieve config from section %s\n",__FILE__, __LINE__,cfgprefix); - } + char cfgprefix[sizeof(LOADER_CONFIG_PREFIX)+strlen(modname)+16]; + sprintf(cfgprefix,LOADER_CONFIG_PREFIX ".%s",modname); + ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),cfgprefix); + if (ret <0) { + fprintf(stderr,"[LOADER] %s %d couldn't retrieve config from section %s\n",__FILE__, __LINE__,cfgprefix); } /* no specific path, use loader default shared lib path */ if (shlibpath == NULL) { @@ -142,6 +136,7 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t * } shlib_path = loader_format_shlibpath(modname, version); + printf("shlib_path %s\n", shlib_path); for (int i = 0; i < loader_data.numshlibs; i++) { if (strcmp(loader_data.shlibs[i].name, modname) == 0) { @@ -198,15 +193,17 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t * } if (farray) { - if (!loader_data.shlibs[lib_idx].funcarray) { - loader_data.shlibs[lib_idx].funcarray = malloc(numf*sizeof(loader_shlibfunc_t)); - if (!loader_data.shlibs[lib_idx].funcarray) { + loader_shlibdesc_t *shlib = &loader_data.shlibs[lib_idx]; + if (!shlib->funcarray) { + shlib->funcarray = calloc(numf, sizeof(loader_shlibfunc_t)); + if (!shlib->funcarray) { fprintf(stderr, "[LOADER] load_module_shlib(): unable to allocate memory\n"); ret = -1; goto load_module_shlib_exit; } + shlib->len_funcarray = numf; + shlib->numfunc = 0; } - loader_data.shlibs[lib_idx].numfunc = 0; for (int i = 0; i < numf; i++) { farray[i].fptr = dlsym(lib_handle,farray[i].fname); if (!farray[i].fptr) { @@ -215,9 +212,32 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t * ret = -1; goto load_module_shlib_exit; } - loader_data.shlibs[lib_idx].funcarray[i].fname=strdup(farray[i].fname); - loader_data.shlibs[lib_idx].funcarray[i].fptr = farray[i].fptr; - loader_data.shlibs[lib_idx].numfunc++; + /* check whether this function has been loaded before */ + int j = 0; + for (; j < shlib->numfunc; ++j) { + if (shlib->funcarray[j].fptr == farray[i].fptr) { + int rc = strcmp(shlib->funcarray[i].fname, farray[i].fname); + AssertFatal(rc == 0, + "reloading the same fptr with different fnames (%s, %s)\n", + shlib->funcarray[i].fname, farray[i].fname); + break; + } + } + if (j == shlib->numfunc) { + if (shlib->numfunc == shlib->len_funcarray) { + loader_shlibfunc_t *n = reallocarray(shlib->funcarray, shlib->numfunc * 2, sizeof(loader_shlibfunc_t)); + if (!n) { + fprintf(stderr, "[LOADER] %s(): unable to allocate memory\n", __func__); + ret = -1; + goto load_module_shlib_exit; + } + shlib->funcarray = n; + shlib->len_funcarray = shlib->numfunc * 2; + } + shlib->funcarray[j].fname = strdup(farray[i].fname); + shlib->funcarray[j].fptr = farray[i].fptr; + shlib->numfunc++; + } } /* for int i... */ } else { /* farray ! NULL */ sprintf(afname,"%s_getfarray",modname); @@ -248,3 +268,18 @@ void * get_shlibmodule_fptr(char *modname, char *fname) } /* for i loop on modules */ return NULL; } + +void loader_reset() +{ + for (int i = 0; i < loader_data.numshlibs && loader_data.shlibs[i].name != NULL; i++) { + loader_shlibdesc_t *shlib = &loader_data.shlibs[i]; + free(shlib->name); + free(shlib->thisshlib_path); + for (int j = 0; j < shlib->numfunc; ++j) + free(shlib->funcarray[j].fname); + free(shlib->funcarray); + shlib->numfunc = 0; + shlib->len_funcarray = 0; + } + free(loader_data.shlibs); +} diff --git a/common/utils/load_module_shlib.h b/common/utils/load_module_shlib.h index 0e80a5353c..8139c21909 100644 --- a/common/utils/load_module_shlib.h +++ b/common/utils/load_module_shlib.h @@ -47,6 +47,7 @@ typedef struct { char *thisshlib_path; uint32_t numfunc; loader_shlibfunc_t *funcarray; + uint32_t len_funcarray; }loader_shlibdesc_t; typedef struct { @@ -90,5 +91,6 @@ extern void * get_shlibmodule_fptr(char *modname, char *fname); extern loader_data_t loader_data; #endif /* LOAD_MODULE_SHLIB_MAIN */ #define load_module_shlib(M, F, N, I) load_module_version_shlib(M, NULL, F, N, I) +void loader_reset(); #endif diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index f566b93d9c..ed91fed9fa 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -29,6 +29,7 @@ #include "common/config/config_userapi.h" #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" +#include "common/utils/load_module_shlib.h" #include "T.h" #include "PHY/defs_gNB.h" #include "PHY/defs_nr_common.h" @@ -671,6 +672,8 @@ int main(int argc, char **argv) if (ouput_vcd) vcd_signal_dumper_close(); + loader_reset(); + return (n_errors); } From 136cc93aa9dbf67eee46b10f8123c152af8f8b3e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 13 Feb 2022 15:50:12 +0100 Subject: [PATCH 139/196] Fix memory leaks in nr_dlschsim --- openair1/PHY/INIT/nr_init.c | 10 +++ openair1/PHY/INIT/phy_init.h | 1 + openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 67 +++++++++---------- .../PHY/NR_TRANSPORT/nr_transport_proto.h | 2 + openair1/SIMULATION/NR_PHY/dlschsim.c | 31 +++------ 5 files changed, 56 insertions(+), 55 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index e6b6c82834..a69b283dfb 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -553,6 +553,16 @@ void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) { } } +void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) +{ + const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; + const nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; + const uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value; + for (int i=0; inumber_of_nr_dlsch_max; i++) + for (int j=0; j<2; j++) + free_gNB_dlsch(&msg->dlsch[i][j], grid_size); +} + void init_nr_transport(PHY_VARS_gNB *gNB) { NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; LOG_I(PHY, "Initialise nr transport\n"); diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index dd9232de83..f66901f09a 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -410,6 +410,7 @@ void init_dfts(void); void fill_subframe_mask(PHY_VARS_eNB *eNB); void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg); +void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg); /** @} */ #endif diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 6d16fa531c..cdf0e6c152 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -55,42 +55,39 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) { NR_gNB_DLSCH_t *dlsch = *dlschptr; uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated - if (dlsch) { - if (N_RB != 273) { - a_segments = a_segments*N_RB; - a_segments = a_segments/273 +1; - } - -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY,"Freeing dlsch %p\n",dlsch); -#endif - NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; - - if (harq->b) { - free16(harq->b, a_segments * 1056); - harq->b = NULL; -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing harq->b (%p)\n", harq->b); -#endif - } - -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); -#endif - - for (r = 0; r < a_segments; r++) { -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); -#endif - - if (harq->c[r]) { - free16(harq->c[r], 1056); - harq->c[r] = NULL; - } - } - free16(dlsch, sizeof(NR_gNB_DLSCH_t)); - *dlschptr = NULL; + if (N_RB != 273) { + a_segments = a_segments*N_RB; + a_segments = a_segments/273 +1; } + + NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; + if (harq->b) { + free16(harq->b, a_segments * 1056); + harq->b = NULL; + } + for (r = 0; r < a_segments; r++) { + free(harq->c[r]); + harq->c[r] = NULL; + } + free(harq->pdu); + + for (int aa = 0; aa < 64; aa++) + free(dlsch->calib_dl_ch_estimates[aa]); + free(dlsch->calib_dl_ch_estimates); + + for (int q=0; qmod_symbs[q]); + + for (int layer = 0; layer < NR_MAX_NB_LAYERS; layer++) { + free(dlsch->txdataF_precoding[layer]); + free(dlsch->txdataF[layer]); + for (int aa = 0; aa < 64; aa++) + free(dlsch->ue_spec_bf_weights[layer][aa]); + free(dlsch->ue_spec_bf_weights[layer]); + } + + free(dlsch); + *dlschptr = NULL; } NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index d45858bca0..e757e835b9 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -106,6 +106,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint8_t abstraction_flag, uint16_t N_RB); +void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB); + /** \brief This function is the top-level entry point to PUSCH demodulation, after frequency-domain transformation and channel estimation. It performs - RB extraction (signal and channel estimates) - channel compensation (matched filtering) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index ed91fed9fa..62672cf36f 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -473,16 +473,13 @@ int main(int argc, char **argv) rel15->dlDmrsSymbPos = 4; rel15->mcsIndex[0] = Imcs; rel15->numDmrsCdmGrpsNoData = 1; - double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc - short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384); - short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384); + double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc + short channel_output_fixed[16 * 68 * 384]; //unsigned char *estimated_output; - unsigned char *estimated_output_bit; - unsigned char *test_input_bit; unsigned int errors_bit = 0; - test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); + unsigned char test_input_bit[16 * 68 * 384]; //estimated_output = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); - estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); + unsigned char estimated_output_bit[16 * 68 * 384]; NR_UE_DLSCH_t *dlsch0_ue = UE->dlsch[0][0][0]; NR_DL_UE_HARQ_t *harq_process = dlsch0_ue->harq_processes[harq_pid]; harq_process->mcs = Imcs; @@ -496,9 +493,10 @@ int main(int argc, char **argv) harq_process->dlDmrsSymbPos = 4; harq_process->n_dmrs_cdm_groups = 1; printf("harq process ue mcs = %d Qm = %d, symb %d\n", harq_process->mcs, harq_process->Qm, nb_symb_sch); + unsigned char *test_input; test_input = (unsigned char *) malloc16(sizeof(unsigned char) * TBS / 8); - + //unsigned char test_input[TBS / 8] __attribute__ ((aligned(16))); for (i = 0; i < TBS / 8; i++) test_input[i] = (unsigned char) rand(); @@ -555,12 +553,6 @@ int main(int argc, char **argv) i,modulated_input[i], i,channel_output_fixed[i]); */ - - //Uncoded BER - if (channel_output_fixed[i] < 0) - channel_output_uncoded[i] = 1; //QPSK demod - else - channel_output_uncoded[i] = 0; } #ifdef DEBUG_CODER @@ -642,12 +634,11 @@ int main(int argc, char **argv) } }*/ - for (i = 0; i < 2; i++) { - printf("gNB %d\n", i); - free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL); - printf("UE %d\n", i); - free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL); - } + free(test_input); + + free_channel_desc_scm(gNB2UE); + + reset_DLSCH_struct(gNB, &msgDataTx); for (i = 0; i < 2; i++) { free(s_re[i]); From 331575ebabac870e526f2981f59802b74a0e1363 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 13 Feb 2022 17:27:58 +0100 Subject: [PATCH 140/196] Fix memory leaks in nr_ulschsim --- openair1/SIMULATION/NR_PHY/ulschsim.c | 48 +++++++++++++-------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 931a63a77e..3528ee4316 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -454,46 +454,39 @@ int main(int argc, char **argv) rel15_ul->pusch_data.tb_size = TBS/8; /////////////////////////////////////////////////// - double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc - short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384); - short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384); + double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc + short channel_output_fixed[16 * 68 * 384]; + short channel_output_uncoded[16 * 68 * 384]; unsigned int errors_bit_uncoded = 0; - unsigned char *estimated_output_bit; - unsigned char *test_input_bit; unsigned int errors_bit = 0; - test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); - estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); - - unsigned char *test_input; - test_input = (unsigned char *) malloc16(sizeof(unsigned char) * TBS / 8); - - for (i = 0; i < TBS / 8; i++) - test_input[i] = (unsigned char) rand(); + unsigned char test_input_bit[16 * 68 * 384]; + unsigned char estimated_output_bit[16 * 68 * 384]; /////////////////////////[adk] preparing UL harq_process parameters///////////////////////// /////////// NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid]; + DevAssert(harq_process_ul_ue); N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig N_RE_prime = NR_NB_SC_PER_RB*nb_symb_sch - nb_re_dmrs - N_PRB_oh; - if (harq_process_ul_ue) { + harq_process_ul_ue->pusch_pdu.rnti = n_rnti; + harq_process_ul_ue->pusch_pdu.mcs_index = Imcs; + harq_process_ul_ue->pusch_pdu.nrOfLayers = Nl; + harq_process_ul_ue->pusch_pdu.rb_size = nb_rb; + harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch; + harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords; + harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx; + harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS/8; + unsigned char *test_input = harq_process_ul_ue->a; - harq_process_ul_ue->pusch_pdu.rnti = n_rnti; - harq_process_ul_ue->pusch_pdu.mcs_index = Imcs; - harq_process_ul_ue->pusch_pdu.nrOfLayers = Nl; - harq_process_ul_ue->pusch_pdu.rb_size = nb_rb; - harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch; - harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords; - harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx; - harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS/8; - harq_process_ul_ue->a = &test_input[0]; - - } /////////// //////////////////////////////////////////////////////////////////////////////////////////// + for (i = 0; i < TBS / 8; i++) + test_input[i] = (unsigned char) rand(); + #ifdef DEBUG_NR_ULSCHSIM for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%hhu \n",test_input[i]); #endif @@ -620,6 +613,11 @@ int main(int argc, char **argv) printf("\n"); } + for (sf = 0; sf < 2; sf++) + for (i = 0; i < 2; i++) + free_nr_ue_ulsch(&UE->ulsch[sf][0][i], N_RB_UL); + + free_channel_desc_scm(gNB2UE); if (output_fd) fclose(output_fd); From 06dd706df7578c85077b78c34b67db7557d3b8be Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 14 Feb 2022 10:23:09 +0100 Subject: [PATCH 141/196] fix undefined vars in pbchsim.c --- openair1/SIMULATION/NR_PHY/pbchsim.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 0f5752c227..46e51029b3 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -438,12 +438,13 @@ int main(int argc, char **argv) printf("Initializing gNodeB for mu %d, N_RB_DL %d\n",mu,N_RB_DL); RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *)); - RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); + RC.gNB[0] = malloc16_clear(sizeof(*(RC.gNB[0]))); gNB = RC.gNB[0]; gNB->ofdm_offset_divisor = UINT_MAX; frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH) frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; + frame_parms->nb_antenna_ports_gNB = n_tx; frame_parms->N_RB_DL = N_RB_DL; frame_parms->Nid_cell = Nid_cell; frame_parms->nushift = Nid_cell%4; @@ -533,19 +534,13 @@ int main(int argc, char **argv) for (i=0; i<2; i++) { - s_re[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(s_re[i],frame_length_complex_samples*sizeof(double)); - s_im[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(s_im[i],frame_length_complex_samples*sizeof(double)); - - r_re[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(r_re[i],frame_length_complex_samples*sizeof(double)); - r_im[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(r_im[i],frame_length_complex_samples*sizeof(double)); + s_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double)); + s_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double)); + r_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double)); + r_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double)); printf("Allocating %d samples for txdata\n",frame_length_complex_samples); - txdata[i] = malloc(frame_length_complex_samples*sizeof(int)); - bzero(r_re[i],frame_length_complex_samples*sizeof(int)); + txdata[i] = malloc16_clear(frame_length_complex_samples*sizeof(int)); } if (pbch_file_fd!=NULL) { @@ -554,8 +549,8 @@ int main(int argc, char **argv) //configure UE - UE = malloc(sizeof(PHY_VARS_NR_UE)); - memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS)); + UE = malloc16_clear(sizeof(*UE)); + memcpy(&UE->frame_parms,frame_parms,sizeof(UE->frame_parms)); //phy_init_nr_top(UE); //called from init_nr_ue_signal if (run_initial_sync==1) UE->is_synchronized = 0; else UE->is_synchronized = 1; From 5794c07c9454a0291cd1114d127e970ead9a6b16 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 14 Feb 2022 18:33:56 +0100 Subject: [PATCH 142/196] Correctly implement phy_free_nr_gNB() Frees all allocated memory, except for library loading related, and ul reference signal sequences, which are allocated in static variables --- openair1/PHY/INIT/nr_init.c | 166 +++++++++++------- openair1/PHY/INIT/phy_init.h | 1 + .../PHY/NR_TRANSPORT/nr_transport_proto.h | 2 + openair1/PHY/NR_TRANSPORT/nr_ulsch.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 78 +++----- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 5 + openair1/PHY/NR_TRANSPORT/srs_rx.c | 5 + openair1/SIMULATION/NR_PHY/dlschsim.c | 2 + 8 files changed, 142 insertions(+), 119 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index a69b283dfb..bf360d347a 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -242,37 +242,9 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, common_vars->debugBuff = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)*100); common_vars->debugBuff_sample_offset = 0; - - // Channel estimates for SRS -/* - for (UE_id=0; UE_idofdm_symbol_size ); - srs_vars[UE_id].srs_ch_estimates_time[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); - } - } //UE_id -*/ - /*generate_ul_ref_sigs_rx(); - - init_ulsch_power_LUT();*/ - -/* - // SRS - for (UE_id=0; UE_idofdm_symbol_size*sizeof(int32_t)); - } -*/ // PRACH prach_vars->prachF = (int16_t *)malloc16_clear( 1024*2*sizeof(int16_t) ); prach_vars->rxsigF = (int16_t **)malloc16_clear(Prx*sizeof(int16_t*)); - /* - for (i=0;irxsigF[i] = (int16_t *)malloc16_clear( 1024*2*sizeof(int16_t) ); - } - */ prach_vars->prach_ifft = (int32_t *)malloc16_clear(1024*2*sizeof(int32_t)); init_prach_list(gNB); @@ -328,51 +300,102 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, void phy_free_nr_gNB(PHY_VARS_gNB *gNB) { NR_DL_FRAME_PARMS* const fp = &gNB->frame_parms; - NR_gNB_COMMON *const common_vars = &gNB->common_vars; - NR_gNB_PUSCH **const pusch_vars = gNB->pusch_vars; - /*LTE_eNB_SRS *const srs_vars = gNB->srs_vars; - LTE_eNB_PRACH *const prach_vars = &gNB->prach_vars;*/ - uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs; - int Ptx=gNB->gNB_config.carrier_config.num_tx_ant.value; + const int Ptx = gNB->gNB_config.carrier_config.num_tx_ant.value; + const int Prx = gNB->gNB_config.carrier_config.num_rx_ant.value; + const int max_ul_mimo_layers = 4; // taken from phy_init_nr_gNB() + const int n_buf = Prx * max_ul_mimo_layers; + uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs; + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) + free_and_zero(pdcch_dmrs[slot][symb]); + free_and_zero(pdcch_dmrs[slot]); + } + free_and_zero(pdcch_dmrs); + + uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) { + for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++) + free_and_zero(pdsch_dmrs[slot][symb][q]); + free_and_zero(pdsch_dmrs[slot][symb]); + } + free_and_zero(pdsch_dmrs[slot]); + } + free_and_zero(gNB->nr_gold_pdsch_dmrs); + + uint32_t ****pusch_dmrs = gNB->nr_gold_pusch_dmrs; + for(int nscid = 0; nscid < 2; nscid++) { + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) + free_and_zero(pusch_dmrs[nscid][slot][symb]); + free_and_zero(pusch_dmrs[nscid][slot]); + } + free_and_zero(pusch_dmrs[nscid]); + } + free_and_zero(pusch_dmrs); + + uint32_t ***csi_rs = gNB->nr_gold_csi_rs; + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) + free_and_zero(csi_rs[slot][symb]); + free_and_zero(csi_rs[slot]); + } + free_and_zero(csi_rs); + + for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) { + for (int i = 0; i < Prx; i++){ + free_and_zero(gNB->nr_srs_info[id]->srs_received_signal[i]); + free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel[i]); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq[i]); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time[i]); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i]); + } + free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal); + free_and_zero(gNB->nr_srs_info[id]->noise_power); + free_and_zero(gNB->nr_srs_info[id]->srs_received_signal); + free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted); + free_and_zero(gNB->nr_srs_info[id]); + } + + free_ul_reference_signal_sequences(); + free_gnb_lowpapr_sequences(); + + reset_nr_transport(gNB); + + NR_gNB_COMMON * common_vars = &gNB->common_vars; for (int i = 0; i < Ptx; i++) { free_and_zero(common_vars->txdataF[i]); - /* rxdataF[i] is not allocated -> don't free */ + free_and_zero(common_vars->beam_id[i]); + } + + for (int i = 0; i < Prx; ++i) { + free_and_zero(common_vars->rxdataF[i]); + free_and_zero(common_vars->rxdata[i]); } free_and_zero(common_vars->txdataF); + free_and_zero(common_vars->rxdata); free_and_zero(common_vars->rxdataF); - // PDCCH DMRS sequences - free_and_zero(pdcch_dmrs); -/* - // Channel estimates for SRS - for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { - for (i=0; i<64; i++) { - free_and_zero(srs_vars[UE_id].srs_ch_estimates[i]); - free_and_zero(srs_vars[UE_id].srs_ch_estimates_time[i]); - } + free_and_zero(common_vars->beam_id); - free_and_zero(srs_vars[UE_id].srs_ch_estimates); - free_and_zero(srs_vars[UE_id].srs_ch_estimates_time); - } //UE_id - - //free_ul_ref_sigs(); - - for (UE_id=0; UE_iddebugBuff); + NR_gNB_PRACH* prach_vars = &gNB->prach_vars; free_and_zero(prach_vars->prachF); + free_and_zero(prach_vars->rxsigF); + free_and_zero(prach_vars->prach_ifft); - for (i = 0; i < 64; i++) free_and_zero(prach_vars->prach_ifft[0][i]); - - free_and_zero(prach_vars->prach_ifft[0]); - free_and_zero(prach_vars->rxsigF[0]); -*/ + NR_gNB_PUSCH** pusch_vars = gNB->pusch_vars; for (int ULSCH_id=0; ULSCH_idnumber_of_nr_ulsch_max; ULSCH_id++) { - for (int i = 0; i < fp->nb_antennas_rx; i++) { + for (int i = 0; i < Prx; i++) { free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]); free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2[i]); } - for (int i = 0; i < 4*fp->nb_antennas_rx; i++) { + for (int i = 0; i < n_buf; i++) { free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates[i]); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_ext[i]); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_time[i]); @@ -392,8 +415,8 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_ext); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates_ext); - free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_time); free_and_zero(pusch_vars[ULSCH_id]->ptrs_phase_per_slot); + free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_time); free_and_zero(pusch_vars[ULSCH_id]->ul_valid_re_per_slot); free_and_zero(pusch_vars[ULSCH_id]->rxdataF_comp); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_mag0); @@ -405,14 +428,6 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) free_and_zero(pusch_vars[ULSCH_id]->llr); free_and_zero(pusch_vars[ULSCH_id]); } //ULSCH_id -/* - for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) gNB->UE_stats_ptr[UE_id] = NULL; -*/ - - - free_gnb_lowpapr_sequences(); - - } //Adding nr_schedule_handler @@ -587,7 +602,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB) { for (int j=0; j<2; j++) { // ULSCH for data - gNB->ulsch[i][j] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL, 0); + gNB->ulsch[i][j] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL); if (!gNB->ulsch[i][j]) { LOG_E(PHY,"Can't get gNB ulsch structures\n"); @@ -603,3 +618,18 @@ void init_nr_transport(PHY_VARS_gNB *gNB) { //fp->pucch_config_common.deltaPUCCH_Shift = 1; } + +void reset_nr_transport(PHY_VARS_gNB *gNB) +{ + const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; + + for (int i = 0; i < NUMBER_OF_NR_PUCCH_MAX; i++) + free_gNB_pucch(gNB->pucch[i]); + + for (int i = 0; i < NUMBER_OF_NR_SRS_MAX; i++) + free_gNB_srs(gNB->srs[i]); + + for (int i=0; inumber_of_nr_ulsch_max; i++) + for (int j=0; j<2; j++) + free_gNB_ulsch(&gNB->ulsch[i][j], fp->N_RB_UL); +} diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index f66901f09a..9ad5a88364 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -405,6 +405,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu, void phy_free_nr_gNB(PHY_VARS_gNB *gNB); int l1_north_init_gNB(void); void init_nr_transport(PHY_VARS_gNB *gNB); +void reset_nr_transport(PHY_VARS_gNB *gNB); void init_dfts(void); diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index e757e835b9..b62698c748 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -298,6 +298,7 @@ int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame,int slot, find_type_t type); int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type); NR_gNB_PUCCH_t *new_gNB_pucch(void); +void free_gNB_pucch(NR_gNB_PUCCH_t *pucch); void nr_fill_pucch(PHY_VARS_gNB *gNB, int frame, @@ -310,6 +311,7 @@ int nr_find_pucch(uint16_t rnti, PHY_VARS_gNB *gNB); NR_gNB_SRS_t *new_gNB_srs(void); +void free_gNB_srs(NR_gNB_SRS_t *srs); int nr_find_srs(uint16_t rnti, int frame, diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h index f7bb3be577..9929ee0602 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h @@ -35,7 +35,7 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch,uint8_t N_RB_UL); -NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint8_t abstraction_flag); +NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL); /*! \brief Perform PUSCH decoding. TS 38.212 V15.4.0 subclause 6.2 diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index a398df877e..af67c03481 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -61,53 +61,33 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr,uint8_t N_RB_UL) uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated NR_gNB_ULSCH_t *ulsch = *ulschptr; - if (ulsch) { - if (N_RB_UL != 273) { - a_segments = a_segments*N_RB_UL; - a_segments = a_segments/273 +1; - } - - - for (i=0; iharq_processes[i]) { - if (ulsch->harq_processes[i]->b) { - free16(ulsch->harq_processes[i]->b,a_segments*1056); - ulsch->harq_processes[i]->b = NULL; - } - for (r=0; rharq_processes[i]->c[r],(8448)*sizeof(uint8_t)); - ulsch->harq_processes[i]->c[r] = NULL; - } - for (r=0; rharq_processes[i]->d[r]) { - free16(ulsch->harq_processes[i]->d[r],(68*384)*sizeof(int16_t)); - ulsch->harq_processes[i]->d[r] = NULL; - } - } - for (r=0; rharq_processes[i]->w[r]) { - free16(ulsch->harq_processes[i]->w[r],(3*(6144+64))*sizeof(int16_t)); - ulsch->harq_processes[i]->w[r] = NULL; - } - } - for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r]){ - nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]); - ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL; - } - } - free16(ulsch->harq_processes[i],sizeof(NR_UL_gNB_HARQ_t)); - ulsch->harq_processes[i] = NULL; - } - } - free16(ulsch,sizeof(NR_gNB_ULSCH_t)); - *ulschptr = NULL; + if (N_RB_UL != 273) { + a_segments = a_segments*N_RB_UL; + a_segments = a_segments/273 +1; } + + for (i=0; iharq_processes[i]) { + if (ulsch->harq_processes[i]->b) { + free_and_zero(ulsch->harq_processes[i]->b); + ulsch->harq_processes[i]->b = NULL; + } + for (r=0; rharq_processes[i]->c[r]); + free_and_zero(ulsch->harq_processes[i]->d[r]); + free_and_zero(ulsch->harq_processes[i]->w[r]); + nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]); + ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL; + } + free_and_zero(ulsch->harq_processes[i]); + ulsch->harq_processes[i] = NULL; + } + } + free_and_zero(*ulschptr); } -NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint8_t abstraction_flag) +NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL) { NR_gNB_ULSCH_t *ulsch; @@ -129,13 +109,11 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t)); ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes); - if (abstraction_flag == 0) { - for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); - ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t)); - ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t)); - ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t)); - } + for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); + ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t)); + ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t)); + ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t)); } } diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 56d87866ed..4256159812 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -62,6 +62,11 @@ NR_gNB_PUCCH_t *new_gNB_pucch(void){ return (pucch); } +void free_gNB_pucch(NR_gNB_PUCCH_t *pucch) +{ + free_and_zero(pucch); +} + int nr_find_pucch(uint16_t rnti, int frame, int slot, diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c index c16becdb20..2d7aefdee0 100644 --- a/openair1/PHY/NR_TRANSPORT/srs_rx.c +++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c @@ -49,6 +49,11 @@ NR_gNB_SRS_t *new_gNB_srs(void){ return (srs); } +void free_gNB_srs(NR_gNB_SRS_t *srs) +{ + free_and_zero(srs); +} + int nr_find_srs(uint16_t rnti, int frame, int slot, diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 62672cf36f..4867832e6a 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -640,6 +640,8 @@ int main(int argc, char **argv) reset_DLSCH_struct(gNB, &msgDataTx); + phy_free_nr_gNB(gNB); + for (i = 0; i < 2; i++) { free(s_re[i]); free(s_im[i]); From efd62d14a7bd0c7ca8581678f5556476acc43ebb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 14 Feb 2022 21:07:20 +0100 Subject: [PATCH 143/196] Implement term_nr_ue_signal(), remove abstraction_flag from init_nr_ue_signal() term_nr_ue_signal() frees all memory, except for dfts lib load --- executables/nr-ue.c | 2 +- openair1/PHY/INIT/nr_init_ue.c | 468 +++++++++++++----- openair1/PHY/INIT/phy_init.h | 4 +- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 31 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 4 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 2 +- openair1/SIMULATION/NR_PHY/prachsim.c | 2 +- openair1/SIMULATION/NR_PHY/pucchsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- .../NR_UE_PHY/unit_tests/src/pss_util_test.c | 4 +- 11 files changed, 361 insertions(+), 162 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index d1b26601b4..70b3d3a199 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -167,7 +167,7 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue, } // initialize all signal buffers - init_nr_ue_signal(ue, nb_connected_gNB, abstraction_flag); + init_nr_ue_signal(ue, nb_connected_gNB); // intialize transport init_nr_ue_transport(ue, abstraction_flag); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b09e8690f3..7c9f15d8f1 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -111,6 +111,49 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch, } } +void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp) +{ + for (int i = 0; i < fp->nb_antennas_rx; i++) { + for (int j = 0; j < NR_MAX_NB_LAYERS; j++) { + const int idx = j * fp->nb_antennas_rx + i; + for (int k = 0; k < NR_MAX_NB_LAYERS; k++) + free_and_zero(pdsch->rho[i][j*NR_MAX_NB_LAYERS+k]); + free_and_zero(pdsch->rxdataF_comp0[idx]); + free_and_zero(pdsch->dl_ch_estimates[idx]); + free_and_zero(pdsch->dl_ch_estimates_ext[idx]); + free_and_zero(pdsch->dl_bf_ch_estimates[idx]); + free_and_zero(pdsch->dl_bf_ch_estimates_ext[idx]); + free_and_zero(pdsch->dl_ch_mag0[idx]); + free_and_zero(pdsch->dl_ch_magb0[idx]); + free_and_zero(pdsch->dl_ch_magr0[idx]); + } + free_and_zero(pdsch->rxdataF_ext[i]); + free_and_zero(pdsch->rxdataF_uespec_pilots[i]); + free_and_zero(pdsch->ptrs_phase_per_slot[i]); + free_and_zero(pdsch->ptrs_re_per_slot[i]); + free_and_zero(pdsch->dl_ch_ptrs_estimates_ext[i]); + free_and_zero(pdsch->rho[i]); + } + free_and_zero(pdsch->pmi_ext); + free_and_zero(pdsch->llr[0]); + free_and_zero(pdsch->layer_llr[0]); + free_and_zero(pdsch->llr128); + free_and_zero(pdsch->rxdataF_ext); + free_and_zero(pdsch->rxdataF_uespec_pilots); + free_and_zero(pdsch->rxdataF_comp0); + free_and_zero(pdsch->rho); + free_and_zero(pdsch->dl_ch_estimates); + free_and_zero(pdsch->dl_ch_estimates_ext); + free_and_zero(pdsch->dl_bf_ch_estimates); + free_and_zero(pdsch->dl_bf_ch_estimates_ext); + free_and_zero(pdsch->dl_ch_mag0); + free_and_zero(pdsch->dl_ch_magb0); + free_and_zero(pdsch->dl_ch_magr0); + free_and_zero(pdsch->ptrs_phase_per_slot); + free_and_zero(pdsch->ptrs_re_per_slot); + free_and_zero(pdsch->dl_ch_ptrs_estimates_ext); +} + void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch, const NR_DL_FRAME_PARMS *const fp) { AssertFatal( pusch, "pusch==0" ); @@ -120,9 +163,14 @@ void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch, } } -int init_nr_ue_signal(PHY_VARS_NR_UE *ue, - int nb_connected_gNB, - uint8_t abstraction_flag) { +void phy_term_nr_ue_PUSCH(NR_UE_PUSCH *pusch) +{ + for (int i = 0; i < NR_MAX_NB_LAYERS; i++) + free_and_zero(pusch->txdataF_layers[i]); +} + +int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) +{ // create shortcuts NR_DL_FRAME_PARMS *const fp = &ue->frame_parms; NR_UE_COMMON *const common_vars = &ue->common_vars; @@ -136,8 +184,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, uint32_t ****pusch_dmrs; uint16_t N_n_scid[2] = {0,1}; // [HOTFIX] This is a temporary implementation of scramblingID0 and scramblingID1 which are given by DMRS-UplinkConfig int n_scid; - abstraction_flag = 0; - LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx); + LOG_I(PHY, "Initializing UE vars for gNB TXant %u, UE RXant %u\n", fp->nb_antennas_tx, fp->nb_antennas_rx); + //LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST); phy_init_nr_top(ue); // many memory allocation sizes are hard coded AssertFatal( fp->nb_antennas_rx <= 4, "hard coded allocation for ue_common_vars->dl_ch_estimates[gNB_id]" ); @@ -230,29 +278,27 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, for (i=0; i<10; i++) ue->tx_power_dBm[i]=-127; - if (abstraction_flag == 0) { - // init TX buffers - common_vars->txdata = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) ); - common_vars->txdataF = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) ); + // init TX buffers + common_vars->txdata = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) ); + common_vars->txdataF = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) ); - for (i=0; inb_antennas_tx; i++) { - common_vars->txdata[i] = (int32_t *)malloc16_clear( fp->samples_per_subframe*10*sizeof(int32_t) ); - common_vars->txdataF[i] = (int32_t *)malloc16_clear( fp->samples_per_slot_wCP*sizeof(int32_t) ); - } + for (i=0; inb_antennas_tx; i++) { + common_vars->txdata[i] = (int32_t *)malloc16_clear( fp->samples_per_subframe*10*sizeof(int32_t) ); + common_vars->txdataF[i] = (int32_t *)malloc16_clear( fp->samples_per_slot_wCP*sizeof(int32_t) ); + } - // init RX buffers - common_vars->rxdata = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + // init RX buffers + common_vars->rxdata = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + + for (th_id=0; th_idcommon_vars_rx_data_per_thread[th_id].rxdataF = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + } + + for (i=0; inb_antennas_rx; i++) { + common_vars->rxdata[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); for (th_id=0; th_idcommon_vars_rx_data_per_thread[th_id].rxdataF = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - } - - for (i=0; inb_antennas_rx; i++) { - common_vars->rxdata[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - - for (th_id=0; th_idcommon_vars_rx_data_per_thread[th_id].rxdataF[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(fp->samples_per_slot_wCP) ); - } + common_vars->common_vars_rx_data_per_thread[th_id].rxdataF[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(fp->samples_per_slot_wCP) ); } } @@ -330,129 +376,121 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); } - if (abstraction_flag == 0) { - for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp ); + for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp ); + } + + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12); + ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts; + ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) ); + ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) ); + ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) ); + } + + + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + } + + for (i=0; inb_antennas_rx; i++) + for (j=0; j<4; j++) { + const int idx = (j*fp->nb_antennas_rx)+i; + const size_t num = 7*2*fp->N_RB_DL*12+4; + + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num ); + } } - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12); - ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts; - ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) ); - ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) ); - ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) ); - } - - - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - } - - for (i=0; inb_antennas_rx; i++) - for (j=0; j<4; j++) { - const int idx = (j*fp->nb_antennas_rx)+i; - const size_t num = 7*2*fp->N_RB_DL*12+4; - - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num ); - } + //const size_t num = 7*2*fp->N_RB_DL*12+4; + for (k=0; k<8; k++) { //harq_pid + for (l=0; l<8; l++) { //round + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); } - //const size_t num = 7*2*fp->N_RB_DL*12+4; - for (k=0; k<8; k++) { //harq_pid - for (l=0; l<8; l++) { //round - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - } + for (int i=0; inb_antennas_rx; i++) + for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) + const int idx = (j*fp->nb_antennas_rx)+i; - for (int i=0; inb_antennas_rx; i++) - for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) - const int idx = (j*fp->nb_antennas_rx)+i; - - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - } + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); + ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); + ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); + ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); } - } - } - - // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE - for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 ); - ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - // Channel estimates - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); - - for (i=0; inb_antennas_rx; i++) { - ue->pdcch_vars[th_id][gNB_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(100*12*4)); - - for (j=0; j<4; j++) { - int idx = (j*fp->nb_antennas_rx)+i; - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) ); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); - // size_t num = 7*2*fp->N_RB_DL*12; - size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB - ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); } - } } + } - // PBCH - pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); // - prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); - prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); + // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE + for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); + ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); + ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); + ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 ); + ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + // Channel estimates + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); for (i=0; inb_antennas_rx; i++) { - pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); + ue->pdcch_vars[th_id][gNB_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(100*12*4)); - for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) { + for (j=0; j<4; j++) { int idx = (j*fp->nb_antennas_rx)+i; - pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); - pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); - pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); - pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) ); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); + // size_t num = 7*2*fp->N_RB_DL*12; + size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB + ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); + ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); } } } + // PBCH + pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); // + prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); + prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); + + for (i=0; inb_antennas_rx; i++) { + pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); + + for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) { + int idx = (j*fp->nb_antennas_rx)+i; + pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); + pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); + pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); + pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); + } + } + pbch_vars[gNB_id]->decoded_output = (uint8_t *)malloc16_clear(64); } // initialization for the last instance of pdsch_vars (used for MU-MIMO) - for (th_id=0; th_idpdsch_vars[th_id][gNB_id] = (NR_UE_PDSCH *)malloc16_clear(sizeof(NR_UE_PDSCH)); - } + for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) + ue->pdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH)); - if (abstraction_flag == 0) { - for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp ); - ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); - ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); - } - } else { //abstraction == 1 - ue->sinr_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) ); + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); + ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); } ue->sinr_CQI_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) ); @@ -473,6 +511,180 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, return 0; } +void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) +{ + const NR_DL_FRAME_PARMS* fp = &ue->frame_parms; + phy_term_nr_top(); + + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { + phy_term_nr_ue_PUSCH(ue->pusch_vars[th_id][gNB_id]); + free_and_zero(ue->pusch_vars[th_id][gNB_id]); + free_and_zero(ue->pucch_vars[th_id][gNB_id]); + } + } + + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) { + for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++) + free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb][q]); + free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb]); + } + free_and_zero(ue->nr_gold_pusch_dmrs[slot]); + } + free_and_zero(ue->nr_gold_pusch_dmrs); + + NR_UE_COMMON* common_vars = &ue->common_vars; + + for (int i = 0; i < fp->nb_antennas_tx; i++) { + free_and_zero(common_vars->txdata[i]); + free_and_zero(common_vars->txdataF[i]); + } + + free_and_zero(common_vars->txdata); + free_and_zero(common_vars->txdataF); + + for (int i = 0; i < fp->nb_antennas_rx; i++) { + free_and_zero(common_vars->rxdata[i]); + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) + free_and_zero(common_vars->common_vars_rx_data_per_thread[th_id].rxdataF[i]); + } + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + free_and_zero(common_vars->common_vars_rx_data_per_thread[th_id].rxdataF); + } + free_and_zero(common_vars->rxdata); + + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) + free_and_zero(ue->nr_gold_pdcch[0][slot][symb]); + free_and_zero(ue->nr_gold_pdcch[0][slot]); + } + free_and_zero(ue->nr_gold_pdcch[0]); + + for (int slot=0; slotslots_per_frame; slot++) { + for (int symb=0; symbsymbols_per_slot; symb++) { + for (int q=0; qnr_gold_pdsch[0][slot][symb][q]); + free_and_zero(ue->nr_gold_pdsch[0][slot][symb]); + } + free_and_zero(ue->nr_gold_pdsch[0][slot]); + } + free_and_zero(ue->nr_gold_pdsch[0]); + + for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { + + // PDSCH + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + for (int k = 0; k < 8; k++) { //harq_pid + for (int l = 0; l < 8; l++) { //round + for (int i = 0; i < fp->nb_antennas_rx; i++) { + for (int j = 0; j < 4; j++) { //frame_parms->nb_antennas_tx; j++) + const int idx = j * fp->nb_antennas_rx + i; + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx]); + } + } + + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l]); + } + } + + for (int i = 0; i < fp->nb_antennas_rx; i++) { + for (int j = 0; j < 4; j++) { + const int idx = (j*fp->nb_antennas_rx)+i; + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx]); + } + } + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr_shifts); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext); + + phy_term_nr_ue__PDSCH(ue->pdsch_vars[th_id][gNB_id], fp); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]); + } + + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + for (int i = 0; i < fp->nb_antennas_rx; i++) { + for (int j = 0; j < 4; j++) { + int idx = j * fp->nb_antennas_rx + i; + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx]); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx]); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx]); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx]); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx]); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx]); + } + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho[i]); + } + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr16); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->wbar); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->e_rx); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time); + + free_and_zero(ue->pdcch_vars[th_id][gNB_id]); + } + + for (int i = 0; i < fp->nb_antennas_rx; i++) { + free_and_zero(ue->nr_srs_info->srs_received_signal[i]); + free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel[i]); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_freq[i]); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_time[i]); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted[i]); + } + free_and_zero(ue->nr_srs_info->srs_generated_signal); + free_and_zero(ue->nr_srs_info->noise_power); + free_and_zero(ue->nr_srs_info->srs_received_signal); + free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_freq); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_time); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted); + free_and_zero(ue->nr_srs_info); + + free_and_zero(ue->srs_vars[gNB_id]); + + for (int i = 0; i < fp->nb_antennas_rx; i++) { + free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext[i]); + + for (int j = 0; j < 4; j++) { + int idx = (j*fp->nb_antennas_rx)+i; + free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp[idx]); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates[idx]); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time[idx]); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext[idx]); + } + } + + free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext); + free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time); + free_and_zero(ue->pbch_vars[gNB_id]->llr); + free_and_zero(ue->pbch_vars[gNB_id]->decoded_output); + free_and_zero(ue->pbch_vars[gNB_id]); + + free_and_zero(ue->prach_vars[gNB_id]->prachF); + free_and_zero(ue->prach_vars[gNB_id]->prach); + free_and_zero(ue->prach_vars[gNB_id]); + } + + free_and_zero(ue->sinr_CQI_dB); +} + void init_nr_ue_transport(PHY_VARS_NR_UE *ue, int abstraction_flag) { for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { @@ -555,3 +767,9 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue) { //init_unscrambling_lut(); //set_taus_seed(1328); } + +void phy_term_nr_top(void) +{ + free_ul_reference_signal_sequences(); + free_context_synchro_nr(); +} diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index 9ad5a88364..7cd6896e4f 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -57,6 +57,7 @@ int l1_north_init_eNB(void); int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms); void phy_init_nr_top(PHY_VARS_NR_UE *ue); +void phy_term_nr_top(void); /*! @@ -395,7 +396,8 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp,uint8_t i_ssb); int nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms); int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band); void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band); -int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstraction_flag); +int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB); +void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB); void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag); void init_N_TA_offset(PHY_VARS_NR_UE *ue); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 4fc11d5fc6..88bdc3a9cd 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -440,33 +440,10 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue) void free_context_pss_nr(void) { for (int i = 0; i < NUMBER_PSS_SEQUENCE; i++) { - - if (primary_synchro_time_nr[i] != NULL) { - free(primary_synchro_time_nr[i]); - primary_synchro_time_nr[i] = NULL; - } - else { - LOG_E(PHY,"Fatal memory deallocation problem \n"); - assert(0); - } - - if (primary_synchro_nr[i] != NULL) { - free(primary_synchro_nr[i]); - primary_synchro_nr[i] = NULL; - } - else { - LOG_E(PHY,"Fatal memory deallocation problem \n"); - assert(0); - } - - if (pss_corr_ue[i] != NULL) { - free(pss_corr_ue[i]); - pss_corr_ue[i] = NULL; - } - else { - LOG_E(PHY,"Fatal memory deallocation problem \n"); - assert(0); - } + free_and_zero(primary_synchro_nr[i]); + free_and_zero(primary_synchro_nr2[i]); + free_and_zero(primary_synchro_time_nr[i]); + free_and_zero(pss_corr_ue[i]); } } diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 4867832e6a..a3c03ad149 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -413,7 +413,7 @@ int main(int argc, char **argv) memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS)); //phy_init_nr_top(frame_parms); - if (init_nr_ue_signal(UE, 1, 0) != 0) { + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); } @@ -642,6 +642,8 @@ int main(int argc, char **argv) phy_free_nr_gNB(gNB); + term_nr_ue_signal(UE, 1); + for (i = 0; i < 2; i++) { free(s_re[i]); free(s_im[i]); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 046f410bd4..1f8f55db01 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -917,7 +917,7 @@ int main(int argc, char **argv) UE->perfect_ce = 0; - if (init_nr_ue_signal(UE, 1, 0) != 0) + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 46e51029b3..a141dfbe9e 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -560,7 +560,7 @@ int main(int argc, char **argv) if(eps!=0.0) UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation - if (init_nr_ue_signal(UE, 1, 0) != 0) { + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); } diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 2d1ca3d25a..537612ac30 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -674,7 +674,7 @@ int main(int argc, char **argv){ memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS)); UE->nrUE_config.prach_config.num_prach_fd_occasions_list = (fapi_nr_num_prach_fd_occasions_t *) malloc(num_prach_fd_occasions*sizeof(fapi_nr_num_prach_fd_occasions_t)); - if (init_nr_ue_signal(UE, 1, 0) != 0){ + if (init_nr_ue_signal(UE, 1) != 0){ printf("Error at UE NR initialisation\n"); exit(-1); } diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 465fe71f60..34fe0ef543 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -490,7 +490,7 @@ int main(int argc, char **argv) if(eps!=0.0) UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation - if (init_nr_ue_signal(UE, 1, 0) != 0) + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 6e9b88593c..8fa584a45f 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -761,7 +761,7 @@ int main(int argc, char **argv) memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS)); //phy_init_nr_top(frame_parms); - if (init_nr_ue_signal(UE, 1, 0) != 0) { + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); } diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c index f3dbc78a73..4334bd12f9 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c @@ -71,7 +71,7 @@ static nfapi_config_request_t *config =&config_t; /*************** FUNCTIONS ****************************************/ //void phy_init_nr_top(NR_DL_FRAME_PARMS *frame_parms); -int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_eNB, uint8_t abstraction_flag); +int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_eNB); /******************************************************************* * @@ -248,7 +248,7 @@ int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission //phy_init_nr_top(frame_parms); - if (init_nr_ue_signal(PHY_vars_UE, 1, 0) != 0) { + if (init_nr_ue_signal(PHY_vars_UE, 1) != 0) { LOG_E(PHY,"Error at UE NR initialisation : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); return (0); } From d2523bfa442550c018ba5ac55d5b716dd9b2372c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 14 Feb 2022 21:11:48 +0100 Subject: [PATCH 144/196] Remove unused SI and RA DLSCH from nr_dlschsim --- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index a3c03ad149..e47e1e440d 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -434,8 +434,6 @@ int main(int argc, char **argv) } } - UE->dlsch_SI[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); - UE->dlsch_ra[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); unsigned char harq_pid = 0; //dlsch->harq_ids[subframe]; processingData_L1tx_t msgDataTx; init_DLSCH_struct(gNB, &msgDataTx); From 20e13db86b41aef57c41c09b2e0eba9588331463 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 14 Feb 2022 21:23:01 +0100 Subject: [PATCH 145/196] Implement logTerm() to close logging subsystem --- common/utils/LOG/log.c | 16 ++++++++++++++++ common/utils/LOG/log.h | 1 + openair1/SIMULATION/NR_PHY/dlschsim.c | 1 + 3 files changed, 18 insertions(+) diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index a65a9732e7..5b047c082d 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -411,6 +411,16 @@ int register_log_component(char *name, return computed_compidx; } +static void unregister_all_log_components(void) +{ + log_component_t* lc = &g_log->log_component[0]; + while (lc->name) { + free((char *)lc->name); // defined as const, but assigned through strdup() + free(lc->filelog_name); + lc++; + } +} + int isLogInitDone (void) { if (g_log == NULL) @@ -502,6 +512,12 @@ int logInit (void) return 0; } +void logTerm(void) +{ + unregister_all_log_components(); + free_and_zero(g_log); +} + #include static inline int log_header(log_component_t *c, char *log_buffer, diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 8299c48fbb..d73fc03ed9 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -302,6 +302,7 @@ extern "C" { # include "log_if.h" /*----------------------------------------------------------------------------*/ int logInit (void); +void logTerm (void); int isLogInitDone (void); void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7))); void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args ); diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index e47e1e440d..69e98242d9 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -666,6 +666,7 @@ int main(int argc, char **argv) vcd_signal_dumper_close(); loader_reset(); + logTerm(); return (n_errors); } From 338019601c536f0778cf0627682f152b8ca775bf Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 10:33:42 +0100 Subject: [PATCH 146/196] new_nr_ue_dlsch(): remove abstraction_flag --- openair1/PHY/INIT/nr_init_ue.c | 8 ++-- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 38 +++++++++---------- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 5 +-- openair1/SIMULATION/NR_PHY/dlschsim.c | 3 +- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 7c9f15d8f1..8a87a3f96d 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -690,20 +690,20 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue, for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { for (int j=0; j<2; j++) { for (int k=0; kdlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag))!=NULL,"Can't get ue dlsch structures\n"); + AssertFatal((ue->dlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL))!=NULL,"Can't get ue dlsch structures\n"); LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]); AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES, abstraction_flag))!=NULL,"Can't get ue ulsch structures\n"); LOG_D(PHY,"ulsch[%d][%d][%d] => %p\n",k,i,j,ue->ulsch[k][i][j]); } } - ue->dlsch_SI[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag); - ue->dlsch_ra[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag); + ue->dlsch_SI[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL); + ue->dlsch_ra[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL); ue->transmission_mode[i] = ue->frame_parms.nb_antenna_ports_gNB==1 ? 1 : 2; } //ue->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1; - ue->dlsch_MCH[0] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS_MBSFN,ue->frame_parms.N_RB_DL,0); + ue->dlsch_MCH[0] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS_MBSFN,ue->frame_parms.N_RB_DL); for(int i=0; i<5; i++) ue->dl_stats[i] = 0; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 8064093eed..f02e0ebd8a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -131,7 +131,7 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr,uint8_t N_RB_DL) { } } -NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_ldpc_iterations,uint16_t N_RB_DL, uint8_t abstraction_flag) { +NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_ldpc_iterations,uint16_t N_RB_DL) { NR_UE_DLSCH_t *dlsch; uint8_t exit_flag = 0,i,r; uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated @@ -167,30 +167,28 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint else exit_flag=3; - if (abstraction_flag == 0) { - for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); - dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056); + for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); + dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056); - if (dlsch->harq_processes[i]->c[r]) - memset(dlsch->harq_processes[i]->c[r],0,1056); - else - exit_flag=2; + if (dlsch->harq_processes[i]->c[r]) + memset(dlsch->harq_processes[i]->c[r],0,1056); + else + exit_flag=2; - dlsch->harq_processes[i]->d[r] = (short *)malloc16((5*8448)*sizeof(short)); + dlsch->harq_processes[i]->d[r] = (short *)malloc16((5*8448)*sizeof(short)); - if (dlsch->harq_processes[i]->d[r]) - memset(dlsch->harq_processes[i]->d[r],0,(5*8448)*sizeof(short)); - else - exit_flag=2; + if (dlsch->harq_processes[i]->d[r]) + memset(dlsch->harq_processes[i]->d[r],0,(5*8448)*sizeof(short)); + else + exit_flag=2; - dlsch->harq_processes[i]->w[r] = (short *)malloc16((5*8448)*sizeof(short)); + dlsch->harq_processes[i]->w[r] = (short *)malloc16((5*8448)*sizeof(short)); - if (dlsch->harq_processes[i]->w[r]) - memset(dlsch->harq_processes[i]->w[r],0,(5*8448)*sizeof(short)); - else - exit_flag=2; - } + if (dlsch->harq_processes[i]->w[r]) + memset(dlsch->harq_processes[i]->w[r],0,(5*8448)*sizeof(short)); + else + exit_flag=2; } } else { exit_flag=1; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index 239731208e..e55d0bc890 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -53,16 +53,15 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch,uint8_t N_RB_DL); -/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag) +/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft) \brief This function allocates structures for a particular DLSCH at UE @returns Pointer to DLSCH to be removed @param Kmimo Kmimo factor from 36-212/36-213 @param Mdlharq Maximum number of HARQ rounds (36-212/36-213) @param Nsoft Soft-LLR buffer size from UE-Category @params N_RB_DL total number of resource blocks (determine the operating BW) - @param abstraction_flag Flag to indicate abstracted interface */ -NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL, uint8_t abstraction_flag); +NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL); void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch,unsigned char N_RB_UL); diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 69e98242d9..d1a53ca42f 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -422,8 +422,7 @@ int main(int argc, char **argv) //init_nr_ue_transport(UE, 0); for (int sf = 0; sf < 2; sf++) { for (i = 0; i < 2; i++) { - UE->dlsch[sf][0][i] = new_nr_ue_dlsch(Kmimo, 8, Nsoft, 5, N_RB_DL, - 0); + UE->dlsch[sf][0][i] = new_nr_ue_dlsch(Kmimo, 8, Nsoft, 5, N_RB_DL); if (!UE->dlsch[sf][0][i]) { printf("Can't get ue dlsch structures\n"); From 7638e653797d9558590a32a0320584a395f4f47c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 10:34:12 +0100 Subject: [PATCH 147/196] Free memory in nr_dlschsim --- openair1/SIMULATION/NR_PHY/dlschsim.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index d1a53ca42f..37d5582b1e 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -638,8 +638,15 @@ int main(int argc, char **argv) reset_DLSCH_struct(gNB, &msgDataTx); phy_free_nr_gNB(gNB); + free(gNB->threadPool); + free(RC.gNB[0]); + free(RC.gNB); + for (int sf = 0; sf < 2; sf++) + for (int i = 0; i < 2; i++) + free_nr_ue_dlsch(&UE->dlsch[sf][0][i], N_RB_DL); term_nr_ue_signal(UE, 1); + free(UE); for (i = 0; i < 2; i++) { free(s_re[i]); From e66e9eef7de06600d5231e6206e8a8a021fcf350 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 11:31:46 +0100 Subject: [PATCH 148/196] UL Ref Sig Seq: initialize only once, free and reset to NULL --- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c index 4a419ae926..69a9722664 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c @@ -204,6 +204,11 @@ int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, void generate_lowpapr_typ1_refsig_sequences(unsigned int scaling) { + /* prevent multiple calls, relevant when both UE & gNB initialize this */ + static bool already_called = false; + if (already_called) return; + already_called = true; + unsigned int u,Msc_RS; unsigned int v = 0; // sequence hopping and group hopping are not supported yet @@ -223,6 +228,11 @@ void generate_lowpapr_typ1_refsig_sequences(unsigned int scaling) void generate_ul_reference_signal_sequences(unsigned int scaling) { + /* prevent multiple calls, relevant when both UE & gNB initialize this */ + static bool already_called = false; + if (already_called) return; + already_called = true; + unsigned int u,v,Msc_RS; #if 0 @@ -295,10 +305,10 @@ void free_ul_reference_signal_sequences(void) for (u=0; u < U_GROUP_NUMBER; u++) { for (v=0; v < V_BASE_SEQUENCE_NUMBER; v++) { if (rv_ul_ref_sig[u][v][Msc_RS]) - free16(rv_ul_ref_sig[u][v][Msc_RS],2*sizeof(int16_t)*ul_allocated_re[Msc_RS]); + free_and_zero(rv_ul_ref_sig[u][v][Msc_RS]); if ((v==0) && (Msc_RS < MAX_INDEX_DMRS_UL_ALLOCATED_REs)) if (dmrs_lowpaprtype1_ul_ref_sig[u][v][Msc_RS]) - free16(dmrs_lowpaprtype1_ul_ref_sig[u][v][Msc_RS],2*sizeof(int16_t)*dmrs_ul_allocated_res[Msc_RS]); + free_and_zero(dmrs_lowpaprtype1_ul_ref_sig[u][v][Msc_RS]); } } } @@ -321,7 +331,7 @@ void free_gnb_lowpapr_sequences(void) v=0; for (u=0; u < U_GROUP_NUMBER; u++) { if (gNB_dmrs_lowpaprtype1_sequence[u][v][Msc_RS]) - free16(gNB_dmrs_lowpaprtype1_sequence[u][v][Msc_RS],2*sizeof(int16_t)*dmrs_ul_allocated_res[Msc_RS]); + free_and_zero(gNB_dmrs_lowpaprtype1_sequence[u][v][Msc_RS]); } } } From 20a8704c980415c383bfda8875b9f26579c859ec Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 11:37:48 +0100 Subject: [PATCH 149/196] unitialized jump dlschsim --- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 37d5582b1e..f3aae9a3f7 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -356,7 +356,7 @@ int main(int argc, char **argv) } RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *)); - RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); + RC.gNB[0] = calloc(1, sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); initTpool(gNBthreads, gNB->threadPool, true); From 399e6d78f7551072041f88bcd5c76795ed0753f8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 12:09:09 +0100 Subject: [PATCH 150/196] new_nr_ue_ulsch(): no abstraction_flag, add term_nr_ue_transport() --- executables/nr-ue.c | 2 +- openair1/PHY/INIT/nr_init_ue.c | 24 +++- openair1/PHY/INIT/phy_init.h | 2 +- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 +- .../PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 120 ++++++------------ openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 4 +- openair1/SIMULATION/NR_PHY/ulsim.c | 4 +- 8 files changed, 66 insertions(+), 94 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 70b3d3a199..9c9ca4db4c 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -170,7 +170,7 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue, init_nr_ue_signal(ue, nb_connected_gNB); // intialize transport - init_nr_ue_transport(ue, abstraction_flag); + init_nr_ue_transport(ue); // init N_TA offset init_N_TA_offset(ue); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 8a87a3f96d..8067c77e71 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -685,14 +685,32 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->sinr_CQI_dB); } -void init_nr_ue_transport(PHY_VARS_NR_UE *ue, - int abstraction_flag) { +void term_nr_ue_transport(PHY_VARS_NR_UE *ue) +{ + const int N_RB_DL = ue->frame_parms.N_RB_DL; + for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { + for (int j = 0; j < 2; j++) { + for (int k = 0; k < RX_NB_TH_MAX; k++) { + free_nr_ue_dlsch(&ue->dlsch[k][i][j], N_RB_DL); + free_nr_ue_ulsch(&ue->ulsch[k][i][j], N_RB_DL); + } + } + + free_nr_ue_dlsch(&ue->dlsch_SI[i], N_RB_DL); + free_nr_ue_dlsch(&ue->dlsch_ra[i], N_RB_DL); + } + + free_nr_ue_dlsch(&ue->dlsch_MCH[0], N_RB_DL); +} + +void init_nr_ue_transport(PHY_VARS_NR_UE *ue) +{ for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { for (int j=0; j<2; j++) { for (int k=0; kdlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL))!=NULL,"Can't get ue dlsch structures\n"); LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]); - AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES, abstraction_flag))!=NULL,"Can't get ue ulsch structures\n"); + AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES))!=NULL,"Can't get ue ulsch structures\n"); LOG_D(PHY,"ulsch[%d][%d][%d] => %p\n",k,i,j,ue->ulsch[k][i][j]); } } diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index 7cd6896e4f..8648dd7d82 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -398,7 +398,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_reques void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band); int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB); void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB); -void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag); +void init_nr_ue_transport(PHY_VARS_NR_UE *ue); void init_N_TA_offset(PHY_VARS_NR_UE *ue); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char lowmem_flag); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index e55d0bc890..504ab93889 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -66,7 +66,7 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch,unsigned char N_RB_UL); -NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids, uint8_t abstraction_flag); +NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids); /** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream QPSK/QPSK reception. @param stream0_in Input from channel compensated (MR combined) stream 0 diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index aa4c858574..a3e0b668d0 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -105,11 +105,8 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,unsigned char N_RB_UL) } -NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, - int number_of_harq_pids, - uint8_t abstraction_flag) +NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids) { - NR_UE_ULSCH_t *ulsch; unsigned char exit_flag = 0,i,r; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated @@ -120,97 +117,54 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, uint32_t ulsch_bytes = a_segments*1056; // allocated bytes per segment - ulsch = (NR_UE_ULSCH_t *)malloc16(sizeof(NR_UE_ULSCH_t)); + NR_UE_ULSCH_t *ulsch = malloc16(sizeof(NR_UE_ULSCH_t)); + DevAssert(ulsch); + memset(ulsch, 0, sizeof(*ulsch)); - if (ulsch) { - memset(ulsch,0,sizeof(NR_UE_ULSCH_t)); + ulsch->number_harq_processes_for_pusch = NR_MAX_ULSCH_HARQ_PROCESSES; + ulsch->Mlimit = 4; // maximum harq retransmissions - ulsch->number_harq_processes_for_pusch = NR_MAX_ULSCH_HARQ_PROCESSES; - ulsch->Mlimit = 4; // maximum harq retransmissions + //for (i=0; i<10; i++) + //ulsch->harq_ids[i] = 0; - //for (i=0; i<10; i++) - //ulsch->harq_ids[i] = 0; + for (i=0; iharq_processes[i] = malloc16(sizeof(NR_UL_UE_HARQ_t)); + DevAssert(ulsch->harq_processes[i]); + memset(ulsch->harq_processes[i], 0, sizeof(NR_UL_UE_HARQ_t)); - ulsch->harq_processes[i] = (NR_UL_UE_HARQ_t *)malloc16(sizeof(NR_UL_UE_HARQ_t)); + ulsch->harq_processes[i]->a = malloc16(ulsch_bytes); + DevAssert(ulsch->harq_processes[i]->a); + bzero(ulsch->harq_processes[i]->a,ulsch_bytes); - // printf("ulsch->harq_processes[%d] %p\n",i,ulsch->harq_processes[i]); - if (ulsch->harq_processes[i]) { - memset(ulsch->harq_processes[i], 0, sizeof(NR_UL_UE_HARQ_t)); - ulsch->harq_processes[i]->b = (uint8_t*)malloc16(ulsch_bytes); - ulsch->harq_processes[i]->a = (unsigned char*)malloc16(ulsch_bytes); + ulsch->harq_processes[i]->b = malloc16(ulsch_bytes); + DevAssert(ulsch->harq_processes[i]->b); + bzero(ulsch->harq_processes[i]->b,ulsch_bytes); - if (ulsch->harq_processes[i]->a) { - bzero(ulsch->harq_processes[i]->a,ulsch_bytes); - } else { - printf("Can't allocate PDU\n"); - exit_flag=1; - } + for (r=0; rharq_processes[i]->c[r] = malloc16(8448); + DevAssert(ulsch->harq_processes[i]->c[r]); + bzero(ulsch->harq_processes[i]->c[r],8448); - if (ulsch->harq_processes[i]->b) - bzero(ulsch->harq_processes[i]->b,ulsch_bytes); - else { - LOG_E(PHY,"Can't get b\n"); - exit_flag=1; - } - - if (abstraction_flag==0) { - for (r=0; rharq_processes[i]->c[r] = (uint8_t*)malloc16(8448); - ulsch->harq_processes[i]->d[r] = (uint8_t*)malloc16(68*384); //max size for coded output - - if (ulsch->harq_processes[i]->c[r]) { - bzero(ulsch->harq_processes[i]->c[r],8448); - } else { - printf("Can't get c\n"); - exit_flag=2; - } - if (ulsch->harq_processes[i]->d[r]) { - bzero(ulsch->harq_processes[i]->d[r],(68*384)); - } else { - printf("Can't get d\n"); - exit_flag=2; - } - } - ulsch->harq_processes[i]->e = (uint8_t*)malloc16(14*N_RB_UL*12*8); - if (ulsch->harq_processes[i]->e) { - bzero(ulsch->harq_processes[i]->e,14*N_RB_UL*12*8); - } else { - printf("Can't get e\n"); - exit_flag=1; - } - ulsch->harq_processes[i]->f = (uint8_t*)malloc16(14*N_RB_UL*12*8); - if (ulsch->harq_processes[i]->f) { - bzero(ulsch->harq_processes[i]->f,14*N_RB_UL*12*8); - } else { - printf("Can't get f\n"); - exit_flag=1; - } - } - - ulsch->harq_processes[i]->subframe_scheduling_flag = 0; - ulsch->harq_processes[i]->first_tx = 1; - } else { - LOG_E(PHY,"Can't get harq_p %d\n",i); - exit_flag=3; - } + ulsch->harq_processes[i]->d[r] = malloc16(68*384); //max size for coded output + DevAssert(ulsch->harq_processes[i]->d[r]); + bzero(ulsch->harq_processes[i]->d[r],(68*384)); } - if (exit_flag==0) { - for (i=0; iharq_processes[i]->round=0; - } - return(ulsch); - } + ulsch->harq_processes[i]->e = malloc16(14*N_RB_UL*12*8); + DevAssert(ulsch->harq_processes[i]->e); + bzero(ulsch->harq_processes[i]->e,14*N_RB_UL*12*8); + + ulsch->harq_processes[i]->f = malloc16(14*N_RB_UL*12*8); + DevAssert(ulsch->harq_processes[i]->f); + bzero(ulsch->harq_processes[i]->f,14*N_RB_UL*12*8); + + ulsch->harq_processes[i]->subframe_scheduling_flag = 0; + ulsch->harq_processes[i]->first_tx = 1; } - LOG_E(PHY,"new_ue_ulsch exit flag, size of %d , %zu\n",exit_flag, sizeof(LTE_UE_ULSCH_t)); - free_nr_ue_ulsch(&ulsch,N_RB_UL); - return(NULL); - - + return(ulsch); } diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 1f8f55db01..8e20a84f81 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -923,7 +923,7 @@ int main(int argc, char **argv) exit(-1); } - init_nr_ue_transport(UE,0); + init_nr_ue_transport(UE); nr_gold_pbch(UE); nr_gold_pdcch(UE,0); diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 3528ee4316..bc4b4709e8 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -400,7 +400,7 @@ int main(int argc, char **argv) memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS)); //phy_init_nr_top(frame_parms); - if (init_nr_ue_signal(UE, 1, 0) != 0) { + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation.\n"); exit(-1); } @@ -408,7 +408,7 @@ int main(int argc, char **argv) for (sf = 0; sf < 2; sf++) { for (i = 0; i < 2; i++) { - UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0); + UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8); if (!UE->ulsch[sf][0][i]) { printf("Can't get ue ulsch structures.\n"); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 8fa584a45f..3a7381062f 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -767,13 +767,13 @@ int main(int argc, char **argv) } //nr_init_frame_parms_ue(&UE->frame_parms); - init_nr_ue_transport(UE, 0); + init_nr_ue_transport(UE); /* for (int sf = 0; sf < 2; sf++) { for (i = 0; i < 2; i++) { - UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0); + UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8); if (!UE->ulsch[sf][0][i]) { printf("Can't get ue ulsch structures\n"); From 0827b2f5b8cc52f051209b7f103d70dba9e584cb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 12:27:50 +0100 Subject: [PATCH 151/196] Fix leaks & unitialized memory in nr_ulschsim --- openair1/SIMULATION/NR_PHY/ulschsim.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index bc4b4709e8..6cdf0b90cd 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -26,6 +26,7 @@ #include #include #include "common/config/config_userapi.h" +#include "common/utils/load_module_shlib.h" #include "common/utils/LOG/log.h" #include "common/ran_context.h" #include "PHY/types.h" @@ -372,7 +373,7 @@ int main(int argc, char **argv) RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *)); - RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); + RC.gNB[0] = calloc(1, sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; //gNB_config = &gNB->gNB_config; @@ -616,6 +617,14 @@ int main(int argc, char **argv) for (sf = 0; sf < 2; sf++) for (i = 0; i < 2; i++) free_nr_ue_ulsch(&UE->ulsch[sf][0][i], N_RB_UL); + term_nr_ue_signal(UE, 1); + free(UE); + + phy_free_nr_gNB(gNB); + free(gNB->threadPool); + free(gNB->respDecode); + free(RC.gNB[0]); + free(RC.gNB); free_channel_desc_scm(gNB2UE); @@ -625,6 +634,9 @@ int main(int argc, char **argv) if (input_fd) fclose(input_fd); + loader_reset(); + logTerm(); + return (n_errors); } From 32c7795aad2038a6ad13fc72c2461fab567451a8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 20:30:42 +0100 Subject: [PATCH 152/196] Fixes for 0bdb1b9f402c5315a591b1fbc4310dbc62fc820d --- openair1/PHY/INIT/nr_init_ue.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 8067c77e71..ad6ed0eaa4 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -485,10 +485,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) } // initialization for the last instance of pdsch_vars (used for MU-MIMO) - for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) - ue->pdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH)); - for (th_id=0; th_idpdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH)); ue->pdsch_vars[th_id][gNB_id]->llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); } @@ -682,6 +680,13 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->prach_vars[gNB_id]); } + const int gNB_id = ue->n_connected_gNB; + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]); + } + free_and_zero(ue->sinr_CQI_dB); } From b4dbf46ddebd924cc3fa5eea3cce546aa28359aa Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 20:46:20 +0100 Subject: [PATCH 153/196] Provide term_freq_channel() to free memory in abstraction.c --- openair1/SIMULATION/TOOLS/abstraction.c | 19 ++++++++++++++++--- openair1/SIMULATION/TOOLS/sim.h | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/openair1/SIMULATION/TOOLS/abstraction.c b/openair1/SIMULATION/TOOLS/abstraction.c index a6b0586882..b1cd691ec4 100644 --- a/openair1/SIMULATION/TOOLS/abstraction.c +++ b/openair1/SIMULATION/TOOLS/abstraction.c @@ -33,11 +33,26 @@ // NEW code with lookup table for sin/cos based on delay profile (TO BE TESTED) double **cos_lut=NULL,* *sin_lut=NULL; +static int freq_channel_init = 0; +static int n_samples_max = 0; //#if 1 - +void term_freq_channel(void) +{ + for (int f = -(n_samples_max >> 1); f <= n_samples_max >> 1; f++) { + const int idx = f + (n_samples_max >> 1); + if (cos_lut[idx]) + free_and_zero(cos_lut[idx]); + if (sin_lut[idx]) + free_and_zero(sin_lut[idx]); + } + free_and_zero(cos_lut); + free_and_zero(sin_lut); + freq_channel_init = 0; + n_samples_max = 0; +} int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs) { double delta_f,freq; // 90 kHz spacing @@ -78,8 +93,6 @@ int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs) int16_t f,f2,d; uint8_t aarx,aatx,l; double *clut,*slut; - static int freq_channel_init=0; - static int n_samples_max=0; // do some error checking // n_samples has to be a odd number because we assume the spectrum is symmetric around the DC and includes the DC diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h index ce470fe0b0..f12483d70a 100644 --- a/openair1/SIMULATION/TOOLS/sim.h +++ b/openair1/SIMULATION/TOOLS/sim.h @@ -479,6 +479,7 @@ void randominit(unsigned int seed_init); double uniformrandom(void); int freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples,int scs); int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs); +void term_freq_channel(void); uint8_t multipath_channel_nosigconv(channel_desc_t *desc); void multipath_tv_channel(channel_desc_t *desc, double **tx_sig_re, From 81537701b21245e4b0d80793ed05ffb6b04c4b84 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 20:46:42 +0100 Subject: [PATCH 154/196] Fix: channel chF large enough for 5G --- openair1/SIMULATION/TOOLS/random_channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index b00f6e31d5..0f6b8fb1bc 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -125,7 +125,7 @@ void fill_channel_desc(channel_desc_t *chan_desc, chan_desc->ch[i] = (struct complexd *) malloc(channel_length * sizeof(struct complexd)); for (i = 0; ichF[i] = (struct complexd *) malloc(12*257 * sizeof(struct complexd)); // allocate for up to 257 RBs, 12 samples per RB + chan_desc->chF[i] = (struct complexd *) malloc(275 * 12 * sizeof(struct complexd)); // allocate for up to 275 RBs, 12 symbols per RB LOG_D(OCM,"[CHANNEL] Filling a (nb_taps %d)\n",nb_taps); From dcae857463d55d19c579738fc3e0febc94b8b163 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 20:48:09 +0100 Subject: [PATCH 155/196] Fix memory problems in nr_pucchsim except: - from dlopen() - from configuration module - uninitialized value --- openair1/SIMULATION/NR_PHY/pucchsim.c | 44 ++++++++++++++------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 34fe0ef543..2339e988f1 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -26,6 +26,7 @@ #include #include #include "common/config/config_userapi.h" +#include "common/utils/load_module_shlib.h" #include "common/utils/LOG/log.h" #include "common/ran_context.h" #include "PHY/types.h" @@ -70,7 +71,6 @@ int main(int argc, char **argv) double sigma2, sigma2_dB=10,SNR,snr0=-2.0,snr1=2.0; double cfo=0; uint8_t snr1set=0; - int **txdataF,**rxdataF; double **s_re,**s_im,**r_re,**r_im; //int sync_pos, sync_pos_slot; //FILE *rx_frame_file; @@ -372,7 +372,7 @@ int main(int argc, char **argv) printf("Transmitted payload is %ld, do_DTX = %d\n",actual_payload,do_DTX); - RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *)); + RC.gNB = calloc(1, sizeof(PHY_VARS_gNB *)); RC.gNB[0] = calloc(1,sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; gNB->pucch0_thres = pucch_DTX_thres; @@ -441,24 +441,15 @@ int main(int argc, char **argv) s_im = malloc(n_tx*sizeof(double*)); r_re = malloc(n_rx*sizeof(double*)); r_im = malloc(n_rx*sizeof(double*)); - txdataF = malloc(n_tx*sizeof(int*)); - rxdataF = malloc(n_rx*sizeof(int*)); - gNB->common_vars.rxdataF=rxdataF; memcpy((void*)&gNB->frame_parms,(void*)frame_parms,sizeof(frame_parms)); for (int aatx=0; aatxsymbols_per_slot*frame_parms->ofdm_symbol_size); - txdataF[aatx] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int)); - bzero(txdataF[aatx],14*frame_parms->ofdm_symbol_size*sizeof(int)); } for (int aarx=0; aarxsymbols_per_slot*frame_parms->ofdm_symbol_size); - rxdataF[aarx] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int)); - bzero(rxdataF[aarx],14*frame_parms->ofdm_symbol_size*sizeof(int)); } uint8_t mcs=0; @@ -536,6 +527,7 @@ int main(int argc, char **argv) ack_nack_errors=0; sr_errors=0; n_errors = 0; + int **txdataF = gNB->common_vars.txdataF; for (trial=0; trialofdm_symbol_size*sizeof(int)); @@ -562,6 +554,7 @@ int main(int argc, char **argv) int i0; double txr,txi,rxr,rxi,nr,ni; + int **rxdataF = gNB->common_vars.rxdataF; for (int symb=0; symbframe_parms.symbols_per_slot;symb++) { if (symb= startingSymbolIndex+nrofSymbols) { i0 = symb*gNB->frame_parms.ofdm_symbol_size; @@ -662,20 +655,20 @@ int main(int argc, char **argv) sr_errors+=1; } // harq value 0 -> pass + nfapi_nr_harq_t *harq_list = uci_pdu.harq->harq_list; // confidence value 0 -> good confidence - const int harq_value0 = uci_pdu.harq->harq_list[0].harq_value; - const int harq_value1 = uci_pdu.harq->harq_list[1].harq_value; const int confidence_lvl = uci_pdu.harq->harq_confidence_level; if(nr_bit>0){ if (nr_bit==1 && do_DTX == 0) - ack_nack_errors+=(actual_payload^(!harq_value0)); + ack_nack_errors+=(actual_payload^(!harq_list[0].harq_value)); else if (do_DTX == 0) - ack_nack_errors+=(((actual_payload&1)^(!harq_value0))+((actual_payload>>1)^(!harq_value1))); - else if ((!confidence_lvl && !harq_value0) || - (!confidence_lvl && nr_bit == 2 && !harq_value1)) + ack_nack_errors+=(((actual_payload&1)^(!harq_list[0].harq_value))+((actual_payload>>1)^(!harq_list[1].harq_value))); + else if ((!confidence_lvl && !harq_list[0].harq_value) || + (!confidence_lvl && nr_bit == 2 && !harq_list[1].harq_value)) ack_nack_errors++; free(uci_pdu.harq->harq_list); } + free(uci_pdu.harq); } else if (format==1) { nr_decode_pucch1(rxdataF,PUCCH_GroupHopping,hopping_id, @@ -735,25 +728,34 @@ int main(int argc, char **argv) } } + free_channel_desc_scm(UE2gNB); + term_freq_channel(); + + phy_free_nr_gNB(gNB); + free(RC.gNB[0]); + free(RC.gNB); + + term_nr_ue_signal(UE, 1); + free(UE); + for (int aatx=0; aatx Date: Thu, 17 Feb 2022 14:58:52 +0100 Subject: [PATCH 156/196] Resolve memory issues in nr_prachsim Except for config module and dlopen() --- openair1/PHY/INIT/nr_init_ru.c | 34 ++++++++++++++------------- openair1/SCHED_NR/sched_nr.h | 1 + openair1/SIMULATION/NR_PHY/prachsim.c | 34 +++++++++++++++++++++++---- 3 files changed, 49 insertions(+), 20 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index d032746718..07f1d3b9e3 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -174,17 +174,13 @@ void nr_phy_free_RU(RU_t *ru) LOG_I(PHY, "Feeing RU signal buffers (if_south %s) nb_tx %d\n", ru_if_types[ru->if_south], ru->nb_tx); - free_and_zero(ru->nr_frame_parms); - free_and_zero(ru->frame_parms); - if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so free memory for time-domain signals - int32_t *ptr; - for (i = 0; i < ru->nb_tx; i++) { - ptr=&ru->common.txdata[i][-ru->sf_extension]; - free_and_zero(ptr); - } - for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdata[i]); + for (i = 0; i < ru->nb_tx; i++) + free_and_zero(ru->common.txdata[i]); free_and_zero(ru->common.txdata); + + for (i = 0; i < ru->nb_rx; i++) + free_and_zero(ru->common.rxdata[i]); free_and_zero(ru->common.rxdata); } // else: IF5 or local RF -> nothing to free() @@ -193,7 +189,7 @@ void nr_phy_free_RU(RU_t *ru) free_and_zero(ru->common.rxdata_7_5kHz); // free beamforming input buffers (TX) - for (i = 0; i < 15; i++) free_and_zero(ru->common.txdataF[i]); + for (i = 0; i < ru->nb_tx; i++) free_and_zero(ru->common.txdataF[i]); free_and_zero(ru->common.txdataF); // free IFFT input buffers (TX) @@ -205,15 +201,21 @@ void nr_phy_free_RU(RU_t *ru) free_and_zero(ru->common.rxdataF); for (j=0;jnb_rx; i++) { + for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->prach_rxsigF[j][i]); - } + free_and_zero(ru->prach_rxsigF[j]); } - for (i = 0; i < ru->num_gNB; i++) { - for (p = 0; p < 15; p++) { - for (j=0; jnb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]); - free_and_zero(ru->beam_weights[i][p]); + + if (ru->do_precoding == 1) { + for (i = 0; i < ru->num_gNB; i++) { + for (p = 0; p < ru->nb_log_antennas; p++) { + for (j=0; jnb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]); + free_and_zero(ru->beam_weights[i][p]); + } } + for(i=0; i< ru->nb_tx; ++i) + free_and_zero(ru->common.beam_id[i]); + free_and_zero(ru->common.beam_id); } } free_and_zero(ru->common.sync_corr); diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index d7e0332b85..2124397c47 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -54,5 +54,6 @@ void nr_fep_full(RU_t *ru, int slot); void nr_fep_full_2thread(RU_t *ru, int slot); void feptx_prec(RU_t *ru,int frame_tx,int tti_tx); int nr_phy_init_RU(RU_t *ru); +void nr_phy_free_RU(RU_t *ru); #endif diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 537612ac30..bc4f4a0b60 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -25,6 +25,7 @@ #include #include "common/config/config_userapi.h" +#include "common/utils/load_module_shlib.h" #include "common/utils/LOG/log.h" #include "common/ran_context.h" @@ -662,7 +663,6 @@ int main(int argc, char **argv){ RC.nb_nr_L1_inst=1; phy_init_nr_gNB(gNB,0,1); //lowmem nr_phy_init_RU(ru); - gNB->common_vars.rxdata = ru->common.rxdata; set_tdd_config_nr(&gNB->gNB_config, mu, 7, 6, 2, 4); // Configure UE @@ -781,7 +781,7 @@ int main(int argc, char **argv){ // multipath channel // dump_nr_prach_config(&gNB->frame_parms,subframe); - for (i = 0; i < frame_parms->samples_per_subframe<<1; i++) { + for (i = 0; i < frame_parms->samples_per_subframe; i++) { for (aa=0; aa<1; aa++) { if (awgn_flag == 0) { s_re[aa][i] = ((double)(((short *)&txdata[aa][prach_start]))[(i<<1)]); @@ -879,7 +879,8 @@ int main(int argc, char **argv){ rx_nr_prach_ru(ru, prach_format, numRA, prachStartSymbol, prachOccasion, frame, slot); - gNB->prach_vars.rxsigF = ru->prach_rxsigF[prachOccasion]; + for (int i = 0; i < ru->nb_rx; ++i) + gNB->prach_vars.rxsigF[i] = ru->prach_rxsigF[prachOccasion][i]; if (n_frames == 1) printf("ncs %d,num_seq %d\n",prach_pdu->num_cs, prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value); rx_nr_prach(gNB, prach_pdu, prachOccasion, frame, subframe, &preamble_rx, &preamble_energy, &preamble_delay); @@ -897,7 +898,7 @@ int main(int argc, char **argv){ #ifdef NR_PRACH_DEBUG LOG_M("prach0.m","prach0", &txdata[0][prach_start], frame_parms->samples_per_subframe, 1, 1); LOG_M("prachF0.m","prachF0", &gNB->prach_vars.prachF[0], N_ZC, 1, 1); - LOG_M("rxsig0.m","rxs0", &gNB->common_vars.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1); + LOG_M("rxsig0.m","rxs0", &ru->common.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1); LOG_M("ru_rxsig0.m","rxs0", &ru->common.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1); LOG_M("ru_rxsigF0.m","rxsF0", ru->common.rxdataF[0], frame_parms->ofdm_symbol_size*frame_parms->symbols_per_slot, 1, 1); LOG_M("ru_prach_rxsigF0.m","rxsF0", ru->prach_rxsigF[0][0], N_ZC, 1, 1); @@ -922,6 +923,28 @@ int main(int argc, char **argv){ break; } //SNR loop + free_channel_desc_scm(UE2gNB); + + nr_phy_free_RU(ru); + free(RC.ru[0]); + free(RC.ru); + + phy_free_nr_gNB(gNB); + // allocated in set_tdd_config_nr() + int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<gNB_config.prach_config.num_prach_fd_occasions_list); + for (int i = 0; i < nb_slots_to_set; ++i) + free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list); + free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list); + free(RC.gNB[0]); + free(RC.gNB); + + term_nr_ue_signal(UE, 1); + free(UE->nrUE_config.prach_config.num_prach_fd_occasions_list); + free(UE); + free(PHY_vars_UE_g[0]); + free(PHY_vars_UE_g); + for (i=0; i<2; i++) { free(s_re[i]); free(s_im[i]); @@ -936,5 +959,8 @@ int main(int argc, char **argv){ if (input_fd) fclose(input_fd); + loader_reset(); + logTerm(); + return(0); } From be314a9770670a53d3a3de0dc12afd479eb334ec Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 16 Feb 2022 00:54:20 +0100 Subject: [PATCH 157/196] remove usage of undefined var in polar and memory leaks --- openair1/PHY/CODING/TESTBENCH/polartest.c | 2 +- .../CODING/nrPolar_tools/nr_polar_decoder.c | 144 ++++++++-------- .../nrPolar_tools/nr_polar_decoding_tools.c | 156 ++++++++--------- .../PHY/CODING/nrPolar_tools/nr_polar_defs.h | 97 +++-------- .../nrPolar_tools/nr_polar_matrix_and_array.c | 157 ------------------ 5 files changed, 172 insertions(+), 384 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c index 8e7e377542..ddda974e10 100644 --- a/openair1/PHY/CODING/TESTBENCH/polartest.c +++ b/openair1/PHY/CODING/TESTBENCH/polartest.c @@ -160,7 +160,7 @@ if (logFlag){ uint8_t testArrayLength = ceil(testLength / 32.0); uint8_t coderArrayLength = ceil(coderLength / 32.0); - uint32_t testInput[testArrayLength]; //generate randomly + uint32_t testInput[min(2,testArrayLength)]; //generate randomly uint32_t encoderOutput[coderArrayLength]; uint32_t estimatedOutput[testArrayLength]; //decoder output memset(testInput,0,sizeof(uint32_t) * testArrayLength); diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c index 8fe115b23a..a59307a875 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c @@ -39,19 +39,40 @@ #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" #include "assertions.h" +static inline void updateCrcChecksum2(int xlen, + int ylen, + uint8_t crcChecksum[xlen][ylen], + int gxlen, + int gylen, + uint8_t crcGen[gxlen][gylen], + uint8_t listSize, + uint32_t i2, + uint8_t len) +{ + for (uint8_t i = 0; i < listSize; i++) { + for (uint8_t j = 0; j < len; j++) { + crcChecksum[j][i+listSize] = ( (crcChecksum[j][i] + crcGen[i2][j]) % 2 ); + } + } +} + int8_t polar_decoder(double *input, uint32_t *out, const t_nrPolar_params *polarParams, uint8_t listSize) { //Assumes no a priori knowledge. - uint8_t ***bit = nr_alloc_uint8_3D_array(polarParams->N, (polarParams->n+1), 2*listSize); - uint8_t **bitUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True - uint8_t **llrUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True - double ***llr = nr_alloc_double_3D_array(polarParams->N, (polarParams->n+1), 2*listSize); - uint8_t **crcChecksum = nr_alloc_uint8_2D_array(polarParams->crcParityBits, 2*listSize); - double *pathMetric = malloc(sizeof(double)*(2*listSize)); - uint8_t *crcState = malloc(sizeof(uint8_t)*(2*listSize)); //0=False, 1=True + uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; + memset(bit,0,sizeof bit); + uint8_t bitUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True + memset(bitUpdated,0,sizeof bitUpdated); + uint8_t llrUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True + memset(llrUpdated,0,sizeof llrUpdated); + double llr[polarParams->N][polarParams->n+1][2*listSize]; + uint8_t crcChecksum[polarParams->crcParityBits][2*listSize]; + memset(crcChecksum,0,sizeof crcChecksum); + double pathMetric[2*listSize]; + uint8_t crcState[2*listSize]; //0=False, 1=True for (int i=0; i<(2*listSize); i++) { pathMetric[i] = 0; @@ -63,13 +84,8 @@ int8_t polar_decoder(double *input, bitUpdated[i][0]=((polarParams->information_bit_pattern[i]+1) % 2); } - uint8_t **extended_crc_generator_matrix = malloc(polarParams->K * sizeof(uint8_t *)); //G_P3 - uint8_t **tempECGM = malloc(polarParams->K * sizeof(uint8_t *)); //G_P2 - - for (int i = 0; i < polarParams->K; i++) { - extended_crc_generator_matrix[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t)); - tempECGM[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t)); - } + uint8_t extended_crc_generator_matrix[polarParams->K][polarParams->crcParityBits]; //G_P3 + uint8_t tempECGM[polarParams->K][polarParams->crcParityBits]; //G_P2 for (int i=0; ipayloadBits; i++) { for (int j=0; jcrcParityBits; j++) { @@ -102,7 +118,7 @@ int8_t polar_decoder(double *input, } } - double *d_tilde = malloc(sizeof(double) * polarParams->N); + double d_tilde[polarParams->N]; nr_polar_rate_matching(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength); for (int j = 0; j < polarParams->N; j++) llr[j][polarParams->n][0]=d_tilde[j]; @@ -117,12 +133,12 @@ int8_t polar_decoder(double *input, uint8_t listIndex[2*listSize], copyIndex; for (uint16_t currentBit=0; currentBitN; currentBit++) { - updateLLR(llr, llrUpdated, bit, bitUpdated, currentListSize, currentBit, 0, polarParams->N, (polarParams->n+1)); + updateLLR(currentListSize, currentBit, 0, polarParams->N, polarParams->n+1, 2*listSize, llr, llrUpdated, bit, bitUpdated); if (polarParams->information_bit_pattern[currentBit]==0) { //Frozen bit. - updatePathMetric(pathMetric, llr, currentListSize, 0, currentBit); + updatePathMetric(pathMetric, currentListSize, 0, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr); } else { //Information or CRC bit. - updatePathMetric2(pathMetric, llr, currentListSize, currentBit); + updatePathMetric2(pathMetric, currentListSize, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr); for (int i = 0; i < currentListSize; i++) { for (int j = 0; j < polarParams->N; j++) { @@ -141,7 +157,9 @@ int8_t polar_decoder(double *input, for (int i = currentListSize; i < 2*currentListSize; i++) bit[currentBit][0][i]=1; bitUpdated[currentBit][0]=1; - updateCrcChecksum2(crcChecksum, extended_crc_generator_matrix, currentListSize, nonFrozenBit, polarParams->crcParityBits); + updateCrcChecksum2(polarParams->crcParityBits, 2*listSize, crcChecksum, + polarParams->K, polarParams->crcParityBits, extended_crc_generator_matrix, + currentListSize, nonFrozenBit, polarParams->crcParityBits); currentListSize*=2; //Keep only the best "listSize" number of entries. @@ -246,12 +264,12 @@ int8_t polar_decoder(double *input, if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - free(d_tilde); - free(pathMetric); - free(crcState); - nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); + //free(d_tilde); + //free(pathMetric); + //free(crcState); + //nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); + //nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); + //nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); free(tempECGM); return(-1); } @@ -282,14 +300,6 @@ int8_t polar_decoder(double *input, } } - free(d_tilde); - free(pathMetric); - free(crcState); - nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); - nr_free_uint8_2D_array(extended_crc_generator_matrix, polarParams->K); - nr_free_uint8_2D_array(tempECGM, polarParams->K); /* * Return bits. */ @@ -302,13 +312,17 @@ int8_t polar_decoder_dci(double *input, const t_nrPolar_params *polarParams, uint8_t listSize, uint16_t n_RNTI) { - uint8_t ***bit = nr_alloc_uint8_3D_array(polarParams->N, (polarParams->n+1), 2*listSize); - uint8_t **bitUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True - uint8_t **llrUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True - double ***llr = nr_alloc_double_3D_array(polarParams->N, (polarParams->n+1), 2*listSize); - uint8_t **crcChecksum = nr_alloc_uint8_2D_array(polarParams->crcParityBits, 2*listSize); - double *pathMetric = malloc(sizeof(double)*(2*listSize)); - uint8_t *crcState = malloc(sizeof(uint8_t)*(2*listSize)); //0=False, 1=True + uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; + memset(bit,0,sizeof bit); + uint8_t bitUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True + memset(bitUpdated,0,sizeof bitUpdated); + uint8_t llrUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True + memset(llrUpdated,0,sizeof llrUpdated); + double llr[polarParams->N][polarParams->n+1][2*listSize]; + uint8_t crcChecksum[polarParams->crcParityBits][2*listSize]; + memset(crcChecksum,0,sizeof crcChecksum); + double pathMetric[2*listSize]; + uint8_t crcState[2*listSize]; //0=False, 1=True uint8_t extended_crc_scrambling_pattern[polarParams->crcParityBits]; for (int i=0; i<(2*listSize); i++) { @@ -321,13 +335,8 @@ int8_t polar_decoder_dci(double *input, bitUpdated[i][0]=((polarParams->information_bit_pattern[i]+1) % 2); } - uint8_t **extended_crc_generator_matrix = malloc(polarParams->K * sizeof(uint8_t *)); //G_P3: K-by-P - uint8_t **tempECGM = malloc(polarParams->K * sizeof(uint8_t *)); //G_P2: K-by-P - - for (int i = 0; i < polarParams->K; i++) { - extended_crc_generator_matrix[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t)); - tempECGM[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t)); - } + uint8_t extended_crc_generator_matrix[polarParams->K][polarParams->crcParityBits]; //G_P3: K-by-P + uint8_t tempECGM[polarParams->K][polarParams->crcParityBits]; //G_P2: K-by-P for (int i=0; ipayloadBits; i++) { for (int j=0; jcrcParityBits; j++) { @@ -366,17 +375,19 @@ int8_t polar_decoder_dci(double *input, extended_crc_scrambling_pattern[i]=(n_RNTI>>(23-i))&1; } - double *d_tilde = malloc(sizeof(double) * polarParams->N); + double d_tilde[polarParams->N]; nr_polar_rate_matching(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength); - for (int j = 0; j < polarParams->N; j++) llr[j][polarParams->n][0]=d_tilde[j]; + for (int j = 0; j < polarParams->N; j++) + llr[j][polarParams->n][0]=d_tilde[j]; /* * SCL polar decoder. */ for (int i=0; icrcParityBits; i++) { - for (int j=0; jcrcParityBits; j++) crcChecksum[i][0]=crcChecksum[i][0]+polarParams->crc_generator_matrix[j][i]; + for (int j=0; jcrcParityBits; j++) + crcChecksum[i][0]=crcChecksum[i][0]+polarParams->crc_generator_matrix[j][i]; crcChecksum[i][0]=(crcChecksum[i][0]%2); } @@ -388,12 +399,12 @@ int8_t polar_decoder_dci(double *input, uint8_t listIndex[2*listSize], copyIndex; for (uint16_t currentBit=0; currentBitN; currentBit++) { - updateLLR(llr, llrUpdated, bit, bitUpdated, currentListSize, currentBit, 0, polarParams->N, (polarParams->n+1)); + updateLLR(currentListSize, currentBit, 0, polarParams->N, polarParams->n+1, 2*listSize, llr, llrUpdated, bit, bitUpdated); if (polarParams->information_bit_pattern[currentBit]==0) { //Frozen bit. - updatePathMetric(pathMetric, llr, currentListSize, 0, currentBit); + updatePathMetric(pathMetric, currentListSize, 0, currentBit,polarParams->N, polarParams->n+1, 2*listSize, llr); } else { //Information or CRC bit. - updatePathMetric2(pathMetric, llr, currentListSize, currentBit); + updatePathMetric2(pathMetric, currentListSize, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr); for (int i = 0; i < currentListSize; i++) { for (int j = 0; j < polarParams->N; j++) { @@ -412,7 +423,9 @@ int8_t polar_decoder_dci(double *input, for (int i = currentListSize; i < 2*currentListSize; i++) bit[currentBit][0][i]=1; bitUpdated[currentBit][0]=1; - updateCrcChecksum2(crcChecksum, extended_crc_generator_matrix, currentListSize, nonFrozenBit, polarParams->crcParityBits); + updateCrcChecksum2(polarParams->crcParityBits, 2*listSize, crcChecksum, + polarParams->K, polarParams->crcParityBits, extended_crc_generator_matrix, + currentListSize, nonFrozenBit, polarParams->crcParityBits); currentListSize*=2; //Keep only the best "listSize" number of entries. @@ -513,16 +526,17 @@ int8_t polar_decoder_dci(double *input, } } - for (uint8_t i = 0; i < currentListSize; i++) decoderIterationCheck+=crcState[i]; + for (uint8_t i = 0; i < currentListSize; i++) + decoderIterationCheck+=crcState[i]; if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - free(d_tilde); - free(pathMetric); - free(crcState); - nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); + //free(d_tilde); + //free(pathMetric); + //free(crcState); + //nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); + //nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); + //nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); free(tempECGM); return(-1); } @@ -553,14 +567,6 @@ int8_t polar_decoder_dci(double *input, } } - free(d_tilde); - free(pathMetric); - free(crcState); - nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); - nr_free_uint8_2D_array(extended_crc_generator_matrix, polarParams->K); - nr_free_uint8_2D_array(tempECGM, polarParams->K); /* * Return bits. */ diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c index 42d500ae86..e8046ff622 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c @@ -36,51 +36,25 @@ //#define DEBUG_NEW_IMPL 1 -void updateLLR(double ***llr, - uint8_t **llrU, - uint8_t ***bit, - uint8_t **bitU, - uint8_t listSize, - uint16_t row, - uint16_t col, - uint16_t xlen, - uint8_t ylen) -{ - uint16_t offset = (xlen/(pow(2,(ylen-col-1)))); - for (uint8_t i=0; i= offset ) { - if(bitU[row-offset][col]==0) updateBit(bit, bitU, listSize, (row-offset), col, xlen, ylen); - if(llrU[row-offset][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, (row-offset), (col+1), xlen, ylen); - if(llrU[row][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, row, (col+1), xlen, ylen); - llr[row][col][i] = (pow((-1),bit[row-offset][col][i])*llr[row-offset][col+1][i]) + llr[row][col+1][i]; - } else { - if(llrU[row][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, row, (col+1), xlen, ylen); - if(llrU[row+offset][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, (row+offset), (col+1), xlen, ylen); - computeLLR(llr, row, col, i, offset); - } - } - llrU[row][col]=1; - // printf("LLR (a %f, b %f): llr[%d][%d] %f\n",32*a,32*b,col,row,32*llr[col][row]); -} - -void updateBit(uint8_t ***bit, - uint8_t **bitU, - uint8_t listSize, - uint16_t row, - uint16_t col, - uint16_t xlen, - uint8_t ylen) +static inline void updateBit(uint8_t listSize, + uint16_t row, + uint16_t col, + uint16_t xlen, + uint8_t ylen, + int zlen, + uint8_t bit[xlen][ylen][zlen], + uint8_t bitU[xlen][ylen]) { uint16_t offset = ( xlen/(pow(2,(ylen-col))) ); for (uint8_t i=0; i= offset ) { - if (bitU[row][col-1]==0) updateBit(bit, bitU, listSize, row, (col-1), xlen, ylen); + if (bitU[row][col-1]==0) updateBit(listSize, row, (col-1), xlen, ylen, zlen, bit, bitU); bit[row][col][i] = bit[row][col-1][i]; } else { - if (bitU[row][col-1]==0) updateBit(bit, bitU, listSize, row, (col-1), xlen, ylen); - if (bitU[row+offset][col-1]==0) updateBit(bit, bitU, listSize, (row+offset), (col-1), xlen, ylen); + if (bitU[row][col-1]==0) updateBit(listSize, row, (col-1), xlen, ylen, zlen, bit, bitU); + if (bitU[row+offset][col-1]==0) updateBit(listSize, (row+offset), (col-1), xlen, ylen, zlen, bit, bitU); bit[row][col][i] = ( (bit[row][col-1][i]+bit[row+offset][col-1][i]) % 2); } } @@ -88,11 +62,60 @@ void updateBit(uint8_t ***bit, bitU[row][col]=1; } +static inline void computeLLR(uint16_t row, + uint16_t col, + uint8_t i, + uint16_t offset, + int xlen, + int ylen, + int zlen, + double llr[xlen][ylen][zlen]) +{ + double a = llr[row][col + 1][i]; + double b = llr[row + offset][col + 1][i]; + llr[row][col][i] = log((exp(a + b) + 1) / (exp(a) + exp(b))); //eq. (8a) +} + + +void updateLLR(uint8_t listSize, + uint16_t row, + uint16_t col, + uint16_t xlen, + uint8_t ylen, + int zlen, + double llr[xlen][ylen][zlen], + uint8_t llrU[xlen][ylen], + uint8_t bit[xlen][ylen][zlen], + uint8_t bitU[xlen][ylen] + ) +{ + uint16_t offset = (xlen/(pow(2,(ylen-col-1)))); + for (uint8_t i=0; i= offset ) { + if(bitU[row-offset][col]==0) updateBit(listSize, (row-offset), col, xlen, ylen, zlen, bit, bitU); + if(llrU[row-offset][col+1]==0) updateLLR(listSize, (row-offset), (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU ); + if(llrU[row][col+1]==0) updateLLR(listSize, row, (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU); + llr[row][col][i] = (pow((-1),bit[row-offset][col][i])*llr[row-offset][col+1][i]) + llr[row][col+1][i]; + } else { + if(llrU[row][col+1]==0) updateLLR(listSize, row, (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU ); + if(llrU[row+offset][col+1]==0) updateLLR(listSize, (row+offset), (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU ); + computeLLR(row, col, i, offset, xlen, ylen, zlen, llr); + } + } + llrU[row][col]=1; + + // printf("LLR (a %f, b %f): llr[%d][%d] %f\n",32*a,32*b,col,row,32*llr[col][row]); +} + void updatePathMetric(double *pathMetric, - double ***llr, - uint8_t listSize, - uint8_t bitValue, - uint16_t row) + uint8_t listSize, + uint8_t bitValue, + uint16_t row, + int xlen, + int ylen, + int zlen, + double llr[xlen][ylen][zlen] + ) { int8_t multiplier = (2*bitValue) - 1; for (uint8_t i=0; i Date: Thu, 17 Feb 2022 15:03:44 +0100 Subject: [PATCH 158/196] with polar structures delete and better cpu performance --- openair1/PHY/CODING/TESTBENCH/polartest.c | 5 +-- .../PHY/CODING/nrPolar_tools/nr_crc_byte.c | 7 ++-- .../CODING/nrPolar_tools/nr_polar_decoder.c | 28 ++++----------- .../nrPolar_tools/nr_polar_decoding_tools.c | 17 ++++++++++ .../PHY/CODING/nrPolar_tools/nr_polar_defs.h | 3 +- .../CODING/nrPolar_tools/nr_polar_encoder.c | 2 +- openair1/PHY/CODING/nr_polar_init.c | 34 +++++++++++++++++-- 7 files changed, 66 insertions(+), 30 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c index ddda974e10..af1228be07 100644 --- a/openair1/PHY/CODING/TESTBENCH/polartest.c +++ b/openair1/PHY/CODING/TESTBENCH/polartest.c @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) { - //Default simulation values (Aim for iterations = 1000000.) + //Default simulation values (Aim for iterations = 1000000.) int decoder_int16=0; int itr, iterations = 1000, arguments, polarMessageType = 0; //0=PBCH, 1=DCI, 2=UCI double SNRstart = -20.0, SNRstop = 0.0, SNRinc= 0.5; //dB @@ -160,7 +160,7 @@ if (logFlag){ uint8_t testArrayLength = ceil(testLength / 32.0); uint8_t coderArrayLength = ceil(coderLength / 32.0); - uint32_t testInput[min(2,testArrayLength)]; //generate randomly + uint32_t testInput[max(2,testArrayLength)]; //generate randomly uint32_t encoderOutput[coderArrayLength]; uint32_t estimatedOutput[testArrayLength]; //decoder output memset(testInput,0,sizeof(uint32_t) * testArrayLength); @@ -357,5 +357,6 @@ if (logFlag){ print_meas(&timeEncoder,"polar_encoder",NULL,NULL); print_meas(&timeDecoder,"polar_decoder",NULL,NULL); if (logFlag) fclose(logFile); + nr_polar_delete(currentPtr); return (0); } diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c b/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c index 461eb7d6f6..3a484ff991 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c @@ -29,12 +29,13 @@ uint8_t **crc24c_generator_matrix(uint16_t payloadSizeBits){ uint8_t crcPolynomialSize = 24; uint8_t temp1[crcPolynomialSize], temp2[crcPolynomialSize]; - uint8_t **crc_generator_matrix = malloc(payloadSizeBits * sizeof(uint8_t *)); + uint8_t **crc_generator_matrix = malloc(payloadSizeBits*sizeof(uint8_t *) + payloadSizeBits*crcPolynomialSize*sizeof(uint8_t)); if (crc_generator_matrix) for (int i = 0; i < payloadSizeBits; i++) - crc_generator_matrix[i] = malloc(crcPolynomialSize * sizeof(uint8_t)); + crc_generator_matrix[i] = ((uint8_t*)&crc_generator_matrix[payloadSizeBits])+i*crcPolynomialSize; - for (int i = 0; i < crcPolynomialSize; i++) crc_generator_matrix[payloadSizeBits-1][i]=crcPolynomialPattern[i+1]; + for (int i = 0; i < crcPolynomialSize; i++) + crc_generator_matrix[payloadSizeBits-1][i]=crcPolynomialPattern[i+1]; for (int i = payloadSizeBits-2; i >= 0; i--){ for (int j = 0; j < crcPolynomialSize-1; j++) temp1[j]=crc_generator_matrix[i+1][j+1]; diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c index a59307a875..bdafb15d9c 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c @@ -141,18 +141,18 @@ int8_t polar_decoder(double *input, updatePathMetric2(pathMetric, currentListSize, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr); for (int i = 0; i < currentListSize; i++) { - for (int j = 0; j < polarParams->N; j++) { - for (int k = 0; k < (polarParams->n+1); k++) { + for (int j = 0; j < polarParams->N; j++) { + for (int k = 0; k < (polarParams->n+1); k++) { bit[j][k][i+currentListSize]=bit[j][k][i]; llr[j][k][i+currentListSize]=llr[j][k][i]; } - } + } } - for (int i = 0; i < currentListSize; i++) { - bit[currentBit][0][i]=0; - crcState[i+currentListSize]=crcState[i]; - } + for (int i = 0; i < currentListSize; i++) { + bit[currentBit][0][i]=0; + crcState[i+currentListSize]=crcState[i]; + } for (int i = currentListSize; i < 2*currentListSize; i++) bit[currentBit][0][i]=1; @@ -264,13 +264,6 @@ int8_t polar_decoder(double *input, if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - //free(d_tilde); - //free(pathMetric); - //free(crcState); - //nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - //nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - //nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); - free(tempECGM); return(-1); } @@ -531,13 +524,6 @@ int8_t polar_decoder_dci(double *input, if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - //free(d_tilde); - //free(pathMetric); - //free(crcState); - //nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - //nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - //nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); - free(tempECGM); return(-1); } diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c index e8046ff622..b201db2ba6 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c @@ -208,6 +208,23 @@ decoder_node_t *add_nodes(int level, int first_leaf_index, t_nrPolar_params *pol return(new_node); } +void delete_nodes(decoder_node_t * n) { + if (n) { + if(n->left) + delete_nodes(n->left); + if(n->right) + delete_nodes(n->right); + free(n->alpha); + free(n->beta); + free(n); + } +} + +void delete_decoder_tree(t_nrPolar_params *polarParams) { + if (polarParams->tree.root) + delete_nodes(polarParams->tree.root); +} + void build_decoder_tree(t_nrPolar_params *polarParams) { polarParams->tree.num_nodes=0; diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h index 4e32c66127..de6e2c3222 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h @@ -332,5 +332,6 @@ static inline void nr_polar_deinterleaver(uint8_t *input, { for (int i=0; iN==512 || polarParams->N==256 || polarParams->N==128,"N = %d, not done yet\n",polarParams->N); // build G bit vectors for information bit positions and convert the bit as bytes tables in nr_polar_kronecker_power_matrices.c to 64 bit packed vectors. // keep only rows of G which correspond to information/crc bits - polarParams->G_N_tab = (uint64_t **)malloc((polarParams->K + polarParams->n_pc) * sizeof(int64_t *)); + polarParams->G_N_tab = (uint64_t **)calloc((polarParams->K + polarParams->n_pc),sizeof(int64_t *)); int k=0; for (int i=0; iN; i++) { diff --git a/openair1/PHY/CODING/nr_polar_init.c b/openair1/PHY/CODING/nr_polar_init.c index f6a700117d..5fd5ff404b 100644 --- a/openair1/PHY/CODING/nr_polar_init.c +++ b/openair1/PHY/CODING/nr_polar_init.c @@ -36,6 +36,37 @@ static int intcmp(const void *p1,const void *p2) { return(*(int16_t *)p1 > *(int16_t *)p2); } +void nr_polar_delete(t_nrPolar_params * polarParams) { + delete_decoder_tree(polarParams); + //From build_polar_tables() + for (int k=0; k < polarParams->K + polarParams->n_pc; k++) + if (polarParams->G_N_tab[k]) + free(polarParams->G_N_tab[k]); + free(polarParams->G_N_tab); + free(polarParams->rm_tab); + if (polarParams->crc_generator_matrix) + free(polarParams->crc_generator_matrix); + //polar_encoder vectors: + free(polarParams->nr_polar_crc); + free(polarParams->nr_polar_aPrime); + free(polarParams->nr_polar_APrime); + free(polarParams->nr_polar_D); + free(polarParams->nr_polar_E); + //Polar Coding vectors + free(polarParams->nr_polar_U); + free(polarParams->nr_polar_CPrime); + free(polarParams->nr_polar_B); + free(polarParams->nr_polar_A); + free(polarParams->interleaving_pattern); + free(polarParams->deinterleaving_pattern); + free(polarParams->rate_matching_pattern); + free(polarParams->information_bit_pattern); + free(polarParams->Q_I_N); + free(polarParams->Q_F_N); + free(polarParams->Q_PC_N); + free(polarParams->channel_interleaver_pattern); + free(polarParams); +} static void nr_polar_init(t_nrPolar_params * *polarParams, int8_t messageType, @@ -151,7 +182,7 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, newPolarInitNode->deinterleaving_pattern[newPolarInitNode->interleaving_pattern[i]] = i; newPolarInitNode->rate_matching_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength); - uint16_t *J = malloc(sizeof(uint16_t) * newPolarInitNode->N); + uint16_t J[newPolarInitNode->N]; nr_polar_rate_matching_pattern(newPolarInitNode->rate_matching_pattern, J, nr_polar_subblock_interleaver_pattern, @@ -181,7 +212,6 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern, newPolarInitNode->i_bil, newPolarInitNode->encoderLength); - free(J); if (decoder_flag == 1) build_decoder_tree(newPolarInitNode); build_polar_tables(newPolarInitNode); init_polar_deinterleaver_table(newPolarInitNode); From 65c6456472d2045e41f150ce5ba52a04594f1f55 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 17 Feb 2022 17:48:37 +0100 Subject: [PATCH 159/196] Resolve buffer overflows polartest --- openair1/PHY/CODING/TESTBENCH/polartest.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c index af1228be07..409b91a8f6 100644 --- a/openair1/PHY/CODING/TESTBENCH/polartest.c +++ b/openair1/PHY/CODING/TESTBENCH/polartest.c @@ -158,14 +158,19 @@ if (logFlag){ #endif } - uint8_t testArrayLength = ceil(testLength / 32.0); - uint8_t coderArrayLength = ceil(coderLength / 32.0); - uint32_t testInput[max(2,testArrayLength)]; //generate randomly + const uint8_t testArrayLength = ceil(testLength / 32.0); + const uint8_t coderArrayLength = ceil(coderLength / 32.0); + // in the polar code, often uint64_t arrays are used, but we work with + // uint32_t arrays below, so realArrayLength is the length that always + // satisfies uint64_t array length + const uint8_t realArrayLength = ((testArrayLength + 1) / 2) * 2; + printf("testArrayLength %d realArrayLength %d\n", testArrayLength, realArrayLength); + uint32_t testInput[realArrayLength]; //generate randomly uint32_t encoderOutput[coderArrayLength]; - uint32_t estimatedOutput[testArrayLength]; //decoder output - memset(testInput,0,sizeof(uint32_t) * testArrayLength); + uint32_t estimatedOutput[realArrayLength]; //decoder output + memset(testInput,0,sizeof(uint32_t) * realArrayLength); // does not reset all memset(encoderOutput,0,sizeof(uint32_t) * coderArrayLength); - memset(estimatedOutput,0,sizeof(uint32_t) * testArrayLength); + memset(estimatedOutput,0,sizeof(uint32_t) * realArrayLength); uint8_t encoderOutputByte[coderLength]; double modulatedInput[coderLength]; //channel input double channelOutput[coderLength]; //add noise @@ -334,9 +339,9 @@ if (logFlag){ decoderState=0; nBitError=0; blockErrorState=0; - memset(testInput,0,sizeof(uint32_t) * testArrayLength); + memset(testInput,0,sizeof(uint32_t) * realArrayLength); memset(encoderOutput,0,sizeof(uint32_t) * coderArrayLength); - memset(estimatedOutput,0,sizeof(uint32_t) * testArrayLength); + memset(estimatedOutput,0,sizeof(uint32_t) * realArrayLength); } //Calculate error statistics for the SNR. From 2251453cbdbc649f5df9c84f0f9857e16a651a19 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 14:42:05 +0100 Subject: [PATCH 160/196] Fix nr_dlschsim: correct size for N_RB_DL Fix warning, drop undefined function --- openair1/PHY/NR_TRANSPORT/nr_ulsch.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 5 ++--- openair1/SCHED_NR_UE/defs.h | 3 --- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h index 9929ee0602..0791fd2bbc 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h @@ -33,7 +33,7 @@ #include "PHY/defs_gNB.h" #include "common/utils/threadPool/thread-pool.h" -void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch,uint8_t N_RB_UL); +void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch, uint16_t N_RB_UL); NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index af67c03481..e9ed278bb1 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -54,7 +54,7 @@ //extern double cpuf; -void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr,uint8_t N_RB_UL) +void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL) { int i,r; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index f02e0ebd8a..a9b8ce2e55 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -79,7 +79,7 @@ void init_dlsch_tpool(uint8_t num_dlsch_threads) { free(params); } -void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr,uint8_t N_RB_DL) { +void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) { int i,r; uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated NR_UE_DLSCH_t *dlsch=*dlschptr; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index 504ab93889..e956d9ea51 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -50,7 +50,7 @@ \brief This function frees memory allocated for a particular DLSCH at UE @param dlsch Pointer to DLSCH to be removed */ -void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch,uint8_t N_RB_DL); +void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch, uint16_t N_RB_DL); /** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index a3e0b668d0..d77fe35047 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -107,7 +107,6 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,unsigned char N_RB_UL) NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids) { - unsigned char exit_flag = 0,i,r; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated if (N_RB_UL != 273) { @@ -127,7 +126,7 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids) //for (i=0; i<10; i++) //ulsch->harq_ids[i] = 0; - for (i=0; iharq_processes[i] = malloc16(sizeof(NR_UL_UE_HARQ_t)); DevAssert(ulsch->harq_processes[i]); @@ -141,7 +140,7 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids) DevAssert(ulsch->harq_processes[i]->b); bzero(ulsch->harq_processes[i]->b,ulsch_bytes); - for (r=0; rharq_processes[i]->c[r] = malloc16(8448); DevAssert(ulsch->harq_processes[i]->c[r]); diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index b85d4c1b50..c362bb470f 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -295,9 +295,6 @@ uint8_t nr_pdcch_alloc2ul_subframe(NR_DL_FRAME_PARMS *frame_parms,uint8_t n); uint32_t nr_pdcch_alloc2ul_frame(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n); -uint16_t nr_get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1); - - int8_t nr_find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); /*! \brief UL time alignment procedures for TA application From d6012090363dd7b3662a70dd89a175b96c5dc26a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 14:54:30 +0100 Subject: [PATCH 161/196] Fix nr_ulschsim: correct size for N_RB_UL --- openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index e956d9ea51..9bc3643557 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -64,7 +64,7 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch, uint16_t N_RB_DL); NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL); -void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch,unsigned char N_RB_UL); +void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch, uint16_t N_RB_UL); NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index d77fe35047..0ab4c94b96 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -43,7 +43,7 @@ //#define DEBUG_ULSCH_CODING -void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,unsigned char N_RB_UL) +void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL) { int i, r; From 3f4fa05c7498ceac60af2dc964a732a5c43f6b52 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 15:07:05 +0100 Subject: [PATCH 162/196] nr_pucchsim: correctly free SR PDU --- openair1/SIMULATION/NR_PHY/pucchsim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 2339e988f1..084a735204 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -653,6 +653,7 @@ int main(int argc, char **argv) if(sr_flag==1){ if (uci_pdu.sr->sr_indication == 0 || uci_pdu.sr->sr_confidence_level == 1) sr_errors+=1; + free(uci_pdu.sr); } // harq value 0 -> pass nfapi_nr_harq_t *harq_list = uci_pdu.harq->harq_list; From fe61216a66b93a82fcb8bc32c5f31da8e964afe0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 15:48:05 +0100 Subject: [PATCH 163/196] Correctly free memory in nr_pbchsim Except for: - polar code --- openair1/SIMULATION/NR_PHY/pbchsim.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index a141dfbe9e..f3a8d21fdd 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -27,6 +27,7 @@ #include #include "common/config/config_userapi.h" #include "common/utils/LOG/log.h" +#include "common/utils/load_module_shlib.h" #include "common/ran_context.h" #include "common/utils/nr/nr_common.h" #include "PHY/types.h" @@ -775,6 +776,15 @@ int main(int argc, char **argv) } // NSR + free_channel_desc_scm(gNB2UE); + + phy_free_nr_gNB(gNB); + free(RC.gNB[0]); + free(RC.gNB); + + term_nr_ue_signal(UE, 1); + free(UE); + for (i=0; i<2; i++) { free(s_re[i]); free(s_im[i]); @@ -795,6 +805,9 @@ int main(int argc, char **argv) if (input_fd) fclose(input_fd); + loader_reset(); + logTerm(); + return(n_errors); } From cdea2899bc531e4dce0f4c51e2c7300de836283c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 16:24:51 +0100 Subject: [PATCH 164/196] Remove memory leaks from ldpctest except for: - config module --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 59 +++++++----------------- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index 371deba3f2..58d649d011 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -25,6 +25,7 @@ #include #include "assertions.h" #include "SIMULATION/TOOLS/sim.h" +#include "common/utils/load_module_shlib.h" #include "PHY/CODING/nrLDPC_extern.h" //#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h" #include "openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.h" @@ -118,15 +119,13 @@ int test_ldpc(short No_iteration, //short test_input[block_length]; unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};; //short *c; //padded codeword - unsigned char *estimated_output[MAX_NUM_DLSCH_SEGMENTS]; - unsigned char *estimated_output_bit[MAX_NUM_DLSCH_SEGMENTS]; - unsigned char *test_input_bit; + unsigned char estimated_output[MAX_NUM_DLSCH_SEGMENTS][block_length]; + memset(estimated_output, 0, sizeof(estimated_output)); unsigned char *channel_input[MAX_NUM_DLSCH_SEGMENTS]; - unsigned char *channel_output_uncoded[MAX_NUM_DLSCH_SEGMENTS]; unsigned char *channel_input_optim[MAX_NUM_DLSCH_SEGMENTS]; - double *channel_output; - double *modulated_input[MAX_NUM_DLSCH_SEGMENTS]; - char *channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS]; + //double channel_output[68 * 384]; + double modulated_input[MAX_NUM_DLSCH_SEGMENTS][68 * 384] = { 0 }; + char channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS][68 * 384] = { 0 }; unsigned int i,j,trial=0; short BG=0,nrows=0;//,ncols; int no_punctured_columns,removed_bit; @@ -155,24 +154,12 @@ int test_ldpc(short No_iteration, // generate input block for(j=0;j>(i&7); - test_input_bit[i] = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); // Further correct for multiple segments - if (estimated_output_bit[j][i] != test_input_bit[i]) - { + unsigned char estoutputbit = (estimated_output[j][i/8]&(1<<(i&7)))>>(i&7); + unsigned char inputbit = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); // Further correct for multiple segments + if (estoutputbit != inputbit) *errors_bit = (*errors_bit) + 1; - } } //if (*errors == 1000) @@ -460,17 +441,8 @@ int test_ldpc(short No_iteration, for(j=0;j Date: Fri, 18 Feb 2022 19:42:21 +0100 Subject: [PATCH 165/196] Do not create CMakeLists.txt; new build_oai option -d --- cmake_targets/CMakeLists.txt | 6 +- cmake_targets/build_oai | 165 ++++++++++++++--------------------- 2 files changed, 67 insertions(+), 104 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index a4624066ae..68f53132d2 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -21,7 +21,8 @@ # Author: laurent THOMAS, Lionel GAUTHIER -cmake_minimum_required (VERSION 3.0) +cmake_minimum_required (VERSION 2.8) +project (OpenAirInterface LANGUAGES C CXX) # System packages that are required @@ -341,7 +342,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11") - +add_boolean_option(SANITIZE_ADDRESS False "enable the address sanitizer (ASan)") if (SANITIZE_ADDRESS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common") @@ -788,7 +789,6 @@ add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU") -add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET") #NOKIA config enhancement set (CONFIG_ROOTDIR ${OPENAIR_DIR}/common/config diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index c2b6305831..6b19047cdc 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -39,34 +39,24 @@ conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf XFORMS="True" SKIP_SHARED_LIB_FLAG="False" -UE_EXPANSION="False" PRINT_STATS="False" -VCD_TIMING="False" DEADLINE_SCHEDULER_FLAG_USER="" -CPU_AFFINITY_FLAG_USER="False" #Only valid when low-latency flag is set to False REL="Rel15" HW="None" TP="Ethernet" EPC=0 VERBOSE_CI=0 VERBOSE_COMPILE=0 -CFLAGS_PROCESSOR_USER="" RUN_GROUP=0 TEST_CASE_GROUP="" +BUILD_DIR=ran_build BUILD_DOXYGEN=0 BUILD_COVERITY_SCAN=0 -T_TRACER="True" DISABLE_HARDWARE_DEPENDENCY="False" CMAKE_BUILD_TYPE="RelWithDebInfo" CMAKE_CMD="$CMAKE" -UE_AUTOTEST_TRACE="False" -UE_DEBUG_TRACE="False" -UE_TIMING_TRACE="False" -USRP_REC_PLAY="False" BUILD_ECLIPSE=0 NR="False" -ITTI_SIM="False" -SANITIZE_ADDRESS="False" OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope" RU=0 trap handle_ctrl_c INT @@ -82,6 +72,8 @@ Options Erase all files made by previous compilations, installations --clean-kernel Erase previously installed features in kernel: iptables, drivers, ... +-d | --build-dir + Sets build directory (will be /cmake_targets//build) -I | --install-external-packages Installs required packages such as LibXML, asn1.1 compiler, freediameter, ... This option will require root password @@ -201,6 +193,9 @@ function main() { clean_kernel echo_info "Erased iptables config and removed modules from kernel" shift;; + -d | --build-dir) + BUILD_DIR=$2 + shift;; -I | --install-external-packages) INSTALL_EXTERNAL=1 echo_info "Will install external packages" @@ -275,7 +270,7 @@ function main() { echo_info "Will compile NR UE" shift;; --mu) - UE_EXPANSION="True" + CMAKE_CMD="$CMAKE_CMD -DUE_EXPANSION=True -DPRE_SCD_THREAD=True" echo_info "Will compile with UE_EXPANSION" shift;; --UE-conf-nvram) @@ -299,7 +294,9 @@ function main() { *) echo_fatal "Unknown HW type $HW: exit..." esac - echo_info "Setting hardware to: $HW" + echo_info "Setting hardware to: $HW" + #CMAKE_CMD="$CMAKE_CMD -DRF_BOARD=\"${HW}\"" + CMAKE_CMD="$CMAKE_CMD -DRF_BOARD=${HW}" shift 2;; -t | --transport) TP=$2 @@ -323,7 +320,7 @@ function main() { shift 2;; -V | --vcd) echo_info "Setting gtk-wave output" - VCD_TIMING=1 + CMAKE_CMD="$CMAKE_CMD -DENABLE_VCD_FIFO=True" EXE_ARGUMENTS="$EXE_ARGUMENTS -V" shift;; -x | --xforms) @@ -348,8 +345,8 @@ function main() { echo_info "Will compile with verbose instructions" shift;; --cflags_processor) - CFLAGS_PROCESSOR_USER=$2 - echo_info "Setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER" + CMAKE_CMD="$CMAKE_CMD -DCFLAGS_PROCESSOR_USER=\"$2\"" + echo_info "Setting CPU FLAGS from USER to: $2" shift 2;; --build-doxygen) BUILD_DOXYGEN=1 @@ -361,22 +358,26 @@ function main() { shift;; --disable-deadline) DEADLINE_SCHEDULER_FLAG_USER="False" + CMAKE_CMD="$CMAKE_CMD -DDEADLINE_SCHEDULER=False" echo_info "Disabling the usage of deadline scheduler" shift 1;; --enable-deadline) DEADLINE_SCHEDULER_FLAG_USER="True" + CMAKE_CMD="$CMAKE_CMD -DDEADLINE_SCHEDULER=True" echo_info "Enabling the usage of deadline scheduler" shift 1;; --enable-cpu-affinity) CPU_AFFINITY_FLAG_USER="True" + CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=True" echo_info "Enabling CPU Affinity (only valid when not using deadline scheduler)" shift 1;; --disable-cpu-affinity) CPU_AFFINITY_FLAG_USER="False" + CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=False" echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)" shift 1;; --disable-T-Tracer) - T_TRACER="False" + CMAKE_CMD="$CMAKE_CMD -DT_TRACER=False" echo_info "Disabling the T tracer" shift 1;; --disable-hardware-dependency) @@ -384,15 +385,15 @@ function main() { DISABLE_HARDWARE_DEPENDENCY="True" shift 1;; --ue-autotest-trace) - UE_AUTOTEST_TRACE="True" + CMAKE_CMD="$CMAKE_CMD -DUE_AUTOTEST_TRACE=True" echo_info "Enabling autotest specific trace for UE" shift 1;; --ue-trace) - UE_DEBUG_TRACE="True" + CMAKE_CMD="$CMAKE_CMD -DUE_DEBUG_TRACE=False" echo_info "Enabling UE trace for debug" shift 1;; --ue-timing) - UE_TIMING_TRACE="True" + CMAKE_CMD="$CMAKE_CMD -DUE_TIMING_TRACE=True" echo_info "Enabling UE timing trace" shift 1;; --uhd-images-dir) @@ -423,24 +424,20 @@ function main() { fi fi shift 2;; - --usrp-recplay) - USRP_REC_PLAY="True" - echo_info "Enabling USRP record playback mode" - shift 1;; -k | --skip-shared-libraries) SKIP_SHARED_LIB_FLAG="True" echo_info "Skipping build of shared libraries, rfsimulator and transport protocol libraries" shift;; - --ninja) - CMAKE_CMD="$CMAKE_CMD -GNinja" - MAKE_CMD=ninja - shift;; - --sanitize-address | -fsanitize=address) - SANITIZE_ADDRESS=True - shift;; - --ittiSIM) + --ninja) + CMAKE_CMD="$CMAKE_CMD -GNinja" + MAKE_CMD=ninja + shift;; + --sanitize-address | -fsanitize=address) + CMAKE_CMD="$CMAKE_CMD -DSANITIZE_ADDRESS=True" + shift;; + --ittiSIM) ittiSIM=1 - ITTI_SIM="True" + CMAKE_CMD="$CMAKE_CMD -DITTI_SIM=True" echo_info "Will compile itti simulator" shift;; -h | --help) @@ -466,9 +463,6 @@ function main() { fi fi - CMAKE_CMD="$CMAKE_CMD .." - echo_info "CMAKE_CMD=$CMAKE_CMD" - ######################################################## # Check validity of HW and TP parameters for eNB / gNB # ######################################################## @@ -508,6 +502,7 @@ function main() { #Disable CPU Affinity for deadline scheduler if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then CPU_AFFINITY_FLAG_USER="False" + CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=False" fi echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER" @@ -585,45 +580,13 @@ function main() { echo_info "3. building the compilation directives ..." DIR=$OPENAIR_DIR/cmake_targets - if [ "$T_TRACER" = "False" ] ; then - build_dir=ran_build_noLOG - else - build_dir=ran_build - fi - [ "$CLEAN" = "1" ] && rm -rf $DIR/$build_dir/build - mkdir -p $DIR/$build_dir/build + [ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build + mkdir -p $DIR/$BUILD_DIR/build -# configuration module libraries, one currently available, using libconfig - config_libconfig_shlib=params_libconfig - - # first generate the CMakefile in the right directory - # softmodem compilation - - cmake_file=$DIR/$build_dir/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "project (OpenAirInterface)" >> $cmake_file - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file - # echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file - echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file - echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file - echo "set ( PACKAGE_NAME \"${exec}\")" >> $cmake_file - echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >> $cmake_file - echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >> $cmake_file - echo "set ( T_TRACER $T_TRACER )" >> $cmake_file - echo "set ( UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE )" >> $cmake_file - echo "set ( UE_DEBUG_TRACE $UE_DEBUG_TRACE )" >> $cmake_file - echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file - echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file - echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file - echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file - echo "set ( SANITIZE_ADDRESS $SANITIZE_ADDRESS )" >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file - cd $DIR/$build_dir/build + cd $DIR/$BUILD_DIR/build + CMAKE_CMD="$CMAKE_CMD ../.." + echo_info "running $CMAKE_CMD" eval $CMAKE_CMD execlist="" @@ -653,7 +616,7 @@ function main() { for f in $execlist ; do echo_info "Compiling $f..." compilations \ - $build_dir $f \ + $BUILD_DIR $f \ $f $dbin/$f.$REL done @@ -662,13 +625,16 @@ function main() { if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then echo_info "Building shared libraries common to UE and gNB" + + # configuration module libraries, one currently available, using libconfig + config_libconfig_shlib=params_libconfig compilations \ - $build_dir $config_libconfig_shlib \ + $BUILD_DIR $config_libconfig_shlib \ lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so compilations \ - $build_dir coding \ + $BUILD_DIR coding \ libcoding.so $dbin/libcoding.so fi @@ -681,7 +647,7 @@ function main() { then echo_info "Building ue_ip module" compilations \ - $build_dir ue_ip \ + $BUILD_DIR ue_ip \ CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko else echo_info "Bypassing ue_ip build" @@ -712,16 +678,16 @@ function main() { # generate USIM data if [ -f $dbin/conf2uedata ]; then install_nas_tools $conf_nvram_path $gen_nvram_path "$dlog/conf2uedata.txt" - echo_info "Copying UE specific part to $DIR/$build_dir/build" - cp -Rvf $dbin/.ue_emm.nvram0 $DIR/$build_dir/build - cp -Rvf $dbin/.ue.nvram0 $DIR/$build_dir/build - cp -Rvf $dbin/.usim.nvram0 $DIR/$build_dir/build + echo_info "Copying UE specific part to $DIR/$BUILD_DIR/build" + cp -Rvf $dbin/.ue_emm.nvram0 $DIR/$BUILD_DIR/build + cp -Rvf $dbin/.ue.nvram0 $DIR/$BUILD_DIR/build + cp -Rvf $dbin/.usim.nvram0 $DIR/$BUILD_DIR/build else echo_warning "not generated UE NAS files: binaries not found" fi fi - cd $DIR/$build_dir/build + cd $DIR/$BUILD_DIR/build ################## # PHY simulators # @@ -739,9 +705,6 @@ function main() { compilations \ ran_build coding \ libcoding.so $dbin/libcoding.so -# compilations \ -# lte-simulators $config_libconfig_shlib \ -# lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so fi ################### @@ -763,14 +726,14 @@ function main() { if [ "$HW" = "EXMIMO" ] ; then echo_info "Compiling Express MIMO 2 board drivers" compilations \ - $build_dir openair_rf \ + $BUILD_DIR openair_rf \ CMakeFiles/openair_rf/openair_rf.ko $dbin/openair_rf.ko compilations \ - $build_dir updatefw \ + $BUILD_DIR updatefw \ updatefw $dbin/updatefw echo_info "Compiling oarf tools. The logfile for compilation is here: $dlog/oarf.txt" - make -C $OPENAIR_DIR/cmake_targets/$build_dir/build oarf > $dlog/oarf.txt 2>&1 - cp $OPENAIR_DIR/cmake_targets/$build_dir/build/*.oct $dbin + make -C $OPENAIR_DIR/cmake_targets/$BUILD_DIR/build oarf > $dlog/oarf.txt 2>&1 + cp $OPENAIR_DIR/cmake_targets/$BUILD_DIR/build/*.oct $dbin if [ -s $dbin/oarf_config_exmimo.oct ] ; then echo_success "oarf tools compiled" else @@ -785,7 +748,7 @@ function main() { if [ ! -z "$BUILD_OPTLIB" ] ; then for oklib in $BUILD_OPTLIB ; do compilations \ - $build_dir $oklib \ + $BUILD_DIR $oklib \ lib${oklib}.so $dbin/lib${oklib}.so done fi @@ -859,7 +822,7 @@ function main() { # link liboai_device.so with the selected RF device library if [ "$HW" == "EXMIMO" ] ; then compilations \ - $build_dir oai_exmimodevif \ + $BUILD_DIR oai_exmimodevif \ liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL ln -sf liboai_exmimodevif.so liboai_device.so @@ -867,7 +830,7 @@ function main() { echo_info "liboai_device.so is linked to EXMIMO device library" elif [ "$HW" == "OAI_USRP" ] ; then compilations \ - $build_dir oai_usrpdevif \ + $BUILD_DIR oai_usrpdevif \ liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL ln -sf liboai_usrpdevif.so liboai_device.so @@ -876,7 +839,7 @@ function main() { elif [ "$HW" == "OAI_BLADERF" ] ; then if [ -f "/usr/include/libbladeRF.h" ] ; then compilations \ - $build_dir oai_bladerfdevif \ + $BUILD_DIR oai_bladerfdevif \ liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL fi @@ -886,7 +849,7 @@ function main() { elif [ "$HW" == "OAI_LMSSDR" ] ; then # if [ -f "/usr/include/libbladeRF.h" ] ; then compilations \ - $build_dir oai_lmssdrdevif \ + $BUILD_DIR oai_lmssdrdevif \ liboai_lmssdrdevif.so $dbin/liboai_lmssdrdevif.so.$REL # fi @@ -895,7 +858,7 @@ function main() { echo_info "liboai_device.so is linked to LMSSDR device library" elif [ "$HW" == "OAI_IRIS" ] ; then compilations \ - $build_dir oai_irisdevif \ + $BUILD_DIR oai_irisdevif \ liboai_irisdevif.so $dbin/liboai_irisdevif.so.$REL ln -s liboai_irisdevif.so liboai_device.so @@ -915,7 +878,7 @@ function main() { echo_info "liboai_device.so is linked to ADRV9371_ZC706 device library for Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN" elif [ "$HW" == "OAI_AW2SORI" ] ; then compilations \ - $build_dir aw2sori_transpro \ + $BUILD_DIR aw2sori_transpro \ libaw2sori_transpro.so $dbin/libaw2sori_transpro.so.$REL ln -sf libaw2sori_transpro.so libthirdparty_transpro.so @@ -930,12 +893,12 @@ function main() { if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then echo_info "Compiling rfsimulator" compilations \ - $build_dir rfsimulator \ + $BUILD_DIR rfsimulator \ librfsimulator.so $dbin/librfsimulator.so.$REL echo_info "Compiling tcp_bridge_oai" compilations \ - $build_dir tcp_bridge_oai \ + $BUILD_DIR tcp_bridge_oai \ libtcp_bridge_oai.so $dbin/libtcp_bridge_oai.so.$REL fi @@ -946,7 +909,7 @@ function main() { rm -f $dbin/liboai_transpro.so if [ "$TP" == "Ethernet" ]; then compilations \ - $build_dir oai_eth_transpro \ + $BUILD_DIR oai_eth_transpro \ liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL ln -sf liboai_eth_transpro.so liboai_transpro.so ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so @@ -954,7 +917,7 @@ function main() { fi if [ "$TP" == "benetel4g" ]; then compilations \ - $build_dir benetel_4g \ + $BUILD_DIR benetel_4g \ libbenetel_4g.so $dbin/libbenetel_4g.$REL ln -sf libbenetel_4g.so liboai_transpro.so ln -sf $dbin/libbenetel_4g.so.$REL $dbin/liboai_transpro.so @@ -962,7 +925,7 @@ function main() { fi if [ "$TP" == "benetel5g" ]; then compilations \ - $build_dir benetel_5g \ + $BUILD_DIR benetel_5g \ libbenetel_5g.so $dbin/libbenetel_5g.$REL ln -sf libbenetel_5g.so liboai_transpro.so ln -sf $dbin/libbenetel_5g.so.$REL $dbin/liboai_transpro.so From 990385eea0f371987edada279c6d30c8fd279203 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 15 Nov 2020 23:47:17 +0100 Subject: [PATCH 166/196] Move CMake macro definitions to separate file --- cmake_targets/CMakeLists.txt | 101 +---------------------------------- cmake_targets/macros.cmake | 98 +++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 100 deletions(-) create mode 100644 cmake_targets/macros.cmake diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 68f53132d2..5d5306fe93 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -24,6 +24,7 @@ cmake_minimum_required (VERSION 2.8) project (OpenAirInterface LANGUAGES C CXX) +include("macros.cmake") # System packages that are required # We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/ @@ -185,106 +186,6 @@ else (CUDA_FOUND) message ("No CUDA tool installed") endif () - -########################################### -# macros to define options as there is numerous options in oai -################################################ -macro(add_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - add_definitions("-D${name}=${value}") -endmacro(add_option) - -macro(add_boolean_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - set_property(CACHE ${name} PROPERTY TYPE BOOL) - if (${value}) - add_definitions("-D${name}") - endif (${value}) -endmacro(add_boolean_option) - -macro(add_integer_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - add_definitions("-D${name}=${value}") -endmacro(add_integer_option) - -macro(add_list1_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) - if(NOT "${value}" STREQUAL "False") - add_definitions("-D${name}=${value}") - endif() -endmacro(add_list1_option) - -macro(add_list2_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) - if(NOT "${value}" STREQUAL "False") - add_definitions("-D${value}=1") - endif() -endmacro(add_list2_option) - -macro(add_list_string_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) - if(NOT "${value}" STREQUAL "False") - add_definitions("-D${name}=\"${value}\"") - endif() -endmacro(add_list_string_option) - -# this function should produce the same value as the macro MAKE_VERSION defined in the C code (file types.h) -function(make_version VERSION_VALUE) - math(EXPR RESULT "0") - foreach (ARG ${ARGN}) - math(EXPR RESULT "${RESULT} * 16 + ${ARG}") - endforeach() - set(${VERSION_VALUE} "${RESULT}" PARENT_SCOPE) -endfunction() - -macro(compile_asn1 asn1Source asn1cCmd ResultFlag) - # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make - execute_process(COMMAND ${asn1cCmd} ${asn1Source} RESULT_VARIABLE ret) - - if (NOT ${ret} STREQUAL 0) - message(FATAL_ERROR "${ret}: error") - endif (NOT ${ret} STREQUAL 0) - - add_custom_target ( - ${ResultFlag} ALL - ${asn1cCmd} ${asn1Source} - DEPENDS ${asn1Source} - ) -endmacro(compile_asn1) - #################################################### # compilation flags ############################################# diff --git a/cmake_targets/macros.cmake b/cmake_targets/macros.cmake new file mode 100644 index 0000000000..0417420af4 --- /dev/null +++ b/cmake_targets/macros.cmake @@ -0,0 +1,98 @@ +########################################### +# macros to define options as there is numerous options in oai +################################################ +macro(add_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + add_definitions("-D${name}=${value}") +endmacro(add_option) + +macro(add_boolean_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + set_property(CACHE ${name} PROPERTY TYPE BOOL) + if (${value}) + add_definitions("-D${name}") + endif (${value}) +endmacro(add_boolean_option) + +macro(add_integer_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + add_definitions("-D${name}=${value}") +endmacro(add_integer_option) + +macro(add_list1_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) + if(NOT "${value}" STREQUAL "False") + add_definitions("-D${name}=${value}") + endif() +endmacro(add_list1_option) + +macro(add_list2_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) + if(NOT "${value}" STREQUAL "False") + add_definitions("-D${value}=1") + endif() +endmacro(add_list2_option) + +macro(add_list_string_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) + if(NOT "${value}" STREQUAL "False") + add_definitions("-D${name}=\"${value}\"") + endif() +endmacro(add_list_string_option) + +# this function should produce the same value as the macro MAKE_VERSION defined in the C code (file types.h) +function(make_version VERSION_VALUE) + math(EXPR RESULT "0") + foreach (ARG ${ARGN}) + math(EXPR RESULT "${RESULT} * 16 + ${ARG}") + endforeach() + set(${VERSION_VALUE} "${RESULT}" PARENT_SCOPE) +endfunction() + +macro(compile_asn1 asn1Source asn1cCmd ResultFlag) + # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make + execute_process(COMMAND ${asn1cCmd} ${asn1Source} RESULT_VARIABLE ret) + + if (NOT ${ret} STREQUAL 0) + message(FATAL_ERROR "${ret}: error") + endif (NOT ${ret} STREQUAL 0) + + add_custom_target ( + ${ResultFlag} ALL + ${asn1cCmd} ${asn1Source} + DEPENDS ${asn1Source} + ) +endmacro(compile_asn1) From f51590b54684511e655d3947e26f880b7de0a8ed Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 20:22:07 +0100 Subject: [PATCH 167/196] Don't leak check in {nr_,}{d,u}lsim, fix buffer overflows in dlsim --- cmake_targets/CMakeLists.txt | 3 +-- openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 2 +- openair1/SIMULATION/LTE_PHY/dlsim.c | 11 +++++++++-- openair1/SIMULATION/NR_PHY/dlsim.c | 6 ++++++ openair1/SIMULATION/NR_PHY/ulsim.c | 6 ++++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 5d5306fe93..7c60d316e1 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -50,6 +50,7 @@ include_directories(${CRYPTO_INCLUDE_DIRS}) #uhd 4.0 and iris installs by default in /usr/local include_directories("/usr/local/include/") #use native cmake method as this package is not in pkg-config +add_list2_option(RF_BOARD "None" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU" "EXMIMO") if (${RF_BOARD} STREQUAL "OAI_USRP") find_package(Boost REQUIRED) include_directories(${LIBBOOST_INCLUDE_DIR}) @@ -688,8 +689,6 @@ add_library(F1AP ${F1AP_C_FILES} ) add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4") add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4") -add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU") - #NOKIA config enhancement set (CONFIG_ROOTDIR ${OPENAIR_DIR}/common/config diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index a7054a44d2..0b665737a7 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -6481,7 +6481,7 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *c sprintf(fname,"dlsch%d_rxF_r%d_uespec0.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_uespec0",eNB_id,round); LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_uespec_pilots[0], - 12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1); + 12*(ue->frame_parms.N_RB_DL),1,1); /* LOG_M("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*NSYMB,1,1); LOG_M("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*NSYMB,1,1); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index c1443700f3..8f9fcae563 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -64,6 +64,13 @@ void feptx_ofdm(RU_t *ru, int frame, int subframe); void feptx_prec(RU_t *ru, int frame, int subframe); +const char *__asan_default_options() +{ + /* don't do leak checking in nr_ulsim, not finished yet */ + return "detect_leaks=0"; +} + + double cpuf; #define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0)) //#define MCS_COUNT 23//added for PHY abstraction @@ -1538,9 +1545,9 @@ int main(int argc, char **argv) { LOG_M("txsig0.m","txs0", &ru->common.txdata[0][subframe* eNB->frame_parms.samples_per_tti], eNB->frame_parms.samples_per_tti,1,1); if (transmission_mode<7) { - LOG_M("txsigF0.m","txsF0x", &ru->common.txdataF_BF[0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); + LOG_M("txsigF0.m","txsF0x", &ru->common.txdataF_BF[0][0],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); } else if (transmission_mode == 7) { - LOG_M("txsigF0.m","txsF0", &ru->common.txdataF_BF[5][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); + LOG_M("txsigF0.m","txsF0", &ru->common.txdataF_BF[5][0],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); LOG_M("txsigF0_BF.m","txsF0_BF", &ru->common.txdataF_BF[0][0],eNB->frame_parms.ofdm_symbol_size,1,1); } } diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 8e20a84f81..acbb6e323d 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -73,6 +73,12 @@ #include #include +const char *__asan_default_options() +{ + /* don't do leak checking in nr_ulsim, not finished yet */ + return "detect_leaks=0"; +} + LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC; rlc_info_t Rlc_info_um,Rlc_info_am_config; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 3a7381062f..99434413c8 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -68,6 +68,12 @@ #include //#define DEBUG_ULSIM +const char *__asan_default_options() +{ + /* don't do leak checking in nr_ulsim, not finished yet */ + return "detect_leaks=0"; +} + LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC; rlc_info_t Rlc_info_um,Rlc_info_am_config; From 32824030f418e50479366c1c27d0c9c4a4b9ad10 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 19 Feb 2022 10:12:07 +0100 Subject: [PATCH 168/196] Fix cmake command target CMakeLists.txt --- cmake_targets/build_oai | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 6b19047cdc..930f2a7f77 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -585,9 +585,8 @@ function main() { mkdir -p $DIR/$BUILD_DIR/build cd $DIR/$BUILD_DIR/build - CMAKE_CMD="$CMAKE_CMD ../.." echo_info "running $CMAKE_CMD" - eval $CMAKE_CMD + eval $CMAKE_CMD ../.. execlist="" if [ "$eNB" = "1" ] ; then @@ -664,7 +663,7 @@ function main() { mkdir -p $DIR/nas_sim_tools/build cd $DIR/nas_sim_tools/build - eval $CMAKE_CMD + eval $CMAKE_CMD .. compilations \ nas_sim_tools usim \ usim $dbin/usim @@ -946,7 +945,7 @@ function main() { [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build cd $OPENAIR_DIR/cmake_targets/doxygen/build - eval $CMAKE_CMD + eval $CMAKE_CMD .. make doc ) >& $doxygen_log fi From 0ad3faaf2a07d53742e12bd30bf3a80918c52fe3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 19 Feb 2022 13:50:11 +0100 Subject: [PATCH 169/196] Disable ASAN on ulsim --- openair1/SIMULATION/LTE_PHY/ulsim.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 1b1058535e..8f275bbd91 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -58,6 +58,12 @@ #include "common/ran_context.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h" +const char *__asan_default_options() +{ + /* don't do leak checking in ulsim, not finished yet */ + return "detect_leaks=0"; +} + double cpuf; #define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0)) //#define MCS_COUNT 23//added for PHY abstraction From e8278de15ce7be1d393e382cd6636fb8c34b3b7b Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 21 Feb 2022 12:09:25 +0100 Subject: [PATCH 170/196] fix for 5G NR UL transform precoding get_index_for_dmrs_lowpapr_seq() was accessing the array dmrs_ul_allocated_res[] out of bounds. --- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c index 69a9722664..c3c4c7a2ee 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c @@ -122,23 +122,20 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, *********************************************************************/ int16_t get_index_for_dmrs_lowpapr_seq(int16_t num_dmrs_res) { - - int16_t index = -1; - - if (num_dmrs_res >= dmrs_ul_allocated_res[(MAX_INDEX_DMRS_UL_ALLOCATED_REs-1)]) + + int16_t index = num_dmrs_res/6 - 1; + + if (index >= MAX_INDEX_DMRS_UL_ALLOCATED_REs) index = MAX_INDEX_DMRS_UL_ALLOCATED_REs-1; - else - index = (num_dmrs_res/6) -1; for (;index >= 0; index--) { if (dmrs_ul_allocated_res[index] == num_dmrs_res) break; - } - LOG_D(PHY, "num_dmrs_res: %d INDEX RETURNED: %d", num_dmrs_res, index); - return index; + LOG_D(PHY, "num_dmrs_res: %d INDEX RETURNED: %d", num_dmrs_res, index); + return index; } /******************************************************************* From 9aba6d722b23c69e8ce87caf0682d3a8e5fb337e Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 21 Feb 2022 13:05:23 +0100 Subject: [PATCH 171/196] fix bugs in polar encode, when len+crc_len>64 --- .../CODING/nrPolar_tools/nr_polar_encoder.c | 49 +++++++++-------- openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c | 2 +- openair1/SIMULATION/NR_PHY/pucchsim.c | 53 ++++++++++--------- 3 files changed, 54 insertions(+), 50 deletions(-) diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c index 3bbae7ece0..01ea511afe 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c @@ -422,7 +422,6 @@ void polar_encoder_fast(uint64_t *A, // AssertFatal(polarParams->K > 32, "K = %d < 33, is not supported yet\n",polarParams->K); AssertFatal(polarParams->K < 129, "K = %d > 128, is not supported yet\n",polarParams->K); AssertFatal(polarParams->payloadBits < 65, "payload bits = %d > 64, is not supported yet\n",polarParams->payloadBits); - uint64_t B[4]= {0,0,0,0},Cprime[4]= {0,0,0,0}; int bitlen = polarParams->payloadBits; // append crc AssertFatal(bitlen<129,"support for payloads <= 128 bits\n"); @@ -451,9 +450,12 @@ void polar_encoder_fast(uint64_t *A, A32_flip[1+offset]=((uint8_t *)&Aprime)[2]; A32_flip[2+offset]=((uint8_t *)&Aprime)[1]; A32_flip[3+offset]=((uint8_t *)&Aprime)[0]; - if (polarParams->crcParityBits == 24) tcrc = (uint64_t)(((crcmask^(crc24c(A32_flip,8*offset+bitlen)>>8)))&0xffffff); - else if (polarParams->crcParityBits == 11) tcrc = (uint64_t)(((crcmask^(crc11(A32_flip,bitlen)>>21)))&0x7ff); - else if (polarParams->crcParityBits == 6) tcrc = (uint64_t)(((crcmask^(crc6(A32_flip,bitlen)>>26)))&0x3f); + if (polarParams->crcParityBits == 24) + tcrc = (uint64_t)(((crcmask^(crc24c(A32_flip,8*offset+bitlen)>>8)))&0xffffff); + else if (polarParams->crcParityBits == 11) + tcrc = (uint64_t)(((crcmask^(crc11(A32_flip,bitlen)>>21)))&0x7ff); + else if (polarParams->crcParityBits == 6) + tcrc = (uint64_t)(((crcmask^(crc6(A32_flip,bitlen)>>26)))&0x3f); } else if (bitlen<=64) { uint8_t A64_flip[8+offset]; if (ones_flag) { @@ -470,8 +472,10 @@ void polar_encoder_fast(uint64_t *A, A64_flip[5+offset]=((uint8_t *)&Aprime)[2]; A64_flip[6+offset]=((uint8_t *)&Aprime)[1]; A64_flip[7+offset]=((uint8_t *)&Aprime)[0]; - if (polarParams->crcParityBits == 24) tcrc = (uint64_t)((crcmask^(crc24c(A64_flip,8*offset+bitlen)>>8)))&0xffffff; - else if (polarParams->crcParityBits == 11) tcrc = (uint64_t)((crcmask^(crc11(A64_flip,bitlen)>>21)))&0x7ff; + if (polarParams->crcParityBits == 24) + tcrc = (uint64_t)((crcmask^(crc24c(A64_flip,8*offset+bitlen)>>8)))&0xffffff; + else if (polarParams->crcParityBits == 11) + tcrc = (uint64_t)((crcmask^(crc11(A64_flip,bitlen)>>21)))&0x7ff; } else if (bitlen<=128) { uint8_t A128_flip[16+offset]; @@ -481,38 +485,37 @@ void polar_encoder_fast(uint64_t *A, A128_flip[2] = 0xff; } uint128_t Aprime= (uint128_t)(((uint128_t)*A)<<(128-bitlen)); - A128_flip[0+offset]=((uint8_t*)&Aprime)[15]; A128_flip[1+offset]=((uint8_t*)&Aprime)[14]; - A128_flip[2+offset]=((uint8_t*)&Aprime)[13]; A128_flip[3+offset]=((uint8_t*)&Aprime)[12]; - A128_flip[4+offset]=((uint8_t*)&Aprime)[11]; A128_flip[5+offset]=((uint8_t*)&Aprime)[10]; - A128_flip[6+offset] =((uint8_t*)&Aprime)[9]; A128_flip[7+offset] =((uint8_t*)&Aprime)[8]; - A128_flip[8+offset] =((uint8_t*)&Aprime)[7]; A128_flip[9+offset] =((uint8_t*)&Aprime)[6]; - A128_flip[10+offset]=((uint8_t*)&Aprime)[5]; A128_flip[11+offset]=((uint8_t*)&Aprime)[4]; - A128_flip[12+offset]=((uint8_t*)&Aprime)[3]; A128_flip[13+offset]=((uint8_t*)&Aprime)[2]; - A128_flip[14+offset]=((uint8_t*)&Aprime)[1]; A128_flip[15+offset]=((uint8_t*)&Aprime)[0]; - if (polarParams->crcParityBits == 24) tcrc = (uint64_t)((crcmask^(crc24c(A128_flip,8*offset+bitlen)>>8)))&0xffffff; - else if (polarParams->crcParityBits == 11) tcrc = (uint64_t)((crcmask^(crc11(A128_flip,bitlen)>>21)))&0x7ff; + for (int i=0; i<16 ; i++) + A128_flip[i+offset]=((uint8_t*)&Aprime)[15-i]; + if (polarParams->crcParityBits == 24) + tcrc = (uint64_t)((crcmask^(crc24c(A128_flip,8*offset+bitlen)>>8)))&0xffffff; + else if (polarParams->crcParityBits == 11) + tcrc = (uint64_t)((crcmask^(crc11(A128_flip,bitlen)>>21)))&0x7ff; } int n; // this is number of quadwords in the bit string - int quadwlen = (polarParams->K>>6); - - if ((polarParams->K&63) > 0) quadwlen++; + int quadwlen = (polarParams->K+63)/64; // Create the B bit string as // 0, 0, ..., 0, a'_0, a'_1, ..., a'_A-1, p_0, p_1, ..., p_{N_parity-1} //??? b_{N'-1} b_{N'-2} ... b_{N'-A} b_{N'-A-1} ... b_{N'-A-Nparity} = a_{N-1} a_{N-2} ... a_{N-A} p_{N_parity-1} ... p_0 - - for (n=0; ncrcParityBits) | tcrc; - else B[n] = (A[n] << polarParams->crcParityBits) | (A[n-1]>>(64-polarParams->crcParityBits)); + uint64_t B[4]= {0}; + B[0] = (A[0] << polarParams->crcParityBits) | tcrc; + for (n=1; n n) + B[n] = (A[n] << polarParams->crcParityBits) | (A[n-1]>>(64-polarParams->crcParityBits)); + else + B[n] = (A[n-1]>>(64-polarParams->crcParityBits)); uint8_t *Bbyte = (uint8_t *)B; // for each byte of B, lookup in corresponding table for 64-bit word corresponding to that byte and its position + uint64_t Cprime[4]= {0}; if (polarParams->K<65) Cprime[0] = polarParams->cprime_tab0[0][Bbyte[0]] | - polarParams->cprime_tab0[1][Bbyte[1]] | + polarParams->cprime_tab0[1][Bbyte[1]] | polarParams->cprime_tab0[2][Bbyte[2]] | polarParams->cprime_tab0[3][Bbyte[3]] | polarParams->cprime_tab0[4][Bbyte[4]] | diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index ddec605253..85651f498a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -850,7 +850,7 @@ static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_ printf("\t\t [nr_pucch2_3_4_scrambling] scrambling M_bit=%d bits\n", M_bit); #endif } -void nr_uci_encoding(uint64_t payload, +static void nr_uci_encoding(uint64_t payload, uint8_t nr_bit, int fmt, uint8_t is_pi_over_2_bpsk_enabled, diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 084a735204..16b3589a95 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -552,19 +552,17 @@ int main(int argc, char **argv) if (n_trials==1) printf("txlev %d (%f dB), offset %d, sigma2 %f ( %f dB)\n",txlev,10*log10(txlev),startingSymbolIndex*frame_parms->ofdm_symbol_size,sigma2,sigma2_dB); - int i0; - double txr,txi,rxr,rxi,nr,ni; - int **rxdataF = gNB->common_vars.rxdataF; + struct complex16 **rxdataF = (struct complex16 **)gNB->common_vars.rxdataF; for (int symb=0; symbframe_parms.symbols_per_slot;symb++) { if (symb= startingSymbolIndex+nrofSymbols) { - i0 = symb*gNB->frame_parms.ofdm_symbol_size; + int i0 = symb*gNB->frame_parms.ofdm_symbol_size; for (int re=0;reframe_parms.first_carrier_offset + re)%gNB->frame_parms.ofdm_symbol_size); for (int aarx=0;aarxframe_parms.ofdm_symbol_size; + int i0 = (startingSymbolIndex + symb)*gNB->frame_parms.ofdm_symbol_size; for (int re=0;reframe_parms.first_carrier_offset + re)%gNB->frame_parms.ofdm_symbol_size); - phasor.r = cos(2*M_PI*phase*re); + struct complexd phasor; + phasor.r = cos(2*M_PI*phase*re); phasor.i = sin(2*M_PI*phase*re); for (int aarx=0;aarxchF[aarx][re].r - txi*UE2gNB->chF[aarx][re].i; - rxi = txr*UE2gNB->chF[aarx][re].i + txi*UE2gNB->chF[aarx][re].r; - rxr_tmp = rxr*phasor.r - rxi*phasor.i; + double txr = (double)(((int16_t *)txdataF[0])[(i<<1)]); + double txi = (double)(((int16_t *)txdataF[0])[1+(i<<1)]); + double rxr={0},rxi={0}; + for (int l = 0; lchannel_length; l++) { + rxr = txr*UE2gNB->chF[aarx][l].r - txi*UE2gNB->chF[aarx][l].i; + rxi = txr*UE2gNB->chF[aarx][l].i + txi*UE2gNB->chF[aarx][l].r; + } + double rxr_tmp = rxr*phasor.r - rxi*phasor.i; rxi = rxr*phasor.i + rxi*phasor.r; rxr = rxr_tmp; - nr = sqrt(sigma2/2)*gaussdouble(0.0,1.0); - ni = sqrt(sigma2/2)*gaussdouble(0.0,1.0); - ((int16_t*)rxdataF[aarx])[i<<1] = (int16_t)(100.0*(rxr + nr)/sqrt((double)txlev)); - ((int16_t*)rxdataF[aarx])[1+(i<<1)]=(int16_t)(100.0*(rxi + ni)/sqrt((double)txlev)); + double nr = sqrt(sigma2/2)*gaussdouble(0.0,1.0); + double ni = sqrt(sigma2/2)*gaussdouble(0.0,1.0); + rxdataF[aarx][i].r = (int16_t)(100.0*(rxr + nr)/sqrt((double)txlev)); + rxdataF[aarx][i].i=(int16_t)(100.0*(rxi + ni)/sqrt((double)txlev)); if (n_trials==1 && abs(txr) > 0) printf("symb %d, re %d , aarx %d : txr %f, txi %f, chr %f, chi %f, nr %f, ni %f, rxr %f, rxi %f => %d,%d\n", symb, re, aarx, txr,txi, UE2gNB->chF[aarx][re].r,UE2gNB->chF[aarx][re].i, nr,ni, rxr,rxi, - ((int16_t*)rxdataF[aarx])[i<<1],((int16_t*)rxdataF[aarx])[1+(i<<1)]); + rxdataF[aarx][i].r,rxdataF[aarx][i].i); } } } int rxlev=0; - for (int aarx=0;aarxofdm_symbol_size], + for (int aarx=0;aarxofdm_symbol_size], frame_parms->ofdm_symbol_size); int rxlev_pucch=0; - for (int aarx=0;aarxofdm_symbol_size], + for (int aarx=0;aarxofdm_symbol_size], 12); // set UL mask for pucch allocation @@ -672,7 +672,7 @@ int main(int argc, char **argv) free(uci_pdu.harq); } else if (format==1) { - nr_decode_pucch1(rxdataF,PUCCH_GroupHopping,hopping_id, + nr_decode_pucch1((int32_t **)rxdataF,PUCCH_GroupHopping,hopping_id, &(payload_received),frame_parms,amp,nr_slot_tx, m0,nrofSymbols,startingSymbolIndex,startingPRB, startingPRB_intraSlotHopping,timeDomainOCC,nr_bit); @@ -728,7 +728,8 @@ int main(int argc, char **argv) break; } } - + if (gNB->uci_polarParams) + nr_polar_delete(gNB->uci_polarParams); free_channel_desc_scm(UE2gNB); term_freq_channel(); From 0b7be7466e01816a2f79cfb21f5e99faa08b61ff Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 10 Feb 2022 15:33:08 +0100 Subject: [PATCH 172/196] fix(ci): display state of container when failure, better tshark filtering, auto-undeploy if deploy went wrong Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 27 ++++++++++++++----- ci-scripts/main.py | 2 +- .../container_4g_rfsim_fdd_05MHz.xml | 2 +- .../container_4g_rfsim_fdd_05MHz_noS1.xml | 2 +- .../container_4g_rfsim_fdd_10MHz.xml | 2 +- .../container_4g_rfsim_fdd_20MHz.xml | 2 +- .../container_4g_rfsim_tdd_05MHz.xml | 2 +- .../5g_f1_rfsimulator/docker-compose.yaml | 24 ++++++++--------- .../5g_rfsimulator/docker-compose.yaml | 10 +++---- 9 files changed, 44 insertions(+), 29 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index e606513935..eca75617a6 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -636,7 +636,7 @@ class Containerize(): mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + self.eNB_logFile[self.eNB_instance], self.eNBSourceCodePath + '/cmake_targets/') logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') - def DeployGenObject(self, HTML): + def DeployGenObject(self, HTML, RAN, UE): self.exitStatus = 0 logging.info('\u001B[1m Checking Services to deploy\u001B[0m') cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose config --services' @@ -677,14 +677,17 @@ class Containerize(): cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml ps -a' count = 0 healthy = 0 + containerStatus = [] while (count < 10): count += 1 + containerStatus = [] deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) healthy = 0 for state in deployStatus.split('\n'): res = re.search('Up \(healthy\)', state) if res is not None: healthy += 1 + containerStatus.append(state) if healthy == self.nb_healthy[0]: count = 100 else: @@ -694,27 +697,39 @@ class Containerize(): if self.tsharkStarted == False: logging.debug('Starting tshark on public network') self.CaptureOnDockerNetworks() - self.tsharkStarted = True HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK) logging.info('\u001B[1m Deploying OAI Object(s) PASS\u001B[0m') else: - self.exitStatus = 1 HTML.CreateHtmlTestRow('Could not deploy in time', 'KO', CONST.ALL_PROCESSES_OK) + for cState in containerStatus: + logging.debug(cState) logging.error('\u001B[1m Deploying OAI Object(s) FAILED\u001B[0m') + HTML.testCase_id = 'AUTO-UNDEPLOY' + UE.testCase_id = 'AUTO-UNDEPLOY' + HTML.desc = 'Automatic Undeployment' + UE.desc = 'Automatic Undeployment' + UE.ShowTestID() + self.UndeployGenObject(HTML, RAN, UE) + self.exitStatus = 1 def CaptureOnDockerNetworks(self): cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"' networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - cmd = 'sudo nohup tshark -f "not tcp and not arp and not port 53 and not host archive.ubuntu.com and not host security.ubuntu.com and not port 2152"' + if re.search('4g.*rfsimulator', self.yamlPath[0]) is not None: + cmd = 'sudo nohup tshark -f "(host 192.168.61.11 and icmp) or (not host 192.168.61.11 and not host 192.168.61.30 and not arp and not port 53 and not port 2152)"' + elif re.search('5g.*rfsimulator', self.yamlPath[0]) is not None: + cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not host 192.168.71.150 and not arp and not port 53 and not port 2152 and not port 2153)"' + else: + return for name in networkNames.split('\n'): - res = re.search('rfsim', name) - if res is not None: + if re.search('rfsim', name) is not None: cmd += ' -i ' + name cmd += ' -w /tmp/capture_' ymlPath = self.yamlPath[0].split('/') cmd += ymlPath[1] + '.pcap > /tmp/tshark.log 2>&1 &' logging.debug(cmd) networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + self.tsharkStarted = True def UndeployGenObject(self, HTML, RAN, UE): self.exitStatus = 0 diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 43772fb655..5357a90a3d 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -910,7 +910,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re elif action == 'Deploy_Run_PhySim': PHYSIM.Deploy_PhySim(HTML, RAN) elif action == 'DeployGenObject': - CONTAINERS.DeployGenObject(HTML) + CONTAINERS.DeployGenObject(HTML, RAN, CiTestObj) if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'UndeployGenObject': diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml index fd254f1856..55f60b8307 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml @@ -80,7 +80,7 @@ DeployGenObject - Deploy OAI 4G NR-UE RF sim (FDD 05MHz) + Deploy OAI 4G LTE-UE RF sim (FDD 05MHz) yaml_files/4g_rfsimulator_fdd_05MHz oai_ue0 8 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml index 2ff9461b93..07ea358ad5 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml @@ -60,7 +60,7 @@ DeployGenObject - Deploy OAI 4G NR-UE RF sim (FDD 05MHz) + Deploy OAI 4G LTE-UE RF sim (FDD 05MHz) yaml_files/4g_rfsimulator_fdd_05MHz_noS1 oai_ue0 2 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml index f00e277c36..d5152c7779 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml @@ -80,7 +80,7 @@ DeployGenObject - Deploy OAI 4G NR-UE RF sim (FDD 10MHz) + Deploy OAI 4G LTE-UE RF sim (FDD 10MHz) yaml_files/4g_rfsimulator_fdd_10MHz oai_ue0 8 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml index 52e1ac7de1..0c5b9d43bd 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml @@ -80,7 +80,7 @@ DeployGenObject - Deploy OAI 4G NR-UE RF sim (FDD 20MHz) + Deploy OAI 4G LTE-UE RF sim (FDD 20MHz) yaml_files/4g_rfsimulator_fdd_20MHz oai_ue0 8 diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml index cdaee430ef..aa70db1fed 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml @@ -81,7 +81,7 @@ DeployGenObject - Deploy OAI 4G NR-UE RF sim (TDD 05MHz) + Deploy OAI 4G LTE-UE RF sim (TDD 05MHz) yaml_files/4g_rfsimulator_tdd_05MHz oai_ue0 8 diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml index 6a39f2147e..74a23905f0 100644 --- a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml @@ -241,12 +241,12 @@ services: NSSAI_SD1: 112233 AMF_IP_ADDRESS: 192.168.71.132 GNB_NGA_IF_NAME: eth0 - GNB_NGA_IP_ADDRESS: 192.168.71.136 + GNB_NGA_IP_ADDRESS: 192.168.71.140 GNB_NGU_IF_NAME: eth0 - GNB_NGU_IP_ADDRESS: 192.168.71.136 + GNB_NGU_IP_ADDRESS: 192.168.71.140 F1_IF_NAME: eth0 - F1_CU_IP_ADDRESS: 192.168.71.136 - F1_DU_IP_ADDRESS: 192.168.71.138 + F1_CU_IP_ADDRESS: 192.168.71.140 + F1_DU_IP_ADDRESS: 192.168.71.142 F1_CU_D_PORT: 2153 F1_DU_D_PORT: 2153 USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time @@ -254,7 +254,7 @@ services: - oai-ext-dn networks: public_net: - ipv4_address: 192.168.71.136 + ipv4_address: 192.168.71.140 healthcheck: test: /bin/bash -c "pgrep nr-softmodem" interval: 10s @@ -277,12 +277,12 @@ services: NSSAI_SD1: 112233 AMF_IP_ADDRESS: 192.168.71.132 GNB_NGA_IF_NAME: eth0 - GNB_NGA_IP_ADDRESS: 192.168.71.138 + GNB_NGA_IP_ADDRESS: 192.168.71.142 GNB_NGU_IF_NAME: eth0 - GNB_NGU_IP_ADDRESS: 192.168.71.138 + GNB_NGU_IP_ADDRESS: 192.168.71.142 F1_IF_NAME: eth0 - F1_CU_IP_ADDRESS: 192.168.71.136 - F1_DU_IP_ADDRESS: 192.168.71.138 + F1_CU_IP_ADDRESS: 192.168.71.140 + F1_DU_IP_ADDRESS: 192.168.71.142 F1_CU_D_PORT: 2153 F1_DU_D_PORT: 2153 USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time @@ -290,7 +290,7 @@ services: - oai-cu networks: public_net: - ipv4_address: 192.168.71.138 + ipv4_address: 192.168.71.142 healthcheck: test: /bin/bash -c "pgrep nr-softmodem" interval: 10s @@ -301,7 +301,7 @@ services: privileged: true container_name: rfsim5g-oai-nr-ue environment: - RFSIMULATOR: 192.168.71.138 + RFSIMULATOR: 192.168.71.142 FULL_IMSI: '208990100001100' FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' OPC: 'C42449363BBAD02B66D16BC975D77CC1' @@ -313,7 +313,7 @@ services: - oai-du networks: public_net: - ipv4_address: 192.168.71.137 + ipv4_address: 192.168.71.150 healthcheck: test: /bin/bash -c "pgrep nr-uesoftmodem" interval: 10s diff --git a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml index f0476b0a1e..808be7d83d 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml @@ -241,15 +241,15 @@ services: NSSAI_SD1: 112233 AMF_IP_ADDRESS: 192.168.71.132 GNB_NGA_IF_NAME: eth0 - GNB_NGA_IP_ADDRESS: 192.168.71.136 + GNB_NGA_IP_ADDRESS: 192.168.71.140 GNB_NGU_IF_NAME: eth0 - GNB_NGU_IP_ADDRESS: 192.168.71.136 + GNB_NGU_IP_ADDRESS: 192.168.71.140 USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time depends_on: - oai-ext-dn networks: public_net: - ipv4_address: 192.168.71.136 + ipv4_address: 192.168.71.140 healthcheck: test: /bin/bash -c "pgrep nr-softmodem" interval: 10s @@ -260,7 +260,7 @@ services: privileged: true container_name: rfsim5g-oai-nr-ue environment: - RFSIMULATOR: 192.168.71.136 + RFSIMULATOR: 192.168.71.140 FULL_IMSI: '208990100001100' FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' OPC: 'C42449363BBAD02B66D16BC975D77CC1' @@ -272,7 +272,7 @@ services: - oai-gnb networks: public_net: - ipv4_address: 192.168.71.137 + ipv4_address: 192.168.71.150 healthcheck: test: /bin/bash -c "pgrep nr-uesoftmodem" interval: 10s From 2728ce02c8906d2c82f7469c9a99d1763cdc5791 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 10 Feb 2022 16:51:35 +0100 Subject: [PATCH 173/196] feat(ci): switching from OAI-MME to MAGMA-MME for RF sim testing Signed-off-by: Raphael Defosseux --- .../docker-compose.yml | 70 +++----- .../4g_rfsimulator_fdd_05MHz/entrypoint.sh | 36 ++++ .../4g_rfsimulator_fdd_05MHz/mme.conf | 134 ++++++++++++++ .../mme_fd.sprint.conf | 169 ++++++++++++++++++ .../redis_extern.conf | 33 ++++ .../docker-compose.yml | 70 +++----- .../docker-compose.yml | 70 +++----- .../docker-compose.yml | 70 +++----- 8 files changed, 488 insertions(+), 164 deletions(-) create mode 100755 ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml index e852643ab9..b15e794c10 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml @@ -58,57 +58,45 @@ services: timeout: 5s retries: 5 - oai_mme: - image: oai-mme:latest - container_name: rfsim4g-oai-mme + redis: + image: redis:6.0.5 + container_name: rfsim4g-redis privileged: true - depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.6 + volumes: + - ./redis_extern.conf:/usr/local/etc/redis/redis.conf + entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf" + healthcheck: + test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping" + interval: 10s + timeout: 5s + retries: 5 + + magma_mme: + image: magma-mme:latest + container_name: rfsim4g-magma-mme + hostname: mme + privileged: true + depends_on: [oai_hss, redis] networks: public_net: ipv4_address: 192.168.61.3 environment: + TZ: Europe/Paris REALM: openairinterface.org PREFIX: /openair-mme/etc - INSTANCE: 1 - PID_DIRECTORY: /var/run - HSS_IP_ADDR: 192.168.61.2 HSS_HOSTNAME: hss HSS_FQDN: hss.openairinterface.org HSS_REALM: openairinterface.org - MCC: '208' - MNC: '96' - MME_GID: 32768 - MME_CODE: 3 - TAC_0: 1 - TAC_1: 2 - TAC_2: 3 MME_FQDN: mme.openairinterface.org - MME_S6A_IP_ADDR: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S1_MME: eth0 - MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S11: eth0 - MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S10: lo - MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 - OUTPUT: CONSOLE - SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 - PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 - PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 - MCC_SGW_0: '208' - MNC3_SGW_0: '096' - TAC_LB_SGW_0: '01' - TAC_HB_SGW_0: '00' - MCC_MME_0: '208' - MNC3_MME_0: '096' - TAC_LB_MME_0: '02' - TAC_HB_MME_0: '00' - MCC_MME_1: '208' - MNC3_MME_1: '096' - TAC_LB_MME_1: '03' - TAC_HB_MME_1: '00' - TAC_LB_SGW_TEST_0: '03' - TAC_HB_SGW_TEST_0: '00' - SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + FEATURES: mme_oai + volumes: + - ./mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt + - ./mme.conf:/magma-mme/etc/mme.conf + - ./entrypoint.sh:/magma-mme/bin/entrypoint.sh + entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh" healthcheck: test: /bin/bash -c "pgrep oai_mme" interval: 10s @@ -118,7 +106,7 @@ services: oai_spgwc: image: oai-spgwc:latest privileged: true - depends_on: [oai_mme] + depends_on: [magma_mme] container_name: rfsim4g-oai-spgwc networks: public_net: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh new file mode 100755 index 0000000000..07e578907d --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +INSTANCE=1 +PREFIX='/magma-mme/etc' +MY_REALM='openairinterface.org' + +declare -A MME_CONF + +pushd $PREFIX +MME_CONF[@MME_S6A_IP_ADDR@]="192.168.61.3" +MME_CONF[@INSTANCE@]=$INSTANCE +MME_CONF[@PREFIX@]=$PREFIX +MME_CONF[@REALM@]=$MY_REALM +MME_CONF[@MME_FQDN@]="mme.${MME_CONF[@REALM@]}" +MME_CONF[@HSS_HOSTNAME@]='hss' +MME_CONF[@HSS_FQDN@]="${MME_CONF[@HSS_HOSTNAME@]}.${MME_CONF[@REALM@]}" +MME_CONF[@HSS_IP_ADDR@]="192.168.61.2" + +cp mme_fd.conf.tmplt $PREFIX/mme_fd.conf + +for K in "${!MME_CONF[@]}"; do + egrep -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g" + ret=$?;[[ ret -ne 0 ]] && echo "Tried to replace $K with ${MME_CONF[$K]}" +done + +sed -i -e "s@etc/freeDiameter@etc@" /magma-mme/etc/mme_fd.conf +sed -i -e "s@bind: 127.0.0.1@bind: 192.168.61.6@" /etc/magma/redis.yml +# Generate freeDiameter certificate +popd +cd /magma-mme/scripts +./check_mme_s6a_certificate $PREFIX mme.${MME_CONF[@REALM@]} + +cd /magma-mme +nohup /magma-mme/bin/sctpd > /var/log/sctpd.log 2>&1 & +sleep 5 +/magma-mme/bin/oai_mme -c /magma-mme/etc/mme.conf diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf new file mode 100644 index 0000000000..4f491cc63d --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf @@ -0,0 +1,134 @@ +# generated by generate_mme_config_script.py +MME : +{ + REALM = "openairinterface.org" + PID_DIRECTORY = "/var/run"; + MAXENB = 8; # power of 2 + MAXUE = 16; # power of 2 + RELATIVE_CAPACITY = 10; + + EMERGENCY_ATTACH_SUPPORTED = "no"; + UNAUTHENTICATED_IMSI_SUPPORTED = "no"; + + # EPS network feature support + EPS_NETWORK_FEATURE_SUPPORT_IMS_VOICE_OVER_PS_SESSION_IN_S1 = "no"; # DO NOT CHANGE + EPS_NETWORK_FEATURE_SUPPORT_EMERGENCY_BEARER_SERVICES_IN_S1_MODE = "no"; # DO NOT CHANGE + EPS_NETWORK_FEATURE_SUPPORT_LOCATION_SERVICES_VIA_EPC = "no"; # DO NOT CHANGE + EPS_NETWORK_FEATURE_SUPPORT_EXTENDED_SERVICE_REQUEST = "no"; # DO NOT CHANGE + + # Display statistics about whole system (expressed in seconds) + MME_STATISTIC_TIMER = 10; + IP_CAPABILITY = "IPV4"; # UE PDN_TYPE + USE_STATELESS = ""; + + INTERTASK_INTERFACE : + { + # max queue size per task + ITTI_QUEUE_SIZE = 2000000; + }; + + S6A : + { + S6A_CONF = "/magma-mme/etc/mme_fd.conf"; # YOUR MME freeDiameter config file path + HSS_HOSTNAME = "hss.openairinterface.org"; + HSS_REALM = "openairinterface.org"; + }; + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 8; + SCTP_OUTSTREAMS = 8; + }; + + # ------- S1AP definitions + S1AP : + { + # outcome drop timer value (seconds) + S1AP_OUTCOME_TIMER = 10; + }; + + # ------- MME served GUMMEIs + GUMMEI_LIST = ( + { MCC="208" ; MNC="96"; MME_GID="32768" ; MME_CODE="3"; } + ); + + # ------- MME served TAIs + TAI_LIST = ( + {MCC="208" ; MNC="96"; TAC = "1"; } + ); + + TAC_LIST = ( + {MCC="208" ; MNC="96"; TAC = "1"; } + ); + + CSFB : + { + NON_EPS_SERVICE_CONTROL = "OFF"; + CSFB_MCC = "208"; + CSFB_MNC = "96"; + LAC = "1"; + }; + NAS : + { + ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "EIA2" , "EIA1" , "EIA0" ]; + ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "EEA0" , "EEA1" , "EEA2" ]; + T3402 = 1 # in minutes (default is 12 minutes) + T3412 = 54 # in minutes (default is 54 minutes, network dependent) + T3422 = 6 # in seconds (default is 6s) + T3450 = 6 # in seconds (default is 6s) + T3460 = 6 # in seconds (default is 6s) + T3470 = 6 # in seconds (default is 6s) + T3485 = 8 # UNUSED in seconds (default is 8s) + T3486 = 8 # UNUSED in seconds (default is 8s) + T3489 = 4 # UNUSED in seconds (default is 4s) + T3495 = 8 # UNUSED in seconds (default is 8s) + }; + + SGS : + { + TS6_1 = 10 # in seconds (default is 10s) + TS8 = 4 # in seconds (default is 4s) + TS9 = 2 # in seconds (default is 4s) + TS10 = 4 # in seconds (default is 4s) + TS13 = 4 # in seconds (default is 4s) + }; + + NETWORK_INTERFACES : + { + MME_INTERFACE_NAME_FOR_S1_MME = "eth0"; + MME_IPV4_ADDRESS_FOR_S1_MME = "192.168.61.3/24"; + MME_INTERFACE_NAME_FOR_S11_MME = "eth0"; + MME_IPV4_ADDRESS_FOR_S11_MME = "192.168.61.3/24"; + MME_PORT_FOR_S11_MME = 2123; + }; + + LOGGING : + { + OUTPUT = "CONSOLE"; + THREAD_SAFE = "no"; + COLOR = "no"; + + SCTP_LOG_LEVEL = "ERROR"; + GTPV1U_LOG_LEVEL = "INFO"; + SPGW_APP_LOG_LEVEL = "INFO"; + UDP_LOG_LEVEL = "INFO"; + S1AP_LOG_LEVEL = "DEBUG"; + NAS_LOG_LEVEL = "INFO"; + MME_APP_LOG_LEVEL = "DEBUG"; + GTPV2C_LOG_LEVEL = "INFO"; + S11_LOG_LEVEL = "DEBUG"; + S6A_LOG_LEVEL = "DEBUG"; + UTIL_LOG_LEVEL = "INFO"; + MSC_LOG_LEVEL = "ERROR"; + ITTI_LOG_LEVEL = "ERROR"; + MME_SCENARIO_PLAYER_LOG_LEVEL = "ERROR"; + ASN1_VERBOSITY = "INFO"; + }; + + S-GW : + { + SGW_IPV4_ADDRESS_FOR_S11 = "192.168.61.4"; + }; +}; diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf new file mode 100644 index 0000000000..6f87ed8c2b --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf @@ -0,0 +1,169 @@ +# -------- Local --------- + +# Uncomment if the framework cannot resolv it. +Identity = "@MME_FQDN@"; +Realm = "@REALM@"; + +# TLS configuration (see previous section) +TLS_Cred = "@PREFIX@/freeDiameter/mme.cert.pem", + "@PREFIX@/freeDiameter/mme.key.pem"; +TLS_CA = "@PREFIX@/freeDiameter/mme.cacert.pem"; + +# Disable use of TCP protocol (only listen and connect in SCTP) +# Default : TCP enabled +No_SCTP; + +# This option is ignored if freeDiameter is compiled with DISABLE_SCTP option. +# Prefer TCP instead of SCTP for establishing new connections. +# This setting may be overwritten per peer in peer configuration blocs. +# Default : SCTP is attempted first. +Prefer_TCP; + + +No_IPv6; + +# Overwrite the number of SCTP streams. This value should be kept low, +# especially if you are using TLS over SCTP, because it consumes a lot of +# resources in that case. See tickets 19 and 27 for some additional details on +# this. +# Limit the number of SCTP streams +SCTP_streams = 3; + + +# By default, freeDiameter acts as a Diameter Relay Agent by forwarding all +# messages it cannot handle locally. This parameter disables this behavior. +NoRelay; + +# Use RFC3588 method for TLS protection, where TLS is negociated after CER/CEA exchange is completed +# on the unsecure connection. The alternative is RFC6733 mechanism, where TLS protects also the +# CER/CEA exchange on a dedicated secure port. +# This parameter only affects outgoing connections. +# The setting can be also defined per-peer (see Peers configuration section). +# Default: use RFC6733 method with separate port for TLS. + +#TLS_old_method; + +AppServThreads = 4; + +# Specify the addresses on which to bind the listening server. This must be +# specified if the framework is unable to auto-detect these addresses, or if the +# auto-detected values are incorrect. Note that the list of addresses is sent +# in CER or CEA message, so one should pay attention to this parameter if some +# adresses should be kept hidden. +ListenOn = "@MME_S6A_IP_ADDR@"; + +Port = 3870; +SecPort = 5870; + +# -------- Extensions --------- + +# Uncomment (and create rtd.conf) to specify routing table for this peer. +#LoadExtension = "/usr/local/lib/freeDiameter/rt_default.fdx" : "rtd.conf"; + +#LoadExtension = "/usr/local/lib/freeDiameter/_sample.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/app_acct.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/app_diameap.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/app_radgw.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/app_redirect.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/app_sip.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dbg_interactive.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dbg_monitor.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dbg_msg_dumps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dbg_msg_timings.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dbg_rt.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_CreditControl.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_CxDx.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Gx.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_NAS.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Ro.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Rx.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_S6mS6n.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_SGd.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_SLh.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Sd.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Sh.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_T4.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_T6aT6bT7.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Tsp.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca_3gpp.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca_starent.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_eap.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_legacy_xml.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_mip6a.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_mip6i.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_nas_mipv6.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_nasreq.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4004_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4006bis_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4072_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4590_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5447_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5580_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5777_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5778_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6734_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6942_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7155_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7683_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7944_avps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_sip.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29061_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29128_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29154_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29173_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29212_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29214_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29215_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29217_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29229_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29272_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29273_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29329_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29336_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29337_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29338_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29343_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29344_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29345_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29368_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29468_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts32299_avps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_busypeers.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_default.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_ereg.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_ignore_dh.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_load_balance.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_randomize.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_redirect.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_acct.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_app.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_hss.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_netemul.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_rt_any.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_sip.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Rf.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_S6as6d.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_S6c.fdx"; + + +# -------- Peers --------- + +# The framework will actively attempt to establish and maintain a connection +# with the peers listed here. +# For only accepting incoming connections, see the acl_wl.fx extension. + +# ConnectPeer +# Declare a remote peer to which this peer must maintain a connection. +# In addition, this allows specifying non-default parameters for this peer only +# (for example disable SCTP with this peer, or use RFC3588-flavour TLS). +# Note that by default, if a peer is not listed as a ConnectPeer entry, an +# incoming connection from this peer will be rejected. If you want to accept +# incoming connections from other peers, see the acl_wl.fdx? extension which +# allows exactly this. + +ConnectPeer= "@HSS_FQDN@" { ConnectTo = "@HSS_IP_ADDR@"; No_SCTP ; No_IPv6; Prefer_TCP; No_TLS; port = 3868;}; diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf new file mode 100644 index 0000000000..1ee9dd9a78 --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf @@ -0,0 +1,33 @@ +# +# Copyright (c) 2016-present, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +# Jinja template for Redis configuration +# See the default config file for options and explanations: +# https://github.com/antirez/redis/blob/unstable/redis.conf + +# TODO: make sensible, production-aware config decisions + +bind 192.168.61.6 +port 6380 + +daemonize no +loglevel notice + +timeout 0 +databases 1 + +dbfilename redis_dump.rdb +dir /data + +# Save the DB on disk + +save 900 1 + +save 300 10 + +save 60 1000 diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml index 4c1ceb424a..e1e992c94c 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml @@ -58,57 +58,45 @@ services: timeout: 5s retries: 5 - oai_mme: - image: oai-mme:latest - container_name: rfsim4g-oai-mme + redis: + image: redis:6.0.5 + container_name: rfsim4g-redis privileged: true - depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.6 + volumes: + - ../4g_rfsimulator_fdd_05MHz/redis_extern.conf:/usr/local/etc/redis/redis.conf + entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf" + healthcheck: + test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping" + interval: 10s + timeout: 5s + retries: 5 + + magma_mme: + image: magma-mme:latest + container_name: rfsim4g-magma-mme + hostname: mme + privileged: true + depends_on: [oai_hss, redis] networks: public_net: ipv4_address: 192.168.61.3 environment: + TZ: Europe/Paris REALM: openairinterface.org PREFIX: /openair-mme/etc - INSTANCE: 1 - PID_DIRECTORY: /var/run - HSS_IP_ADDR: 192.168.61.2 HSS_HOSTNAME: hss HSS_FQDN: hss.openairinterface.org HSS_REALM: openairinterface.org - MCC: '208' - MNC: '96' - MME_GID: 32768 - MME_CODE: 3 - TAC_0: 1 - TAC_1: 2 - TAC_2: 3 MME_FQDN: mme.openairinterface.org - MME_S6A_IP_ADDR: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S1_MME: eth0 - MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S11: eth0 - MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S10: lo - MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 - OUTPUT: CONSOLE - SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 - PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 - PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 - MCC_SGW_0: '208' - MNC3_SGW_0: '096' - TAC_LB_SGW_0: '01' - TAC_HB_SGW_0: '00' - MCC_MME_0: '208' - MNC3_MME_0: '096' - TAC_LB_MME_0: '02' - TAC_HB_MME_0: '00' - MCC_MME_1: '208' - MNC3_MME_1: '096' - TAC_LB_MME_1: '03' - TAC_HB_MME_1: '00' - TAC_LB_SGW_TEST_0: '03' - TAC_HB_SGW_TEST_0: '00' - SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + FEATURES: mme_oai + volumes: + - ../4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt + - ../4g_rfsimulator_fdd_05MHz/mme.conf:/magma-mme/etc/mme.conf + - ../4g_rfsimulator_fdd_05MHz/entrypoint.sh:/magma-mme/bin/entrypoint.sh + entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh" healthcheck: test: /bin/bash -c "pgrep oai_mme" interval: 10s @@ -118,7 +106,7 @@ services: oai_spgwc: image: oai-spgwc:latest privileged: true - depends_on: [oai_mme] + depends_on: [magma_mme] container_name: rfsim4g-oai-spgwc networks: public_net: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml index 4a61181afb..ad665813f2 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml @@ -58,57 +58,45 @@ services: timeout: 5s retries: 5 - oai_mme: - image: oai-mme:latest - container_name: rfsim4g-oai-mme + redis: + image: redis:6.0.5 + container_name: rfsim4g-redis privileged: true - depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.6 + volumes: + - ../4g_rfsimulator_fdd_05MHz/redis_extern.conf:/usr/local/etc/redis/redis.conf + entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf" + healthcheck: + test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping" + interval: 10s + timeout: 5s + retries: 5 + + magma_mme: + image: magma-mme:latest + container_name: rfsim4g-magma-mme + hostname: mme + privileged: true + depends_on: [oai_hss, redis] networks: public_net: ipv4_address: 192.168.61.3 environment: + TZ: Europe/Paris REALM: openairinterface.org PREFIX: /openair-mme/etc - INSTANCE: 1 - PID_DIRECTORY: /var/run - HSS_IP_ADDR: 192.168.61.2 HSS_HOSTNAME: hss HSS_FQDN: hss.openairinterface.org HSS_REALM: openairinterface.org - MCC: '208' - MNC: '96' - MME_GID: 32768 - MME_CODE: 3 - TAC_0: 1 - TAC_1: 2 - TAC_2: 3 MME_FQDN: mme.openairinterface.org - MME_S6A_IP_ADDR: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S1_MME: eth0 - MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S11: eth0 - MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S10: lo - MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 - OUTPUT: CONSOLE - SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 - PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 - PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 - MCC_SGW_0: '208' - MNC3_SGW_0: '096' - TAC_LB_SGW_0: '01' - TAC_HB_SGW_0: '00' - MCC_MME_0: '208' - MNC3_MME_0: '096' - TAC_LB_MME_0: '02' - TAC_HB_MME_0: '00' - MCC_MME_1: '208' - MNC3_MME_1: '096' - TAC_LB_MME_1: '03' - TAC_HB_MME_1: '00' - TAC_LB_SGW_TEST_0: '03' - TAC_HB_SGW_TEST_0: '00' - SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + FEATURES: mme_oai + volumes: + - ../4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt + - ../4g_rfsimulator_fdd_05MHz/mme.conf:/magma-mme/etc/mme.conf + - ../4g_rfsimulator_fdd_05MHz/entrypoint.sh:/magma-mme/bin/entrypoint.sh + entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh" healthcheck: test: /bin/bash -c "pgrep oai_mme" interval: 10s @@ -118,7 +106,7 @@ services: oai_spgwc: image: oai-spgwc:latest privileged: true - depends_on: [oai_mme] + depends_on: [magma_mme] container_name: rfsim4g-oai-spgwc networks: public_net: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml index 3424780791..ffa92bac49 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml @@ -58,57 +58,45 @@ services: timeout: 5s retries: 5 - oai_mme: - image: oai-mme:latest - container_name: rfsim4g-oai-mme + redis: + image: redis:6.0.5 + container_name: rfsim4g-redis privileged: true - depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.6 + volumes: + - ../4g_rfsimulator_fdd_05MHz/redis_extern.conf:/usr/local/etc/redis/redis.conf + entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf" + healthcheck: + test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping" + interval: 10s + timeout: 5s + retries: 5 + + magma_mme: + image: magma-mme:latest + container_name: rfsim4g-magma-mme + hostname: mme + privileged: true + depends_on: [oai_hss, redis] networks: public_net: ipv4_address: 192.168.61.3 environment: + TZ: Europe/Paris REALM: openairinterface.org PREFIX: /openair-mme/etc - INSTANCE: 1 - PID_DIRECTORY: /var/run - HSS_IP_ADDR: 192.168.61.2 HSS_HOSTNAME: hss HSS_FQDN: hss.openairinterface.org HSS_REALM: openairinterface.org - MCC: '208' - MNC: '96' - MME_GID: 32768 - MME_CODE: 3 - TAC_0: 1 - TAC_1: 2 - TAC_2: 3 MME_FQDN: mme.openairinterface.org - MME_S6A_IP_ADDR: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S1_MME: eth0 - MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S11: eth0 - MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S10: lo - MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 - OUTPUT: CONSOLE - SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 - PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 - PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 - MCC_SGW_0: '208' - MNC3_SGW_0: '096' - TAC_LB_SGW_0: '01' - TAC_HB_SGW_0: '00' - MCC_MME_0: '208' - MNC3_MME_0: '096' - TAC_LB_MME_0: '02' - TAC_HB_MME_0: '00' - MCC_MME_1: '208' - MNC3_MME_1: '096' - TAC_LB_MME_1: '03' - TAC_HB_MME_1: '00' - TAC_LB_SGW_TEST_0: '03' - TAC_HB_SGW_TEST_0: '00' - SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + FEATURES: mme_oai + volumes: + - ../4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt + - ../4g_rfsimulator_fdd_05MHz/mme.conf:/magma-mme/etc/mme.conf + - ../4g_rfsimulator_fdd_05MHz/entrypoint.sh:/magma-mme/bin/entrypoint.sh + entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh" healthcheck: test: /bin/bash -c "pgrep oai_mme" interval: 10s @@ -118,7 +106,7 @@ services: oai_spgwc: image: oai-spgwc:latest privileged: true - depends_on: [oai_mme] + depends_on: [magma_mme] container_name: rfsim4g-oai-spgwc networks: public_net: From 519dea7780820e6e48f59a070aba0881c72f612d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 11 Feb 2022 10:05:29 +0100 Subject: [PATCH 174/196] fix(ci): correct services in scenario files fix(doc): updated the Tutorial with only MAGMA-MME references and logs Signed-off-by: Raphael Defosseux --- .../container_4g_rfsim_fdd_05MHz.xml | 8 +- .../container_4g_rfsim_fdd_10MHz.xml | 8 +- .../container_4g_rfsim_fdd_20MHz.xml | 8 +- .../4g_rfsimulator_fdd_05MHz/README.md | 256 ++++++++++-------- 4 files changed, 149 insertions(+), 131 deletions(-) diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml index 55f60b8307..a598b2bdc1 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml @@ -66,8 +66,8 @@ DeployGenObject Deploy OAI 4G CoreNetwork yaml_files/4g_rfsimulator_fdd_05MHz - oai_hss oai_mme oai_spgwc oai_spgwu trf_gen - 6 + oai_hss redis magma_mme oai_spgwc oai_spgwu trf_gen + 7 @@ -75,7 +75,7 @@ Deploy OAI 4G eNB RF sim (FDD 05MHz) yaml_files/4g_rfsimulator_fdd_05MHz enb - 7 + 8 @@ -83,7 +83,7 @@ Deploy OAI 4G LTE-UE RF sim (FDD 05MHz) yaml_files/4g_rfsimulator_fdd_05MHz oai_ue0 - 8 + 9 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml index d5152c7779..29acfa3b09 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml @@ -66,8 +66,8 @@ DeployGenObject Deploy OAI 4G CoreNetwork yaml_files/4g_rfsimulator_fdd_10MHz - oai_hss oai_mme oai_spgwc oai_spgwu trf_gen - 6 + oai_hss redis magma_mme oai_spgwc oai_spgwu trf_gen + 7 @@ -75,7 +75,7 @@ Deploy OAI 4G eNB RF sim (FDD 10MHz) yaml_files/4g_rfsimulator_fdd_10MHz enb - 7 + 8 @@ -83,7 +83,7 @@ Deploy OAI 4G LTE-UE RF sim (FDD 10MHz) yaml_files/4g_rfsimulator_fdd_10MHz oai_ue0 - 8 + 9 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml index 0c5b9d43bd..74f712ebda 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml @@ -66,8 +66,8 @@ DeployGenObject Deploy OAI 4G CoreNetwork yaml_files/4g_rfsimulator_fdd_20MHz - oai_hss oai_mme oai_spgwc oai_spgwu trf_gen - 6 + oai_hss redis magma_mme oai_spgwc oai_spgwu trf_gen + 7 @@ -75,7 +75,7 @@ Deploy OAI 4G eNB RF sim (FDD 20MHz) yaml_files/4g_rfsimulator_fdd_20MHz enb - 7 + 8 @@ -83,7 +83,7 @@ Deploy OAI 4G LTE-UE RF sim (FDD 20MHz) yaml_files/4g_rfsimulator_fdd_20MHz oai_ue0 - 8 + 9 diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md index b2a7f8e30c..400559d269 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md @@ -48,8 +48,9 @@ Now pull images. ```bash $ docker pull cassandra:2.1 +$ docker pull redis:6.0.5 $ docker pull rdefosseoai/oai-hss:latest -$ docker pull rdefosseoai/oai-mme:latest +$ docker pull rdefosseoai/magma-mme:latest $ docker pull rdefosseoai/oai-spgwc:latest $ docker pull rdefosseoai/oai-spgwu-tiny:latest @@ -57,13 +58,15 @@ $ docker pull rdefosseoai/oai-enb:develop $ docker pull rdefosseoai/oai-lte-ue:develop ``` +If the `redis` tag is not available, pick the newest available `6.0.x` tag at [Docker Hub Redis Tags](https://hub.docker.com/_/redis?tab=tags). + And **re-tag** them for tutorials' docker-compose file to work. ```bash $ docker image tag rdefosseoai/oai-spgwc:latest oai-spgwc:latest $ docker image tag rdefosseoai/oai-hss:latest oai-hss:latest $ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest -$ docker image tag rdefosseoai/oai-mme:latest oai-mme:latest +$ docker image tag rdefosseoai/magma-mme:latest magma-mme:latest $ docker image tag rdefosseoai/oai-enb:develop oai-enb:develop $ docker image tag rdefosseoai/oai-lte-ue:develop oai-lte-ue:develop @@ -81,14 +84,14 @@ How to build the Traffic-Generator image is explained [here](https://github.com/ **Just `docker-compose up -d` WILL NOT WORK!** -All the following commands **SHALL** be run from the `ci-scripts/yaml_files/4g_rfsimulator` folder. +All the following commands **SHALL** be run from the `ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz` folder. ## 2.1. Deploy and Configure Cassandra Database ## It is very crutial that the Cassandra DB is fully configured before you do anything else! ```bash -$ cd ci-scripts/yaml_files/4g_rfsimulator +$ cd ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz $ docker-compose up -d db_init Creating network "rfsim4g-oai-private-net" with the default driver Creating network "rfsim4g-oai-public-net" with the default driver @@ -128,11 +131,12 @@ $ sudo tshark -i rfsim4g-public -f 'port 3868 or port 2123 or port 36412 or port ## 2.2. Deploy OAI CN4G containers ## ```bash -$ docker-compose up -d oai_mme oai_spgwu trf_gen +$ docker-compose up -d magma_mme oai_spgwu trf_gen rfsim4g-cassandra is up-to-date -Creating rfsim4g-trf-gen ... done +Creating rfsim4g-trf-gen ... done +Creating rfsim4g-redis ... done Creating rfsim4g-oai-hss ... done -Creating rfsim4g-oai-mme ... done +Creating rfsim4g-magma-mme ... done Creating rfsim4g-oai-spgwc ... done Creating rfsim4g-oai-spgwu-tiny ... done ``` @@ -144,11 +148,12 @@ $ docker-compose ps -a Name Command State Ports ------------------------------------------------------------------------------------------------------------------------- rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp -rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp -rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp -rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp -rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp -rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) +rfsim4g-magma-mme /bin/bash -c /magma-mme/bi ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp +rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp +rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp +rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +rfsim4g-redis /bin/bash -c redis-server ... Up (healthy) 6379/tcp +rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) ``` ## 2.3. Deploy OAI eNB in RF simulator mode ## @@ -165,77 +170,55 @@ $ docker-compose ps -a Name Command State Ports ------------------------------------------------------------------------------------------------------------------------- rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp -rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp -rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp -rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp -rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp -rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp -rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) +rfsim4g-magma-mme /bin/bash -c /magma-mme/bi ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp +rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp +rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp +rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp +rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +rfsim4g-redis /bin/bash -c redis-server ... Up (healthy) 6379/tcp +rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) ``` -Check if the eNB connected to MME: +Check if the eNB connected to MME: with MAGMA-MME, the logs are not pushed to `stdout` but to a file at `/var/log/mme.log` ```bash -$ docker logs rfsim4g-oai-mme +$ docker exec rfsim4g-magma-mme /bin/bash -c "cat /var/log/mme.log" ... -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================ +000141 Fri Feb 11 09:49:29 2022 7EFFE7BE4700 DEBUG S6A tasks/s6a/s6a_peer.c :0095 Diameter identity of MME: mme.openairinterface.org with length: 24 +000142 Fri Feb 11 09:49:29 2022 7EFFE7BE4700 DEBUG S6A tasks/s6a/s6a_peer.c :0130 S6a peer connection attempt 1 / 8 +000143 Fri Feb 11 09:49:29 2022 7EFFE7BE4700 DEBUG S6A tasks/s6a/s6a_peer.c :0141 Peer hss.openairinterface.org is now connected... +000144 Fri Feb 11 09:49:29 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000146 Fri Feb 11 09:49:29 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_main.c :0083 MME APP ZMQ latency: 214. +000145 Fri Feb 11 09:49:29 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme.c :0121 S1AP ZMQ latency: 146. +000147 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme.c :0121 S1AP ZMQ latency: 144. +000148 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme_handlers.c :3775 Create eNB context for assoc_id: 4121 +000149 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme.c :0121 S1AP ZMQ latency: 48. +000150 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme_handlers.c :0536 New s1 setup request incoming from eNB-rf-sim macro eNB id: 00e01 +000151 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme_handlers.c :0639 Adding eNB with enb_id :3585 to the list of served eNBs +000152 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================ -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 | +000153 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status| +000154 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 0 | +000155 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 0 | +000156 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 0 | +000157 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 0 | +000158 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================ +000159 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================ -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0469 Client association changed: 0 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0101 ---------------------- -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0102 SCTP Status: -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0103 assoc id .....: 675 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0104 state ........: 4 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0105 instrms ......: 2 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0106 outstrms .....: 2 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0108 fragmentation : 1452 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0109 pending data .: 0 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0110 unack data ...: 0 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0111 rwnd .........: 106496 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0112 peer info : -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0114 state ....: 2 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0116 cwnd .....: 4380 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0118 srtt .....: 0 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0120 rto ......: 3000 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0122 mtu ......: 1500 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0123 ---------------------- -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0479 New connection -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0205 ---------------------- -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0206 Local addresses: -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0217 - [192.168.61.3] -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0234 ---------------------- -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0151 ---------------------- -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0152 Peer addresses: -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0163 - [192.168.61.20] -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0178 ---------------------- -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0554 SCTP RETURNING!! -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0547 [675][44] Msg of length 51 received from port 36412, on stream 0, PPID 18 -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0554 SCTP RETURNING!! -DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:2826 Create eNB context for assoc_id: 675 -DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0361 S1-Setup-Request macroENB_ID.size 3 (should be 20) -DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0321 New s1 setup request incoming from macro eNB id: 00e01 -DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0423 Adding eNB to the list of served eNBs -DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0438 Adding eNB id 3585 to the list of served eNBs -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0283 [44][675] Sending buffer 0x7f9394009f90 of 27 bytes on stream 0 with ppid 18 -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0296 Successfully sent 27 bytes on stream 0 -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================ +000160 Fri Feb 11 09:50:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000161 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================ -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 1 | 1 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 | +000162 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status| +000163 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 0 | +000164 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 0 | +000165 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 1 | +000166 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 0 | +000167 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================ +000168 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================ + +000169 Fri Feb 11 09:51:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 ... ``` @@ -253,14 +236,14 @@ $ docker-compose ps -a Name Command State Ports ------------------------------------------------------------------------------------------------------------------------- rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp -rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp -rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp -rfsim4g-oai-lte-ue0 /opt/oai-lte-ue/bin/entryp ... Up (healthy) 10000/tcp -rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp -rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp -rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp -rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) -Creating rfsim4g-oai-enb ... done +rfsim4g-magma-mme /bin/bash -c /magma-mme/bi ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp +rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp +rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp +rfsim4g-oai-lte-ue0 /opt/oai-lte-ue/bin/entryp ... Up (healthy) 10000/tcp +rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp +rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +rfsim4g-redis /bin/bash -c redis-server ... Up (healthy) 6379/tcp +rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) ``` Making sure the OAI UE is connected: @@ -268,40 +251,69 @@ Making sure the OAI UE is connected: ```bash $ docker logs rfsim4g-oai-enb ... -[RRC] RRCConnectionReconfiguration Encoded 1098 bits (138 bytes) -[RRC] [eNB 0] Frame 0, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes 138, UE id 617b) -[RRC] sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB -[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][SRB 02] Action ADD LCID 2 (SRB id 2) configured with SN size 5 bits and RLC AM -[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][DRB 01] Action ADD LCID 3 (DRB id 1) configured with SN size 12 bits and RLC AM -[SCTP] Successfully sent 46 bytes on stream 1 for assoc_id 676 -[RRC] [FRAME 00000][eNB][MOD 00][RNTI 617b] UE State = RRC_RECONFIGURED (default DRB, xid 0) -[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][SRB 02] Action MODIFY LCID 2 RB id 2 reconfigured with SN size 5 and RLC AM -[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][DRB 01] Action MODIFY LCID 3 RB id 1 reconfigured with SN size 1 and RLC AM -[RRC] [eNB 0] Frame 0 CC 0 : SRB2 is now active -[RRC] [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE rnti 617b, reconfiguring DRB 1/LCID 3 -[RRC] [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete, reconfiguring DRB 1/LCID 3 -[MAC] UE 0 RNTI 617b adding LC 3 idx 2 to scheduling control (total 3) -[MAC] Added physicalConfigDedicated 0x7f98e0004950 for 0.0 -[S1AP] initial_ctxt_resp_p: e_rab ID 5, enb_addr 192.168.61.20, SIZE 4 -[SCTP] Successfully sent 40 bytes on stream 1 for assoc_id 676 -[SCTP] Successfully sent 61 bytes on stream 1 for assoc_id 676 +7320446.555734 [RRC] I [FRAME 00000][eNB][MOD 00][RNTI bd8c] Logical Channel DL-DCCH, Generate UECapabilityEnquiry (bytes 10) +7320446.555739 [RRC] I sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB +7320446.570284 [RRC] I [FRAME 00000][eNB][MOD 00][RNTI bd8c] received ueCapabilityInformation on UL-DCCH 1 from UE +7320446.570293 [RRC] A got UE capabilities for UE bd8c +7320446.570346 [RRC] W drx_Configuration parameter is NULL, cannot configure local UE parameters or CDRX is deactivated +7320446.570370 [RRC] I [eNB 0] frame 0: requesting A2, A3, A4, and A5 event reporting +7320446.570435 [RRC] I RRCConnectionReconfiguration Encoded 1146 bits (144 bytes) +7320446.570440 [RRC] I [eNB 0] Frame 0, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes 144, UE id bd8c) +7320446.570445 [RRC] I sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB +7320446.570446 [SCTP] I Successfully sent 46 bytes on stream 1 for assoc_id 4120 +7320446.570449 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][SRB 02] Action ADD LCID 2 (SRB id 2) configured with SN size 5 bits and RLC AM +7320446.570455 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][DRB 01] Action ADD LCID 3 (DRB id 1) configured with SN size 12 bits and RLC AM +7320446.583036 [RRC] I [FRAME 00000][eNB][MOD 00][RNTI bd8c] UE State = RRC_RECONFIGURED (default DRB, xid 0) +7320446.583056 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][SRB 02] Action MODIFY LCID 2 RB id 2 reconfigured with SN size 5 and RLC AM +7320446.583060 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][DRB 01] Action MODIFY LCID 3 RB id 1 reconfigured with SN size 1 and RLC AM +7320446.583065 [RRC] I [eNB 0] Frame 0 CC 0 : SRB2 is now active +7320446.583067 [RRC] I [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE rnti bd8c, reconfiguring DRB 1/LCID 3 +7320446.583070 [RRC] I [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete, reconfiguring DRB 1/LCID 3 +7320446.583074 [MAC] I UE 0 RNTI bd8c adding LC 3 idx 2 to scheduling control (total 3) +7320446.583077 [MAC] I Added physicalConfigDedicated 0x7fd18c46be50 for 0.0 +7320446.583095 [S1AP] I initial_ctxt_resp_p: e_rab ID 5, enb_addr 192.168.61.20, SIZE 4 +7320446.583150 [SCTP] I Successfully sent 40 bytes on stream 1 for assoc_id 4120 +7320446.595495 [SCTP] I Successfully sent 61 bytes on stream 1 for assoc_id 4120 +7320446.774197 [SCTP] I Found data for descriptor 103 +7320446.774227 [SCTP] I [4120][103] Msg of length 53 received, on stream 1, PPID 18 +7320446.774295 [RRC] I [eNB 0] Received S1AP_DOWNLINK_NAS: ue_initial_id 0, eNB_ue_s1ap_id 4527568 +7320446.774316 [RRC] I sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB ... ``` -On the MME: +On the MME: be patient, the statistics display update is slow! ```bash -$ docker logs rfsim4g-oai-mme -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================ +$ docker exec rfsim4g-magma-mme /bin/bash -c "cat /var/log/mme.log" +000413 Fri Feb 11 09:52:52 2022 7EFFE8BE6700 INFO GTPv2- lib/gtpv2-c/nwgtpv2c-0.11/src/Nw:2376 Stopped active timer 0x2 for info 0x0x60700001a9b0! +000414 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000415 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_main.c :0083 MME APP ZMQ latency: 172. +000416 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 INFO MME-AP tasks/mme_app/mme_app_main.c :0137 Received S11 MODIFY BEARER RESPONSE from SPGW +000417 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_main.c :0150 S11 MODIFY BEARER RESPONSE local S11 teid = 1 +000418 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000419 Fri Feb 11 09:53:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000420 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================ -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 1 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 1 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 1 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 | +000421 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status| +000422 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 0 | +000423 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 0 | +000424 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 1 | +000425 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 0 | +000426 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================ +000427 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================ + +000428 Fri Feb 11 09:54:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000429 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================ + +000430 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status| +000431 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 1 | +000432 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 1 | +000433 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 1 | +000434 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 1 | +000435 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 1 | + +000436 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================ ``` On the LTE UE: @@ -377,16 +389,18 @@ Stopping rfsim4g-oai-lte-ue0 ... done Stopping rfsim4g-oai-enb ... done Stopping rfsim4g-oai-spgwu-tiny ... done Stopping rfsim4g-oai-spgwc ... done -Stopping rfsim4g-oai-mme ... done +Stopping rfsim4g-magma-mme ... done Stopping rfsim4g-oai-hss ... done +Stopping rfsim4g-redis ... done Stopping rfsim4g-trf-gen ... done Stopping rfsim4g-cassandra ... done Removing rfsim4g-oai-lte-ue0 ... done Removing rfsim4g-oai-enb ... done Removing rfsim4g-oai-spgwu-tiny ... done Removing rfsim4g-oai-spgwc ... done -Removing rfsim4g-oai-mme ... done +Removing rfsim4g-magma-mme ... done Removing rfsim4g-oai-hss ... done +Removing rfsim4g-redis ... done Removing rfsim4g-trf-gen ... done Removing rfsim4g-cassandra ... done Removing network rfsim4g-oai-private-net @@ -443,19 +457,23 @@ My 1st UE IMSI is an aggregation of `MCC`, `MNC`, `SHORT_IMSI`. ## 5.2. PLMN and TAI ## -in MME config: +in MME config, in the docker-compose there is not much besides REALM fields: ```yaml + TZ: Europe/Paris REALM: openairinterface.org -.. - MCC: '208' - MNC: '96' - MME_GID: 32768 - MME_CODE: 3 - TAC_0: 1 - TAC_1: 2 - TAC_2: 3 + PREFIX: /openair-mme/etc + HSS_HOSTNAME: hss + HSS_FQDN: hss.openairinterface.org + HSS_REALM: openairinterface.org MME_FQDN: mme.openairinterface.org + FEATURES: mme_oai +``` + +Everything is hard-coded in the `mme.conf` that is mounted as a volume: look for instances of + +``` +MCC="208" ; MNC="96"; TAC = "1"; ``` in SPGW-C/-U configs: From 4c76eb6c00ef589b7ab5fb6b93ef463114118285 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 11 Feb 2022 15:27:54 +0100 Subject: [PATCH 175/196] fix(ci): display state of container even when successful recover the full MAGMA-MME log Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index eca75617a6..2eb7808a37 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -684,9 +684,10 @@ class Containerize(): deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) healthy = 0 for state in deployStatus.split('\n'): - res = re.search('Up \(healthy\)', state) - if res is not None: + if re.search('Up \(healthy\)', state) is not None: healthy += 1 + if re.search('rfsim4g-db-init.*Exit 0', state) is not None: + subprocess.check_output('docker rm -f rfsim4g-db-init || true', shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) containerStatus.append(state) if healthy == self.nb_healthy[0]: count = 100 @@ -698,6 +699,8 @@ class Containerize(): logging.debug('Starting tshark on public network') self.CaptureOnDockerNetworks() HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK) + for cState in containerStatus: + logging.debug(cState) logging.info('\u001B[1m Deploying OAI Object(s) PASS\u001B[0m') else: HTML.CreateHtmlTestRow('Could not deploy in time', 'KO', CONST.ALL_PROCESSES_OK) @@ -760,7 +763,11 @@ class Containerize(): cName = res.group('container_name') cmd = 'cd ' + self.yamlPath[0] + ' && docker logs ' + cName + ' > ' + cName + '.log 2>&1' logging.debug(cmd) - deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) + subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) + if re.search('magma-mme', cName) is not None: + cmd = 'cd ' + self.yamlPath[0] + ' && docker cp -L ' + cName + ':/var/log/mme.log ' + cName + '-full.log' + logging.debug(cmd) + subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) fullStatus = True if anyLogs: cmd = 'mkdir -p '+ logPath + ' && cp ' + self.yamlPath[0] + '/*.log ' + logPath From 8981b53f837458aaf7792f5b4092b3c22b1c785d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 21 Feb 2022 16:39:38 +0100 Subject: [PATCH 176/196] fix(ci): changes after code review. Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 1 - ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 2eb7808a37..2b19a80984 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -677,7 +677,6 @@ class Containerize(): cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml ps -a' count = 0 healthy = 0 - containerStatus = [] while (count < 10): count += 1 containerStatus = [] diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh index 07e578907d..24960e215d 100755 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh @@ -20,7 +20,7 @@ cp mme_fd.conf.tmplt $PREFIX/mme_fd.conf for K in "${!MME_CONF[@]}"; do egrep -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g" - ret=$?;[[ ret -ne 0 ]] && echo "Tried to replace $K with ${MME_CONF[$K]}" + ret=$?;[[ ret -ne 0 ]] && echo "Could not replace $K with ${MME_CONF[$K]}" done sed -i -e "s@etc/freeDiameter@etc@" /magma-mme/etc/mme_fd.conf From b112282e2b0d4280138023ea0b0f9017dafabcd8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Feb 2022 19:42:45 +0100 Subject: [PATCH 177/196] Suppress warning, print stacktrace to stdout --- common/utils/assertions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/utils/assertions.h b/common/utils/assertions.h index c80a306645..3a2dd817f3 100644 --- a/common/utils/assertions.h +++ b/common/utils/assertions.h @@ -33,9 +33,9 @@ #define _Assert_Exit_ \ if (getenv("gdbStacks")) { \ char tmp [1000]; \ - sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d > /tmp/full_stacks.%d < /dev/null", \ + sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d < /dev/null", \ getpid(), getpid()); \ - __attribute__((unused)) int dummy=system(tmp); \ + (void) system(tmp); \ } \ fprintf(stderr, "\nExiting execution\n"); \ fflush(stdout); \ From 719f82870d2a97b137f1a362bf6f3d6d322c2a56 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Feb 2022 19:47:14 +0100 Subject: [PATCH 178/196] Don't redirect stack trace to file --- common/utils/assertions.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/utils/assertions.h b/common/utils/assertions.h index 3a2dd817f3..573036b1d9 100644 --- a/common/utils/assertions.h +++ b/common/utils/assertions.h @@ -33,9 +33,8 @@ #define _Assert_Exit_ \ if (getenv("gdbStacks")) { \ char tmp [1000]; \ - sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d < /dev/null", \ - getpid(), getpid()); \ - (void) system(tmp); \ + sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d < /dev/null", getpid()); \ + __attribute__((unused)) int dummy=system(tmp); \ } \ fprintf(stderr, "\nExiting execution\n"); \ fflush(stdout); \ From 9656d646dbf36300db7588ee0fda01050d0a594a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Feb 2022 20:08:42 +0100 Subject: [PATCH 179/196] reallocarray -> realloc since CI env has no reallocarray --- common/utils/load_module_shlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/load_module_shlib.c b/common/utils/load_module_shlib.c index f5a52d0626..1c9aa8cab9 100644 --- a/common/utils/load_module_shlib.c +++ b/common/utils/load_module_shlib.c @@ -225,7 +225,7 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t * } if (j == shlib->numfunc) { if (shlib->numfunc == shlib->len_funcarray) { - loader_shlibfunc_t *n = reallocarray(shlib->funcarray, shlib->numfunc * 2, sizeof(loader_shlibfunc_t)); + loader_shlibfunc_t *n = realloc(shlib->funcarray, shlib->numfunc * 2 * sizeof(loader_shlibfunc_t)); if (!n) { fprintf(stderr, "[LOADER] %s(): unable to allocate memory\n", __func__); ret = -1; From ec00d84299ae2c4b7fd651eebdc5ddf1f266ad86 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Feb 2022 22:35:22 +0100 Subject: [PATCH 180/196] Prevent memory leak of rx_ind message --- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index dff347f7c0..04e32cd3c1 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -601,11 +601,12 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif nr_downlink_indication_t dl_indication; - fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); + fapi_nr_rx_indication_t rx_ind; + memset(&rx_ind, 0, sizeof(rx_ind)); uint16_t number_pdus = 1; - nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); + nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id); + nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); if (ue->if_inst && ue->if_inst->dl_indication) ue->if_inst->dl_indication(&dl_indication, NULL); From 04e2d4f6f83601740b4a269fba4eed733965d14d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Feb 2022 22:38:22 +0100 Subject: [PATCH 181/196] Fix polar encoder memory leaks --- openair1/PHY/NR_TRANSPORT/nr_pbch.c | 7 ++++--- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index bf5edccb1b..0481338a9a 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -298,9 +298,10 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, a_reversed |= (((uint64_t)pbch->pbch_a_prime>>i)&1)<<(31-i); /// CRC, coding and rate matching - polar_encoder_fast (&a_reversed, (void*)pbch->pbch_e, 0, 0, - nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,0,NULL) - ); + t_nrPolar_params* polar = nr_polar_params(NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL, 0, NULL); + polar_encoder_fast (&a_reversed, (void*)pbch->pbch_e, 0, 0, polar); + nr_polar_delete(polar); + #ifdef DEBUG_PBCH_ENCODING printf("Channel coding:\n"); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 04e32cd3c1..7b2cff0a40 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -533,8 +533,9 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0); //polar decoding de-rate matching - const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); + t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0,currentPtr); + nr_polar_delete(currentPtr); if(decoderState) return(decoderState); From abbcbe6aa55af6e608a251b544954f5f8344d642 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 22 Feb 2022 09:16:35 -0800 Subject: [PATCH 182/196] Adding fixes for MR from review These include: - Simplifying VNF code. - Adding comments to several areas of the code. - Using free_and_zero macros - Fixing spelling errors --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 4 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 7 +- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 105 ++++++++----------- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 3 +- 4 files changed, 53 insertions(+), 66 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 5b13b2e9d0..b6fbf7452b 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -90,6 +90,9 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu)); memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu)); rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti; + /* TODO: Implement channel modeling to abstract TA and CQI. For now, + we hard code the values below since they are set in L1 and we are + abstracting L1. */ rx_ind->pdu_list[j].timing_advance = 31; rx_ind->pdu_list[j].ul_cqi = 255; char buffer[1024]; @@ -204,6 +207,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response } } } + dl_config->number_pdus = 0; } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index c7d9d525a6..0cb3c4f7a6 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3810,8 +3810,11 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR)); ra->RA_RAPID_found = 1; if (get_softmodem_params()->emulate_l1) { - LOG_I(NR_MAC, "If we found the RAR, the other PDUs are for other UEs and we dont need to process. " - "Only save rx_indication_body[%d] as only PDU in RX_indication\n", pdu_id); + /* When we are emulating L1 with multiple UEs, the rx_indication will have + multiple RAR PDUs. The code would previously handle each of these PDUs, + but it should only be handling the single RAR that matches the current + UE. */ + LOG_I(NR_MAC, "RAR PDU found for our UE with PDU index %d\n", pdu_id); dl_info->rx_ind->number_pdus = 1; if (pdu_id != 0) { memcpy(&dl_info->rx_ind->rx_indication_body[0], diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index b94b22282c..4f50e0481c 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -225,13 +225,10 @@ static void free_unqueued_nfapi_indications(nfapi_nr_rach_indication_t *rach_ind { for(int i = 0; i < rach_ind->number_of_pdus; i++) { - free(rach_ind->pdu_list[i].preamble_list); - rach_ind->pdu_list[i].preamble_list = NULL; + free_and_zero(rach_ind->pdu_list[i].preamble_list); } - free(rach_ind->pdu_list); - rach_ind->pdu_list = NULL; - free(rach_ind); - rach_ind = NULL; + free_and_zero(rach_ind->pdu_list); + free_and_zero(rach_ind); } if (uci_ind && uci_ind->num_ucis > 0) { @@ -239,40 +236,31 @@ static void free_unqueued_nfapi_indications(nfapi_nr_rach_indication_t *rach_ind switch (uci_ind->uci_list[i].pdu_type) { case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: if (uci_ind->uci_list[i].pucch_pdu_format_0_1.harq) { - free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list); - uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL; + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list); } - free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq); - uci_ind->uci_list[i].pucch_pdu_format_0_1.harq = NULL; - free(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr); - uci_ind->uci_list[i].pucch_pdu_format_0_1.sr = NULL; + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq); + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr); break; case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: - free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); - free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); - free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); break; } } - free(uci_ind->uci_list); - uci_ind->uci_list = NULL; - free(uci_ind); - uci_ind = NULL; + free_and_zero(uci_ind->uci_list); + free_and_zero(uci_ind); } if (rx_ind && rx_ind->number_of_pdus > 0) { - free(rx_ind->pdu_list); - rx_ind->pdu_list = NULL; - free(rx_ind); - rx_ind = NULL; + free_and_zero(rx_ind->pdu_list); + free_and_zero(rx_ind); } if (crc_ind && crc_ind->number_crcs > 0) { - free(crc_ind->crc_list); - crc_ind->crc_list = NULL; - free(crc_ind); - crc_ind = NULL; + free_and_zero(crc_ind->crc_list); + free_and_zero(crc_ind); } } @@ -321,73 +309,61 @@ static void match_crc_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, nfapi_nr_crc "Invalid number of crc_ind->number_crcs %d or rx_ind->number_of_pdus %d\n", crc_ind->number_crcs, rx_ind->number_of_pdus); if (crc_ind->number_crcs > rx_ind->number_of_pdus) { + int num_unmatched_crcs = 0; nfapi_nr_crc_indication_t *crc_ind_unmatched = calloc(1, sizeof(*crc_ind_unmatched)); crc_ind_unmatched->header = crc_ind->header; crc_ind_unmatched->sfn = crc_ind->sfn; crc_ind_unmatched->slot = crc_ind->slot; - crc_ind_unmatched->number_crcs = 0; - crc_ind_unmatched->crc_list = NULL; + crc_ind_unmatched->number_crcs = crc_ind->number_crcs - rx_ind->number_of_pdus; + crc_ind_unmatched->crc_list = calloc(crc_ind_unmatched->number_crcs, sizeof(nfapi_nr_crc_t)); for (int i = 0; i < crc_ind->number_crcs; i++) { if (!rx_ind_has_rnti(rx_ind, crc_ind->crc_list[i].rnti)) { LOG_I(NR_MAC, "crc_ind->crc_list[%d].rnti %x does not match any rx_ind pdu rnti\n", i, crc_ind->crc_list[i].rnti); - crc_ind_unmatched->number_crcs++; - if (crc_ind_unmatched->crc_list == NULL) { - crc_ind_unmatched->crc_list = malloc(sizeof(nfapi_nr_crc_t)); - } - else { - crc_ind_unmatched->crc_list = realloc(crc_ind_unmatched->crc_list, - sizeof(nfapi_nr_crc_t) * crc_ind_unmatched->number_crcs); - } - crc_ind_unmatched->crc_list[crc_ind_unmatched->number_crcs - 1] = crc_ind->crc_list[i]; + crc_ind_unmatched->crc_list[num_unmatched_crcs] = crc_ind->crc_list[i]; + num_unmatched_crcs++; remove_crc_pdu(crc_ind, i); } if (crc_ind->number_crcs == rx_ind->number_of_pdus) { break; } } - AssertFatal(crc_ind_unmatched->number_crcs > 0, "The nubmer of unmatched crc_ind pdus %d <= 0\n", - crc_ind_unmatched->number_crcs); + AssertFatal(crc_ind_unmatched->number_crcs == num_unmatched_crcs, "crc_ind num_pdus %d doesnt match %d\n", + crc_ind_unmatched->number_crcs, num_unmatched_crcs); if (!requeue(&gnb_crc_ind_queue, crc_ind_unmatched)) { LOG_E(NR_PHY, "requeue failed for crc_ind_unmatched.\n"); - free(crc_ind_unmatched); - crc_ind_unmatched = NULL; + free_and_zero(crc_ind_unmatched->crc_list); + free_and_zero(crc_ind_unmatched); } } else if (crc_ind->number_crcs < rx_ind->number_of_pdus) { + int num_unmatched_rxs = 0; nfapi_nr_rx_data_indication_t *rx_ind_unmatched = calloc(1, sizeof(*rx_ind_unmatched)); rx_ind_unmatched->header = rx_ind->header; rx_ind_unmatched->sfn = rx_ind->sfn; rx_ind_unmatched->slot = rx_ind->slot; - rx_ind_unmatched->number_of_pdus = 0; - rx_ind_unmatched->pdu_list = NULL; + rx_ind_unmatched->number_of_pdus = rx_ind->number_of_pdus - crc_ind->number_crcs; + rx_ind_unmatched->pdu_list = calloc(rx_ind_unmatched->number_of_pdus, sizeof(nfapi_nr_pdu_t)); for (int i = 0; i < rx_ind->number_of_pdus; i++) { if (!crc_ind_has_rnti(crc_ind, rx_ind->pdu_list[i].rnti)) { LOG_I(NR_MAC, "rx_ind->pdu_list[%d].rnti %d does not match any crc_ind pdu rnti\n", i, rx_ind->pdu_list[i].rnti); - rx_ind_unmatched->number_of_pdus++; - if (rx_ind_unmatched->pdu_list == NULL) { - rx_ind_unmatched->pdu_list = malloc(sizeof(nfapi_nr_rx_data_pdu_t)); - } - else { - rx_ind_unmatched->pdu_list = realloc(rx_ind_unmatched->pdu_list, - sizeof(nfapi_nr_rx_data_pdu_t) * rx_ind_unmatched->number_of_pdus); - } - rx_ind_unmatched->pdu_list[rx_ind_unmatched->number_of_pdus - 1] = rx_ind->pdu_list[i]; + rx_ind_unmatched->pdu_list[num_unmatched_rxs] = rx_ind->pdu_list[i]; + num_unmatched_rxs++; remove_rx_pdu(rx_ind, i); } if (rx_ind->number_of_pdus == crc_ind->number_crcs) { break; } } - AssertFatal(rx_ind_unmatched->number_of_pdus > 0, "The nubmer of unmatched rx_ind pdus %d <= 0\n", - rx_ind_unmatched->number_of_pdus); + AssertFatal(rx_ind_unmatched->number_of_pdus == num_unmatched_rxs, "rx_ind num_pdus %d doesnt match %d\n", + rx_ind_unmatched->number_of_pdus, num_unmatched_rxs); if (!requeue(&gnb_rx_ind_queue, rx_ind_unmatched)) { LOG_E(NR_PHY, "requeue failed for rx_ind_unmatched.\n"); - free(rx_ind_unmatched); - rx_ind_unmatched = NULL; + free_and_zero(rx_ind_unmatched->pdu_list); + free_and_zero(rx_ind_unmatched); } } else { @@ -420,17 +396,19 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { if (get_softmodem_params()->emulate_l1) { if (gnb_rach_ind_queue.num_items > 0) { - LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); + LOG_D(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); rach_ind = get_queue(&gnb_rach_ind_queue); + AssertFatal(rach_ind->number_of_pdus > 0, "Invalid number of PDUs\n"); UL_info->rach_ind = *rach_ind; } if (gnb_uci_ind_queue.num_items > 0) { - LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); + LOG_D(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); uci_ind = get_queue(&gnb_uci_ind_queue); + AssertFatal(uci_ind->num_ucis > 0, "Invalid number of PDUs\n"); UL_info->uci_ind = *uci_ind; } if (gnb_rx_ind_queue.num_items > 0 && gnb_crc_ind_queue.num_items > 0) { - LOG_I(NR_MAC, "gnb_rx_ind_queue size = %zu and gnb_crc_ind_queue size = %zu\n", + LOG_D(NR_MAC, "gnb_rx_ind_queue size = %zu and gnb_crc_ind_queue size = %zu\n", gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items); rx_ind = get_queue(&gnb_rx_ind_queue); int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot); @@ -443,11 +421,12 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { requeue(&gnb_rx_ind_queue, rx_ind); } else { + AssertFatal(rx_ind->number_of_pdus > 0, "Invalid number of PDUs\n"); + AssertFatal(crc_ind->number_crcs > 0, "Invalid number of PDUs\n"); + if (crc_ind->number_crcs != rx_ind->number_of_pdus) + match_crc_rx_pdu(rx_ind, crc_ind); UL_info->rx_ind = *rx_ind; UL_info->crc_ind = *crc_ind; - if (crc_ind->number_crcs != rx_ind->number_of_pdus) { - match_crc_rx_pdu(&UL_info->rx_ind, &UL_info->crc_ind); - } } } } diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index d271eecd5c..c3e41978e5 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4294,7 +4294,8 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; /* TODO: This asn1cCalloc leaks memory but also masks a bug. - If we delete this asn1cCalloc statement, eNB will crash in NSA mode. */ + If we delete this asn1cCalloc statement, eNB will crash in NSA mode. + Please don't delete the following line unless the bug has been found. */ asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; asn1cCallocOne(measResult->rsrpResult, rsrp_tar); From efcac39c7682990403a68ef6baef62efec8d8e53 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 22 Feb 2022 18:30:44 +0100 Subject: [PATCH 183/196] simplify polar codec interface --- openair1/PHY/CODING/TESTBENCH/polartest.c | 33 +++---- .../CODING/nrPolar_tools/nr_polar_decoder.c | 21 +++-- .../PHY/CODING/nrPolar_tools/nr_polar_defs.h | 40 +++++---- .../CODING/nrPolar_tools/nr_polar_encoder.c | 19 +++- openair1/PHY/CODING/nr_polar_init.c | 89 ++++++++++--------- openair1/PHY/NR_TRANSPORT/nr_dci.c | 7 +- openair1/PHY/NR_TRANSPORT/nr_pbch.c | 5 +- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 3 +- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 22 ++--- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 13 ++- openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c | 10 +-- openair1/PHY/defs_gNB.h | 2 +- openair1/PHY/defs_nr_UE.h | 1 - openair1/PHY/defs_nr_common.h | 2 - openair1/SIMULATION/NR_PHY/pucchsim.c | 3 - 15 files changed, 147 insertions(+), 123 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c index 409b91a8f6..18946dac90 100644 --- a/openair1/PHY/CODING/TESTBENCH/polartest.c +++ b/openair1/PHY/CODING/TESTBENCH/polartest.c @@ -176,7 +176,7 @@ if (logFlag){ double channelOutput[coderLength]; //add noise int16_t channelOutput_int16[coderLength]; - t_nrPolar_params *currentPtr = nr_polar_params(polarMessageType, testLength, aggregation_level, 1, NULL); + t_nrPolar_params *currentPtr = nr_polar_params(polarMessageType, testLength, aggregation_level, true); #ifdef DEBUG_DCI_POLAR_PARAMS uint32_t dci_pdu[4]; @@ -211,7 +211,8 @@ if (logFlag){ modulated_input[i]=(-1)/sqrt(2); channel_output[i] = modulated_input[i] + (gaussdouble(0.0,1.0) * (1/sqrt(2*SNR_lin))); } - decoderState = polar_decoder_dci(channel_output, dci_est, currentPtrDCI, NR_POLAR_DECODER_LISTSIZE, rnti); + decoderState = polar_decoder_dci(channel_output, dci_est, NR_POLAR_DECODER_LISTSIZE, rnti, + 1, size, aggregation_level); printf("dci_est: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", dci_est[0], dci_est[1], dci_est[2], dci_est[3]); free(encoder_outputByte); free(channel_output); @@ -244,13 +245,13 @@ if (logFlag){ start_meas(&timeEncoder); if (decoder_int16==1) { - polar_encoder_fast((uint64_t *)testInput, encoderOutput, 0, 0, currentPtr); + polar_encoder_fast((uint64_t *)testInput, encoderOutput, 0, 0, polarMessageType, testLength, aggregation_level); //polar_encoder_fast((uint64_t*)testInput, (uint64_t*)encoderOutput,0,0,currentPtr); } else { //0 --> PBCH, 1 --> DCI, -1 --> UCI if (polarMessageType == 0) - polar_encoder(testInput, encoderOutput, currentPtr); + polar_encoder(testInput, encoderOutput, polarMessageType, testLength, aggregation_level); else if (polarMessageType == 1) - polar_encoder_dci(testInput, encoderOutput, currentPtr, rnti); + polar_encoder_dci(testInput, encoderOutput, rnti, polarMessageType, testLength, aggregation_level); } stop_meas(&timeEncoder); @@ -281,19 +282,20 @@ if (logFlag){ start_meas(&timeDecoder); if (decoder_int16==1) { - decoderState = polar_decoder_int16(channelOutput_int16, (uint64_t *)estimatedOutput, 0, currentPtr); + decoderState = polar_decoder_int16(channelOutput_int16, (uint64_t *)estimatedOutput, 0, + polarMessageType, testLength, aggregation_level); } else { //0 --> PBCH, 1 --> DCI, -1 --> UCI if (polarMessageType == 0) { - decoderState = polar_decoder(channelOutput, - estimatedOutput, - currentPtr, - decoderListSize); + decoderState = polar_decoder(channelOutput, + estimatedOutput, + decoderListSize, + polarMessageType, testLength, aggregation_level); } else if (polarMessageType == 1) { - decoderState = polar_decoder_dci(channelOutput, - estimatedOutput, - currentPtr, - decoderListSize, - rnti); + decoderState = polar_decoder_dci(channelOutput, + estimatedOutput, + decoderListSize, + rnti, + polarMessageType, testLength, aggregation_level); } } stop_meas(&timeDecoder); @@ -362,6 +364,5 @@ if (logFlag){ print_meas(&timeEncoder,"polar_encoder",NULL,NULL); print_meas(&timeDecoder,"polar_decoder",NULL,NULL); if (logFlag) fclose(logFile); - nr_polar_delete(currentPtr); return (0); } diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c index bdafb15d9c..5b21f49381 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c @@ -58,9 +58,13 @@ static inline void updateCrcChecksum2(int xlen, int8_t polar_decoder(double *input, uint32_t *out, - const t_nrPolar_params *polarParams, - uint8_t listSize) + uint8_t listSize, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level + ) { + const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); //Assumes no a priori knowledge. uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; memset(bit,0,sizeof bit); @@ -302,9 +306,13 @@ int8_t polar_decoder(double *input, int8_t polar_decoder_dci(double *input, uint32_t *out, - const t_nrPolar_params *polarParams, uint8_t listSize, - uint16_t n_RNTI) { + uint16_t n_RNTI, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level ) { + const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); + uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; memset(bit,0,sizeof bit); uint8_t bitUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True @@ -596,8 +604,11 @@ void init_polar_deinterleaver_table(t_nrPolar_params *polarParams) { uint32_t polar_decoder_int16(int16_t *input, uint64_t *out, uint8_t ones_flag, - const t_nrPolar_params *polarParams) + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level ) { + const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); int16_t d_tilde[polarParams->N];// = malloc(sizeof(double) * polarParams->N); nr_polar_rate_matching_int16(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength); diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h index de6e2c3222..5d5d55b23e 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h @@ -79,9 +79,9 @@ typedef struct decoder_tree_t_s { struct nrPolar_params { //messageType: 0=PBCH, 1=DCI, -1=UCI - int idx; //idx = (messageType * messageLength * aggregation_prime); - struct nrPolar_params *nextPtr; + struct nrPolar_params *nextPtr __attribute__((aligned(16))); + uint32_t idx; uint8_t n_max; uint8_t i_il; uint8_t i_seg; @@ -138,34 +138,46 @@ typedef struct nrPolar_params t_nrPolar_params; void polar_encoder(uint32_t *input, uint32_t *output, - const t_nrPolar_params *polarParams); + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); void polar_encoder_dci(uint32_t *in, uint32_t *out, - const t_nrPolar_params *polarParams, - uint16_t n_RNTI); + uint16_t n_RNTI, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); void polar_encoder_fast(uint64_t *A, void *out, int32_t crcmask, uint8_t ones_flag, - const t_nrPolar_params *polarParams); + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); int8_t polar_decoder(double *input, uint32_t *output, - const t_nrPolar_params *polarParams, - uint8_t listSize); + uint8_t listSize, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); uint32_t polar_decoder_int16(int16_t *input, uint64_t *out, uint8_t ones_flag, - const t_nrPolar_params *polarParams); + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); int8_t polar_decoder_dci(double *input, uint32_t *out, - const t_nrPolar_params *polarParams, uint8_t listSize, - uint16_t n_RNTI); + uint16_t n_RNTI, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); void generic_polar_decoder(const t_nrPolar_params *pp, decoder_node_t *node); @@ -183,13 +195,12 @@ void build_decoder_tree(t_nrPolar_params *pp); void build_polar_tables(t_nrPolar_params *polarParams); void init_polar_deinterleaver_table(t_nrPolar_params *polarParams); -void nr_polar_print_polarParams(t_nrPolar_params *polarParams); +void nr_polar_print_polarParams(void); t_nrPolar_params *nr_polar_params (int8_t messageType, uint16_t messageLength, uint8_t aggregation_level, - int decoder_flag, - t_nrPolar_params **polarList_ext); + int decoder_flag); uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level); @@ -333,5 +344,4 @@ static inline void nr_polar_deinterleaver(uint8_t *input, for (int i=0; iidx == 0 || polarParams->idx == 1) { //PBCH or PDCCH /* uint64_t B = (((uint64_t)*in)&((((uint64_t)1)<<32)-1)) | (((uint64_t)crc24c((uint8_t*)in,polarParams->payloadBits)>>8)<payloadBits); @@ -154,8 +157,12 @@ void polar_encoder(uint32_t *in, void polar_encoder_dci(uint32_t *in, uint32_t *out, - const t_nrPolar_params *polarParams, - uint16_t n_RNTI) { + uint16_t n_RNTI, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level) { + const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); + #ifdef DEBUG_POLAR_ENCODER_DCI printf("[polar_encoder_dci] in: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", in[0], in[1], in[2], in[3]); #endif @@ -418,7 +425,11 @@ void polar_encoder_fast(uint64_t *A, void *out, int32_t crcmask, uint8_t ones_flag, - const t_nrPolar_params *polarParams) { + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level) { + + const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); // AssertFatal(polarParams->K > 32, "K = %d < 33, is not supported yet\n",polarParams->K); AssertFatal(polarParams->K < 129, "K = %d > 128, is not supported yet\n",polarParams->K); AssertFatal(polarParams->payloadBits < 65, "payload bits = %d > 64, is not supported yet\n",polarParams->payloadBits); diff --git a/openair1/PHY/CODING/nr_polar_init.c b/openair1/PHY/CODING/nr_polar_init.c index 5fd5ff404b..50bc90636d 100644 --- a/openair1/PHY/CODING/nr_polar_init.c +++ b/openair1/PHY/CODING/nr_polar_init.c @@ -33,10 +33,20 @@ #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" #include "PHY/NR_TRANSPORT/nr_dci.h" +#define PolarKey ((messageType<<24)|(messageLength<<8)|aggregation_level) +static t_nrPolar_params * PolarList=NULL; +static pthread_mutex_t PolarListMutex=PTHREAD_MUTEX_INITIALIZER; + static int intcmp(const void *p1,const void *p2) { return(*(int16_t *)p1 > *(int16_t *)p2); } -void nr_polar_delete(t_nrPolar_params * polarParams) { + +static void nr_polar_delete_list(t_nrPolar_params * polarParams) { + if (!polarParams) + return; + if (polarParams->nextPtr) + nr_polar_delete_list(polarParams->nextPtr); + delete_decoder_tree(polarParams); //From build_polar_tables() for (int k=0; k < polarParams->K + polarParams->n_pc; k++) @@ -68,20 +78,36 @@ void nr_polar_delete(t_nrPolar_params * polarParams) { free(polarParams); } -static void nr_polar_init(t_nrPolar_params * *polarParams, - int8_t messageType, +static void nr_polar_delete(void) { + pthread_mutex_lock(&PolarListMutex); + nr_polar_delete_list(PolarList); + PolarList=NULL; + pthread_mutex_unlock(&PolarListMutex); +} + +t_nrPolar_params * nr_polar_params(int8_t messageType, uint16_t messageLength, uint8_t aggregation_level, int decoder_flag) { - t_nrPolar_params *currentPtr = *polarParams; - uint16_t aggregation_prime = (messageType >= 2) ? aggregation_level : nr_polar_aggregation_prime(aggregation_level); - + // The lock is weak, because we never delete in the list, only at exit time + // therefore, returning t_nrPolar_params * from the list is safe for future usage + pthread_mutex_lock(&PolarListMutex); + if(!PolarList) + atexit(nr_polar_delete); + + t_nrPolar_params *currentPtr = PolarList; //Parse the list. If the node is already created, return without initialization. while (currentPtr != NULL) { //printf("currentPtr->idx %d, (%d,%d)\n",currentPtr->idx,currentPtr->payloadBits,currentPtr->encoderLength); //LOG_D(PHY,"Looking for index %d\n",(messageType * messageLength * aggregation_prime)); - if (currentPtr->idx == (messageType * messageLength * aggregation_prime)) return; - else currentPtr = currentPtr->nextPtr; + if (currentPtr->idx == PolarKey ) { + if (decoder_flag && !currentPtr->tree.root) + build_decoder_tree(currentPtr); + pthread_mutex_unlock(&PolarListMutex); + return currentPtr ; + } + else + currentPtr = currentPtr->nextPtr; } // printf("currentPtr %p (polarParams %p)\n",currentPtr,polarParams); @@ -90,7 +116,7 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, if (newPolarInitNode != NULL) { // LOG_D(PHY,"Setting new polarParams index %d, messageType %d, messageLength %d, aggregation_prime %d\n",(messageType * messageLength * aggregation_prime),messageType,messageLength,aggregation_prime); - newPolarInitNode->idx = (messageType * messageLength * aggregation_prime); + newPolarInitNode->idx = PolarKey; newPolarInitNode->nextPtr = NULL; //printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level); @@ -212,7 +238,8 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern, newPolarInitNode->i_bil, newPolarInitNode->encoderLength); - if (decoder_flag == 1) build_decoder_tree(newPolarInitNode); + if (decoder_flag == 1) + build_decoder_tree(newPolarInitNode); build_polar_tables(newPolarInitNode); init_polar_deinterleaver_table(newPolarInitNode); //printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes); @@ -220,21 +247,22 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, AssertFatal(1 == 0, "[nr_polar_init] New t_nrPolar_params * could not be created"); } - //Fixme: the list is not thread safe - //The defect is not critical: we always append (never delete items) and adding two times the same is fine - newPolarInitNode->nextPtr=*polarParams; - *polarParams=newPolarInitNode; - return; + newPolarInitNode->nextPtr=PolarList; + PolarList=newPolarInitNode; + pthread_mutex_unlock(&PolarListMutex); + return newPolarInitNode; } -void nr_polar_print_polarParams(t_nrPolar_params *polarParams) { +void nr_polar_print_polarParams() { uint8_t i = 0; - if (polarParams == NULL) { + if (PolarList == NULL) { printf("polarParams is empty.\n"); } else { + t_nrPolar_params * polarParams=PolarList; while (polarParams != NULL) { - printf("polarParams[%d] = %d\n", i, polarParams->idx); + printf("polarParams[%d] = %d, %d, %d\n", i, + polarParams->idx>>24, (polarParams->idx>>8)&0xFFFF, polarParams->idx&0xFF); polarParams = polarParams->nextPtr; i++; } @@ -243,31 +271,6 @@ void nr_polar_print_polarParams(t_nrPolar_params *polarParams) { return; } -t_nrPolar_params *nr_polar_params (int8_t messageType, - uint16_t messageLength, - uint8_t aggregation_level, - int decoding_flag, - t_nrPolar_params **polarList_ext) { - static t_nrPolar_params *polarList = NULL; - nr_polar_init(polarList_ext != NULL ? polarList_ext : &polarList, - messageType,messageLength,aggregation_level,decoding_flag); - t_nrPolar_params *polarParams=polarList_ext != NULL ? *polarList_ext : polarList; - const int tag=messageType * messageLength * (messageType>=2 ? aggregation_level : nr_polar_aggregation_prime(aggregation_level)); - - - - while (polarParams != NULL) { - // LOG_D(PHY,"nr_polar_params : tag %d (from nr_polar_init %d)\n",tag,polarParams->idx); - if (polarParams->idx == tag) - return polarParams; - - polarParams = polarParams->nextPtr; - } - - AssertFatal(false,"Polar Init tables internal failure, no polarParams found\n"); - return NULL; -} - uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level) { if (aggregation_level == 0) return 0; else if (aggregation_level == 1) return NR_POLAR_AGGREGATION_LEVEL_1_PRIME; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index d233eb9ba6..0af56ba706 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -130,11 +130,8 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, uint16_t Nid = dci_pdu->ScramblingId; uint16_t scrambling_RNTI = dci_pdu->ScramblingRNTI; - t_nrPolar_params *currentPtr = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, - dci_pdu->PayloadSizeBits, - dci_pdu->AggregationLevel, - 0,NULL); - polar_encoder_fast((uint64_t*)dci_pdu->Payload, (void*)encoder_output, n_RNTI,1,currentPtr); + polar_encoder_fast((uint64_t*)dci_pdu->Payload, (void*)encoder_output, n_RNTI, 1, + NR_POLAR_DCI_MESSAGE_TYPE, dci_pdu->PayloadSizeBits, dci_pdu->AggregationLevel); #ifdef DEBUG_CHANNEL_CODING printf("polar rnti %x,length %d, L %d\n",n_RNTI, dci_pdu->PayloadSizeBits,pdcch_pdu_rel15->dci_pdu->AggregationLevel); printf("DCI PDU: [0]->0x%lx \t [1]->0x%lx\n", diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index 0481338a9a..fc7df46496 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -298,9 +298,8 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, a_reversed |= (((uint64_t)pbch->pbch_a_prime>>i)&1)<<(31-i); /// CRC, coding and rate matching - t_nrPolar_params* polar = nr_polar_params(NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL, 0, NULL); - polar_encoder_fast (&a_reversed, (void*)pbch->pbch_e, 0, 0, polar); - nr_polar_delete(polar); + polar_encoder_fast (&a_reversed, (void*)pbch->pbch_e, 0, 0, + NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL); #ifdef DEBUG_PBCH_ENCODING printf("Channel coding:\n"); diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 4256159812..b85dbd1454 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -1538,7 +1538,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, } else { // polar coded case - t_nrPolar_params *currentPtr = nr_polar_params(2,nb_bit,pucch_pdu->prb_size,1,&gNB->uci_polarParams); __m64 *rp_re[Prx2][2]; __m64 *rp2_re[Prx2][2]; __m64 *rp_im[Prx2][2]; @@ -1665,7 +1664,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, } // half_prb } // symb // run polar decoder on llrs - decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, currentPtr); + decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, 2,nb_bit,pucch_pdu->prb_size); LOG_D(PHY,"UCI decoderState %d, payload[0] %llu\n",decoderState,(unsigned long long)decodedPayload[0]); if (decoderState>0) decoderState=1; corr_dB = dB_fixed64(corr); diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 84c9627c8a..1b247805a6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -832,14 +832,18 @@ void nr_pdcch_unscrambling(int16_t *z, /* This function compares the received DCI bits with * re-encoded DCI bits and returns the number of mismatched bits */ -uint16_t nr_dci_false_detection(uint64_t *dci, - int16_t *soft_in, - const t_nrPolar_params *polar_param, - int encoded_length, - int rnti) { +static uint16_t nr_dci_false_detection(uint64_t *dci, + int16_t *soft_in, + int encoded_length, + int rnti, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level + ) { uint32_t encoder_output[NR_MAX_DCI_SIZE_DWORD]; - polar_encoder_fast(dci, (void*)encoder_output, rnti, 1, (t_nrPolar_params *)polar_param); + polar_encoder_fast(dci, (void*)encoder_output, rnti, 1, + messageType, messageLength, aggregation_level); uint8_t *enout_p = (uint8_t*)encoder_output; uint16_t x = 0; @@ -886,7 +890,6 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, if (dci_found==1) continue; int dci_length = rel15->dci_length_options[k]; uint64_t dci_estimation[2]= {0}; - const t_nrPolar_params *currentPtrDCI = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L, 1, &ue->polarList); LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]); @@ -901,11 +904,10 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, } } #endif - uint16_t crc = polar_decoder_int16(tmp_e, dci_estimation, 1, - currentPtrDCI); + NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L); n_rnti = rel15->rnti; LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n", @@ -913,7 +915,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, if (crc == n_rnti) { LOG_D(PHY, "(%i.%i) Received dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %llx)\n", proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length,*(unsigned long long*)dci_estimation); - uint16_t mb = nr_dci_false_detection(dci_estimation,tmp_e,currentPtrDCI,L*108,n_rnti); + uint16_t mb = nr_dci_false_detection(dci_estimation,tmp_e,L*108,n_rnti, NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L); ue->dci_thres = (ue->dci_thres + mb) / 2; if (mb > (ue->dci_thres+20)) { LOG_W(PHY,"DCI false positive. Dropping DCI index %d. Mismatched bits: %d/%d. Current DCI threshold: %d\n",j,mb,L*108,ue->dci_thres); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 7b2cff0a40..20d63f985a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -533,9 +533,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0); //polar decoding de-rate matching - t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); - decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0,currentPtr); - nr_polar_delete(currentPtr); + decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0, + NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL); if(decoderState) return(decoderState); @@ -602,12 +601,12 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif nr_downlink_indication_t dl_indication; - fapi_nr_rx_indication_t rx_ind; - memset(&rx_ind, 0, sizeof(rx_ind)); + //Fixme: on the heap to please the mandatory free in nr_ue_ul_indication() + fapi_nr_rx_indication_t *rx_ind=calloc(sizeof(*rx_ind),1); uint16_t number_pdus = 1; - nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); + nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); + nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); if (ue->if_inst && ue->if_inst->dl_indication) ue->if_inst->dl_indication(&dl_indication, NULL); diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index 85651f498a..4dcce9f60f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -946,12 +946,10 @@ static void nr_uci_encoding(uint64_t payload, AssertFatal(nrofPRB<=16,"Number of PRB >16\n"); } else if (A>=12) { AssertFatal(A<65,"Polar encoding not supported yet for UCI with more than 64 bits\n"); - t_nrPolar_params *currentPtr = nr_polar_params(NR_POLAR_UCI_PUCCH_MESSAGE_TYPE, - A, - nrofPRB, - 1, - NULL); - polar_encoder_fast(&payload, b, 0,0,currentPtr); + polar_encoder_fast(&payload, b, 0,0, + NR_POLAR_UCI_PUCCH_MESSAGE_TYPE, + A, + nrofPRB); } } diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 7c7d30a6e2..34dadf5bfd 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -779,7 +779,7 @@ typedef struct PHY_VARS_gNB_s { /// statistics for ULSCH measurement collection NR_gNB_SCH_STATS_t ulsch_stats[NUMBER_OF_NR_SCH_STATS_MAX]; NR_gNB_UCI_STATS_t uci_stats[NUMBER_OF_NR_UCI_STATS_MAX]; - t_nrPolar_params *uci_polarParams; + t_nrPolar_params **polarParams; /// SRS variables nr_srs_info_t *nr_srs_info[NUMBER_OF_NR_SRS_MAX]; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 0fa839f104..653b435e12 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -814,7 +814,6 @@ typedef struct { fapi_nr_config_request_t nrUE_config; - t_nrPolar_params *polarList; NR_UE_PDSCH *pdsch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX+1]; // two RxTx Threads NR_UE_PBCH *pbch_vars[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_PDCCH *pdcch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 78599dcbb6..d3352fb520 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -387,8 +387,6 @@ struct NR_DL_FRAME_PARMS { uint8_t N_ssb; /// SSB index uint8_t ssb_index; - /// PBCH polar encoder params - t_nrPolar_params pbch_polar_params; /// OFDM symbol offset divisor for UL uint32_t ofdm_offset_divisor; }; diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 16b3589a95..151d51d726 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -465,7 +465,6 @@ int main(int argc, char **argv) mcs=table2_mcs[actual_payload+shift]; else AssertFatal(1==0,"Either nr_bit %d or sr_flag %d must be non-zero\n", nr_bit, sr_flag); } - else if (format == 2 && nr_bit > 11) gNB->uci_polarParams = nr_polar_params(2, nr_bit, nrofPRB, 1, NULL); startingPRB_intraSlotHopping = N_RB_DL-1; uint32_t hopping_id = Nid_cell; @@ -728,8 +727,6 @@ int main(int argc, char **argv) break; } } - if (gNB->uci_polarParams) - nr_polar_delete(gNB->uci_polarParams); free_channel_desc_scm(UE2gNB); term_freq_channel(); From 7b73a9e14eba780f3464115070fedeef6f8d8bc0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 22 Feb 2022 19:33:47 +0100 Subject: [PATCH 184/196] Build phy sims with optimizations As of this commit, the CI would take too much time to process dl_sim. This commit activate optimizations to be within the CI time limits. --- docker/Dockerfile.phySim.rhel8.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile.phySim.rhel8.2 b/docker/Dockerfile.phySim.rhel8.2 index 15a363b05b..2627a9eafd 100644 --- a/docker/Dockerfile.phySim.rhel8.2 +++ b/docker/Dockerfile.phySim.rhel8.2 @@ -38,7 +38,7 @@ RUN yum install -y libasan RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - ./build_oai --phy_simulators -g --ninja --verbose-ci --sanitize-address + ./build_oai --phy_simulators --ninja --verbose-ci --sanitize-address #start from scratch for target executable FROM registry.access.redhat.com/ubi8/ubi:latest as oai-physim From 70ba0cda0ed91295b03a05a3042d1c9572d1ab59 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 22 Feb 2022 19:42:50 +0100 Subject: [PATCH 185/196] Free rx_ind if dl_indication not called --- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 20d63f985a..6b5185dc2c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -601,7 +601,6 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif nr_downlink_indication_t dl_indication; - //Fixme: on the heap to please the mandatory free in nr_ue_ul_indication() fapi_nr_rx_indication_t *rx_ind=calloc(sizeof(*rx_ind),1); uint16_t number_pdus = 1; @@ -610,6 +609,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, if (ue->if_inst && ue->if_inst->dl_indication) ue->if_inst->dl_indication(&dl_indication, NULL); + else + free(rx_ind); // dl_indication would free(), so free() here if not called return 0; } From 34edc9c04c1fb72596a208744b2f2ecdb35b251b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 23 Feb 2022 12:32:40 +0100 Subject: [PATCH 186/196] Increase CI physim time limit --- ci-scripts/cls_physim1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index b7a730e91c..83fb74b7cb 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -246,7 +246,7 @@ class PhySim: isFinished = False # doing a deep copy! tmpPodNames = podNames.copy() - while(count < 32 and isFinished == False): + while(count < 50 and isFinished == False): time.sleep(60) for podName in tmpPodNames: mySSH.command2(f'oc logs --tail=1 {podName} 2>&1', 6, silent=True) From ae803b5370f1bdb83bbbb0edec282e5599b36519 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 23 Feb 2022 16:57:49 +0100 Subject: [PATCH 187/196] Prevent heap buffer overflow in nr_dlsch_channel_compensation() The TX correlation calculation incremented the pointer over the outer TX antenna inside the inner TX antenna loop. Incrementing the pointer in the outer loop instead prevents overflowing. --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 075aaecc08..7101cadac8 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -1027,7 +1027,6 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, ((int16_t*)&rho128[2])[5] + ((int16_t*)&rho128[2])[7])/16; - dl_ch128+=3; dl_ch128_2+=3; rho128+=3; } @@ -1037,6 +1036,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, avg_rho_im[aarx][aatx*nb_aatx+atx] = 16*avg_rho_im[aarx][aatx*nb_aatx+atx]/(nb_rb*12); //printf("rho[rx]%d tx%d tx%d = Re: %d Im: %d\n",aarx, aatx,atx, avg_rho_re[aarx][aatx*nb_aatx+atx], avg_rho_im[aarx][aatx*nb_aatx+atx]); } + dl_ch128+=3; } } } From 11441023db2b958349f4192acbb1c1b34c320f48 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 23 Feb 2022 17:19:00 +0100 Subject: [PATCH 188/196] fix polar race condition --- .../install_external_packages.ubuntu20 | 1 + .../CODING/nrPolar_tools/nr_polar_decoder.c | 13 +- .../PHY/CODING/nrPolar_tools/nr_polar_defs.h | 8 + .../CODING/nrPolar_tools/nr_polar_encoder.c | 15 +- openair1/PHY/CODING/nr_polar_init.c | 248 +++++++++--------- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +- openair1/SIMULATION/LTE_PHY/ulsim.c | 8 +- openair3/NAS/COMMON/API/NETWORK/nas_message.c | 3 +- 8 files changed, 159 insertions(+), 139 deletions(-) diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20 index 1f10ca53c7..a2f6a9709c 100755 --- a/cmake_targets/install_external_packages.ubuntu20 +++ b/cmake_targets/install_external_packages.ubuntu20 @@ -86,6 +86,7 @@ check_supported_distribution() { "ubuntu20.04") return 0 ;; "ubuntu20.10") return 0 ;; "ubuntu21.04") return 0 ;; + "ubuntu21.10") return 0 ;; esac return 1 } diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c index 5b21f49381..03ffa30025 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c @@ -268,7 +268,7 @@ int8_t polar_decoder(double *input, if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - return(-1); + polarReturn(-1); } nonFrozenBit++; @@ -301,7 +301,8 @@ int8_t polar_decoder(double *input, * Return bits. */ nr_byte2bit_uint8_32(polarParams->nr_polar_A, polarParams->payloadBits, out); - return(0); + + polarReturn 0; } int8_t polar_decoder_dci(double *input, @@ -532,7 +533,7 @@ int8_t polar_decoder_dci(double *input, if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - return(-1); + polarReturn -1; } nonFrozenBit++; @@ -565,7 +566,8 @@ int8_t polar_decoder_dci(double *input, * Return bits. */ nr_byte2bit_uint8_32(polarParams->nr_polar_A, polarParams->payloadBits, out); - return(0); + + polarReturn 0; } void init_polar_deinterleaver_table(t_nrPolar_params *polarParams) { @@ -705,5 +707,6 @@ uint32_t polar_decoder_int16(int16_t *input, rxcrc,polarParams->payloadBits); #endif out[0]=Ar; - return(crc^rxcrc); + + polarReturn crc^rxcrc; } diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h index 5d5d55b23e..edb5ebbcc2 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h @@ -81,6 +81,7 @@ struct nrPolar_params { //messageType: 0=PBCH, 1=DCI, -1=UCI struct nrPolar_params *nextPtr __attribute__((aligned(16))); + bool busy; uint32_t idx; uint8_t n_max; uint8_t i_il; @@ -344,4 +345,11 @@ static inline void nr_polar_deinterleaver(uint8_t *input, for (int i=0; ibusy=false; \ +pthread_mutex_unlock(&PolarListMutex); \ +return + #endif diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c index 8cea7c8986..f654d33dfd 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c @@ -60,10 +60,10 @@ void polar_encoder(uint32_t *in, */ //Calculate CRC. nr_matrix_multiplication_uint8_1D_uint8_2D(polarParams->nr_polar_A, - polarParams->crc_generator_matrix, - polarParams->nr_polar_crc, - polarParams->payloadBits, - polarParams->crcParityBits); + polarParams->crc_generator_matrix, + polarParams->nr_polar_crc, + polarParams->payloadBits, + polarParams->crcParityBits); for (uint8_t i = 0; i < polarParams->crcParityBits; i++) polarParams->nr_polar_crc[i] = (polarParams->nr_polar_crc[i] % 2); @@ -153,6 +153,9 @@ void polar_encoder(uint32_t *in, #endif nr_byte2bit_uint8_32(polarParams->nr_polar_E, polarParams->encoderLength, out); + + polarReturn; + } void polar_encoder_dci(uint32_t *in, @@ -256,6 +259,7 @@ void polar_encoder_dci(uint32_t *in, printf("\n[polar_encoder_dci] out: "); for (int i = 0; i < outputInd; i++) printf("[%d]->0x%08x\t", i, out[i]); #endif + polarReturn; } static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void *in,void *out) __attribute__((always_inline)); @@ -698,4 +702,7 @@ void polar_encoder_fast(uint64_t *A, } memset((void*)out,0,polarParams->encoderLength>>3); polar_rate_matching(polarParams,(void *)D, out); + + polarReturn; + } diff --git a/openair1/PHY/CODING/nr_polar_init.c b/openair1/PHY/CODING/nr_polar_init.c index 50bc90636d..32e2d7f364 100644 --- a/openair1/PHY/CODING/nr_polar_init.c +++ b/openair1/PHY/CODING/nr_polar_init.c @@ -100,10 +100,11 @@ t_nrPolar_params * nr_polar_params(int8_t messageType, while (currentPtr != NULL) { //printf("currentPtr->idx %d, (%d,%d)\n",currentPtr->idx,currentPtr->payloadBits,currentPtr->encoderLength); //LOG_D(PHY,"Looking for index %d\n",(messageType * messageLength * aggregation_prime)); - if (currentPtr->idx == PolarKey ) { + if (currentPtr->busy == false && currentPtr->idx == PolarKey ) { + currentPtr->busy=true; + pthread_mutex_unlock(&PolarListMutex); if (decoder_flag && !currentPtr->tree.root) build_decoder_tree(currentPtr); - pthread_mutex_unlock(&PolarListMutex); return currentPtr ; } else @@ -113,143 +114,142 @@ t_nrPolar_params * nr_polar_params(int8_t messageType, // printf("currentPtr %p (polarParams %p)\n",currentPtr,polarParams); //Else, initialize and add node to the end of the linked list. t_nrPolar_params *newPolarInitNode = calloc(sizeof(t_nrPolar_params),1); - - if (newPolarInitNode != NULL) { - // LOG_D(PHY,"Setting new polarParams index %d, messageType %d, messageLength %d, aggregation_prime %d\n",(messageType * messageLength * aggregation_prime),messageType,messageLength,aggregation_prime); - newPolarInitNode->idx = PolarKey; - newPolarInitNode->nextPtr = NULL; - //printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level); + newPolarInitNode->busy=true; + pthread_mutex_unlock(&PolarListMutex); - if (messageType == 0) { //PBCH - newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX; - newPolarInitNode->i_il = NR_POLAR_PBCH_I_IL; - newPolarInitNode->i_seg = NR_POLAR_PBCH_I_SEG; - newPolarInitNode->n_pc = NR_POLAR_PBCH_N_PC; - newPolarInitNode->n_pc_wm = NR_POLAR_PBCH_N_PC_WM; - newPolarInitNode->i_bil = NR_POLAR_PBCH_I_BIL; - newPolarInitNode->crcParityBits = NR_POLAR_PBCH_CRC_PARITY_BITS; - newPolarInitNode->payloadBits = NR_POLAR_PBCH_PAYLOAD_BITS; - newPolarInitNode->encoderLength = NR_POLAR_PBCH_E; - newPolarInitNode->crcCorrectionBits = NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS; - newPolarInitNode->crc_generator_matrix = crc24c_generator_matrix(newPolarInitNode->payloadBits);//G_P - //printf("Initializing polar parameters for PBCH (K %d, E %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength); - } else if (messageType == 1) { //DCI - newPolarInitNode->n_max = NR_POLAR_DCI_N_MAX; - newPolarInitNode->i_il = NR_POLAR_DCI_I_IL; - newPolarInitNode->i_seg = NR_POLAR_DCI_I_SEG; - newPolarInitNode->n_pc = NR_POLAR_DCI_N_PC; - newPolarInitNode->n_pc_wm = NR_POLAR_DCI_N_PC_WM; - newPolarInitNode->i_bil = NR_POLAR_DCI_I_BIL; - newPolarInitNode->crcParityBits = NR_POLAR_DCI_CRC_PARITY_BITS; - newPolarInitNode->payloadBits = messageLength; - newPolarInitNode->encoderLength = aggregation_level*108; - newPolarInitNode->crcCorrectionBits = NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS; - newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P - //printf("Initializing polar parameters for DCI (K %d, E %d, L %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength,aggregation_level); - } else if (messageType == 2) { //UCI PUCCH2 - AssertFatal(aggregation_level>2,"Aggregation level (%d) for PUCCH 2 encoding is NPRB and should be > 2\n",aggregation_level); - AssertFatal(messageLength>11,"Message length %d is too short for polar encoding of UCI\n",messageLength); - newPolarInitNode->n_max = NR_POLAR_PUCCH_N_MAX; - newPolarInitNode->i_il = NR_POLAR_PUCCH_I_IL; - newPolarInitNode->encoderLength = aggregation_level * 16; + AssertFatal(newPolarInitNode != NULL, "[nr_polar_init] New t_nrPolar_params * could not be created"); + + // LOG_D(PHY,"Setting new polarParams index %d, messageType %d, messageLength %d, aggregation_prime %d\n",(messageType * messageLength * aggregation_prime),messageType,messageLength,aggregation_prime); + newPolarInitNode->idx = PolarKey; + newPolarInitNode->nextPtr = NULL; + //printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level); + + if (messageType == 0) { //PBCH + newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX; + newPolarInitNode->i_il = NR_POLAR_PBCH_I_IL; + newPolarInitNode->i_seg = NR_POLAR_PBCH_I_SEG; + newPolarInitNode->n_pc = NR_POLAR_PBCH_N_PC; + newPolarInitNode->n_pc_wm = NR_POLAR_PBCH_N_PC_WM; + newPolarInitNode->i_bil = NR_POLAR_PBCH_I_BIL; + newPolarInitNode->crcParityBits = NR_POLAR_PBCH_CRC_PARITY_BITS; + newPolarInitNode->payloadBits = NR_POLAR_PBCH_PAYLOAD_BITS; + newPolarInitNode->encoderLength = NR_POLAR_PBCH_E; + newPolarInitNode->crcCorrectionBits = NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS; + newPolarInitNode->crc_generator_matrix = crc24c_generator_matrix(newPolarInitNode->payloadBits);//G_P + //printf("Initializing polar parameters for PBCH (K %d, E %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength); + } else if (messageType == 1) { //DCI + newPolarInitNode->n_max = NR_POLAR_DCI_N_MAX; + newPolarInitNode->i_il = NR_POLAR_DCI_I_IL; + newPolarInitNode->i_seg = NR_POLAR_DCI_I_SEG; + newPolarInitNode->n_pc = NR_POLAR_DCI_N_PC; + newPolarInitNode->n_pc_wm = NR_POLAR_DCI_N_PC_WM; + newPolarInitNode->i_bil = NR_POLAR_DCI_I_BIL; + newPolarInitNode->crcParityBits = NR_POLAR_DCI_CRC_PARITY_BITS; + newPolarInitNode->payloadBits = messageLength; + newPolarInitNode->encoderLength = aggregation_level*108; + newPolarInitNode->crcCorrectionBits = NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS; + newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P + //printf("Initializing polar parameters for DCI (K %d, E %d, L %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength,aggregation_level); + } else if (messageType == 2) { //UCI PUCCH2 + AssertFatal(aggregation_level>2,"Aggregation level (%d) for PUCCH 2 encoding is NPRB and should be > 2\n",aggregation_level); + AssertFatal(messageLength>11,"Message length %d is too short for polar encoding of UCI\n",messageLength); + newPolarInitNode->n_max = NR_POLAR_PUCCH_N_MAX; + newPolarInitNode->i_il = NR_POLAR_PUCCH_I_IL; + newPolarInitNode->encoderLength = aggregation_level * 16; - newPolarInitNode->i_seg = 0; + newPolarInitNode->i_seg = 0; - if ((messageLength >= 360 && newPolarInitNode->encoderLength >= 1088)|| - (messageLength >= 1013)) newPolarInitNode->i_seg = 1; + if ((messageLength >= 360 && newPolarInitNode->encoderLength >= 1088)|| + (messageLength >= 1013)) newPolarInitNode->i_seg = 1; - newPolarInitNode->crcParityBits = 11; - newPolarInitNode->n_pc = 0; - newPolarInitNode->n_pc_wm = 0; + newPolarInitNode->crcParityBits = 11; + newPolarInitNode->n_pc = 0; + newPolarInitNode->n_pc_wm = 0; - if (messageLength < 20) { - newPolarInitNode->crcParityBits = 6; - newPolarInitNode->n_pc = 3; - if ((newPolarInitNode->encoderLength - messageLength - 6 + 3) < 193) newPolarInitNode->n_pc_wm = 1; - } - - - - newPolarInitNode->i_bil = NR_POLAR_PUCCH_I_BIL; - - newPolarInitNode->payloadBits = messageLength; - newPolarInitNode->crcCorrectionBits = NR_POLAR_PUCCH_CRC_ERROR_CORRECTION_BITS; - //newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P - //LOG_D(PHY,"New polar node, encoderLength %d, aggregation_level %d\n",newPolarInitNode->encoderLength,aggregation_level); - } else { - AssertFatal(1 == 0, "[nr_polar_init] Incorrect Message Type(%d)", messageType); + if (messageLength < 20) { + newPolarInitNode->crcParityBits = 6; + newPolarInitNode->n_pc = 3; + if ((newPolarInitNode->encoderLength - messageLength - 6 + 3) < 193) newPolarInitNode->n_pc_wm = 1; } - newPolarInitNode->K = newPolarInitNode->payloadBits + newPolarInitNode->crcParityBits; // Number of bits to encode. - newPolarInitNode->N = nr_polar_output_length(newPolarInitNode->K, - newPolarInitNode->encoderLength, - newPolarInitNode->n_max); - newPolarInitNode->n = log2(newPolarInitNode->N); - newPolarInitNode->G_N = nr_polar_kronecker_power_matrices(newPolarInitNode->n); - //polar_encoder vectors: - newPolarInitNode->nr_polar_crc = malloc(sizeof(uint8_t) * newPolarInitNode->crcParityBits); - newPolarInitNode->nr_polar_aPrime = malloc(sizeof(uint8_t) * ((ceil((newPolarInitNode->payloadBits)/32.0)*4)+3)); - newPolarInitNode->nr_polar_APrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); - newPolarInitNode->nr_polar_D = malloc(sizeof(uint8_t) * newPolarInitNode->N); - newPolarInitNode->nr_polar_E = malloc(sizeof(uint8_t) * newPolarInitNode->encoderLength); - //Polar Coding vectors - newPolarInitNode->nr_polar_U = malloc(sizeof(uint8_t) * newPolarInitNode->N); //Decoder: nr_polar_uHat - newPolarInitNode->nr_polar_CPrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_cHat - newPolarInitNode->nr_polar_B = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_bHat - newPolarInitNode->nr_polar_A = malloc(sizeof(uint8_t) * newPolarInitNode->payloadBits); //Decoder: nr_polar_aHat - newPolarInitNode->Q_0_Nminus1 = nr_polar_sequence_pattern(newPolarInitNode->n); - newPolarInitNode->interleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K); - nr_polar_interleaving_pattern(newPolarInitNode->K, - newPolarInitNode->i_il, - newPolarInitNode->interleaving_pattern); - newPolarInitNode->deinterleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K); - for (int i=0; iK; i++) - newPolarInitNode->deinterleaving_pattern[newPolarInitNode->interleaving_pattern[i]] = i; - newPolarInitNode->rate_matching_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength); - uint16_t J[newPolarInitNode->N]; - nr_polar_rate_matching_pattern(newPolarInitNode->rate_matching_pattern, - J, - nr_polar_subblock_interleaver_pattern, - newPolarInitNode->K, - newPolarInitNode->N, - newPolarInitNode->encoderLength); - newPolarInitNode->information_bit_pattern = malloc(sizeof(uint8_t) * newPolarInitNode->N); - newPolarInitNode->Q_I_N = malloc(sizeof(int16_t) * (newPolarInitNode->K + newPolarInitNode->n_pc)); - newPolarInitNode->Q_F_N = malloc( sizeof(int16_t) * (newPolarInitNode->N + 1)); // Last element shows the final array index assigned a value. - newPolarInitNode->Q_PC_N = malloc( sizeof(int16_t) * (newPolarInitNode->n_pc)); + newPolarInitNode->i_bil = NR_POLAR_PUCCH_I_BIL; - for (int i = 0; i <= newPolarInitNode->N; i++) - newPolarInitNode->Q_F_N[i] = -1; // Empty array. - - nr_polar_info_bit_pattern(newPolarInitNode->information_bit_pattern, - newPolarInitNode->Q_I_N, - newPolarInitNode->Q_F_N, - J, - newPolarInitNode->Q_0_Nminus1, - newPolarInitNode->K, - newPolarInitNode->N, - newPolarInitNode->encoderLength, - newPolarInitNode->n_pc); - // sort the Q_I_N array in ascending order (first K positions) - qsort((void *)newPolarInitNode->Q_I_N,newPolarInitNode->K,sizeof(int16_t),intcmp); - newPolarInitNode->channel_interleaver_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength); - nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern, - newPolarInitNode->i_bil, - newPolarInitNode->encoderLength); - if (decoder_flag == 1) - build_decoder_tree(newPolarInitNode); - build_polar_tables(newPolarInitNode); - init_polar_deinterleaver_table(newPolarInitNode); - //printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes); + newPolarInitNode->payloadBits = messageLength; + newPolarInitNode->crcCorrectionBits = NR_POLAR_PUCCH_CRC_ERROR_CORRECTION_BITS; + //newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P + //LOG_D(PHY,"New polar node, encoderLength %d, aggregation_level %d\n",newPolarInitNode->encoderLength,aggregation_level); } else { - AssertFatal(1 == 0, "[nr_polar_init] New t_nrPolar_params * could not be created"); + AssertFatal(1 == 0, "[nr_polar_init] Incorrect Message Type(%d)", messageType); } + newPolarInitNode->K = newPolarInitNode->payloadBits + newPolarInitNode->crcParityBits; // Number of bits to encode. + newPolarInitNode->N = nr_polar_output_length(newPolarInitNode->K, + newPolarInitNode->encoderLength, + newPolarInitNode->n_max); + newPolarInitNode->n = log2(newPolarInitNode->N); + newPolarInitNode->G_N = nr_polar_kronecker_power_matrices(newPolarInitNode->n); + //polar_encoder vectors: + newPolarInitNode->nr_polar_crc = malloc(sizeof(uint8_t) * newPolarInitNode->crcParityBits); + newPolarInitNode->nr_polar_aPrime = malloc(sizeof(uint8_t) * ((ceil((newPolarInitNode->payloadBits)/32.0)*4)+3)); + newPolarInitNode->nr_polar_APrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); + newPolarInitNode->nr_polar_D = malloc(sizeof(uint8_t) * newPolarInitNode->N); + newPolarInitNode->nr_polar_E = malloc(sizeof(uint8_t) * newPolarInitNode->encoderLength); + //Polar Coding vectors + newPolarInitNode->nr_polar_U = malloc(sizeof(uint8_t) * newPolarInitNode->N); //Decoder: nr_polar_uHat + newPolarInitNode->nr_polar_CPrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_cHat + newPolarInitNode->nr_polar_B = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_bHat + newPolarInitNode->nr_polar_A = malloc(sizeof(uint8_t) * newPolarInitNode->payloadBits); //Decoder: nr_polar_aHat + newPolarInitNode->Q_0_Nminus1 = nr_polar_sequence_pattern(newPolarInitNode->n); + newPolarInitNode->interleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K); + nr_polar_interleaving_pattern(newPolarInitNode->K, + newPolarInitNode->i_il, + newPolarInitNode->interleaving_pattern); + newPolarInitNode->deinterleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K); + + for (int i=0; iK; i++) + newPolarInitNode->deinterleaving_pattern[newPolarInitNode->interleaving_pattern[i]] = i; + + newPolarInitNode->rate_matching_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength); + uint16_t J[newPolarInitNode->N]; + nr_polar_rate_matching_pattern(newPolarInitNode->rate_matching_pattern, + J, + nr_polar_subblock_interleaver_pattern, + newPolarInitNode->K, + newPolarInitNode->N, + newPolarInitNode->encoderLength); + newPolarInitNode->information_bit_pattern = malloc(sizeof(uint8_t) * newPolarInitNode->N); + newPolarInitNode->Q_I_N = malloc(sizeof(int16_t) * (newPolarInitNode->K + newPolarInitNode->n_pc)); + newPolarInitNode->Q_F_N = malloc( sizeof(int16_t) * (newPolarInitNode->N + 1)); // Last element shows the final array index assigned a value. + newPolarInitNode->Q_PC_N = malloc( sizeof(int16_t) * (newPolarInitNode->n_pc)); + + for (int i = 0; i <= newPolarInitNode->N; i++) + newPolarInitNode->Q_F_N[i] = -1; // Empty array. + + nr_polar_info_bit_pattern(newPolarInitNode->information_bit_pattern, + newPolarInitNode->Q_I_N, + newPolarInitNode->Q_F_N, + J, + newPolarInitNode->Q_0_Nminus1, + newPolarInitNode->K, + newPolarInitNode->N, + newPolarInitNode->encoderLength, + newPolarInitNode->n_pc); + // sort the Q_I_N array in ascending order (first K positions) + qsort((void *)newPolarInitNode->Q_I_N,newPolarInitNode->K,sizeof(int16_t),intcmp); + newPolarInitNode->channel_interleaver_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength); + nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern, + newPolarInitNode->i_bil, + newPolarInitNode->encoderLength); + if (decoder_flag == 1) + build_decoder_tree(newPolarInitNode); + build_polar_tables(newPolarInitNode); + init_polar_deinterleaver_table(newPolarInitNode); + //printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes); + newPolarInitNode->nextPtr=PolarList; PolarList=newPolarInitNode; - pthread_mutex_unlock(&PolarListMutex); return newPolarInitNode; } diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 8f9fcae563..25f2f37321 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -147,7 +147,7 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_ } void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4], - double *s_re[2],double *s_im[2],double *r_re[2],double *r_im[2],FILE *csv_fd) { + double *s_re[NB_ANTENNAS_TX],double *s_im[[NB_ANTENNAS_TX],double *r_re[NB_ANTENNAS_RX],double *r_im[NB_ANTENNAS_RX],FILE *csv_fd) { int i,u; int aa,aarx,aatx; double channelx,channely; diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 8f275bbd91..a1894d03d7 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -340,10 +340,10 @@ int main(int argc, char **argv) { double s_re1[30720],s_im1[30720],r_re1[30720],r_im1[30720]; double r_re2[30720],r_im2[30720]; double r_re3[30720],r_im3[30720]; - double *s_re[2]= {s_re0,s_re1}; - double *s_im[2]= {s_im0,s_im1}; - double *r_re[4]= {r_re0,r_re1,r_re2,r_re3}; - double *r_im[4]= {r_im0,r_im1,r_im2,r_im3}; + double *s_re[NB_ANTENNAS_TX]= {s_re0,s_re1, NULL, NULL}; + double *s_im[NB_ANTENNAS_TX]= {s_im0,s_im1, NULL, NULL}; + double *r_re[NB_ANTENNAS_RX]= {r_re0,r_re1,r_re2,r_re3}; + double *r_im[NB_ANTENNAS_RX]= {r_im0,r_im1,r_im2,r_im3}; double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel double iqim=0.0; int cqi_error,cqi_errors,ack_errors,cqi_crc_falsepositives,cqi_crc_falsenegatives; diff --git a/openair3/NAS/COMMON/API/NETWORK/nas_message.c b/openair3/NAS/COMMON/API/NETWORK/nas_message.c index 769eab5260..d1a9e97025 100644 --- a/openair3/NAS/COMMON/API/NETWORK/nas_message.c +++ b/openair3/NAS/COMMON/API/NETWORK/nas_message.c @@ -1096,7 +1096,8 @@ static int _nas_message_decrypt( "Unknown security header type %u", security_header_type); LOG_FUNC_RETURN (0); }; - + LOG_FUNC_RETURN (0); + } /**************************************************************************** From 22d2e9a38f38f6d96231e2a356b68ad34ecf5885 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 23 Feb 2022 18:02:55 +0100 Subject: [PATCH 189/196] fix warnings and race cond in polar codec --- .../CODING/nrPolar_tools/nr_polar_decoder.c | 6 ++--- .../PHY/CODING/nrPolar_tools/nr_polar_defs.h | 3 ++- .../CODING/nrPolar_tools/nr_polar_encoder.c | 6 ++--- openair1/PHY/CODING/nr_polar_init.c | 2 +- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 7 ------ openair2/RRC/NR/nr_rrc_proto.h | 21 ++++++++++++++++++ openair2/RRC/NR/rrc_gNB.c | 1 + openair2/RRC/NR/rrc_gNB_nsa.c | 22 +------------------ openair2/RRC/NR_UE/rrc_UE.c | 22 +------------------ 10 files changed, 34 insertions(+), 58 deletions(-) diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c index 03ffa30025..62ce034f59 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c @@ -64,7 +64,7 @@ int8_t polar_decoder(double *input, uint8_t aggregation_level ) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); //Assumes no a priori knowledge. uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; memset(bit,0,sizeof bit); @@ -312,7 +312,7 @@ int8_t polar_decoder_dci(double *input, int8_t messageType, uint16_t messageLength, uint8_t aggregation_level ) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; memset(bit,0,sizeof bit); @@ -610,7 +610,7 @@ uint32_t polar_decoder_int16(int16_t *input, uint16_t messageLength, uint8_t aggregation_level ) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); int16_t d_tilde[polarParams->N];// = malloc(sizeof(double) * polarParams->N); nr_polar_rate_matching_int16(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength); diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h index edb5ebbcc2..79af311e45 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h @@ -346,9 +346,10 @@ static inline void nr_polar_deinterleaver(uint8_t *input, } void delete_decoder_tree(t_nrPolar_params *); +extern pthread_mutex_t PolarListMutex; #define polarReturn \ pthread_mutex_lock(&PolarListMutex); \ -currentPtr->busy=false; \ +polarParams->busy=false; \ pthread_mutex_unlock(&PolarListMutex); \ return diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c index f654d33dfd..4cba3fe078 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c @@ -46,7 +46,7 @@ void polar_encoder(uint32_t *in, int8_t messageType, uint16_t messageLength, uint8_t aggregation_level) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); if (1) {//polarParams->idx == 0 || polarParams->idx == 1) { //PBCH or PDCCH /* uint64_t B = (((uint64_t)*in)&((((uint64_t)1)<<32)-1)) | (((uint64_t)crc24c((uint8_t*)in,polarParams->payloadBits)>>8)<payloadBits); @@ -164,7 +164,7 @@ void polar_encoder_dci(uint32_t *in, int8_t messageType, uint16_t messageLength, uint8_t aggregation_level) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); #ifdef DEBUG_POLAR_ENCODER_DCI printf("[polar_encoder_dci] in: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", in[0], in[1], in[2], in[3]); @@ -433,7 +433,7 @@ void polar_encoder_fast(uint64_t *A, uint16_t messageLength, uint8_t aggregation_level) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); // AssertFatal(polarParams->K > 32, "K = %d < 33, is not supported yet\n",polarParams->K); AssertFatal(polarParams->K < 129, "K = %d > 128, is not supported yet\n",polarParams->K); AssertFatal(polarParams->payloadBits < 65, "payload bits = %d > 64, is not supported yet\n",polarParams->payloadBits); diff --git a/openair1/PHY/CODING/nr_polar_init.c b/openair1/PHY/CODING/nr_polar_init.c index 32e2d7f364..38a1ae86ae 100644 --- a/openair1/PHY/CODING/nr_polar_init.c +++ b/openair1/PHY/CODING/nr_polar_init.c @@ -35,7 +35,7 @@ #define PolarKey ((messageType<<24)|(messageLength<<8)|aggregation_level) static t_nrPolar_params * PolarList=NULL; -static pthread_mutex_t PolarListMutex=PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t PolarListMutex=PTHREAD_MUTEX_INITIALIZER; static int intcmp(const void *p1,const void *p2) { return(*(int16_t *)p1 > *(int16_t *)p2); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 25f2f37321..495b6803a6 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -147,7 +147,7 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_ } void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4], - double *s_re[NB_ANTENNAS_TX],double *s_im[[NB_ANTENNAS_TX],double *r_re[NB_ANTENNAS_RX],double *r_im[NB_ANTENNAS_RX],FILE *csv_fd) { + double *s_re[NB_ANTENNAS_TX],double *s_im[NB_ANTENNAS_TX],double *r_re[NB_ANTENNAS_RX],double *r_im[NB_ANTENNAS_RX],FILE *csv_fd) { int i,u; int aa,aarx,aatx; double channelx,channely; diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index a08c9d2c78..1f66400af1 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -101,13 +101,6 @@ typedef struct { static rlc_data_req_queue q; -extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, - const NR_SRB_ToAddModList_t * const srb2add_listP, - const NR_DRB_ToAddModList_t * const drb2add_listP, - const NR_DRB_ToReleaseList_t * const drb2release_listP, - const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - static void *rlc_data_req_thread(void *_) { int i; diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 30211b6a0b..5008af6fa8 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -208,3 +208,24 @@ void rrc_gNB_generate_dedicatedRRCReconfiguration( const protocol_ctxt_t *const ctxt_pP, rrc_gNB_ue_context_t *ue_context_pP); + +rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, + const NR_SRB_ToAddModList_t * const srb2add_listP, + const NR_DRB_ToAddModList_t * const drb2add_listP, + const NR_DRB_ToReleaseList_t * const drb2release_listP, + const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, + struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); + +boolean_t nr_rrc_pdcp_config_asn1_req( + const protocol_ctxt_t *const ctxt_pP, + NR_SRB_ToAddModList_t *const srb2add_list, + NR_DRB_ToAddModList_t *const drb2add_list, + NR_DRB_ToReleaseList_t *const drb2release_list, + const uint8_t security_modeP, + uint8_t *const kRRCenc, + uint8_t *const kRRCint, + uint8_t *const kUPenc, + uint8_t *const kUPint + ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 + ,rb_id_t *const defaultDRB, + struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index f49a0e24bc..2f588157ce 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -98,6 +98,7 @@ #include #include #include +#include #include "BIT_STRING.h" #include "assertions.h" diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 939b35f3f2..e55c9d4ed2 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -42,27 +42,7 @@ #include #include #include "UTIL/OSA/osa_defs.h" - -extern boolean_t nr_rrc_pdcp_config_asn1_req( - const protocol_ctxt_t *const ctxt_pP, - NR_SRB_ToAddModList_t *const srb2add_list, - NR_DRB_ToAddModList_t *const drb2add_list, - NR_DRB_ToReleaseList_t *const drb2release_list, - const uint8_t security_modeP, - uint8_t *const kRRCenc, - uint8_t *const kRRCint, - uint8_t *const kUPenc, - uint8_t *const kUPint - ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 - ,rb_id_t *const defaultDRB, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - -extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, - const NR_SRB_ToAddModList_t * const srb2add_listP, - const NR_DRB_ToAddModList_t * const drb2add_listP, - const NR_DRB_ToReleaseList_t * const drb2release_listP, - const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); +#include void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t *cg_config_info) { struct rrc_gNB_ue_context_s *ue_context_p = NULL; diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 2fa0583074..47f4466f85 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -72,6 +72,7 @@ #include #include "nr_nas_msg_sim.h" +#include NR_UE_RRC_INST_t *NR_UE_rrc_inst; /* NAS Attach request with IMSI */ @@ -178,27 +179,6 @@ static int nr_rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_NR_t subS return (0); } -extern boolean_t nr_rrc_pdcp_config_asn1_req( - const protocol_ctxt_t *const ctxt_pP, - NR_SRB_ToAddModList_t *const srb2add_list, - NR_DRB_ToAddModList_t *const drb2add_list, - NR_DRB_ToReleaseList_t *const drb2release_list, - const uint8_t security_modeP, - uint8_t *const kRRCenc, - uint8_t *const kRRCint, - uint8_t *const kUPenc, - uint8_t *const kUPint - ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 - ,rb_id_t *const defaultDRB, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - -extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, - const NR_SRB_ToAddModList_t * const srb2add_listP, - const NR_DRB_ToAddModList_t * const drb2add_listP, - const NR_DRB_ToReleaseList_t * const drb2release_listP, - const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - // from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded) int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const module_id_t module_id, const uint8_t *buffer, From 048b539050b2f1aee6ff10e3f9ad4673e3a401f8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 23 Feb 2022 21:21:54 +0100 Subject: [PATCH 190/196] Correctly initialize PDCP in F1 mode --- executables/nr-softmodem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 7410e303b1..6452036912 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -593,6 +593,7 @@ void init_pdcp(void) { if (!get_softmodem_params()->nsa) { if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) { + pdcp_layer_init(); nr_pdcp_module_init(pdcp_initmask, 0); } } else { From 61e608adb5594a5804a235fbef78cd850b9b49ff Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 23 Feb 2022 21:54:01 +0100 Subject: [PATCH 191/196] Support reconfiguration of number of HARQ processes In F1, the time until the serving cell config comes from CU can be longer than when we want to schedule a particular UE. Then, if we don't configure the default number of HARQ processes, we can have a segfault. In this commit, we initially configure 8 HARQ processes. When we get the right number from RRC, we reconfigure. --- openair2/LAYER2/NR_MAC_gNB/config.c | 8 +-- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 64 +++++++++++++++---- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + 3 files changed, 55 insertions(+), 18 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 19c82c71df..e703d5aa65 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -628,16 +628,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; - if (sched_ctrl->available_dl_harq.len == 0) { + if (get_softmodem_params()->sa) { // add all available DL HARQ processes for this UE in SA create_dl_harq_list(sched_ctrl, pdsch); } - else { - const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ? - get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8; - AssertFatal(sched_ctrl->available_dl_harq.len==nrofHARQ, - "Reconfiguration of available harq processes not yet supported\n"); - } // update coreset/searchspace void *bwpd = NULL; NR_BWP_t *genericParameters = NULL; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 721f67295b..b9f5147457 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1942,14 +1942,46 @@ void dump_nr_list(NR_list_t *listP) void create_nr_list(NR_list_t *list, int len) { list->head = -1; - list->next = calloc(len, sizeof(*list->next)); - AssertFatal(list, "cannot calloc() memory for NR_list_t->next\n"); + list->next = malloc(len * sizeof(*list->next)); + LOG_W(NR_MAC, "NR list->next %p\n", list->next); + AssertFatal(list->next, "cannot calloc() memory for NR_list_t->next\n"); for (int i = 0; i < len; ++i) list->next[i] = -1; list->tail = -1; list->len = len; } +/* + * Resize an NR_list + */ +void resize_nr_list(NR_list_t *list, int new_len) +{ + if (new_len == list->len) + return; + if (new_len > list->len) { + /* list->head remains */ + const int old_len = list->len; + int* n = realloc(list->next, new_len * sizeof(*list->next)); + AssertFatal(n, "cannot realloc() memory for NR_list_t->next\n"); + list->next = n; + for (int i = old_len; i < new_len; ++i) + list->next[i] = -1; + /* list->tail remains */ + list->len = new_len; + } else { /* new_len < len */ + AssertFatal(list->head < new_len, "shortened list head out of index %d (new len %d)\n", list->head, new_len); + AssertFatal(list->tail < new_len, "shortened list tail out of index %d (new len %d)\n", list->head, new_len); + for (int i = 0; i < list->len; ++i) + AssertFatal(list->next[i] < new_len, "shortened list entry out of index %d (new len %d)\n", list->next[i], new_len); + /* list->head remains */ + int *n = realloc(list->next, new_len * sizeof(*list->next)); + AssertFatal(n, "cannot realloc() memory for NR_list_t->next\n"); + list->next = n; + /* list->tail remains */ + list->len = new_len; + } +} + /* * Destroy an NR_list */ @@ -2205,10 +2237,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG "no pdsch-ServingCellConfig found for UE %d\n", UE_id); const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; - // add DL HARQ processes for this UE only in NSA - // (SA still doesn't have information on nrofHARQ_ProcessesForPDSCH at this stage) - if (!get_softmodem_params()->sa) - create_dl_harq_list(sched_ctrl,pdsch); + // pdsch == NULL in SA -> will create default (8) number of HARQ processes + create_dl_harq_list(sched_ctrl, pdsch); // add all available UL HARQ processes for this UE // nb of ul harq processes not configurable create_nr_list(&sched_ctrl->available_ul_harq, 16); @@ -2236,11 +2266,23 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ? get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8; // add all available DL HARQ processes for this UE - create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); - for (int harq = 0; harq < nrofHARQ; harq++) - add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); - create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); - create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); + AssertFatal(sched_ctrl->available_dl_harq.len == sched_ctrl->feedback_dl_harq.len + && sched_ctrl->available_dl_harq.len == sched_ctrl->retrans_dl_harq.len, + "HARQ lists have different lengths (%d/%d/%d)\n", + sched_ctrl->available_dl_harq.len, + sched_ctrl->feedback_dl_harq.len, + sched_ctrl->retrans_dl_harq.len); + if (sched_ctrl->available_dl_harq.len == 0) { + create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); + for (int harq = 0; harq < nrofHARQ; harq++) + add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); + create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); + create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); + } else { + resize_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); + resize_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); + resize_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); + } } /* hack data to remove UE in the phy */ diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 55136b0015..28e9d689fa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -351,6 +351,7 @@ int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB); /* Functions to manage an NR_list_t */ void dump_nr_list(NR_list_t *listP); void create_nr_list(NR_list_t *listP, int len); +void resize_nr_list(NR_list_t *list, int new_len); void destroy_nr_list(NR_list_t *list); void add_nr_list(NR_list_t *listP, int id); void remove_nr_list(NR_list_t *listP, int id); From 1858418fb892a2de96b8c6cb8045b0e383763078 Mon Sep 17 00:00:00 2001 From: Panos Matzakos Date: Thu, 24 Feb 2022 14:57:11 +0000 Subject: [PATCH 192/196] Update TESTING_5GSA_setup.md for CU/DU instructions --- doc/TESTING_5GSA_setup.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/TESTING_5GSA_setup.md b/doc/TESTING_5GSA_setup.md index 048d8c86ff..f8c85bf2ca 100644 --- a/doc/TESTING_5GSA_setup.md +++ b/doc/TESTING_5GSA_setup.md @@ -169,8 +169,7 @@ MACRLCs = ( At the point of writing this document the control-plane exchanges between the CU and the DU over *F1-C* interface, as well as some IP traffic tests over *F1-U* have been validated using the OAI gNB/nrUE in RFSIMULATOR mode. - -*These extensions are not yet fully integrated into develop branch, as they are under merge request. Until they get fully integrated, the CU/DU functionalities can be tested in [NR_F1C_F1U_extensions](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/NR_F1C_F1U_extensions) branch.* + ## 1.2 OAI 5G Core Network installation and configuration The instructions for the installation of OAI CN components (AMF, SMF, NRF, UPF) using `docker-compose` can be found [here](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/README.md). @@ -264,12 +263,12 @@ the gNB can be launched in 2 modes: 1. Launch the CU component: ```bash sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \ - -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf + -O ../../../ci-scripts/conf_files/gNB_SA_CU.conf ``` 2. Launch the DU component: ```bash sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \ - -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf + -O ../../../ci-scripts/conf_files/gNB_SA_DU.conf ``` - To launch the OAI UE (valid in `monolithic` gNB and `CU/DU split` gNB): From 8b526c3cb785dad0ad5f3ea90dc1b69e9c81f4a0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Feb 2022 20:52:05 +0100 Subject: [PATCH 193/196] Address review comment --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index b9f5147457..938b9f2584 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1944,7 +1944,7 @@ void create_nr_list(NR_list_t *list, int len) list->head = -1; list->next = malloc(len * sizeof(*list->next)); LOG_W(NR_MAC, "NR list->next %p\n", list->next); - AssertFatal(list->next, "cannot calloc() memory for NR_list_t->next\n"); + AssertFatal(list->next, "cannot malloc() memory for NR_list_t->next\n"); for (int i = 0; i < len; ++i) list->next[i] = -1; list->tail = -1; From 8cfb8b6a3bf6b33a0fb0b01f913f7ba04599e13d Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 25 Feb 2022 11:42:15 +0100 Subject: [PATCH 194/196] Fix correlation calculation in nr_dlsch_channel_compensation() --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 7101cadac8..75517b7a6f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -931,12 +931,12 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, for (aarx=0; aarxnb_antennas_rx; aarx++) { for (aatx=0; aatxnb_antennas_rx+aarx][symbol*nb_rb*12]; for (atx=0; atxnb_antennas_rx+aarx][symbol*nb_rb*12]; dl_ch128_2 = (__m128i *)&dl_ch_estimates_ext[atx*frame_parms->nb_antennas_rx+aarx][symbol*nb_rb*12]; for (rb=0; rb Date: Fri, 25 Feb 2022 12:57:17 +0100 Subject: [PATCH 195/196] fix scrambling initialization in nr_dlsim and nr_ulsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 11 ++++++++++- openair1/SIMULATION/NR_PHY/ulsim.c | 19 ++++--------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index b8f51f8e95..fb99c50400 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -924,7 +924,16 @@ int main(int argc, char **argv) init_nr_ue_transport(UE,0); nr_gold_pbch(UE); - nr_gold_pdcch(UE,0); + + // compute the scramblingID_pdcch and the gold pdcch + UE->scramblingID_pdcch = frame_parms->Nid_cell; + nr_gold_pdcch(UE, frame_parms->Nid_cell); + + // compute the scrambling IDs for PDSCH DMRS + for (int i = 0; i < 2; i++) + UE->scramblingID[i] = frame_parms->Nid_cell; + + nr_gold_pdsch(UE, UE->scramblingID); nr_l2_init_ue(NULL); UE_mac = get_mac_inst(0); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index c71f52c41a..56f5d2dd71 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -755,28 +755,17 @@ int main(int argc, char **argv) PHY_vars_UE_g[0][0] = UE; memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS)); - //phy_init_nr_top(frame_parms); if (init_nr_ue_signal(UE, 1, 0) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); } - //nr_init_frame_parms_ue(&UE->frame_parms); init_nr_ue_transport(UE, 0); - /* - for (int sf = 0; sf < 2; sf++) { - for (i = 0; i < 2; i++) { - - UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0); - - if (!UE->ulsch[sf][0][i]) { - printf("Can't get ue ulsch structures\n"); - exit(-1); - } - } - } - */ + // initialize the pusch dmrs + uint16_t N_n_scid[2] = {frame_parms->Nid_cell,frame_parms->Nid_cell}; + int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization + nr_init_pusch_dmrs(UE, N_n_scid, n_scid); //Configure UE NR_UE_RRC_INST_t rrcue; From 2adf56b08a525e65479f2583cd7a641d92b4ac3f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 26 Feb 2022 11:15:36 +0100 Subject: [PATCH 196/196] Lower logging in handle_nr_ulsch() --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 4f50e0481c..2654988557 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -185,7 +185,7 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) for (int i = 0; i < UL_info->rx_ind.number_of_pdus; i++) { const nfapi_nr_rx_data_pdu_t *rx = &UL_info->rx_ind.pdu_list[i]; const nfapi_nr_crc_t *crc = &UL_info->crc_ind.crc_list[i]; - LOG_I(NR_PHY, "UL_info->crc_ind.pdu_list[%d].rnti:%04x " + LOG_D(NR_PHY, "UL_info->crc_ind.pdu_list[%d].rnti:%04x " "UL_info->rx_ind.pdu_list[%d].rnti:%04x\n", i, crc->rnti, i, rx->rnti);