X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_cfg.c;h=239285ab245526bd067b29fc425d3df8a88e434f;hb=49856df248fd976b4a9882ca4e650fc0bc3e4ee3;hp=e808132dd3d34ae1f1f5eecd4b65b5885287b622;hpb=9bfd39713f94e019675b4a255855177462b39bbd;p=o-du%2Fl2.git diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index e808132dd..239285ab2 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -71,315 +71,6 @@ extern NRCellDU cellParams; char encBuf[ENC_BUF_MAX_LEN]; - -/* Filling Slot configuration as : - * Slot Sym 0 Sym 1 Sym 2 Sym 3 Sym 4 Sym 5 Sym 6 Sym 7 Sym 8 Sym 9 Sym10 Sym11 Sym12 Sym13 - * 0 DL DL DL DL DL DL DL DL DL DL DL DL DL DL - * 1 DL DL DL DL DL DL DL DL DL DL DL DL DL DL - * 2 DL DL DL DL DL DL DL DL DL DL DL DL DL DL - 3 DL DL DL DL DL DL DL DL DL DL DL DL DL DL - 4 DL DL DL DL DL DL DL DL DL DL DL DL DL DL - 5 DL DL DL DL DL DL DL DL DL DL DL DL DL DL - 6 DL DL DL DL DL DL DL DL DL DL DL DL DL DL - 7 DL DL DL DL DL DL DL DL DL DL DL DL F UL - 8 UL UL UL UL UL UL UL UL UL UL UL UL UL UL - 9 UL UL UL UL UL UL UL UL UL UL UL UL UL UL - */ - -/******************************************************************* - * @brief Reads the CL Configuration. - * - * @details - * - * Function : readMacCfg - * - * Functionality: - * - Fills up the cell configuration for CL. - * - Calls FillSlotConfig() - * - * @params[in] void - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ - -uint8_t readMacCfg() -{ - uint8_t idx=0, sliceIdx=0,plmnIdx = 0; - SupportedSliceList *taiSliceSuppLst; - - /* DL carrier configuration */ -#ifdef O1_ENABLE - duCfgParam.macCellCfg.cellId = cellParams.cellLocalId; - duCfgParam.macCellCfg.carrCfg.dlBw = cellParams.bSChannelBwDL; - duCfgParam.macCellCfg.carrCfg.arfcnDL = cellParams.arfcnDL; -#else - duCfgParam.macCellCfg.cellId = NR_CELL_ID; - duCfgParam.macCellCfg.carrCfg.dlBw = NR_BANDWIDTH; - duCfgParam.macCellCfg.carrCfg.arfcnDL = NR_DL_ARFCN; -#endif - duCfgParam.macCellCfg.carrCfg.numTxAnt = NUM_TX_ANT; - /* UL Carrier configuration */ -#ifdef O1_ENABLE - duCfgParam.macCellCfg.carrCfg.ulBw = cellParams.bSChannelBwUL; - duCfgParam.macCellCfg.carrCfg.arfcnUL = cellParams.arfcnUL; -#else - duCfgParam.macCellCfg.carrCfg.ulBw = NR_BANDWIDTH; - duCfgParam.macCellCfg.carrCfg.arfcnUL = NR_UL_ARFCN; -#endif - duCfgParam.macCellCfg.carrCfg.numRxAnt = NUM_RX_ANT; - - /* Cell configuration */ -#ifdef O1_ENABLE - duCfgParam.macCellCfg.cellCfg.opState = cellParams.operationalState; - duCfgParam.macCellCfg.cellCfg.adminState = cellParams.administrativeState; - duCfgParam.macCellCfg.cellCfg.cellState = cellParams.cellState; - duCfgParam.macCellCfg.cellCfg.phyCellId = cellParams.nRPCI; - duCfgParam.macCellCfg.cellCfg.tac = cellParams.nRTAC; - duCfgParam.macCellCfg.cellCfg.ssbFreq = cellParams.ssbFrequency; -#else - duCfgParam.macCellCfg.cellCfg.opState = OP_DISABLED; - duCfgParam.macCellCfg.cellCfg.adminState = ADMIN_UNLOCKED; - duCfgParam.macCellCfg.cellCfg.cellState = CELL_INACTIVE; - duCfgParam.macCellCfg.cellCfg.phyCellId = NR_PCI; - duCfgParam.macCellCfg.cellCfg.tac = DU_TAC; - duCfgParam.macCellCfg.cellCfg.ssbFreq = SSB_FREQUENCY; -#endif - /* Plmn And SNSSAI Configuration */ - for(plmnIdx = 0; plmnIdx < MAX_PLMN; plmnIdx++) - { - memcpy(&duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].plmn, &duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[plmnIdx].plmn,\ - sizeof(Plmn)); - taiSliceSuppLst = &duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[plmnIdx].taiSliceSuppLst; - duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices = taiSliceSuppLst->numSupportedSlices; - if(taiSliceSuppLst->snssai) - { - DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai, (duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices) * sizeof(Snssai*)); - if(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai == NULLP) - { - DU_LOG("\nERROR --> DU_APP: Memory allocation failed at readMacCfg"); - return RFAILED; - } - } - for(sliceIdx=0; sliceIdx < taiSliceSuppLst->numSupportedSlices; sliceIdx++) - { - if(taiSliceSuppLst->snssai[sliceIdx] != NULLP) - { - DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai[sliceIdx], sizeof(Snssai)); - if(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai[sliceIdx] == NULLP) - { - DU_LOG("\nERROR --> DU_APP: Memory allocation failed at readMacCfg"); - return RFAILED; - } - memcpy(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai[sliceIdx], taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai)); - } - } - } - duCfgParam.macCellCfg.cellCfg.subCarrSpacing = NR_SCS; - duCfgParam.macCellCfg.cellCfg.dupType = DUPLEX_MODE; - - /* SSB configuration */ - duCfgParam.macCellCfg.ssbCfg.ssbPbchPwr = SSB_PBCH_PWR; - duCfgParam.macCellCfg.ssbCfg.bchPayloadFlag = BCH_PAYLOAD; - duCfgParam.macCellCfg.ssbCfg.ssbOffsetPointA = OFFSET_TO_POINT_A; - duCfgParam.macCellCfg.ssbCfg.betaPss = BETA_PSS; -#ifdef O1_ENABLE - duCfgParam.macCellCfg.ssbCfg.scsCmn = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); - duCfgParam.macCellCfg.ssbCfg.ssbPeriod = convertSSBPeriodicityToEnum(cellParams.ssbPeriodicity); - duCfgParam.macCellCfg.ssbCfg.ssbScOffset = cellParams.ssbOffset; -#else - duCfgParam.macCellCfg.ssbCfg.scsCmn = NR_SCS; - duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PRDCTY_MS_20; - duCfgParam.macCellCfg.ssbCfg.ssbScOffset = SSB_SUBCARRIER_OFFSET; -#endif - duCfgParam.macCellCfg.ssbCfg.ssbMask[0] = 1; /* only one SSB is transmitted */ - if(BuildMibPdu() != ROK) - { - DU_LOG("\nERROR --> Failed to build MIB PDU"); - memset(&duCfgParam.macCellCfg.ssbCfg.mibPdu, 0, 3*sizeof(uint8_t)); - } - else - { - memcpy(&duCfgParam.macCellCfg.ssbCfg.mibPdu, encBuf,encBufSize); - } - - /* PRACH configuration */ - duCfgParam.macCellCfg.prachCfg.prachSeqLen = PRACH_SEQ_LEN; - duCfgParam.macCellCfg.prachCfg.prachSubcSpacing = convertScsEnumValToScsVal(PRACH_SUBCARRIER_SPACING); - duCfgParam.macCellCfg.prachCfg.prachCfgIdx = PRACH_CONFIG_IDX; - duCfgParam.macCellCfg.prachCfg.msg1Fdm = NUM_PRACH_FDM; - duCfgParam.macCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX; - duCfgParam.macCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ; - duCfgParam.macCellCfg.prachCfg.fdm[0].k1 = 0; - duCfgParam.macCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG; - duCfgParam.macCellCfg.prachCfg.prachRstSetCfg = PRACH_RESTRICTED_SET_CFG; - duCfgParam.macCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH; - duCfgParam.macCellCfg.prachCfg.msg1FreqStart = PRACH_FREQ_START; - - duCfgParam.macCellCfg.prachCfg.totalNumRaPreamble = NUM_RA_PREAMBLE; - duCfgParam.macCellCfg.prachCfg.numCbPreamblePerSsb = CB_PREAMBLE_PER_SSB; - duCfgParam.macCellCfg.prachCfg.raRspWindow = RA_RSP_WINDOW; - - /* TDD configuration */ -#ifdef NR_TDD - duCfgParam.macCellCfg.tddCfg.tddPeriod = TDD_PERIODICITY; - duCfgParam.macCellCfg.tddCfg.nrOfDlSlots = NUM_DL_SLOTS; - duCfgParam.macCellCfg.tddCfg.nrOfDlSymbols = NUM_DL_SYMBOLS; - duCfgParam.macCellCfg.tddCfg.nrOfUlSlots = NUM_UL_SLOTS; - duCfgParam.macCellCfg.tddCfg.nrOfUlSymbols = NUM_UL_SYMBOLS; - - //FillSlotConfig(); - -#endif - - /* fill SIB1 configuration */ - duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len; - DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len); - memcpy(duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, \ - duCfgParam.srvdCellLst[0].duSysInfo.sib1Len); - duCfgParam.macCellCfg.cellCfg.sib1Cfg.pdcchCfgSib1.coresetZeroIndex = CORESET_0_INDEX; - duCfgParam.macCellCfg.cellCfg.sib1Cfg.pdcchCfgSib1.searchSpaceZeroIndex = SEARCHSPACE_0_INDEX; - - duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.numPO = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg.ns; - if((duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg.firstPDCCHMontioringType != \ - PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_NOTHING) && (duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.numPO != 0)) - { - duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.poPresent = TRUE; - memcpy(duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.pagingOcc, - duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg.firstPDCCHMontioringInfo,MAX_PO_PER_PF); - } - else - { - duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.poPresent = FALSE; - } - - /* fill Intial DL BWP */ - duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.firstPrb = 0; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */ - duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.scs = duCfgParam.macCellCfg.ssbCfg.scsCmn; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId = SEARCHSPACE_1_INDEX; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.coresetId = CORESET_0_INDEX; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot = - SS_MONITORING_SLOT_SL1; /* sl1 - all slots */ - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.duration = 0; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol = - SS_MONITORING_SYMBOL; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace. - candidate.aggLevel1 = 8; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace. - candidate.aggLevel2 = 4; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace. - candidate.aggLevel4 = 2; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace. - candidate.aggLevel8 = 1; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace. - candidate.aggLevel16 = 0; - - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.numTimeDomAlloc = NUM_TIME_DOM_RSRC_ALLOC; - idx = 0; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].k0 = PDSCH_K0_CFG1; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].mappingType = - PDSCH_MAPPING_TYPE_A; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].startSymbol = - PDSCH_START_SYMBOL; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].lengthSymbol = - PDSCH_LENGTH_SYMBOL; - - idx++; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].k0 = PDSCH_K0_CFG2; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].mappingType = - PDSCH_MAPPING_TYPE_A; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].startSymbol = - PDSCH_START_SYMBOL; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].lengthSymbol = - PDSCH_LENGTH_SYMBOL; - - /* ra-searchSpace ID is set to 1 */ - duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.raSearchSpaceId = SEARCHSPACE_1_INDEX; - - /* fill Intial UL BWP */ - duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.firstPrb = 0; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */ - duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.scs = duCfgParam.macCellCfg.ssbCfg.scsCmn; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.numTimeDomRsrcAlloc = 2; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].k2 = PUSCH_K2_CFG1; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].mappingType = - PUSCH_MAPPING_TYPE_A; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].startSymbol = - PUSCH_START_SYMBOL; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].symbolLength = - PUSCH_LENGTH_SYMBOL; - - duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].k2 = PUSCH_K2_CFG2; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].mappingType = - PUSCH_MAPPING_TYPE_A; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].startSymbol = - PUSCH_START_SYMBOL; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].symbolLength = - PUSCH_LENGTH_SYMBOL; - - duCfgParam.macCellCfg.ssbCfg.dmrsTypeAPos = DMRS_TYPE_A_POS; - - /* fill PUCCH config common */ - duCfgParam.macCellCfg.cellCfg.initialUlBwp.pucchCommon.pucchResourceCommon = PUCCH_RSRC_COMMON; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.pucchCommon.pucchGroupHopping = PUCCH_GROUP_HOPPING; - - -#ifndef O1_ENABLE - - /*Note: Static Configuration, when O1 is not configuring the RRM policy*/ - RrmPolicyList rrmPolicy; - rrmPolicy.id[0] = 1; - rrmPolicy.resourceType = PRB; - rrmPolicy.rRMMemberNum = 1; - memcpy(rrmPolicy.rRMPolicyMemberList[0].mcc,duCfgParam.macCellCfg.cellCfg.plmnInfoList[0].plmn.mcc, 3*sizeof(uint8_t)); - memcpy(rrmPolicy.rRMPolicyMemberList[0].mnc,duCfgParam.macCellCfg.cellCfg.plmnInfoList[0].plmn.mnc, 3*sizeof(uint8_t)); - rrmPolicy.rRMPolicyMemberList[0].sst = 1; - rrmPolicy.rRMPolicyMemberList[0].sd[0] = 2; - rrmPolicy.rRMPolicyMemberList[0].sd[1] = 3; - rrmPolicy.rRMPolicyMemberList[0].sd[2] = 4; - rrmPolicy.rRMPolicyMaxRatio = 90; - rrmPolicy.rRMPolicyMinRatio = 30; - rrmPolicy.rRMPolicyDedicatedRatio = 10; - - cpyRrmPolicyInDuCfgParams(&rrmPolicy, 1, &duCfgParam.tempSliceCfg); - -#endif - - return ROK; -} - -/******************************************************************* - * - * @brief Configures the DU Parameters - * - * @details - * - * Function : fillDuPort - * - * Functionality: - * - fills the DU Ports. - * - * @params[in] duPort array to be filled - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ -uint8_t fillDuPort(uint16_t *duPort) -{ - -#ifdef O1_ENABLE - duPort[F1_INTERFACE] = g_cfg.DU_Port; - duPort[E2_INTERFACE] = g_cfg.RIC_Port; -#else - duPort[F1_INTERFACE] = F1_SCTP_PORT; /* DU Port idx 0 38472 */ - duPort[E2_INTERFACE] = E2_SCTP_PORT; /* RIC Port idx 1 36421 */ -#endif - return ROK; -} - /******************************************************************* * * @brief Configures the DU Parameters @@ -411,643 +102,6 @@ uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol) return sliv; } - -/******************************************************************* - * - * @brief Configures serving cell config common in sib1 - * - * @details - * - * Function : fillServCellCfgCommSib - * - * Functionality: - * - fills Serving cell config common for SIB1 - * - * @params[in] SrvCellCfgCommSib pointer - * @return ROK - success - * RFAILED - failure - * - ** ****************************************************************/ -uint8_t fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm) -{ - PdcchCfgCommon pdcchCfg; - PdschCfgCommon pdschCfg; - PcchCfg pcchCfg; - RachCfgCommon rachCfg; - PuschCfgCommon puschCfg; - PucchCfgCommon pucchCfg; - TddUlDlCfgCommon tddCfg; - -#ifdef O1_ENABLE - srvCellCfgComm->scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); -#else - srvCellCfgComm->scs = NR_SCS; -#endif - - /* Configuring DL Config Common for SIB1*/ - srvCellCfgComm->dlCfg.freqBandInd = NR_FREQ_BAND; - srvCellCfgComm->dlCfg.offsetToPointA = OFFSET_TO_POINT_A; -#ifdef O1_ENABLE - srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset = cellParams.ssbOffset; - srvCellCfgComm->dlCfg.dlScsCarrier.scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); - srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = cellParams.bSChannelBwUL; -#else - srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET; - srvCellCfgComm->dlCfg.dlScsCarrier.scs = NR_SCS; - srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = NR_BANDWIDTH; -#endif - srvCellCfgComm->dlCfg.locAndBw = FREQ_LOC_BW; - - /* Configuring PDCCH Config Common For SIB1 */ - pdcchCfg.present = BWP_DownlinkCommon__pdcch_ConfigCommon_PR_setup; - pdcchCfg.ctrlRsrcSetZero = CORESET_0_INDEX; - pdcchCfg.searchSpcZero = SEARCHSPACE_0_INDEX; - pdcchCfg.searchSpcId = PDCCH_SEARCH_SPACE_ID; - pdcchCfg.ctrlRsrcSetId = PDCCH_CTRL_RSRC_SET_ID; - pdcchCfg.monitorSlotPrdAndOffPresent = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1; - //pdcchCfg.monitorSlotPrdAndOff = \ - SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1; - pdcchCfg.monitorSymbolsInSlot[0] = 128; - pdcchCfg.monitorSymbolsInSlot[1] = 0; - pdcchCfg.numCandAggLvl1 = SearchSpace__nrofCandidates__aggregationLevel1_n8; - pdcchCfg.numCandAggLvl2 = SearchSpace__nrofCandidates__aggregationLevel2_n4; - pdcchCfg.numCandAggLvl4 = SearchSpace__nrofCandidates__aggregationLevel4_n2; - pdcchCfg.numCandAggLvl8 = SearchSpace__nrofCandidates__aggregationLevel8_n1; - pdcchCfg.numCandAggLvl16 = SearchSpace__nrofCandidates__aggregationLevel16_n0; - pdcchCfg.searchSpcType = SearchSpace__searchSpaceType_PR_common; - pdcchCfg.commSrchSpcDciFrmt = PDCCH_SERACH_SPACE_DCI_FORMAT; - pdcchCfg.searchSpcSib1 = PDCCH_SEARCH_SPACE_ID_SIB1; - pdcchCfg.pagingSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING; - pdcchCfg.raSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING; - srvCellCfgComm->dlCfg.pdcchCfg = pdcchCfg; - - /* Configuring PDSCH Config Common For SIB1 */ - pdschCfg.present = BWP_DownlinkCommon__pdsch_ConfigCommon_PR_setup; - pdschCfg.numTimeDomRsrcAlloc = 2; - pdschCfg.timeDomAlloc[0].k0 = PDSCH_K0_CFG1; - pdschCfg.timeDomAlloc[0].mapType = PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - pdschCfg.timeDomAlloc[0].sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL); - - pdschCfg.timeDomAlloc[1].k0 = PDSCH_K0_CFG2; - pdschCfg.timeDomAlloc[1].mapType = PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - pdschCfg.timeDomAlloc[1].sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL); - - srvCellCfgComm->dlCfg.pdschCfg = pdschCfg; - - /* Configuring BCCH Config for SIB1 */ - srvCellCfgComm->dlCfg.bcchCfg.modPrdCoeff = BCCH_Config__modificationPeriodCoeff_n16; - - /* Configuring PCCH Config for SIB1 */ - pcchCfg.dfltPagingCycle = convertPagingCycleEnumToValue(PagingCycle_rf256); - pcchCfg.nAndPagingFrmOffsetType = PCCH_Config__nAndPagingFrameOffset_PR_oneT; - pcchCfg.pageFrameOffset = 0; - pcchCfg.ns = convertNsEnumToValue(PCCH_Config__ns_one); - pcchCfg.firstPDCCHMontioringType = PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_sCS30KHZoneT_SCS15KHZhalfT; - memset(pcchCfg.firstPDCCHMontioringInfo, 0, sizeof(uint16_t)); - pcchCfg.firstPDCCHMontioringInfo[0] = 44; - - srvCellCfgComm->dlCfg.pcchCfg = pcchCfg; - - - /* Configuring UL Config Common */ -#ifdef O1_ENABLE - srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset = cellParams.ssbOffset; - srvCellCfgComm->ulCfg.ulScsCarrier.scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); - srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = cellParams.bSChannelBwUL; -#else - srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET; - srvCellCfgComm->ulCfg.ulScsCarrier.scs = NR_SCS; - srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = NR_BANDWIDTH; -#endif - srvCellCfgComm->ulCfg.freqBandInd = NR_FREQ_BAND; - srvCellCfgComm->ulCfg.pMax = UL_P_MAX; - srvCellCfgComm->ulCfg.locAndBw = FREQ_LOC_BW; - srvCellCfgComm->ulCfg.timeAlignTimerComm = TimeAlignmentTimer_infinity; - - /* Configuring RACH Config Common for SIB1 */ - rachCfg.present = BWP_UplinkCommon__rach_ConfigCommon_PR_setup; - rachCfg.prachCfgIdx = PRACH_CONFIG_IDX; - rachCfg.msg1Fdm = RACH_ConfigGeneric__msg1_FDM_one; - rachCfg.msg1FreqStart = PRACH_FREQ_START; - rachCfg.zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG; - rachCfg.preambleRcvdTgtPwr = PRACH_PREAMBLE_RCVD_TGT_PWR; - rachCfg.preambleTransMax = RACH_ConfigGeneric__preambleTransMax_n200; - rachCfg.pwrRampingStep = RACH_ConfigGeneric__powerRampingStep_dB2; - rachCfg.raRspWindow = RACH_ConfigGeneric__ra_ResponseWindow_sl10; - rachCfg.numRaPreamble = NUM_RA_PREAMBLE; - rachCfg.numSsbPerRachOcc = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; - rachCfg.numCbPreamblePerSsb = CB_PREAMBLE_PER_SSB; - rachCfg.contResTimer = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; - rachCfg.rsrpThreshSsb = RSRP_THRESHOLD_SSB; - rachCfg.rootSeqIdxPresent = RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; - rachCfg.rootSeqIdx = ROOT_SEQ_IDX; - rachCfg.msg1Scs = PRACH_SUBCARRIER_SPACING ; - rachCfg.restrictedSetCfg = PRACH_RESTRICTED_SET_CFG; - srvCellCfgComm->ulCfg.rachCfg = rachCfg; - - /* Configuring PUSCH Config Common for SIB1 */ - puschCfg.puschCfgPresent = BWP_UplinkCommon__pusch_ConfigCommon_PR_setup; - puschCfg.numTimeDomRsrcAlloc = 2; - puschCfg.timeDomAllocList[0].k2 = PUSCH_K2_CFG1; - puschCfg.timeDomAllocList[0].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA; - puschCfg.timeDomAllocList[0].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL); - puschCfg.timeDomAllocList[1].k2 = PUSCH_K2_CFG2; - puschCfg.timeDomAllocList[1].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA; - puschCfg.timeDomAllocList[1].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL); - puschCfg.msg3DeltaPreamble = PUSCH_MSG3_DELTA_PREAMBLE; - puschCfg.p0NominalWithGrant = PUSCH_P0_NOMINAL_WITH_GRANT; - srvCellCfgComm->ulCfg.puschCfg = puschCfg; - - /* Configuring PUCCH Config Common for SIB1 */ - pucchCfg.present = BWP_UplinkCommon__pucch_ConfigCommon_PR_setup; - pucchCfg.rsrcComm = PUCCH_RSRC_COMMON; - pucchCfg.grpHop = PUCCH_ConfigCommon__pucch_GroupHopping_neither; - pucchCfg.p0Nominal = PUCCH_P0_NOMINAL; - srvCellCfgComm->ulCfg.pucchCfg = pucchCfg; - - /* Configuring TDD UL DL config common */ - tddCfg.refScs = SubcarrierSpacing_kHz30; - tddCfg.txPrd = TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5; - tddCfg.numDlSlots = NUM_DL_SLOTS; - tddCfg.numDlSymbols = NUM_DL_SYMBOLS; - tddCfg.numUlSlots = NUM_UL_SLOTS; - tddCfg.numUlSymbols = NUM_UL_SYMBOLS; - srvCellCfgComm->tddCfg = tddCfg; - - srvCellCfgComm->ssbPosInBurst = 192; - srvCellCfgComm->ssbPrdServingCell = SSB_PERIODICITY; - srvCellCfgComm->ssPbchBlockPwr = SSB_PBCH_PWR; - - return ROK; -} - -/******************************************************************* - * - * @brief Configures the DU Parameters - * - * @details - * - * Function : readCfg - * - * Functionality: - * - Initializes the DuCfg members. - * - Calls readMacCfg() - * - * @params[in] system task ID - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ - -uint8_t readCfg() -{ - CmLList *node; - uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx, ranFuncIdx, eventTriggerStyleIdx, reportStyleIdx, tnlAssocIdx; - uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx; - uint32_t ipv4_du, ipv4_cu, ipv4_ric; - MibParams mib; - Sib1Params sib1; - SupportedSliceList *taiSliceSuppLst; - uint8_t measurementInfoIdx =0, measurementInfoLen=0; - char shortName[] = SHORT_NAME; - char serviceModelOID[]= SERVICE_MODEL_OID; - char description[] = DESCRIPTION; - char event_trigger_style_name[]= EVENT_TRIGGER_STYLE_NAME; - char ric_report_style_name[]= REPORT_STYLE_NAME; - -#ifndef O1_ENABLE - /* Note: Added these below variable for local testing*/ - Snssai snssai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}}; -#endif - - /* Gnb Id */ - duCb.gnbId = GNB_ID; - -#ifdef O1_ENABLE - if( getStartupConfig(&g_cfg) != ROK ) - { - RETVALUE(RFAILED); - } - cmInetAddr((S8*)g_cfg.DU_IPV4_Addr, &ipv4_du); - cmInetAddr((S8*)g_cfg.CU_IPV4_Addr, &ipv4_cu); - cmInetAddr((S8*)g_cfg.RIC_IPV4_Addr, &ipv4_ric); - - duCfgParam.sctpParams.cuPort = g_cfg.CU_Port; - duCfgParam.sctpParams.ricPort = g_cfg.RIC_Port; -#else - cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du); - cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu); - cmInetAddr((S8*)RIC_IP_V4_ADDR, &ipv4_ric); - - duCfgParam.sctpParams.cuPort = F1_SCTP_PORT; - duCfgParam.sctpParams.ricPort = E2_SCTP_PORT; -#endif - - fillDuPort(duCfgParam.sctpParams.duPort); - - /* F1 DU IP Address and Port*/ - duCfgParam.sctpParams.duIpAddr.ipV4Addr = ipv4_du; - - /* F1 CU IP Address and Port*/ - duCfgParam.sctpParams.cuIpAddr.ipV4Addr = ipv4_cu; - - /* Fill RIC Params */ - duCfgParam.sctpParams.ricIpAddr.ipV4Addr = ipv4_ric; - - /* EGTP Parameters */ - duCfgParam.egtpParams.localIp.ipV4Pres = TRUE; - duCfgParam.egtpParams.localIp.ipV4Addr = ipv4_du; - duCfgParam.egtpParams.localPort = F1_EGTP_PORT; - duCfgParam.egtpParams.destIp.ipV4Pres = TRUE; - duCfgParam.egtpParams.destIp.ipV4Addr = ipv4_cu; - duCfgParam.egtpParams.destPort = F1_EGTP_PORT; - duCfgParam.egtpParams.minTunnelId = MIN_TEID; - duCfgParam.egtpParams.maxTunnelId = MAX_TEID; - - duCfgParam.maxUe = 32; //TODO: Check - - /* DU Info */ - duCfgParam.duId = DU_ID; - DU_ALLOC(duCfgParam.duName, sizeof(DU_NAME)); - if(!duCfgParam.duName) - { - DU_LOG("\nDEBUG --> DU_APP: readCfg(): Memory allocation failure for DU name"); - return RFAILED; - } - strcpy((char*)duCfgParam.duName,DU_NAME); - - memset(&duCb.e2apDb, 0, sizeof(E2apDb)); - duCb.e2apDb.e2NodeId = DU_ID; - duCb.e2apDb.e2TransInfo.transIdCounter = 0; - - duCb.e2apDb.numOfTNLAssoc = 1; - for(tnlAssocIdx =0; tnlAssocIdxmeasurementTypeId = measurementInfoIdx+1; - memcpy(measurementInfoForAction->measurementTypeName, MEASUREMENT_TYPE_NAME[measurementInfoIdx], measurementInfoLen+1); - } - DU_ALLOC(node, sizeof(CmLList)); - if(node) - { - node->node = (PTR) measurementInfoForAction; - cmLListAdd2Tail(&duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].measurementInfoList, node); - } - else - { - - DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction)); - } - } - } - - duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationHeaderFormat = RIC_INDICATION_HEADER_FORMAT; - duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationMessageFormat = RIC_INDICATION_MESSAGE_FORMAT; - - cmLListInit(&duCb.e2apDb.ranFunction[ranFuncIdx].subscriptionList); - } - memset(duCb.e2apDb.e2TransInfo.e2InitTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo)); - memset(duCb.e2apDb.e2TransInfo.ricInitTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo)); - - /* Mib Params */ - mib.sysFrmNum = SYS_FRAME_NUM; -#ifdef NR_TDD - mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs30or120; -#else - mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs15or60; -#endif - mib.ssb_SubcarrierOffset = SSB_SC_OFFSET; //Kssb - mib.dmrs_TypeA_Position = MIB__dmrs_TypeA_Position_pos2; - mib.controlResourceSetZero = CORESET_0_INDEX; - mib.searchSpaceZero = SEARCHSPACE_0_INDEX; - mib.cellBarred = MIB__cellBarred_notBarred; - mib.intraFreqReselection = MIB__intraFreqReselection_notAllowed; - duCfgParam.mibParams = mib; - - /* SIB1 Params */ - memset(&sib1.plmn, 0, sizeof(Plmn)); - sib1.plmn.mcc[0] = PLMN_MCC0; - sib1.plmn.mcc[1] = PLMN_MCC1; - sib1.plmn.mcc[2] = PLMN_MCC2; - sib1.plmn.mnc[0] = PLMN_MNC0; - sib1.plmn.mnc[1] = PLMN_MNC1; - sib1.ranac = DU_RANAC; - -#ifdef O1_ENABLE - sib1.tac = cellParams.nRTAC; - sib1.cellIdentity = CELL_IDENTITY * cellParams.cellLocalId; - DU_LOG("\nDEBUG --> DU_APP: readCfg(): OAM CellLocalId=%d", \ - sib1.cellIdentity); -#else - sib1.tac = DU_TAC; - sib1.cellIdentity = CELL_IDENTITY * NR_CELL_ID; -#endif - sib1.cellResvdForOpUse = PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved; - sib1.connEstFailCnt = ConnEstFailureControl__connEstFailCount_n3; - sib1.connEstFailOffValidity = ConnEstFailureControl__connEstFailOffsetValidity_s900; - sib1.connEstFailOffset = 15; - sib1.siSchedInfo.winLen = SI_SchedulingInfo__si_WindowLength_s5; - sib1.siSchedInfo.broadcastSta = SchedulingInfo__si_BroadcastStatus_broadcasting; - sib1.siSchedInfo.preiodicity = SchedulingInfo__si_Periodicity_rf8; - sib1.siSchedInfo.sibType = SIB_TypeInfo__type_sibType2; - sib1.siSchedInfo.sibValTag = SIB1_VALUE_TAG; - - fillServCellCfgCommSib(&sib1.srvCellCfgCommSib); - - duCfgParam.sib1Params = sib1; - - for(srvdCellIdx=0; srvdCellIdxnumSupportedSlices = NUM_OF_SUPPORTED_SLICE; - if(taiSliceSuppLst->numSupportedSlices > MAX_NUM_OF_SLICE_ITEMS) - { - DU_LOG("\nERROR --> DU_APP: readCfg(): Number of supported slice [%d] is more than 1024",\ - taiSliceSuppLst->numSupportedSlices); - return RFAILED; - } - - DU_ALLOC(taiSliceSuppLst->snssai, taiSliceSuppLst->numSupportedSlices*sizeof(Snssai*)); - if(taiSliceSuppLst->snssai == NULLP) - { - DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed"); - return RFAILED; - } - - for(sliceIdx=0; sliceIdxnumSupportedSlices; sliceIdx++) - { - DU_ALLOC(taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai)); - if(taiSliceSuppLst->snssai[sliceIdx] == NULLP) - { - DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed"); - return RFAILED; - } -#ifdef O1_ENABLE - memcpy(taiSliceSuppLst->snssai[sliceIdx]->sd, cellParams.plmnList[sliceIdx].sd, \ - SD_SIZE*sizeof(uint8_t)); - taiSliceSuppLst->snssai[sliceIdx]->sst = cellParams.plmnList[sliceIdx].sst; -#else - memcpy(taiSliceSuppLst->snssai[sliceIdx], &snssai[sliceIdx], sizeof(Snssai)); -#endif - } - } - - /* NR Mode info */ -#ifdef NR_TDD - /* NR TDD Mode info */ -#ifdef O1_ENABLE - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = cellParams.arfcnUL; - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL; - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); -#else - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_UL_ARFCN; - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN; - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS; -#endif - duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_273; - - for(freqBandIdx=0; freqBandIdx DU APP : Memory allocation failure at readCfg"); - return RFAILED; - } - memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBuf, encBufSize); - duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibLen = encBufSize; - - /*gnb DU System Info mib msg*/ - BuildSib1Msg(); - DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\ - encBufSize); - if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg)) - { - DU_LOG("\nERROR --> DU APP : Memory allocation failure at readCfg"); - return RFAILED; - } - memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\ - encBuf,encBufSize); - duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Len = encBufSize; - - } - - if(readMacCfg() != ROK) - { - DU_LOG("\nERROR --> DU_APP : Failed while reading MAC config"); - return RFAILED; - } - - return ROK; -} - /******************************************************************* * * @brief Copy Slice Cfg in temp structre in duCfgParams @@ -1129,7 +183,6 @@ uint8_t cpyRrmPolicyInDuCfgParams(RrmPolicyList rrmPolicy[], uint8_t policyNum, return ROK; } -#ifdef XML_BASED_CONFIG /******************************************************************* * * @brief Fill SCTP Parameters @@ -1150,15 +203,21 @@ uint8_t cpyRrmPolicyInDuCfgParams(RrmPolicyList rrmPolicy[], uint8_t policyNum, * ****************************************************************/ uint8_t parseSctpParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SctpParams *sctp) { - uint8_t max_du_port; - uint16_t f1_sctp_port; - uint16_t e2_sctp_port; + uint8_t max_du_port = 0; + uint16_t f1_sctp_port = 0; + uint16_t e2_sctp_port = 0; memset(sctp, 0, sizeof(SctpParams)); cur = cur->xmlChildrenNode; while (cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_DU_PORT")) && (cur->ns == ns)) +#ifdef O1_ENABLE + sctp->duPort[F1_INTERFACE] = g_cfg.DU_Port; + sctp->duPort[E2_INTERFACE] = g_cfg.RIC_Port; + sctp->cuPort = g_cfg.CU_Port; + sctp->ricPort = g_cfg.RIC_Port; +#else + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_DU_PORT")) && (cur->ns == ns)) { max_du_port = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); if (max_du_port == 2 ) @@ -1167,6 +226,7 @@ uint8_t parseSctpParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SctpParams * sctp->duPort[E2_INTERFACE] = e2_sctp_port; /* RIC Port idx 1 */ } } + if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SCTP_PORT")) && (cur->ns == ns)) { f1_sctp_port = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); @@ -1176,10 +236,6 @@ uint8_t parseSctpParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SctpParams * e2_sctp_port = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } -#ifdef O1_ENABLE - sctp->cuPort = g_cfg.CU_Port; - sctp->ricPort = g_cfg.RIC_Port; -#else sctp->cuPort = f1_sctp_port; sctp->ricPort = e2_sctp_port; #endif @@ -1290,44 +346,6 @@ uint8_t parseMibParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, MibParams *mi return ROK; } -/******************************************************************* - * - * @brief Fill RRC version - * - * @details - * - * Function : parseF1RrcVersion - * - * Functionality: Fill RRC version - * - * @params[in] XML document pointer - * XML namespace - * Current node in XML - * Pointer to structure to be filled - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ -uint8_t parseF1RrcVersion(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,F1RrcVersion *f1RrcVersion) -{ - memset(f1RrcVersion, 0, sizeof(F1RrcVersion)); - cur = cur->xmlChildrenNode; - while(cur != NULL) - { - if((!xmlStrcmp(cur->name, (const xmlChar *)"RRC_VER")) && (cur->ns == ns)) - { - strcpy((char*)f1RrcVersion->rrcVer, (char*)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if((!xmlStrcmp(cur->name, (const xmlChar *)"EXT_RRC_VER")) && (cur->ns == ns)) - { - f1RrcVersion->extRrcVer = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - cur = cur -> next; - } - return ROK; -} - /******************************************************************* * * @brief Fill PLMN ID @@ -1359,17 +377,17 @@ uint8_t parsePlmn(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Plmn *plmn) child = cur->xmlChildrenNode; while (child != NULL) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"plmn_MCC0")) && (child->ns == ns)) + if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MCC0")) && (child->ns == ns)) { plmn->mcc[0] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(child->name, (const xmlChar *)"plmn_MCC1")) && (child->ns == ns)) + if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MCC1")) && (child->ns == ns)) { plmn->mcc[1] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(child->name, (const xmlChar *)"plmn_MCC2")) && (child->ns == ns)) + if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MCC2")) && (child->ns == ns)) { plmn->mcc[2] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); } @@ -1383,17 +401,17 @@ uint8_t parsePlmn(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Plmn *plmn) child = cur->xmlChildrenNode; while (child != NULL) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"plmn_MNC0")) && (child->ns == ns)) + if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MNC0")) && (child->ns == ns)) { plmn->mnc[0] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(child->name, (const xmlChar *)"plmn_MNC1")) && (child->ns == ns)) + if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MNC1")) && (child->ns == ns)) { plmn->mnc[1] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(child->name, (const xmlChar *)"plmn_MNC2")) && (child->ns == ns)) + if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MNC2")) && (child->ns == ns)) { plmn->mnc[2] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); } @@ -1522,7 +540,6 @@ uint8_t parseSupportedSliceList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Supp { uint8_t sliceIdx = 0; xmlNodePtr child = NULLP; - xmlNodePtr snssaiNode = NULLP; memset(sliceSuppLst, 0, sizeof(SupportedSliceList)); cur = cur->xmlChildrenNode; @@ -1566,25 +583,17 @@ uint8_t parseSupportedSliceList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Supp } #ifndef O1_ENABLE + sliceIdx = 0; child = cur->xmlChildrenNode; while (child != NULL) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"LIST")) && (child->ns == ns)) - { - sliceIdx = 0; - snssaiNode = child->xmlChildrenNode; - while (snssaiNode != NULL) + if ((!xmlStrcmp(child->name, (const xmlChar *)"SNSSAI")) && (child->ns == ns)) + { + if(parseSnssai(doc, ns, child, sliceSuppLst->snssai[sliceIdx]) != ROK) { - if ((!xmlStrcmp(snssaiNode->name, (const xmlChar *)"SNSSAI")) && (snssaiNode->ns == ns)) - { - if(parseSnssai(doc, ns, snssaiNode, sliceSuppLst->snssai[sliceIdx]) != ROK) - { - return RFAILED; - } - sliceIdx++; - } - snssaiNode = snssaiNode->next; + return RFAILED; } + sliceIdx++; } child = child->next; } @@ -1730,7 +739,6 @@ uint8_t parseF1FreqBand(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1FreqBand * uint8_t sulIdx = 0; uint16_t sulValue = 0; xmlNodePtr child; - xmlNodePtr sulChild; memset(freqBand, 0, sizeof(F1FreqBand)); cur = cur->xmlChildrenNode; @@ -1746,27 +754,19 @@ uint8_t parseF1FreqBand(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1FreqBand * child = cur->xmlChildrenNode; while (child != NULL) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"LIST")) && (child->ns == ns)) + sulIdx = 0; + if ((!xmlStrcmp(child->name, (const xmlChar *)"SUL_BAND")) && (child->ns == ns)) { - sulChild = child->xmlChildrenNode; - sulIdx = 0; - while (sulChild != NULL) + sulValue = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); + if (sulIdx < MAX_NRCELL_BANDS) { - if ((!xmlStrcmp(sulChild->name, (const xmlChar *)"SUL_BAND")) && (sulChild->ns == ns)) - { - sulValue = atoi((char *)xmlNodeListGetString(doc, sulChild->xmlChildrenNode, 1)); - if (sulIdx < MAX_NRCELL_BANDS) - { - freqBand->sulBand[sulIdx] = sulValue; - sulIdx++; - } - else - { - DU_LOG("ERROR --> DU_APP : %s : SUL_BAND array overflow\n", __func__); - return RFAILED; - } - } - sulChild = sulChild->next; + freqBand->sulBand[sulIdx] = sulValue; + sulIdx++; + } + else + { + DU_LOG("ERROR --> DU_APP : %s : SUL_BAND array overflow\n", __func__); + return RFAILED; } } child = child->next; @@ -1799,27 +799,17 @@ uint8_t parseF1FreqBandList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFreq { uint8_t idx = 0; - xmlNodePtr child; cur = cur->xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_FREQ_BAND")) && (cur->ns == ns)) { - child = cur->xmlChildrenNode; - while(child != NULL) + if(parseF1FreqBand(doc, ns, cur, &nrFreqInfo->freqBand[idx]) != ROK) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"F1_FREQ_BAND")) && (child->ns == ns)) - { - if(parseF1FreqBand(doc, ns, child, &nrFreqInfo->freqBand[idx]) != ROK) - { - return RFAILED; - } - idx++; - } - child = child -> next; + return RFAILED; } + idx++; } - cur = cur -> next; } return ROK; @@ -1849,10 +839,14 @@ uint8_t parseF1TxBw(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1TxBw *txBw) cur = cur->xmlChildrenNode; while(cur != NULL) { +#ifdef O1_ENABLE + txBw->nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); +#else if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_SCS")) && (cur->ns == ns)) { txBw->nrScs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } +#endif if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NRB")) && (cur->ns == ns)) { @@ -1888,10 +882,14 @@ uint8_t parseF1SulInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1SulInfo *su cur = cur->xmlChildrenNode; while(cur != NULL) { +#ifdef O1_ENABLE + sulInfo->sulArfcn = cellParams.arfcnSUL; +#else if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUL_ARFCN")) && (cur->ns == ns)) { sulInfo->sulArfcn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } +#endif if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_TX_BW")) && (cur->ns == ns)) { @@ -1930,10 +928,14 @@ uint8_t parseF1NrFreqInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFreqIn cur = cur->xmlChildrenNode; while(cur != NULL) { +#if O1_ENABLE + nrFreqInfo->nrArfcn = cellParams.arfcnUL; +#else if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_ARFCN")) && (cur->ns == ns)) { nrFreqInfo->nrArfcn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } +#endif if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SUL_INFO")) && (cur->ns == ns)) { @@ -2093,9 +1095,9 @@ uint8_t parseNrModeInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, NrModeInfo * strcpy((char*)modeCfg, (char*)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FDD_INFO")) && (cur->ns == ns)) + if(strcmp(modeCfg, "FDD") == 0) { - if(strcmp(modeCfg, "FDD") == 0) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FDD_INFO")) && (cur->ns == ns)) { if(parseF1NrFddInfo(doc, ns, cur, &nrModeInfo->mode.fdd) != ROK) { @@ -2103,10 +1105,9 @@ uint8_t parseNrModeInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, NrModeInfo * } } } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_TDD_INFO")) && (cur->ns == ns)) + else { - if(strcmp(modeCfg, "TDD") == 0) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_TDD_INFO")) && (cur->ns == ns)) { if(parseF1NrTddInfo(doc, ns, cur, &nrModeInfo->mode.tdd) != ROK) { @@ -2212,6 +1213,10 @@ uint8_t parseF1DuCellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1DuCellIn } } +#ifdef O1_ENABLE + duCellInfo->tac = cellParams.nRTAC; + duCellInfo->epsTac = cellParams.nRTAC; +#else if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns)) { duCellInfo->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); @@ -2221,6 +1226,7 @@ uint8_t parseF1DuCellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1DuCellIn { duCellInfo->epsTac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } +#endif if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_MODE_INFO")) && (cur->ns == ns)) { @@ -2252,7 +1258,6 @@ uint8_t parseF1DuCellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1DuCellIn return RFAILED; } } - cur = cur -> next; } return ROK; @@ -2341,7 +1346,7 @@ uint8_t fillDuSrvdCellSysInfo(F1DuSysInfo *sysInfo) return ROK; } -#ifdef O1_ENABLED +#ifdef O1_ENABLE /******************************************************************* * * @brief Fill PLMN received from O1 interface @@ -2626,7 +1631,7 @@ uint8_t parsePrachCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PrachCfg *prac if ((!xmlStrcmp(cur->name, (const xmlChar *)"CB_PREAMBLE_PER_SSB")) && (cur->ns == ns)) { - prachCfg->totalNumRaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + prachCfg->numCbPreamblePerSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_RB")) && (cur->ns == ns)) @@ -2641,30 +1646,675 @@ uint8_t parsePrachCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PrachCfg *prac if ((!xmlStrcmp(cur->name, (const xmlChar *)"RSRP_THRESHOLD_SSB")) && (cur->ns == ns)) { - prachCfg->rsrpThreshSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + prachCfg->rsrpThreshSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_RSP_WINDOW")) && (cur->ns == ns)) + { + prachCfg->raRspWindow = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + cur = cur -> next; + } + + prachCfg->msg1FreqStart = maxNumRbs - prachMaxPrb; + return ROK; +} + +/******************************************************************* + * + * @brief Fill CSI RS configuration + * + * @details + * + * Function : parseCsiRsCfg + * + * Functionality: Fill CSI RS configuration + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseCsiRsCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CsiRsCfg *csiRsCfg) +{ + uint8_t csiFreqDomainAlloc=0; + memset(csiRsCfg, 0, sizeof(CsiRsCfg)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_FREQ")) && (cur->ns == ns)) + { + csiFreqDomainAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + DU_ALLOC(csiRsCfg->csiFreqDomainAlloc, sizeof(uint8_t)); + if(!csiRsCfg->csiFreqDomainAlloc) + { + DU_LOG("\nERROR --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__); + return RFAILED; + } + memcpy(csiRsCfg->csiFreqDomainAlloc, &csiFreqDomainAlloc, sizeof(uint8_t)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_PORTS")) && (cur->ns == ns)) + { + csiRsCfg->csiNrofPorts = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_OFDM_PORT")) && (cur->ns == ns)) + { + csiRsCfg->csirsfirstOFDMSymbolInTimeDomain = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_OFDM_PORT_2")) && (cur->ns == ns)) + { + csiRsCfg->csirsfirstOFDMSymbolInTimeDomain2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DM_TYPE")) && (cur->ns == ns)) + { + csiRsCfg->csirscdmType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DENSITY")) && (cur->ns == ns)) + { + csiRsCfg->csirsdensity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DENSITY_DOT_5")) && (cur->ns == ns)) + { + csiRsCfg->csirsdensitydot5 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"POWER_CONTROL_OFFSET")) && (cur->ns == ns)) + { + csiRsCfg->powerControlOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"POWER_CONTROL_OFFSET_SS")) && (cur->ns == ns)) + { + csiRsCfg->powerControlOffsetSS = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PERIODICITY_OFFSET")) && (cur->ns == ns)) + { + csiRsCfg->periodicityAndOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + cur = cur -> next; + } + return ROK; +} + +/******************************************************************* + * + * @brief Fill SSB Configuration + * + * @details + * + * Function : parseSsbCfg + * + * Functionality: Fill SSB Configuration + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseSsbCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SsbCfg *ssbCfg) +{ + xmlNodePtr child; + uint8_t ssbMaskIdx = 0; + + memset(ssbCfg, 0, sizeof( SsbCfg)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { +#ifdef O1_ENABLE + ssbCfg->scsCmn = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); + ssbCfg->ssbPeriod = convertSSBPeriodicityToEnum(cellParams.ssbPeriodicity); + ssbCfg->ssbScOffset = cellParams.ssbOffset; +#else + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_CMN")) && (cur->ns == ns)) + { + ssbCfg->scsCmn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIOD")) && (cur->ns == ns)) + { + ssbCfg->ssbPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SC_OFFSET")) && (cur->ns == ns)) + { + ssbCfg->ssbScOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } +#endif + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_OFFSET_PT_A")) && (cur->ns == ns)) + { + ssbCfg->ssbOffsetPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBSC_PWR")) && (cur->ns == ns)) + { + ssbCfg->ssbPbchPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_MASK_LIST")) && (cur->ns == ns)) + { + child = cur -> xmlChildrenNode; + while(child != NULL) + { + if ((!xmlStrcmp(child->name, (const xmlChar *)"SSB_MASK")) && (child->ns == ns)) + { + ssbCfg->ssbMask[ssbMaskIdx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); + ssbMaskIdx++; + } + child = child -> next; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_ID")) && (cur->ns == ns)) + { + ssbCfg->beamId[0] = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BETA_PSS")) && (cur->ns == ns)) + { + ssbCfg->betaPss = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCH_PAYLOAD_FLAG")) && (cur->ns == ns)) + { + ssbCfg->bchPayloadFlag = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DMRS_TYPE_A_POS")) && (cur->ns == ns)) + { + ssbCfg->dmrsTypeAPos = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + cur = cur -> next; + } + + if(BuildMibPdu() != ROK) + { + DU_LOG("\nERROR --> Failed to build MIB PDU"); + memset(&ssbCfg->mibPdu, 0, 3*sizeof(uint8_t)); + } + else + { + memcpy(&ssbCfg->mibPdu, encBuf, encBufSize); + } + + return ROK; +} + +/******************************************************************* + * + * @brief Fill Carrier Configuration + * + * @details + * + * Function : parseCarrierCfg + * + * Functionality: Fill Carrier Configuration + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseCarrierCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CarrierCfg *carrierCfg) +{ + memset(carrierCfg, 0, sizeof(CarrierCfg)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { +#ifdef O1_ENABLE + carrierCfg->dlBw = cellParams.bSChannelBwDL; + carrierCfg->arfcnDL = cellParams.arfcnDL; + carrierCfg->ulBw = cellParams.bSChannelBwUL; + carrierCfg->arfcnUL = cellParams.arfcnUL; +#else + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DL_BW")) && (cur->ns == ns)) + { + carrierCfg->dlBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_DL_ARFCN")) && (cur->ns == ns)) + { + carrierCfg->arfcnDL = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_BW")) && (cur->ns == ns)) + { + carrierCfg->ulBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_UL_ARFCN")) && (cur->ns == ns)) + { + carrierCfg->arfcnUL = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } +#endif + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TX_ANT")) && (cur->ns == ns)) + { + carrierCfg->numTxAnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RX_ANT")) && (cur->ns == ns)) + { + carrierCfg->numRxAnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + cur = cur -> next; + } + return ROK; +} + +/******************************************************************* + * + * @brief Fill PLMN Information List + * + * @details + * + * Function : parsePlmnInfo + * + * Functionality: Fill PLMN Information List + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parsePlmnInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PlmnInfoList *plmnInfoList) +{ + + memset(plmnInfoList, 0, sizeof(PlmnInfoList)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns)) + { + if(parsePlmn(doc, ns, cur,&plmnInfoList->plmn) != ROK) + { + return RFAILED; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SLICE_SUPP_LST")) && (cur->ns == ns)) + { + if(parseSupportedSliceList(doc, ns, cur,&plmnInfoList -> suppSliceList) != ROK) + { + return RFAILED; + } + } + + cur = cur -> next; + } + return ROK; +} + +/******************************************************************* + * + * @brief Fill PUCCH Configuration Common + * + * @details + * + * Function : parsePucchConfigCommon + * + * Functionality: Fill PUCCH Configuration Common + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parsePucchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PucchConfigCommon *pucchCfgCmn) +{ + memset(pucchCfgCmn, 0, sizeof(PucchConfigCommon)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_RSRC_COMMON")) && (cur->ns == ns)) + { + pucchCfgCmn->pucchResourceCommon = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_NEITHER_HOPPING")) && (cur->ns == ns)) + { + pucchCfgCmn->pucchGroupHopping = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + cur = cur -> next; + } + return ROK; +} + +/******************************************************************* + * + * @brief Fill PUSCH Common Time Allocation + * + * @details + * + * Function : parsePuschTimeDomRsrcAlloc + * + * Functionality: Fill PUSCH Common Time Allocation + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parsePuschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschTimeDomRsrcAlloc *puschTimeDomRsrsAlloc) +{ + memset(puschTimeDomRsrsAlloc, 0, sizeof(PuschTimeDomRsrcAlloc)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_K2_CFG")) && (cur->ns == ns)) + { + puschTimeDomRsrsAlloc->k2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_MAPPING_TYPE")) && (cur->ns == ns)) + { + puschTimeDomRsrsAlloc->mappingType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_START_SYMBOL")) && (cur->ns == ns)) + { + puschTimeDomRsrsAlloc->startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_LENGTH_SYMBOL")) && (cur->ns == ns)) + { + puschTimeDomRsrsAlloc->symbolLength= atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + cur = cur -> next; + } + + puschTimeDomRsrsAlloc -> startSymbolAndLength = \ + calcSliv(puschTimeDomRsrsAlloc->startSymbol, puschTimeDomRsrsAlloc->symbolLength); + return ROK; +} + +/******************************************************************* + * + * @brief Fill PUSCH Configuration Common + * + * @details + * + * Function : parsePuschConfigCommon + * + * Functionality: Fill PUSCH Configuration Common + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parsePuschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschConfigCommon *puschCfgCmn) +{ + uint8_t idx = 0; + xmlNodePtr child = NULLP; + + memset(puschCfgCmn, 0, sizeof(PuschConfigCommon)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns)) + { + puschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC_LIST")) && (cur->ns == ns)) + { + child = cur->xmlChildrenNode; + while(child != NULL) + { + if ((!xmlStrcmp(child->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC")) && (child->ns == ns)) + { + if(parsePuschTimeDomRsrcAlloc(doc, ns, child, &puschCfgCmn->timeDomRsrcAllocList[idx]) != ROK) + { + return RFAILED; + } + idx++; + } + child = child -> next; + } + } + cur = cur -> next; + } + return ROK; +} + +/******************************************************************* + * + * @brief Fill BWP Configuration + * + * @details + * + * Function : parseBwp + * + * Functionality: Fill BWP Configuration + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseBwp(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpParams *bwp) +{ + memset(bwp, 0, sizeof(BwpParams)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PRB")) && (cur->ns == ns)) + { + bwp->firstPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PRB")) && (cur->ns == ns)) + { + bwp->numPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns)) + { + bwp->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NORMAL_CYCLIC_PREFIX")) && (cur->ns == ns)) + { + bwp->cyclicPrefix = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + cur = cur -> next; + } + return ROK; +} + +/******************************************************************* + * + * @brief Fill UL BWP Configuration + * + * @details + * + * Function : parseBwpULConfig + * + * Functionality: Fill UL BWP Configuration + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseBwpULConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpUlConfig *bwpUlCfg) +{ + memset(bwpUlCfg, 0, sizeof(BwpUlConfig)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_PARAMS")) && (cur->ns == ns)) + { + if(parseBwp(doc, ns, cur, &bwpUlCfg->bwp) != ROK) + { + return RFAILED; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_CFG_COMMON")) && (cur->ns == ns)) + { + if(parsePucchConfigCommon(doc, ns, cur, &bwpUlCfg->pucchCommon) != ROK) + { + return RFAILED; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_COMMON")) && (cur->ns == ns)) + { + if(parsePuschConfigCommon(doc, ns, cur, &bwpUlCfg->puschCommon) != ROK) + { + return RFAILED; + } + } + cur = cur -> next; + } + return ROK; +} + +/******************************************************************* + * + * @brief Fill Page Configuration + * + * @details + * + * Function : parsePageCfg + * + * Functionality: Fill Page Configuration + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parsePageCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SchPageCfg *pageCfg) +{ + char *poPresent; + + memset(pageCfg, 0, sizeof(SchPageCfg)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PO")) && (cur->ns == ns)) + { + pageCfg->numPO = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PO_PRESENT")) && (cur->ns == ns)) + { + poPresent = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + if(!strcmp(poPresent, "TRUE")) + { + pageCfg->poPresent = true; + } + else + { + pageCfg->poPresent = false; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PAGING_OCC")) && (cur->ns == ns)) + { + pageCfg->pagingOcc[0] = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + cur = cur -> next; + } + return ROK; +} + +/******************************************************************* + * + * @brief Fill SIB1 PDCCH Configuration + * + * @details + * + * Function : parsePdcchCfgSib1 + * + * Functionality: Fill SIB1 PDCCH Configuration + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parsePdcchCfgSib1(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfigSib1 *pdcchConfigSib1) +{ + memset(pdcchConfigSib1, 0, sizeof(PdcchConfigSib1)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_ZERO_INDEX")) && (cur->ns == ns)) + { + pdcchConfigSib1->coresetZeroIndex = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_RSP_WINDOW")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_ZERO_INDEX")) && (cur->ns == ns)) { - prachCfg->raRspWindow = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdcchConfigSib1->searchSpaceZeroIndex = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } cur = cur -> next; } - - prachCfg->msg1FreqStart = maxNumRbs - prachMaxPrb; return ROK; } /******************************************************************* * - * @brief Fill CSI RS configuration + * @brief Fill SIB1 Cell Configuration * * @details * - * Function : parseCsiRsCfg + * Function : parseSib1CellCfg * - * Functionality: Fill CSI RS configuration + * Functionality: Fill SIB1 Cell Configuration * * @params[in] XML document pointer * XML namespace @@ -2674,60 +2324,92 @@ uint8_t parsePrachCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PrachCfg *prac * RFAILED - failure * * ****************************************************************/ -uint8_t parseCsiRsCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CsiRsCfg *csiRsCfg) +uint8_t parseSib1CellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Sib1CellCfg *sib1CellCfg) { - memset(csiRsCfg, 0, sizeof(CsiRsCfg)); + memset(sib1CellCfg, 0, sizeof( Sib1CellCfg)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_FREQ")) && (cur->ns == ns)) - { - csiRsCfg->csiFreqDomainAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_PORTS")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCH_PAGE_CFG")) && (cur->ns == ns)) { - csiRsCfg->csiNrofPorts = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parsePageCfg(doc, ns, cur, &sib1CellCfg->pagingCfg) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_OFDM_PORT")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CONFIG_SIB1")) && (cur->ns == ns)) { - csiRsCfg->csirsfirstOFDMSymbolInTimeDomain = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parsePdcchCfgSib1(doc, ns, cur, &sib1CellCfg->pdcchCfgSib1) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_OFDM_PORT_2")) && (cur->ns == ns)) - { - csiRsCfg->csirsfirstOFDMSymbolInTimeDomain2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } + cur = cur -> next; + } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DM_TYPE")) && (cur->ns == ns)) + sib1CellCfg->sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len; + if(sib1CellCfg->sib1PduLen > 0) + { + DU_ALLOC_SHRABL_BUF(sib1CellCfg->sib1Pdu, sib1CellCfg->sib1PduLen); + if(!sib1CellCfg->sib1Pdu) { - csiRsCfg->csirscdmType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + DU_LOG("\nERROR --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__); + return RFAILED; } + memcpy(sib1CellCfg->sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, sib1CellCfg->sib1PduLen); + } + return ROK; +} - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DENSITY")) && (cur->ns == ns)) +/******************************************************************* + * + * @brief Fill Aggregation Level Candidates Information + * + * @details + * + * Function : parseCandidateInfo + * + * Functionality: Fill Aggregation Level Candidates Information + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseCandidateInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CandidatesInfo *candInfo) +{ + memset(candInfo, 0, sizeof(CandidatesInfo)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL1")) && (cur->ns == ns)) { - csiRsCfg->csirsdensity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + candInfo->aggLevel1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DENSITY_DOT_5")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL2")) && (cur->ns == ns)) { - csiRsCfg->csirsdensitydot5 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + candInfo->aggLevel2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"POWER_CONTROL_OFFSET")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL4")) && (cur->ns == ns)) { - csiRsCfg->powerControlOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + candInfo->aggLevel4 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"POWER_CONTROL_OFFSET_SS")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL8")) && (cur->ns == ns)) { - csiRsCfg->powerControlOffsetSS = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + candInfo->aggLevel8 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PERIODICITY_OFFSET")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL16")) && (cur->ns == ns)) { - csiRsCfg->periodicityAndOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + candInfo->aggLevel16 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } cur = cur -> next; @@ -2737,13 +2419,13 @@ uint8_t parseCsiRsCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CsiRsCfg *csiR /******************************************************************* * - * @brief Fill SSB Configuration + * @brief Fill Search Space Connfiguration * * @details * - * Function : parseSsbCfg + * Function : parseSearchSpaceCfg * - * Functionality: Fill SSB Configuration + * Functionality: Fill Search Space Configuration * * @params[in] XML document pointer * XML namespace @@ -2753,74 +2435,45 @@ uint8_t parseCsiRsCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CsiRsCfg *csiR * RFAILED - failure * * ****************************************************************/ -uint8_t parseSsbCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SsbCfg *ssbCfg) +uint8_t parseSearchSpaceCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SearchSpaceCfg *searchSpaceCfg) { - xmlNodePtr child; - uint8_t ssbMaskIdx = 0; - - memset(ssbCfg, 0, sizeof( SsbCfg)); + memset(searchSpaceCfg, 0, sizeof(SearchSpaceCfg)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBSC_PWR")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_1_INDEX")) && (cur->ns == ns)) { - ssbCfg->ssbPbchPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + searchSpaceCfg->searchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_CMN")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns)) { - ssbCfg->scsCmn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + searchSpaceCfg->coresetId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_OFF_PT_A")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SS_MONITORING_SLOT_SL1")) && (cur->ns == ns)) { - ssbCfg->ssbOffsetPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + searchSpaceCfg->monitoringSlot = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIOD")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DURATION")) && (cur->ns == ns)) { - ssbCfg->ssbPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + searchSpaceCfg->duration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SC_OFF")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SS_MONITORING_SYMBOL")) && (cur->ns == ns)) { - ssbCfg->ssbScOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + searchSpaceCfg->monitoringSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_LIST")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CANDIDATE_INFO")) && (cur->ns == ns)) { - child = cur -> xmlChildrenNode; - while(child != NULL) + if(parseCandidateInfo(doc, ns, cur, &searchSpaceCfg->candidate) != ROK) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"SSB_MASK")) && (child->ns == ns)) - { - ssbCfg->ssbMask[ssbMaskIdx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); - ssbMaskIdx++; - } - child = child -> next; + return RFAILED; } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_ID")) && (cur->ns == ns)) - { - ssbCfg->beamId[0] = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BETA_PSS")) && (cur->ns == ns)) - { - ssbCfg->betaPss = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCH_PAY_FLAG")) && (cur->ns == ns)) - { - ssbCfg->bchPayloadFlag = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"DMRS_TYPE_A_PROS")) && (cur->ns == ns)) - { - ssbCfg->dmrsTypeAPos = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - cur = cur -> next; } return ROK; @@ -2828,13 +2481,13 @@ uint8_t parseSsbCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SsbCfg *ssbCfg) /******************************************************************* * - * @brief Fill Carrier Configuration + * @brief Fill PDCCH Configuration Common * * @details * - * Function : parseCarrierCfg + * Function : parsePdcchCfgCommon * - * Functionality: Fill Carrier Configuration + * Functionality: Fill PDCCH Configuration Common * * @params[in] XML document pointer * XML namespace @@ -2844,56 +2497,40 @@ uint8_t parseSsbCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SsbCfg *ssbCfg) * RFAILED - failure * * ****************************************************************/ -uint8_t parseCarrierCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CarrierCfg *carrierCfg) +uint8_t parsePdcchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfigCommon *pdcchCfgCm) { - memset(carrierCfg, 0, sizeof(CarrierCfg)); + memset(pdcchCfgCm, 0, sizeof(PdcchConfigCommon)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"DL_BW")) && (cur->ns == ns)) - { - carrierCfg->dlBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_DL_ARFCN")) && (cur->ns == ns)) - { - carrierCfg->arfcnDL = convertArfcnToFreqKhz(atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1))); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_BW")) && (cur->ns == ns)) - { - carrierCfg->ulBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_UL_ARFCN")) && (cur->ns == ns)) - { - carrierCfg->arfcnUL = convertArfcnToFreqKhz(atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1))); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TX_ANT")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_CFG")) && (cur->ns == ns)) { - carrierCfg->numTxAnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parseSearchSpaceCfg(doc, ns, cur, &pdcchCfgCm->commonSearchSpace) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RX_ANT")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_SEARCH_SPACE_INDEX")) && (cur->ns == ns)) { - carrierCfg->numRxAnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdcchCfgCm->raSearchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } cur = cur -> next; } + return ROK; } /******************************************************************* * - * @brief Fill PLMN Information List + * @brief Fill PDSCH Common Time Domain Resource Allocation * * @details * - * Function : parsePlmnInfo + * Function : parsePdschCmnTimeDomRsrcAlloc * - * Functionality: Fill PLMN Information List + * Functionality: Fill PDSCH Common Time Domain Resource Allocation * * @params[in] XML document pointer * XML namespace @@ -2903,27 +2540,28 @@ uint8_t parseCarrierCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CarrierCfg *c * RFAILED - failure * * ****************************************************************/ -uint8_t parsePlmnInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PlmnInfoList *plmnInfoList) +uint8_t parsePdschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,\ + PdschCfgCommTimeDomRsrcAlloc *pdschTimeDomRsrcAlloc) { - - memset(plmnInfoList, 0, sizeof(PlmnInfoList)); + memset(pdschTimeDomRsrcAlloc, 0, sizeof(PdschCfgCommTimeDomRsrcAlloc)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_K0_CFG")) && (cur->ns == ns)) { - if(parsePlmn(doc, ns, cur,&plmnInfoList->plmn) != ROK) - { - return RFAILED; - } + pdschTimeDomRsrcAlloc->k0 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SLICE_SUPP_LST")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_MAPPING_TYPE")) && (cur->ns == ns)) { - if(parseSupportedSliceList(doc, ns, cur,&plmnInfoList -> suppSliceList) != ROK) - { - return RFAILED; - } + pdschTimeDomRsrcAlloc->mappingType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_START_SYMBOL")) && (cur->ns == ns)) + { + pdschTimeDomRsrcAlloc->startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_LENGTH_SYMBOL")) && (cur->ns == ns)) + { + pdschTimeDomRsrcAlloc->lengthSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } cur = cur -> next; @@ -2933,13 +2571,13 @@ uint8_t parsePlmnInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PlmnInfoList *p /******************************************************************* * - * @brief Fill PUCCH Configuration Common + * @brief Fill PDSCH Configuration Common * * @details * - * Function : parsePucchConfigCommon + * Function : parsePdschConfigCommon * - * Functionality: Fill PUCCH Configuration Common + * Functionality: Fill PDSCH Configuration Common * * @params[in] XML document pointer * XML namespace @@ -2949,22 +2587,36 @@ uint8_t parsePlmnInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PlmnInfoList *p * RFAILED - failure * * ****************************************************************/ -uint8_t parsePucchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PucchConfigCommon *pucchCfgCmn) +uint8_t parsePdschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PdschConfigCommon *pdschCfgCmn) { - memset(pucchCfgCmn, 0, sizeof(PucchConfigCommon)); + uint8_t idx = 0; + xmlNodePtr child = NULLP; + + memset(pdschCfgCmn, 0, sizeof(PdschConfigCommon)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_RSRC_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns)) { - pucchCfgCmn->pucchResourceCommon = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdschCfgCmn->numTimeDomAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_GROUP_HOPPING")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC_LIST")) && (cur->ns == ns)) { - pucchCfgCmn->pucchGroupHopping = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + child = cur->xmlChildrenNode; + while(child != NULL) + { + if ((!xmlStrcmp(child->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC")) && (child->ns == ns)) + { + if(parsePdschCmnTimeDomRsrcAlloc(doc, ns, child, &pdschCfgCmn->timeDomRsrcAllocList[idx]) != ROK) + { + return RFAILED; + } + idx++; + } + child = child -> next; + } } - cur = cur -> next; } return ROK; @@ -2972,13 +2624,13 @@ uint8_t parsePucchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Pucch /******************************************************************* * - * @brief Fill PUSCH Common Time Allocation + * @brief Fill DL BWP Configuration * * @details * - * Function : parsePuschTimeDomRsrcAlloc + * Function : parseBwpDLConfig * - * Functionality: Fill PUSCH Common Time Allocation + * Functionality: Fill DL BWP Configuration * * @params[in] XML document pointer * XML namespace @@ -2988,49 +2640,50 @@ uint8_t parsePucchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Pucch * RFAILED - failure * * ****************************************************************/ -uint8_t parsePuschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschTimeDomRsrcAlloc *puschTimeDomRsrsAlloc) +uint8_t parseBwpDLConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpDlConfig *bwpDlCfg) { - memset(puschTimeDomRsrsAlloc, 0, sizeof(PuschTimeDomRsrcAlloc)); + memset(bwpDlCfg, 0, sizeof(BwpDlConfig)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_K2_CFG")) && (cur->ns == ns)) - { - puschTimeDomRsrsAlloc->k2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_MAPPING_TYPE")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_PARAMS")) && (cur->ns == ns)) { - puschTimeDomRsrsAlloc->mappingType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parseBwp(doc, ns, cur, &bwpDlCfg->bwp) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_START_SYMBOL")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CFG_COMMON")) && (cur->ns == ns)) { - puschTimeDomRsrsAlloc->startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parsePdcchCfgCommon(doc, ns, cur, &bwpDlCfg->pdcchCommon) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_LENGTH_SYMBOL")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_CFG_COMMON")) && (cur->ns == ns)) { - puschTimeDomRsrsAlloc->symbolLength= atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parsePdschConfigCommon(doc, ns, cur, &bwpDlCfg->pdschCommon) != ROK) + { + return RFAILED; + } } cur = cur -> next; } - - puschTimeDomRsrsAlloc -> startSymbolAndLength = \ - calcSliv(puschTimeDomRsrsAlloc->startSymbol, puschTimeDomRsrsAlloc->symbolLength); return ROK; } /******************************************************************* * - * @brief Fill PUSCH Configuration Common + * @brief Fill Cell Configuration * * @details * - * Function : parsePuschConfigCommon + * Function : parseCellCfg * - * Functionality: Fill PUSCH Configuration Common + * Functionality: Fill Cell Configuration * * @params[in] XML document pointer * XML namespace @@ -3040,44 +2693,90 @@ uint8_t parsePuschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Pu * RFAILED - failure * * ****************************************************************/ -uint8_t parsePuschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschConfigCommon *puschCfgCmn) +uint8_t parseCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CellCfg *cellCfg) { - uint8_t idx = 0; - xmlNodePtr child = NULLP; - xmlNodePtr pdschNode = NULLP; - - memset(puschCfgCmn, 0, sizeof(PuschConfigCommon)); + memset(cellCfg, 0, sizeof(CellCfg)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns)) +#ifdef O1_ENABLE + cellCfg->opState = cellParams.operationalState; + cellCfg->adminState = cellParams.administrativeState; + cellCfg->cellState = cellParams.cellState; + cellCfg->phyCellId = cellParams.nRPCI; + cellCfg->tac = cellParams.nRTAC; + cellCfg->ssbFreq = cellParams.ssbFrequency; +#else + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_OP_STATE")) && (cur->ns == ns)) { - puschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + cellCfg->opState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC_LIST")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_ADMIN_STATE")) && (cur->ns == ns)) { - child = cur->xmlChildrenNode; - while(child != NULL) + cellCfg->adminState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_CELL_STATE")) && (cur->ns == ns)) + { + cellCfg->cellState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_PCI")) && (cur->ns == ns)) + { + cellCfg->phyCellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns)) + { + cellCfg->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_FREQUENCY")) && (cur->ns == ns)) + { + cellCfg->ssbFreq = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } +#endif + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN_INFO")) && (cur->ns == ns)) + { + if(parsePlmnInfo(doc, ns, cur, &cellCfg->plmnInfoList[0]) != ROK) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns)) - { - pdschNode = child->xmlChildrenNode; - while(pdschNode != NULL) - { - if ((!xmlStrcmp(pdschNode->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC")) && (pdschNode->ns == ns)) - { - if(parsePuschTimeDomRsrcAlloc(doc, ns, child,&puschCfgCmn->timeDomRsrcAllocList[idx]) != ROK) - { - return RFAILED; - } - idx++; - } - pdschNode = pdschNode -> next; - } - } + return RFAILED; + } + } - child = child -> next; + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns)) + { + cellCfg->subCarrSpacing = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DUPLEX_MODE")) && (cur->ns == ns)) + { + cellCfg->dupType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_CELL_CFG")) && (cur->ns == ns)) + { + if(parseSib1CellCfg(doc, ns, cur, &cellCfg->sib1Cfg) != ROK) + { + return RFAILED; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_DL_CFG")) && (cur->ns == ns)) + { + if(parseBwpDLConfig(doc, ns, cur, &cellCfg->initialDlBwp) != ROK) + { + return RFAILED; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_UL_CFG")) && (cur->ns == ns)) + { + if(parseBwpULConfig(doc, ns, cur, &cellCfg->initialUlBwp) != ROK) + { + return RFAILED; } } cur = cur -> next; @@ -3085,15 +2784,16 @@ uint8_t parsePuschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschC return ROK; } +#ifdef NR_TDD /******************************************************************* * - * @brief Fill BWP Configuration + * @brief Fill TDD slot configuration * * @details * - * Function : parseBwp + * Function : parseTddCfg * - * Functionality: Fill BWP Configuration + * Functionality: Fill TDD slot configuration * * @params[in] XML document pointer * XML namespace @@ -3103,46 +2803,52 @@ uint8_t parsePuschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschC * RFAILED - failure * * ****************************************************************/ -uint8_t parseBwp(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpParams *bwp) +uint8_t parseTddCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TDDCfg *tddCfg) { - memset(bwp, 0, sizeof(BwpParams)); + memset(tddCfg, 0, sizeof(TDDCfg)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PRB")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_PERIODICITY")) && (cur->ns == ns)) { - bwp->firstPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tddCfg->tddPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PRB")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SLOTS")) && (cur->ns == ns)) { - bwp->numPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tddCfg->nrOfDlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SYMBOLS")) && (cur->ns == ns)) { - bwp->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tddCfg->nrOfDlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NORMAL_CYCLIC_PREFIX")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SLOTS")) && (cur->ns == ns)) { - bwp->cyclicPrefix = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tddCfg->nrOfUlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SYMBOLS")) && (cur->ns == ns)) + { + tddCfg->nrOfUlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } cur = cur -> next; } return ROK; } +#endif /******************************************************************* * - * @brief Fill UL BWP Configuration + * @brief Fill MAC Cell Configuration * * @details * - * Function : parseBwpULConfig + * Function : parseMacCellCfg * - * Functionality: Fill UL BWP Configuration + * Functionality: Fill MAC Cell Configuration * * @params[in] XML document pointer * XML namespace @@ -3152,87 +2858,85 @@ uint8_t parseBwp(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpParams *bwp) * RFAILED - failure * * ****************************************************************/ -uint8_t parseBwpULConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpUlConfig *bwpUlCfg) +uint8_t parseMacCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacCellCfg *macCellCfg) { - memset(bwpUlCfg, 0, sizeof(BwpUlConfig)); + memset(macCellCfg, 0, sizeof(MacCellCfg)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_PARAMS")) && (cur->ns == ns)) +#ifdef O1_ENABLE + macCellCfg->cellId = cellParams.cellLocalId; +#else + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_ID")) && (cur->ns == ns)) { - if(parseBwp(doc, ns, cur, &bwpUlCfg->bwp) != ROK) + macCellCfg->cellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } +#endif + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARRIER_CFG")) && (cur->ns == ns)) + { + if(parseCarrierCfg(doc, ns, cur, &macCellCfg->carrCfg) != ROK) { return RFAILED; } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_CFG_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_CFG")) && (cur->ns == ns)) { - if(parsePucchConfigCommon(doc, ns, cur, &bwpUlCfg->pucchCommon) != ROK) + if(parseCellCfg(doc, ns, cur, &macCellCfg->cellCfg) != ROK) { return RFAILED; } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_CFG")) && (cur->ns == ns)) { - if(parsePuschConfigCommon(doc, ns, cur, &bwpUlCfg->puschCommon) != ROK) + if(parseSsbCfg(doc, ns, cur, &macCellCfg->ssbCfg) != ROK) { return RFAILED; } } - cur = cur -> next; - } - return ROK; -} -/******************************************************************* - * - * @brief Fill Page Configuration - * - * @details - * - * Function : parsePageCfg - * - * Functionality: Fill Page Configuration - * - * @params[in] XML document pointer - * XML namespace - * Current node in XML - * Pointer to structure to be filled - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ -uint8_t parsePageCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SchPageCfg *pageCfg) -{ - char *poPresent; + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_CFG")) && (cur->ns == ns)) + { + if(parseCsiRsCfg(doc, ns, cur, &macCellCfg->csiRsCfg) != ROK) + { + return RFAILED; + } + } - memset(pageCfg, 0, sizeof(SchPageCfg)); - cur = cur -> xmlChildrenNode; - while(cur != NULL) - { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PO")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CFG")) && (cur->ns == ns)) { - pageCfg->numPO = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parsePrachCfg(doc, ns, cur, &macCellCfg->prachCfg) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PO_PRESENT")) && (cur->ns == ns)) +#ifdef NR_TDD + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_CFG")) && (cur->ns == ns)) { - poPresent = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - if(!strcmp(poPresent, "TRUE")) + if(parseTddCfg(doc, ns, cur, &macCellCfg->tddCfg) != ROK) { - pageCfg->poPresent = true; + return RFAILED; } - else + } +#endif + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRE_CODE_CFG")) && (cur->ns == ns)) + { + if(parsePrecodingConfig(doc, ns, cur, &macCellCfg->precodingConf) != ROK) { - pageCfg->poPresent = false; + return RFAILED; } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PAGING_OCC")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_FORM_CFG")) && (cur->ns == ns)) { - pageCfg->pagingOcc[0] = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parseBeamformingConfig(doc, ns, cur, &macCellCfg->beamCfg) != ROK) + { + return RFAILED; + } } cur = cur -> next; @@ -3242,13 +2946,15 @@ uint8_t parsePageCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SchPageCfg *pag /******************************************************************* * - * @brief Fill SIB1 PDCCH Configuration + * @brief Fill PUSCH Configuration Common Time Domain + * Resource Allocation * * @details * - * Function : parsePdcchCfgSib1 + * Function : parsePuschCmnTimeDomRsrcAlloc * - * Functionality: Fill SIB1 PDCCH Configuration + * Functionality: Fill PUSCH Configuration Common Time Domain + * Resource Allocation * * @params[in] XML document pointer * XML namespace @@ -3258,36 +2964,46 @@ uint8_t parsePageCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SchPageCfg *pag * RFAILED - failure * * ****************************************************************/ -uint8_t parsePdcchCfgSib1(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfigSib1 *pdcchConfigSib1) +uint8_t parsePuschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgCmnTimeDomAlloc *puschCmnTimeDomAlloc) { - memset(pdcchConfigSib1, 0, sizeof(PdcchConfigSib1)); + uint16_t startSymbol; + uint16_t lenSymbol; + + memset(puschCmnTimeDomAlloc, 0, sizeof(PuschCfgCmnTimeDomAlloc)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_ZERO_INDEX")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"K2")) && (cur->ns == ns)) { - pdcchConfigSib1->coresetZeroIndex = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + puschCmnTimeDomAlloc->k2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_ZERO_INDEX")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAP_TYPE")) && (cur->ns == ns)) { - pdcchConfigSib1->searchSpaceZeroIndex = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + puschCmnTimeDomAlloc->mapType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_START_SYMBOL")) && (cur->ns == ns)) + { + startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_LENGTH_SYMBOL")) && (cur->ns == ns)) + { + lenSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - cur = cur -> next; } + puschCmnTimeDomAlloc->sliv = calcSliv(startSymbol, lenSymbol); return ROK; } /******************************************************************* * - * @brief Fill SIB1 Cell Configuration + * @brief Fill PUSCH Configuration Common * * @details * - * Function : parseSib1CellCfg + * Function : parsePuschCfgCommon * - * Functionality: Fill SIB1 Cell Configuration + * Functionality: Fill PUSCH Configuration Common * * @params[in] XML document pointer * XML namespace @@ -3297,28 +3013,51 @@ uint8_t parsePdcchCfgSib1(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfig * RFAILED - failure * * ****************************************************************/ -uint8_t parseSib1CellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Sib1CellCfg *sib1CellCfg) +uint8_t parsePuschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgCommon *puschCfgCmn) { - memset(sib1CellCfg, 0, sizeof( Sib1CellCfg)); + uint8_t rsrcIdx = 0; + xmlNodePtr child = NULLP; + + memset(puschCfgCmn, 0, sizeof(PuschCfgCommon)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCH_PAGE_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_PRESENT")) && (cur->ns == ns)) { - if(parsePageCfg(doc, ns, cur, &sib1CellCfg->pagingCfg) != ROK) - { - return RFAILED; - } + puschCfgCmn->puschCfgPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CONFIG_SIB1")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_MSG3_DELTA_PREAMBLE")) && (cur->ns == ns)) { - if(parsePdcchCfgSib1(doc, ns, cur, &sib1CellCfg->pdcchCfgSib1) != ROK) + puschCfgCmn->msg3DeltaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_P0_NOMINAL_WITH_GRANT")) && (cur->ns == ns)) + { + puschCfgCmn->p0NominalWithGrant = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns)) + { + puschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_TIME_DOM_RSRC_ALLOC_LIST")) && (cur->ns == ns)) + { + child = cur->xmlChildrenNode; + while (child != NULL) { - return RFAILED; + if ((!xmlStrcmp(child->name, (const xmlChar *)"PUSCH_TIME_DOM_RSRC_ALLOC")) && (child->ns == ns)) + { + if(parsePuschCmnTimeDomRsrcAlloc(doc, ns, child, &puschCfgCmn->timeDomAllocList[rsrcIdx]) != ROK) + { + return RFAILED; + } + rsrcIdx++; + } + child = child->next; } } - cur = cur -> next; } return ROK; @@ -3326,13 +3065,13 @@ uint8_t parseSib1CellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Sib1CellCfg /******************************************************************* * - * @brief Fill Aggregation Level Candidates Information + * @brief Fill PUCCH Configuration Common * * @details * - * Function : parseCandidateInfo + * Function : parsePucchCfgCommon * - * Functionality: Fill Aggregation Level Candidates Information + * Functionality: Fill PUCCH Configuration Common * * @params[in] XML document pointer * XML namespace @@ -3342,35 +3081,30 @@ uint8_t parseSib1CellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Sib1CellCfg * RFAILED - failure * * ****************************************************************/ -uint8_t parseCandidateInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CandidatesInfo *candInfo) +uint8_t parsePucchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PucchCfgCommon *pucchCfgCmn) { - memset(candInfo, 0, sizeof(CandidatesInfo)); + memset(pucchCfgCmn, 0, sizeof(PucchCfgCommon)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL1")) && (cur->ns == ns)) - { - candInfo->aggLevel1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL2")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns)) { - candInfo->aggLevel2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pucchCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL4")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_RSRC_COMMON")) && (cur->ns == ns)) { - candInfo->aggLevel4 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pucchCfgCmn->rsrcComm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL8")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"GRP_HOP")) && (cur->ns == ns)) { - candInfo->aggLevel8 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pucchCfgCmn->grpHop = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL16")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_P0_NOMINAL")) && (cur->ns == ns)) { - candInfo->aggLevel16 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pucchCfgCmn->p0Nominal = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } cur = cur -> next; @@ -3380,13 +3114,13 @@ uint8_t parseCandidateInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Candidates /******************************************************************* * - * @brief Fill Search Space Connfiguration + * @brief Fill RACH Configuration Common * * @details * - * Function : parseSearchSpaceCfg + * Function : parseRachCfgCommon * - * Functionality: Fill Search Space Configuration + * Functionality: Fill RACH Configuration Common * * @params[in] XML document pointer * XML namespace @@ -3396,212 +3130,125 @@ uint8_t parseCandidateInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Candidates * RFAILED - failure * * ****************************************************************/ -uint8_t parseSearchSpaceCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SearchSpaceCfg *searchSpaceCfg) +uint8_t parseRachCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RachCfgCommon *rachCfgCmn) { - memset(searchSpaceCfg, 0, sizeof(SearchSpaceCfg)); + long maxNumRb; + long prachMaxPrb; + + memset(rachCfgCmn, 0, sizeof(RachCfgCommon)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_1_INDEX")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns)) { - searchSpaceCfg->searchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rachCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CONFIG_IDX")) && (cur->ns == ns)) { - searchSpaceCfg->coresetId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rachCfgCmn->prachCfgIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SS_MONITORING_SLOT_SL1")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MSG_1_FDM")) && (cur->ns == ns)) { - searchSpaceCfg->monitoringSlot = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rachCfgCmn->msg1Fdm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"DURATION")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_RB")) && (cur->ns == ns)) { - searchSpaceCfg->duration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + maxNumRb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SS_MONITORING_SYMBOL")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_MAX_PRB")) && (cur->ns == ns)) { - searchSpaceCfg->monitoringSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + prachMaxPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CANDIDATE_INFO")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"ZERO_CORRELATION_ZONE_CFG")) && (cur->ns == ns)) { - if(parseCandidateInfo(doc, ns, cur, &searchSpaceCfg->candidate) != ROK) - { - return RFAILED; - } + rachCfgCmn->zeroCorrZoneCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - cur = cur -> next; - } - return ROK; -} - -/******************************************************************* - * - * @brief Fill PDCCH Configuration Common - * - * @details - * - * Function : parsePdcchCfgCommon - * - * Functionality: Fill PDCCH Configuration Common - * - * @params[in] XML document pointer - * XML namespace - * Current node in XML - * Pointer to structure to be filled - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ -uint8_t parsePdcchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfigCommon *pdcchCfgCm) -{ - memset(pdcchCfgCm, 0, sizeof(PdcchConfigCommon)); - cur = cur -> xmlChildrenNode; - while(cur != NULL) - { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_PREAMBLE_RCVD_TGT_PWR")) && (cur->ns == ns)) { - if(parseSearchSpaceCfg(doc, ns, cur, &pdcchCfgCm->commonSearchSpace) != ROK) - { - return RFAILED; - } + rachCfgCmn->preambleRcvdTgtPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_1_INDEX")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PREAMBLE_TRANS_MAX")) && (cur->ns == ns)) { - pdcchCfgCm->raSearchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rachCfgCmn->preambleTransMax = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - cur = cur -> next; - } + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PWR_RAMPING_STEP")) && (cur->ns == ns)) + { + rachCfgCmn->pwrRampingStep = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } - return ROK; -} + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_RSP_WINDOW")) && (cur->ns == ns)) + { + rachCfgCmn->raRspWindow = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } -/******************************************************************* - * - * @brief Fill PDSCH Common Time Domain Resource Allocation - * - * @details - * - * Function : parsePdschCmnTimeDomRsrcAlloc - * - * Functionality: Fill PDSCH Common Time Domain Resource Allocation - * - * @params[in] XML document pointer - * XML namespace - * Current node in XML - * Pointer to structure to be filled - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ -uint8_t parsePdschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,\ - PdschCfgCommTimeDomRsrcAlloc *pdschTimeDomRsrcAlloc) -{ - memset(pdschTimeDomRsrcAlloc, 0, sizeof(PdschCfgCommTimeDomRsrcAlloc)); - cur = cur -> xmlChildrenNode; - while(cur != NULL) - { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_K0_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RA_PREAMBLE")) && (cur->ns == ns)) { - pdschTimeDomRsrcAlloc->k0 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rachCfgCmn->numRaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_MAPPING_TYPE")) && (cur->ns == ns)) + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_SSB_PER_RACH_OCC")) && (cur->ns == ns)) { - pdschTimeDomRsrcAlloc->mappingType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rachCfgCmn->numSsbPerRachOcc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_START_SYMBOL")) && (cur->ns == ns)) + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CB_PREAMBLE_PER_SSB")) && (cur->ns == ns)) { - pdschTimeDomRsrcAlloc->startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rachCfgCmn->numCbPreamblePerSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_LENGTH_SYMBOL")) && (cur->ns == ns)) + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONT_RES_TIMER")) && (cur->ns == ns)) { - pdschTimeDomRsrcAlloc->lengthSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rachCfgCmn->contResTimer = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - cur = cur -> next; - } - return ROK; -} + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RSRP_THRESHOLD_SSB")) && (cur->ns == ns)) + { + rachCfgCmn->rsrpThreshSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } -/******************************************************************* - * - * @brief Fill PDSCH Configuration Common - * - * @details - * - * Function : parsePdschConfigCommon - * - * Functionality: Fill PDSCH Configuration Common - * - * @params[in] XML document pointer - * XML namespace - * Current node in XML - * Pointer to structure to be filled - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ -uint8_t parsePdschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PdschConfigCommon *pdschCfgCmn) -{ - uint8_t idx = 0; - xmlNodePtr child = NULLP; - xmlNodePtr pdschNode = NULLP; + if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX_PRESENT")) && (cur->ns == ns)) + { + rachCfgCmn->rootSeqIdxPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } - memset(pdschCfgCmn, 0, sizeof(PdschConfigCommon)); - cur = cur -> xmlChildrenNode; - while(cur != NULL) - { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX")) && (cur->ns == ns)) { - pdschCfgCmn->numTimeDomAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rachCfgCmn->rootSeqIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC_LIST")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_SUBCARRIER_SPACING")) && (cur->ns == ns)) { - child = cur->xmlChildrenNode; - while(child != NULL) - { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns)) - { - pdschNode = child->xmlChildrenNode; - while(pdschNode != NULL) - { - if ((!xmlStrcmp(pdschNode->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC")) && (pdschNode->ns == ns)) - { - if(parsePdschCmnTimeDomRsrcAlloc(doc, ns, child, &pdschCfgCmn->timeDomRsrcAllocList[idx]) != ROK) - { - return RFAILED; - } - idx++; - } - pdschNode = pdschNode -> next; - } - } + rachCfgCmn->msg1Scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } - child = child -> next; - } + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_RESTRICTED_SET_CFG")) && (cur->ns== ns)) + { + rachCfgCmn->restrictedSetCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } + cur = cur -> next; } + + rachCfgCmn->msg1FreqStart = ((maxNumRb) - (prachMaxPrb)); return ROK; } /******************************************************************* * - * @brief Fill DL BWP Configuration + * @brief Fill SCS Specific Carrier * * @details * - * Function : parseBwpDLConfig + * Function : parseScsSpecCarrier * - * Functionality: Fill DL BWP Configuration + * Functionality: Fill SCS Specific Carrier * * @params[in] XML document pointer * XML namespace @@ -3611,50 +3258,47 @@ uint8_t parsePdschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Pdsch * RFAILED - failure * * ****************************************************************/ -uint8_t parseBwpDLConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpDlConfig *bwpDlCfg) +uint8_t parseScsSpecCarrier(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, ScsSpecCarrier *scsSpecCrr) { - memset(bwpDlCfg, 0, sizeof(BwpDlConfig)); + memset(scsSpecCrr, 0, sizeof(ScsSpecCarrier)); + +#ifdef O1_ENABLE + scsSpecCrr->scsOffset = cellParams.ssbOffset; + scsSpecCrr->scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); + scsSpecCrr->scsBw = cellParams.bSChannelBwUL; +#else cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_PARAMS")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SUBCARRIER_OFFSET")) && (cur->ns == ns)) { - if(parseBwp(doc, ns, cur, &bwpDlCfg->bwp) != ROK) - { - return RFAILED; - } + scsSpecCrr->scsOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CFG_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns)) { - if(parsePdcchCfgCommon(doc, ns, cur, &bwpDlCfg->pdcchCommon) != ROK) - { - return RFAILED; - } + scsSpecCrr->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_CFG_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_BW")) && (cur->ns == ns)) { - if(parsePdschConfigCommon(doc, ns, cur, &bwpDlCfg->pdschCommon) != ROK) - { - return RFAILED; - } + scsSpecCrr->scsBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - cur = cur -> next; } +#endif return ROK; } /******************************************************************* * - * @brief Fill Cell Configuration + * @brief Fill UL Config Common * * @details * - * Function : parseCellCfg + * Function : parseUlCfgCommon * - * Functionality: Fill Cell Configuration + * Functionality: Fill UL Config Common * * @params[in] XML document pointer * XML namespace @@ -3664,79 +3308,59 @@ uint8_t parseBwpDLConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpDlConfig * RFAILED - failure * * ****************************************************************/ -uint8_t parseCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CellCfg *cellCfg) +uint8_t parseUlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,UlCfgCommon *ulCfgCmn) { - memset(cellCfg, 0, sizeof(CellCfg)); + memset(ulCfgCmn, 0, sizeof(UlCfgCommon)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_OP_STATE")) && (cur->ns == ns)) - { - cellCfg->opState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_ADMIN_STATE")) && (cur->ns == ns)) - { - cellCfg->adminState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_CELL_STATE")) && (cur->ns == ns)) - { - cellCfg->cellState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN_INFO")) && (cur->ns == ns)) - { - if(parsePlmnInfo(doc, ns, cur, &cellCfg->plmnInfoList[0]) != ROK) - { - return RFAILED; - } - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_PCI")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns)) { - cellCfg->phyCellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + ulCfgCmn->freqBandInd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_P_MAX")) && (cur->ns == ns)) { - cellCfg->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + ulCfgCmn->pMax = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_FREQUENCY")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"FREQ_LOC_BW")) && (cur->ns == ns)) { - cellCfg->ssbFreq = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + ulCfgCmn->locAndBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIME_ALLIGN_TIMER_COMM")) && (cur->ns == ns)) { - cellCfg->subCarrSpacing = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + ulCfgCmn->timeAlignTimerComm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"DUPLEX_MODE")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_SPEC_CARRIER")) && (cur->ns == ns)) { - cellCfg->dupType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parseScsSpecCarrier(doc, ns, cur, &ulCfgCmn->ulScsCarrier) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_CELL_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RACH_CFG_COMMON")) && (cur->ns == ns)) { - if(parseSib1CellCfg(doc, ns, cur, &cellCfg->sib1Cfg) != ROK) + if(parseRachCfgCommon(doc, ns, cur, &ulCfgCmn->rachCfg) != ROK) { return RFAILED; } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_DL_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_COMMON")) && (cur->ns == ns)) { - if(parseBwpDLConfig(doc, ns, cur, &cellCfg->initialDlBwp) != ROK) + if(parsePuschCfgCommon(doc, ns, cur, &ulCfgCmn->puschCfg) != ROK) { return RFAILED; } } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_UL_CFG")) && (cur->ns == ns)) + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_CFG_COMMON")) && (cur->ns == ns)) { - if(parseBwpULConfig(doc, ns, cur, &cellCfg->initialUlBwp) != ROK) + if(parsePucchCfgCommon(doc, ns, cur, &ulCfgCmn->pucchCfg) != ROK) { return RFAILED; } @@ -3747,16 +3371,15 @@ uint8_t parseCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CellCfg *cellCfg return ROK; } -#ifdef NR_TDD /******************************************************************* * - * @brief Fill TDD slot configuration + * @brief Fill TDD UL DL Configuration Common * * @details * - * Function : parseTddCfg + * Function : parseTddUlDlCfgCommon * - * Functionality: Fill TDD slot configuration + * Functionality: Fill TDD UL DL Configuration Common * * @params[in] XML document pointer * XML namespace @@ -3766,52 +3389,56 @@ uint8_t parseCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CellCfg *cellCfg * RFAILED - failure * * ****************************************************************/ -uint8_t parseTddCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TDDCfg *tddCfg) +uint8_t parseTddUlDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TddUlDlCfgCommon *tddUlDlCfgCmn) { - memset(tddCfg, 0, sizeof(TDDCfg)); + memset(tddUlDlCfgCmn, 0, sizeof(TddUlDlCfgCommon)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_PERIODICITY")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"REF_SCS")) && (cur->ns == ns)) { - tddCfg->tddPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tddUlDlCfgCmn->refScs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TX_PRD")) && (cur->ns == ns)) + { + tddUlDlCfgCmn->txPrd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SLOTS")) && (cur->ns == ns)) { - tddCfg->nrOfDlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tddUlDlCfgCmn->numDlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SYMBOLS")) && (cur->ns == ns)) { - tddCfg->nrOfDlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tddUlDlCfgCmn->numDlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SLOTS")) && (cur->ns == ns)) { - tddCfg->nrOfUlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tddUlDlCfgCmn->numUlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SYMBOLS")) && (cur->ns == ns)) { - tddCfg->nrOfUlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tddUlDlCfgCmn->numUlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } cur = cur -> next; } return ROK; } -#endif /******************************************************************* * - * @brief Fill MAC Cell Configuration + * @brief Fill PCCH Configuration * * @details * - * Function : parseMacCellCfg + * Function : parsePcchCfg * - * Functionality: Fill MAC Cell Configuration + * Functionality: Fill PCCH Configuration * * @params[in] XML document pointer * XML namespace @@ -3821,83 +3448,53 @@ uint8_t parseTddCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TDDCfg *tddCfg) * RFAILED - failure * * ****************************************************************/ -uint8_t parseMacCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacCellCfg *macCellCfg) +uint8_t parsePcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PcchCfg *pcchCfg) { - memset(macCellCfg, 0, sizeof(MacCellCfg)); + xmlNodePtr child = NULLP; + uint8_t idx = 0; + + memset(pcchCfg, 0, sizeof(PcchCfg)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_ID")) && (cur->ns == ns)) - { - macCellCfg->cellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARRIER_CFG")) && (cur->ns == ns)) - { - if(parseCarrierCfg(doc, ns, cur, &macCellCfg->carrCfg) != ROK) - { - return RFAILED; - } - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_CFG")) && (cur->ns == ns)) - { - if(parseCellCfg(doc, ns, cur, &macCellCfg->cellCfg) != ROK) - { - return RFAILED; - } - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEFAULT_PAGING_CYCLE")) && (cur->ns == ns)) { - if(parseSsbCfg(doc, ns, cur, &macCellCfg->ssbCfg) != ROK) - { - return RFAILED; - } + pcchCfg->dfltPagingCycle = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAND_PAGING_FRAME_OFFSET")) && (cur->ns == ns)) { - if(parseCsiRsCfg(doc, ns, cur, &macCellCfg->csiRsCfg) != ROK) - { - return RFAILED; - } + pcchCfg->nAndPagingFrmOffsetType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PAGE_FRAME_OFFSET")) && (cur->ns == ns)) { - if(parsePrachCfg(doc, ns, cur, &macCellCfg->prachCfg) != ROK) - { - return RFAILED; - } + pcchCfg->pageFrameOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } -#ifdef NR_TDD - if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NS")) && (cur->ns == ns)) { - if(parseTddCfg(doc, ns, cur, &macCellCfg->tddCfg) != ROK) - { - return RFAILED; - } + pcchCfg->ns = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } -#endif - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRE_CODE_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PDCCH_MONITORING_TYPE")) && (cur->ns == ns)) { - if(parsePrecodingConfig(doc, ns, cur, &macCellCfg->precodingConf) != ROK) - { - return RFAILED; - } + pcchCfg->firstPDCCHMontioringType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_FORM_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PDCCH_LIST")) && (cur->ns == ns)) { - if(parseBeamformingConfig(doc, ns, cur, &macCellCfg->beamCfg) != ROK) + child = cur->xmlChildrenNode; + while (child != NULL) { - return RFAILED; + if ((!xmlStrcmp(child->name, (const xmlChar *)"FIRST_PDCCH_MONITORING_INFO")) && (child->ns == ns)) + { + pcchCfg->firstPDCCHMontioringInfo[idx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); + idx++; + } + child = child->next; } } - cur = cur -> next; } return ROK; @@ -3905,15 +3502,13 @@ uint8_t parseMacCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacCellCfg *m /******************************************************************* * - * @brief Fill PUSCH Configuration Common Time Domain - * Resource Allocation + * @brief Fill PDSCH Time Domain Resource Allocation * * @details * - * Function : parsePuschCmnTimeDomRsrcAlloc + * Function : parsePdschTimeDomRsrcAlloc * - * Functionality: Fill PUSCH Configuration Common Time Domain - * Resource Allocation + * Functionality: Fill PDSCH Time Domain Resource Allocation * * @params[in] XML document pointer * XML namespace @@ -3923,46 +3518,50 @@ uint8_t parseMacCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacCellCfg *m * RFAILED - failure * * ****************************************************************/ -uint8_t parsePuschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgCmnTimeDomAlloc *puschCmnTimeDomAlloc) +uint8_t parsePdschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschTimeDomainRsrcAlloc *pdschTimeDomRsrcAlloc) { uint16_t startSymbol; uint16_t lenSymbol; - memset(puschCmnTimeDomAlloc, 0, sizeof(PuschCfgCmnTimeDomAlloc)); + memset(pdschTimeDomRsrcAlloc, 0, sizeof(PdschTimeDomainRsrcAlloc)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"K2")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"K0")) && (cur->ns == ns)) { - puschCmnTimeDomAlloc->k2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdschTimeDomRsrcAlloc->k0 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAP_TYPE")) && (cur->ns == ns)) { - puschCmnTimeDomAlloc->mapType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdschTimeDomRsrcAlloc->mapType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_START_SYMBOL")) && (cur->ns == ns)) + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_START_SYMBOL")) && (cur->ns == ns)) { startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_LENGTH_SYMBOL")) && (cur->ns == ns)) + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_LENGTH_SYMBOL")) && (cur->ns == ns)) { lenSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } + cur = cur -> next; } - puschCmnTimeDomAlloc->sliv = calcSliv(startSymbol, lenSymbol); + pdschTimeDomRsrcAlloc->sliv = calcSliv(startSymbol, lenSymbol); return ROK; } /******************************************************************* * - * @brief Fill PUSCH Configuration Common + * @brief Fill PDSCH Configuration Common * * @details * - * Function : parsePuschCfgCommon + * Function : parsePdschCfgCommon * - * Functionality: Fill PUSCH Configuration Common + * Functionality: Fill PDSCH Configuration Common * * @params[in] XML document pointer * XML namespace @@ -3972,57 +3571,37 @@ uint8_t parsePuschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur * RFAILED - failure * * ****************************************************************/ -uint8_t parsePuschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgCommon *puschCfgCmn) +uint8_t parsePdschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschCfgCommon *pdschCfgCmn) { - uint8_t rsrcIdx = 0; - xmlNodePtr child = NULLP; - xmlNodePtr rsrcNode = NULLP; + uint8_t idx = 0; + xmlNodePtr child = NULLP; - memset(puschCfgCmn, 0, sizeof(PuschCfgCommon)); + memset(pdschCfgCmn, 0, sizeof(PdschCfgCommon)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_PRESENT")) && (cur->ns == ns)) - { - puschCfgCmn->puschCfgPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_MSG3_DELTA_PREAMBLE")) && (cur->ns == ns)) - { - puschCfgCmn->msg3DeltaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_P0_NOMINAL_WITH_GRANT")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns)) { - puschCfgCmn->p0NominalWithGrant = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdschCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRS_ALLOC")) && (cur->ns == ns)) { - puschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_TIME_DOM_RSRC_ALLOC_LIST")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_TIME_DOM_RSRC_ALLOC_LIST")) && (cur->ns == ns)) { child = cur->xmlChildrenNode; while (child != NULL) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"LIST")) && (child->ns == ns)) + if ((!xmlStrcmp(child->name, (const xmlChar *)"PDSCH_TIME_DOM_RSRC_ALLOC")) && (child->ns == ns)) { - rsrcNode = child->xmlChildrenNode; - while (rsrcNode != NULL) + if(parsePdschTimeDomRsrcAlloc(doc, ns, child, &pdschCfgCmn->timeDomAlloc[idx]) != ROK) { - if ((!xmlStrcmp(rsrcNode->name, (const xmlChar *)"PUSCH_TIME_DOM_RSRC_ALLOC")) \ - && (rsrcNode->ns == ns)) - { - if(parsePuschCmnTimeDomRsrcAlloc(doc, ns, rsrcNode, &puschCfgCmn->timeDomAllocList[rsrcIdx]) != ROK) - { - return RFAILED; - } - rsrcIdx++; - } - rsrcNode = rsrcNode->next; + return RFAILED; } + idx++; } child = child->next; } @@ -4034,13 +3613,13 @@ uint8_t parsePuschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgC /******************************************************************* * - * @brief Fill PUCCH Configuration Common + * @brief Fill BCCH Configuration * * @details * - * Function : parsePucchCfgCommon + * Function : parseBcchCfg * - * Functionality: Fill PUCCH Configuration Common + * Functionality: Fill BCCH Configuration * * @params[in] XML document pointer * XML namespace @@ -4050,32 +3629,16 @@ uint8_t parsePuschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgC * RFAILED - failure * * ****************************************************************/ -uint8_t parsePucchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PucchCfgCommon *pucchCfgCmn) +uint8_t parseBcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, BcchCfg *bcchCfg) { - memset(pucchCfgCmn, 0, sizeof(PucchCfgCommon)); + memset(bcchCfg, 0, sizeof(BcchCfg)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns)) - { - pucchCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_RSRC_COMMON")) && (cur->ns == ns)) - { - pucchCfgCmn->rsrcComm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"GRP_HOP")) && (cur->ns == ns)) - { - pucchCfgCmn->grpHop = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_P0_NOMINAL")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MOB_PRD_COEFF")) && (cur->ns == ns)) { - pucchCfgCmn->p0Nominal = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + bcchCfg->modPrdCoeff = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - cur = cur -> next; } return ROK; @@ -4083,13 +3646,13 @@ uint8_t parsePucchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PucchCfgC /******************************************************************* * - * @brief Fill RACH Configuration Common + * @brief Fill PDCCH Configuration Common * * @details * - * Function : parseRachCfgCommon + * Function : parsePdcchConfigCommon * - * Functionality: Fill RACH Configuration Common + * Functionality: Fill PDCCH Configuration Common * * @params[in] XML document pointer * XML namespace @@ -4099,125 +3662,205 @@ uint8_t parsePucchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PucchCfgC * RFAILED - failure * * ****************************************************************/ -uint8_t parseRachCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RachCfgCommon *rachCfgCmn) +uint8_t parsePdcchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PdcchCfgCommon *pdccgCfgCmn) { - long maxNumRb; - long prachMaxPrb; + uint8_t idx = 0; + xmlNodePtr child = NULLP; - memset(rachCfgCmn, 0, sizeof(RachCfgCommon)); + memset(pdccgCfgCmn, 0, sizeof( PdcchCfgCommon)); cur = cur -> xmlChildrenNode; while(cur != NULL) { if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns)) { - rachCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CONFIG_IDX")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns)) { - rachCfgCmn->prachCfgIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->ctrlRsrcSetZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MSG_1_FDM")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_0_INDEX")) && (cur->ns == ns)) { - rachCfgCmn->msg1Fdm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->searchSpcZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_RB")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID")) && (cur->ns == ns)) { - maxNumRb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->searchSpcId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_MAX_PRB")) && (cur->ns == ns)) + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CTRL_RSRC_SET_ID")) && (cur->ns == ns)) { - prachMaxPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->ctrlRsrcSetId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"ZERO_CORRELATION_ZONE_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MONITOR_SLOT_PERIOD_OFFSET_PRESENT")) && (cur->ns == ns)) { - rachCfgCmn->zeroCorrZoneCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->monitorSlotPrdAndOffPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_PREAMBLE_RCVD_TGT_PWR")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MONITOR_LIST")) && (cur->ns == ns)) { - rachCfgCmn->preambleRcvdTgtPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + child = cur->xmlChildrenNode; + while (child) + { + if ((!xmlStrcmp(child->name, (const xmlChar *)"MONITOR_SYMBOL_IN_SLOT")) && (child->ns == ns)) + { + pdccgCfgCmn->monitorSymbolsInSlot[idx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1)); + idx++; + } + child = child->next; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PREAMBLE_TRANS_MAX")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_1")) && (cur->ns == ns)) { - rachCfgCmn->preambleTransMax = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->numCandAggLvl1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PWR_RAMPING_STEP")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_2")) && (cur->ns == ns)) { - rachCfgCmn->pwrRampingStep = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->numCandAggLvl2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_RSP_WINDOW")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_4")) && (cur->ns == ns)) { - rachCfgCmn->raRspWindow = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->numCandAggLvl4 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RA_PREAMBLE")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_8")) && (cur->ns == ns)) { - rachCfgCmn->numRaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->numCandAggLvl8 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_SSB_PER_RACH_OCC")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_16")) && (cur->ns == ns)) { - rachCfgCmn->numSsbPerRachOcc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->numCandAggLvl16 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CB_PREAMBLE_PER_SSB")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_TYPE")) && (cur->ns == ns)) { - rachCfgCmn->numCbPreamblePerSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->searchSpcType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONT_RES_TIMER")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_DCI_FORMAT")) && (cur->ns == ns)) { - rachCfgCmn->contResTimer = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->commSrchSpcDciFrmt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"RSRP_THRESHOLD_SSB")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_SIB1")) && (cur->ns == ns)) { - rachCfgCmn->rsrpThreshSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->searchSpcSib1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX_PRESENT")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_PAGING")) && (cur->ns == ns)) { - rachCfgCmn->rootSeqIdxPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + pdccgCfgCmn->pagingSearchSpc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_RA")) && (cur->ns == ns)) + { + pdccgCfgCmn->raSearchSpc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + cur = cur -> next; + } + return ROK; +} + +/******************************************************************* + * + * @brief Fill DL Configuration Common + * + * @details + * + * Function : parseDlCfgCommon + * + * Functionality: Fill DL Configuration Common + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,DlCfgCommon *dlCfgCmn) +{ + memset(dlCfgCmn, 0, sizeof(DlCfgCommon)); + cur = cur -> xmlChildrenNode; + while(cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns)) + { + dlCfgCmn->freqBandInd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"OFFSET_TO_POINT_A")) && (cur->ns == ns)) + { + dlCfgCmn->offsetToPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"FREQ_LOC_BW")) && (cur->ns == ns)) + { + dlCfgCmn->locAndBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_SPEC_CARRIER")) && (cur->ns == ns)) + { + if(parseScsSpecCarrier(doc, ns, cur, &dlCfgCmn->dlScsCarrier) != ROK) + { + return RFAILED; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CFG_COMMON")) && (cur->ns == ns)) + { + if(parsePdcchConfigCommon(doc, ns, cur, &dlCfgCmn->pdcchCfg) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_CFG_COMMON")) && (cur->ns == ns)) { - rachCfgCmn->rootSeqIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parsePdschCfgCommon(doc, ns, cur, &dlCfgCmn->pdschCfg) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_SUBCARRIER_SPACING")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCCH_CFG")) && (cur->ns == ns)) { - rachCfgCmn->msg1Scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parseBcchCfg(doc, ns, cur, &dlCfgCmn->bcchCfg) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_RESTRICTED_SET_CFG")) && (cur->ns== ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PCCH_CFG")) && (cur->ns == ns)) { - rachCfgCmn->restrictedSetCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parsePcchCfg(doc, ns, cur, &dlCfgCmn->pcchCfg) != ROK) + { + return RFAILED; + } } - cur = cur -> next; } - - rachCfgCmn->msg1FreqStart = ((maxNumRb) - (prachMaxPrb)); return ROK; } - /******************************************************************* * - * @brief Fill SCS Specific Carrier + * @brief Fill Serving Cell Config Common SIB * * @details * - * Function : parseScsSpecCarrier + * Function : parseSrvCellCfgCmnSib * - * Functionality: Fill SCS Specific Carrier + * Functionality: Fill Serving Cell Config Common SIB * * @params[in] XML document pointer * XML namespace @@ -4227,26 +3870,59 @@ uint8_t parseRachCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RachCfgCo * RFAILED - failure * * ****************************************************************/ -uint8_t parseScsSpecCarrier(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,ScsSpecCarrier *scsSpecCrr) +uint8_t parseSrvCellCfgCmnSib(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SrvCellCfgCommSib *srvCellCfgCmnSib) { - memset(scsSpecCrr, 0, sizeof(ScsSpecCarrier)); + memset(srvCellCfgCmnSib, 0, sizeof(SrvCellCfgCommSib)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SUBCARRIER_OFFSET")) && (cur->ns == ns)) +#ifdef O1_ENABLE + srvCellCfgCmnSib->scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing); +#else + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns)) { - scsSpecCrr->scsOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + srvCellCfgCmnSib->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } +#endif + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_POS_INBURST")) && (cur->ns == ns)) + { + srvCellCfgCmnSib->ssbPosInBurst = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIODICITY")) && (cur->ns == ns)) { - scsSpecCrr->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + srvCellCfgCmnSib->ssbPrdServingCell = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_BW")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBCH_PWR")) && (cur->ns == ns)) { - scsSpecCrr->scsBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + srvCellCfgCmnSib->ssPbchBlockPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DL_CFG_COMMON")) && (cur->ns == ns)) + { + if(parseDlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->dlCfg) != ROK) + { + return RFAILED; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_CFG_COMMON")) && (cur->ns == ns)) + { + if(parseUlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->ulCfg) != ROK) + { + return RFAILED; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_UL_DL_CFG_COMMON")) && (cur->ns == ns)) + { + if(parseTddUlDlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->tddCfg) != ROK) + { + return RFAILED; + } } + cur = cur -> next; } return ROK; @@ -4254,13 +3930,13 @@ uint8_t parseScsSpecCarrier(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,ScsSpecCa /******************************************************************* * - * @brief Fill UL Config Common + * @brief Fill SI Scheduling Information * * @details * - * Function : parseUlCfgCommon + * Function : parseSiSchedInfo * - * Functionality: Fill UL Config Common + * Functionality: Fill SI Scheduling Information * * @params[in] XML document pointer * XML namespace @@ -4270,62 +3946,35 @@ uint8_t parseScsSpecCarrier(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,ScsSpecCa * RFAILED - failure * * ****************************************************************/ -uint8_t parseUlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,UlCfgCommon *ulCfgCmn) +uint8_t parseSiSchedInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SiSchedInfo *siSchedInfo) { - memset(ulCfgCmn, 0, sizeof(UlCfgCommon)); + memset(siSchedInfo, 0, sizeof(SiSchedInfo)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns)) - { - ulCfgCmn->freqBandInd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_P_MAX")) && (cur->ns == ns)) - { - ulCfgCmn->pMax = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"FREQ_LOC_BW")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"WIN_LEN")) && (cur->ns == ns)) { - ulCfgCmn->locAndBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + siSchedInfo->winLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIME_ALLIGN_TIMER_COMM")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"BROADCAST_STATUS")) && (cur->ns == ns)) { - ulCfgCmn->timeAlignTimerComm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + siSchedInfo->broadcastSta = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_SPEC_CARRIER")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PERIODICITY")) && (cur->ns == ns)) { - if(parseScsSpecCarrier(doc, ns, cur, &ulCfgCmn->ulScsCarrier) != ROK) - { - return RFAILED; - } + siSchedInfo->preiodicity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"RACH_CFG_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB_TYPE")) && (cur->ns == ns)) { - if(parseRachCfgCommon(doc, ns, cur, &ulCfgCmn->rachCfg) != ROK) - { - return RFAILED; - } + siSchedInfo->sibType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_COMMON")) && (cur->ns == ns)) - { - if(parsePuschCfgCommon(doc, ns, cur, &ulCfgCmn->puschCfg) != ROK) - { - return RFAILED; - } - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_CFG_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_VALUE_TAG")) && (cur->ns == ns)) { - if(parsePucchCfgCommon(doc, ns, cur, &ulCfgCmn->pucchCfg) != ROK) - { - return RFAILED; - } + siSchedInfo->sibValTag = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } cur = cur -> next; @@ -4335,13 +3984,13 @@ uint8_t parseUlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,UlCfgCommon /******************************************************************* * - * @brief Fill TDD UL DL Configuration Common + * @brief Fill SIB1 Parameters * * @details * - * Function : parseTddUlDlCfgCommon + * Function : parseSib1Params * - * Functionality: Fill TDD UL DL Configuration Common + * Functionality: Fill SIB1 Parameters * * @params[in] XML document pointer * XML namespace @@ -4351,40 +4000,75 @@ uint8_t parseUlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,UlCfgCommon * RFAILED - failure * * ****************************************************************/ -uint8_t parseTddUlDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TddUlDlCfgCommon *tddUlDlCfgCmn) +uint8_t parseSib1Params(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Sib1Params *sib1Params) { - memset(tddUlDlCfgCmn, 0, sizeof(TddUlDlCfgCommon)); + memset(sib1Params, 0, sizeof(Sib1Params)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"REF_SCS")) && (cur->ns == ns)) +#ifdef O1_ENABLE + sib1Params-> tac = cellParams.nRTAC; + sib1Params->cellIdentity = CELL_IDENTITY * cellParams.cellLocalId; + DU_LOG("\nDEBUG --> DU_APP: parseSib1Params(): OAM CellLocalId=%d", sib1Params->cellIdentity); +#else + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns)) { - tddUlDlCfgCmn->refScs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + sib1Params-> tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"TX_PRD")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_IDENTITY")) && (cur->ns == ns)) { - tddUlDlCfgCmn->txPrd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + sib1Params->cellIdentity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } +#endif - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SLOTS")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns)) { - tddUlDlCfgCmn->numDlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parsePlmn(doc, ns, cur, &sib1Params->plmn) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SYMBOLS")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RANAC")) && (cur->ns == ns)) { - tddUlDlCfgCmn->numDlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + sib1Params->ranac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SLOTS")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_RESVD_OPUSE")) && (cur->ns == ns)) { - tddUlDlCfgCmn->numUlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + sib1Params->cellResvdForOpUse = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SYMBOLS")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_CNT")) && (cur->ns == ns)) { - tddUlDlCfgCmn->numUlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + sib1Params->connEstFailCnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_OFF_VALID")) && (cur->ns == ns)) + { + sib1Params->connEstFailOffValidity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_OFFSET")) && (cur->ns == ns)) + { + sib1Params->connEstFailOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SI_SHED_INFO")) && (cur->ns == ns)) + { + if(parseSiSchedInfo(doc, ns, cur, &sib1Params->siSchedInfo) != ROK) + { + return RFAILED; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SRV_CELL_CFG_COM_SIB")) && (cur->ns == ns)) + { + if(parseSrvCellCfgCmnSib(doc, ns, cur, &sib1Params->srvCellCfgCommSib) != ROK) + { + return RFAILED; + } } cur = cur -> next; @@ -4392,15 +4076,16 @@ uint8_t parseTddUlDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TddUlD return ROK; } +#ifndef O1_ENABLE /******************************************************************* * - * @brief Fill PCCH Configuration + * @brief Fill RRM Policy List * * @details * - * Function : parsePcchCfg + * Function : parseRrmPolicyList * - * Functionality: Fill PCCH Configuration + * Functionality: Fill RRM Policy List * * @params[in] XML document pointer * XML namespace @@ -4410,62 +4095,28 @@ uint8_t parseTddUlDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TddUlD * RFAILED - failure * * ****************************************************************/ -uint8_t parsePcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PcchCfg *pcchCfg) +uint8_t parseRrmPolicyList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,RrmPolicyMemberList *rrmPolicyMemberList) { - xmlNodePtr child = NULLP; - xmlNodePtr firstPdcchNode = NULLP; - uint8_t idx = 0; - - memset(pcchCfg, 0, sizeof(PcchCfg)); - cur = cur -> xmlChildrenNode; + memset(rrmPolicyMemberList, 0, sizeof(RrmPolicyMemberList)); + cur = cur->xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"DFLT_PAGING_CYCLE")) && (cur->ns == ns)) - { - pcchCfg->dfltPagingCycle = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAND_PAGING_FRM_OFFSET")) && (cur->ns == ns)) - { - pcchCfg->nAndPagingFrmOffsetType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PAGE_FRM_OFFSET")) && (cur->ns == ns)) - { - pcchCfg->pageFrameOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NS")) && (cur->ns == ns)) - { - pcchCfg->ns = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PDCCH_MONITORING_TYPE")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns)) { - pcchCfg->firstPDCCHMontioringType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parsePlmn(doc, ns, cur, &rrmPolicyMemberList->plmn) != ROK) + { + return RFAILED; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SNSSAI")) && (cur->ns == ns)) { - child = cur->xmlChildrenNode; - while(child != NULL) + if(parseSnssai(doc, ns, cur, &rrmPolicyMemberList->snssai) != ROK) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"FIRST_PDCCH_LIST")) && (child->ns == ns)) - { - firstPdcchNode = child->xmlChildrenNode; - while (firstPdcchNode != NULL) - { - if ((!xmlStrcmp(firstPdcchNode->name, (const xmlChar *)"FIRST_PDCCH_MONITORING_INFO")) && (firstPdcchNode->ns == ns)) - { - pcchCfg->firstPDCCHMontioringInfo[idx] = atoi((char *)xmlNodeListGetString(doc, firstPdcchNode->xmlChildrenNode, 1)); - idx++; - } - firstPdcchNode = firstPdcchNode->next; - } - } - child = child -> next; + return RFAILED; } } + cur = cur -> next; } return ROK; @@ -4473,13 +4124,13 @@ uint8_t parsePcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PcchCfg *pcchCfg /******************************************************************* * - * @brief Fill PDSCH Time Domain Resource Allocation + * @brief Fill RRM Policy Ratio * * @details * - * Function : parsePdschTimeDomRsrcAlloc + * Function : parseRrmPolicyRatio * - * Functionality: Fill PDSCH Time Domain Resource Allocation + * Functionality: Fill RRM Policy Ratio * * @params[in] XML document pointer * XML namespace @@ -4489,50 +4140,41 @@ uint8_t parsePcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PcchCfg *pcchCfg * RFAILED - failure * * ****************************************************************/ -uint8_t parsePdschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschTimeDomainRsrcAlloc *pdschTimeDomRsrcAlloc) +uint8_t parseRrmPolicyRatio(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RrmPolicyRatio *rrmPolicyRatio) { - uint16_t startSymbol; - uint16_t lenSymbol; - - memset(pdschTimeDomRsrcAlloc, 0, sizeof(PdschTimeDomainRsrcAlloc)); + memset(rrmPolicyRatio, 0, sizeof(RrmPolicyRatio)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"K0")) && (cur->ns == ns)) - { - pdschTimeDomRsrcAlloc->k0 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAP_TYPE")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_RATIO")) && (cur->ns == ns)) { - pdschTimeDomRsrcAlloc->mapType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rrmPolicyRatio->maxRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_START_SYMBOL")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIN_RATIO")) && (cur->ns == ns)) { - startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rrmPolicyRatio->minRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_LENGTH_SYMBOL")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEDICATED_RATIO")) && (cur->ns == ns)) { - lenSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rrmPolicyRatio->dedicatedRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } cur = cur -> next; } - pdschTimeDomRsrcAlloc->sliv = calcSliv(startSymbol, lenSymbol); return ROK; } /******************************************************************* * - * @brief Fill PDSCH Configuration Common + * @brief Fill MAC Slice RRM Policy * * @details * - * Function : parsePdschCfgCommon + * Function : parseMacSliceRrmPolicy * - * Functionality: Fill PDSCH Configuration Common + * Functionality: Fill MAC Slice RRM Policy * * @params[in] XML document pointer * XML namespace @@ -4542,50 +4184,59 @@ uint8_t parsePdschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Pd * RFAILED - failure * * ****************************************************************/ -uint8_t parsePdschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschCfgCommon *pdschCfgCmn) +uint8_t parseMacSliceRrmPolicy(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, MacSliceRrmPolicy *rrmPolicy) { - uint8_t idx = 0; - xmlNodePtr child = NULLP; - xmlNodePtr listChild = NULLP; + uint8_t memIdx = 0; - memset(pdschCfgCmn, 0, sizeof(PdschCfgCommon)); + memset(rrmPolicy, 0, sizeof(MacSliceRrmPolicy)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RESOURCE_TYPE")) && (cur->ns == ns)) { - pdschCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rrmPolicy->resourceType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRS_ALLOC")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RRM_POLICY_MEMBER")) && (cur->ns == ns)) { - pdschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + rrmPolicy->numOfRrmPolicyMem = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_TIME_DOM_RSRC_ALLOC_LIST")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RRM_POLICY_MEMBER_LIST")) && (cur->ns == ns)) { - child = cur->xmlChildrenNode; - while (child != NULL) + DU_ALLOC_SHRABL_BUF(rrmPolicy->rRMPolicyMemberList,\ + rrmPolicy->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*)); + + if(!rrmPolicy->rRMPolicyMemberList) + { + DU_LOG("\nERROR --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__); + return RFAILED; + } + + for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++) { - if ((!xmlStrcmp(child->name, (const xmlChar *)"LIST")) && (child->ns == ns)) + DU_ALLOC_SHRABL_BUF(rrmPolicy->rRMPolicyMemberList[memIdx], sizeof(RrmPolicyMemberList)); + if (rrmPolicy->rRMPolicyMemberList[memIdx] == NULLP) { - listChild = child->xmlChildrenNode; - while (listChild != NULL) - { - if ((!xmlStrcmp(listChild->name, (const xmlChar *)"PDSCH_TIME_DOM_RSRC_ALLOC")) && (listChild->ns == ns)) - { - if(parsePdschTimeDomRsrcAlloc(doc, ns, listChild, &pdschCfgCmn->timeDomAlloc[idx]) != ROK) - { - return RFAILED; - } - idx++; - } - listChild = listChild->next; - } + DU_LOG("\nERROR --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__); + return RFAILED; } - child = child->next; + + if(parseRrmPolicyList(doc, ns, cur, rrmPolicy->rRMPolicyMemberList[memIdx]) != ROK) + { + return RFAILED; + } + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RRM_POLICY_RATIO")) && (cur->ns == ns)) + { + if(parseRrmPolicyRatio(doc, ns, cur, &rrmPolicy->policyRatio) != ROK) + { + return RFAILED; } } + cur = cur -> next; } return ROK; @@ -4593,13 +4244,13 @@ uint8_t parsePdschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschCfgC /******************************************************************* * - * @brief Fill BCCH Configuration + * @brief Fill MAC Slice Configuration * * @details * - * Function : parseBcchCfg + * Function : parseMacSliceCfgReq * - * Functionality: Fill BCCH Configuration + * Functionality: Fill MAC Slice Configuration * * @params[in] XML document pointer * XML namespace @@ -4609,149 +4260,125 @@ uint8_t parsePdschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschCfgC * RFAILED - failure * * ****************************************************************/ -uint8_t parseBcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, BcchCfg *bcchCfg) +uint8_t parseMacSliceCfgReq(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacSliceCfgReq *macSliceCfgReq) { - memset(bcchCfg, 0, sizeof(BcchCfg)); + uint8_t policyIdx = 0; + memset(macSliceCfgReq, 0, sizeof(MacSliceCfgReq)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MOB_PRD_COEFF")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RRM_POLICY")) && (cur->ns == ns)) { - bcchCfg->modPrdCoeff = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + macSliceCfgReq->numOfRrmPolicy = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_SLICE_RRM_POLICY")) && (cur->ns == ns)) + { + DU_ALLOC_SHRABL_BUF(macSliceCfgReq->listOfRrmPolicy, macSliceCfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*)); + if(!macSliceCfgReq->listOfRrmPolicy) + { + DU_LOG("\nERROR --> DU APP: %s: Memory allocation failed at line %d", __func__, __LINE__); + return RFAILED; + } + + for(policyIdx = 0; policyIdx < macSliceCfgReq->numOfRrmPolicy; policyIdx++) + { + DU_ALLOC_SHRABL_BUF(macSliceCfgReq->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy)); + if (macSliceCfgReq->listOfRrmPolicy[policyIdx] == NULLP) + { + DU_LOG("\nERROR --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__); + } + + if(parseMacSliceRrmPolicy(doc, ns, cur, macSliceCfgReq->listOfRrmPolicy[policyIdx]) != ROK) + { + return RFAILED; + } + } } cur = cur -> next; } return ROK; } +#endif /******************************************************************* * - * @brief Fill PDCCH Configuration Common + * @brief Set thread affinity to the core configured via XML file * * @details * - * Function : parsePdcchConfigCommon + * Function : parseThreadAffinity * - * Functionality: Fill PDCCH Configuration Common + * Functionality: Set thread affinity to the core configured + * via XML file * * @params[in] XML document pointer * XML namespace * Current node in XML - * Pointer to structure to be filled + * Thread information * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t parsePdcchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PdcchCfgCommon *pdccgCfgCmn) +uint8_t parseThreadAffinity(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, ThreadInfo *threads) { - uint8_t idx = 0; - xmlNodePtr child = NULLP; - xmlNodePtr listChild = NULLP; - - memset(pdccgCfgCmn, 0, sizeof( PdcchCfgCommon)); cur = cur -> xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns)) - { - pdccgCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns)) - { - pdccgCfgCmn->ctrlRsrcSetZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_0_INDEX")) && (cur->ns == ns)) - { - pdccgCfgCmn->searchSpcZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID")) && (cur->ns == ns)) - { - pdccgCfgCmn->searchSpcId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CTRL_RSRC_SET_ID")) && (cur->ns == ns)) - { - pdccgCfgCmn->ctrlRsrcSetId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MONITOR_SLOT_PRD_OFFPRESENT")) && (cur->ns == ns)) - { - pdccgCfgCmn->monitorSlotPrdAndOffPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns)) - { - child = cur->xmlChildrenNode; - while (child) - { - if ((!xmlStrcmp(child->name, (const xmlChar *)"MONITOR_LIST")) && (child->ns == ns)) - { - listChild = child->xmlChildrenNode; - while (listChild != NULL) - { - if ((!xmlStrcmp(listChild->name, (const xmlChar *)"MONITOR_SYMBOL_INSLOT")) && (listChild->ns == ns)) - { - pdccgCfgCmn->monitorSymbolsInSlot[idx] = atoi((char *)xmlNodeListGetString(doc, listChild->xmlChildrenNode, 1)); - idx++; - } - listChild = listChild->next; - } - } - child = child->next; - } - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUMC_AGG_LVL1")) && (cur->ns == ns)) - { - pdccgCfgCmn->numCandAggLvl1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUMC_AGG_LVL2")) && (cur->ns == ns)) - { - pdccgCfgCmn->numCandAggLvl2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUMC_AGG_LVL4")) && (cur->ns == ns)) - { - pdccgCfgCmn->numCandAggLvl4 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUMC_AGG_LVL8")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_APP_CORE")) && (cur->ns == ns)) { - pdccgCfgCmn->numCandAggLvl8 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + threads->duAppCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); +#ifdef THREAD_AFFINITY + ODU_SET_THREAD_AFFINITY(&threads->duAppSTskId, SS_AFFINITY_MODE_EXCL, threads->duAppCoreId, 0); +#endif } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUMC_AGG_LVL16")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"EGTP_CORE")) && (cur->ns == ns)) { - pdccgCfgCmn->numCandAggLvl16 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + threads->egtpCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); +#ifdef THREAD_AFFINITY + ODU_SET_THREAD_AFFINITY(&threads->egtpSTskId, SS_AFFINITY_MODE_EXCL, threads->egtpCoreId, 0); +#endif } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPC_TYPE")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RLC_MAC_CORE")) && (cur->ns == ns)) { - pdccgCfgCmn->searchSpcType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + threads->rlcMacCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); +#ifdef THREAD_AFFINITY + ODU_SET_THREAD_AFFINITY(&threads->rlcMacSTskId, SS_AFFINITY_MODE_EXCL, threads->rlcMacCoreId, 0); +#endif } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SERACH_SPACE_DCI_FORMAT")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RLC_UL_CORE")) && (cur->ns == ns)) { - pdccgCfgCmn->commSrchSpcDciFrmt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + threads->rlcUlCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); +#ifdef THREAD_AFFINITY + ODU_SET_THREAD_AFFINITY(&threads->rlcUlSTskId, SS_AFFINITY_MODE_EXCL, threads->rlcUlCoreId, 0); +#endif } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_SIB1")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCH_CORE")) && (cur->ns == ns)) { - pdccgCfgCmn->searchSpcSib1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + threads->schCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); +#ifdef THREAD_AFFINITY + ODU_SET_THREAD_AFFINITY(&threads->schSTskId, SS_AFFINITY_MODE_EXCL, threads->schCoreId, 0); +#endif } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_PAGING")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCTP_CORE")) && (cur->ns == ns)) { - pdccgCfgCmn->pagingSearchSpc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + threads->sctpCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); +#ifdef THREAD_AFFINITY + ODU_SET_THREAD_AFFINITY(&threads->sctpSTskId, SS_AFFINITY_MODE_EXCL, threads->sctpCoreId, 0); +#endif } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_PDCCH_SEARCH_SPACE_ID_PAGING")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOWER_MAC_CORE")) && (cur->ns == ns)) { - pdccgCfgCmn->raSearchSpc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + threads->lwrMacCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); +#ifdef THREAD_AFFINITY + ODU_SET_THREAD_AFFINITY(&threads->lwrMacSTskId, SS_AFFINITY_MODE_EXCL, threads->lwrMacCoreId, 0); +#endif } cur = cur -> next; @@ -4761,13 +4388,13 @@ uint8_t parsePdcchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Pdcch /******************************************************************* * - * @brief Fill DL Configuration Common + * @brief Fill tmrTqCp * * @details * - * Function : parseDlCfgCommon + * Function : parseTmrTqCp * - * Functionality: Fill DL Configuration Common + * Functionality: Fill tmrTqCp * * @params[in] XML document pointer * XML namespace @@ -4777,80 +4404,77 @@ uint8_t parsePdcchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Pdcch * RFAILED - failure * * ****************************************************************/ -uint8_t parseDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,DlCfgCommon *dlCfgCmn) +uint8_t parseTmrTqCp(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CmTqCp *tmrTqCp) { - memset(dlCfgCmn, 0, sizeof(DlCfgCommon)); - cur = cur -> xmlChildrenNode; + memset(tmrTqCp, 0, sizeof(CmTqCp)); + cur = cur ->xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns)) - { - dlCfgCmn->freqBandInd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"OFFSET_TO_POINT_A")) && (cur->ns == ns)) - { - dlCfgCmn->offsetToPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"FREQ_LOC_BW")) && (cur->ns == ns)) - { - dlCfgCmn->locAndBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_SPEC_CARRIER")) && (cur->ns == ns)) - { - if(parseScsSpecCarrier(doc, ns, cur, &dlCfgCmn->dlScsCarrier) != ROK) - { - return RFAILED; - } - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CFG_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_LEN")) && (cur->ns == ns)) { - if(parsePdcchConfigCommon(doc, ns, cur, &dlCfgCmn->pdcchCfg) != ROK) - { - return RFAILED; - } + tmrTqCp->tmrLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } + cur = cur -> next; + } + return ROK; +} - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_CFG_COMMON")) && (cur->ns == ns)) +/******************************************************************* + * + * @brief Fill DU timer Parameters + * + * @details + * + * Function : parseDuTimerParams + * + * Functionality: Fill DU timer Parmeters + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseDuTimerParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, DuTimers *duTimers) +{ + memset(duTimers, 0, sizeof(DuTimers)); + + cur = cur->xmlChildrenNode; + while (cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_TQ_CP")) && (cur->ns == ns)) { - if(parsePdschCfgCommon(doc, ns, cur, &dlCfgCmn->pdschCfg) != ROK) + if(parseTmrTqCp(doc, ns, cur, &duTimers->tmrTqCp) != ROK) { return RFAILED; } - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCCH_CFG")) && (cur->ns == ns)) - { - if(parseBcchCfg(doc, ns, cur, &dlCfgCmn->bcchCfg) != ROK) + else { - return RFAILED; + /* Initialzie the timer queue */ + memset(&(duTimers->tmrTq), 0, sizeof(CmTqType) * duTimers->tmrTqCp.tmrLen); } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PCCH_CFG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_RESOLUTION")) && (cur->ns == ns)) { - if(parsePcchCfg(doc, ns, cur, &dlCfgCmn->pcchCfg) != ROK) - { - return RFAILED; - } + duTimers->tmrRes = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - cur = cur -> next; } return ROK; } + /******************************************************************* * - * @brief Fill Serving Cell Config Common SIB + * @brief Fill TNL assoc * * @details * - * Function : parseSrvCellCfgCmnSib + * Function : parseTnlAssoc * - * Functionality: Fill Serving Cell Config Common SIB + * Functionality: Fill TNL assoc * * @params[in] XML document pointer * XML namespace @@ -4860,56 +4484,47 @@ uint8_t parseDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,DlCfgCommon * RFAILED - failure * * ****************************************************************/ -uint8_t parseSrvCellCfgCmnSib(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SrvCellCfgCommSib *srvCellCfgCmnSib) +uint8_t parseTnlAssoc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TNLAssociation *tnlAssoc) { - memset(srvCellCfgCmnSib, 0, sizeof(SrvCellCfgCommSib)); - cur = cur -> xmlChildrenNode; + char *duIpV4Addr; + char *ricIpV4Addr; + CmInetIpAddr duIp; + CmInetIpAddr ricIp; + + memset(tnlAssoc, 0, sizeof(TNLAssociation)); + cur = cur ->xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns)) - { - srvCellCfgCmnSib->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_POS_INBURST")) && (cur->ns == ns)) - { - srvCellCfgCmnSib->ssbPosInBurst = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIODICITY")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOCAL_IP")) && (cur->ns == ns)) { - srvCellCfgCmnSib->ssbPrdServingCell = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + duIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + cmInetAddr(duIpV4Addr, &(duIp)); + tnlAssoc->localIpAddress.ipV4Pres = true; + tnlAssoc->localIpAddress.ipV4Addr = duIp; } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBCH_PWR")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOCAL_PORT")) && (cur->ns == ns)) { - srvCellCfgCmnSib->ssPbchBlockPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tnlAssoc->localPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"DL_CFG_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESTINATION_IP")) && (cur->ns == ns)) { - if(parseDlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->dlCfg) != ROK) - { - return RFAILED; - } + ricIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + cmInetAddr(ricIpV4Addr, &(ricIp)); + tnlAssoc->destIpAddress.ipV4Pres = true; + tnlAssoc->destIpAddress.ipV4Addr = ricIp; } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_CFG_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESTINATION_PORT")) && (cur->ns == ns)) { - if(parseUlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->ulCfg) != ROK) - { - return RFAILED; - } + tnlAssoc->destPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_UL_DL_CFG_COMMON")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"ASSOC_USAGE")) && (cur->ns == ns)) { - if(parseTddUlDlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->tddCfg) != ROK) - { - return RFAILED; - } + tnlAssoc->usage = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - cur = cur -> next; } return ROK; @@ -4917,13 +4532,13 @@ uint8_t parseSrvCellCfgCmnSib(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SrvCell /******************************************************************* * - * @brief Fill SI Scheduling Information + * @brief Fill ric style parmeters * * @details * - * Function : parseSiSchedInfo + * Function : parseRicStyle * - * Functionality: Fill SI Scheduling Information + * Functionality: Fill ric style parmeters * * @params[in] XML document pointer * XML namespace @@ -4933,51 +4548,105 @@ uint8_t parseSrvCellCfgCmnSib(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SrvCell * RFAILED - failure * * ****************************************************************/ -uint8_t parseSiSchedInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SiSchedInfo *siSchedInfo) +uint8_t parseRicStyle(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RicStyle *ricStyle) { - memset(siSchedInfo, 0, sizeof(SiSchedInfo)); - cur = cur -> xmlChildrenNode; - while(cur != NULL) + char *tempName; + memset(ricStyle, 0, sizeof(RicStyle)); + + cur = cur->xmlChildrenNode; + while (cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"WIN_LEN")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"STYLE_TYPE")) && (cur->ns == ns)) { - siSchedInfo->winLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + ricStyle->styleType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"BROADCAST_STA")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME")) && (cur->ns == ns)) { - siSchedInfo->broadcastSta = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tempName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + strcpy((char*)ricStyle->name, tempName); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PERIODICITY")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"FORMAT_TYPE")) && (cur->ns == ns)) { - siSchedInfo->preiodicity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + ricStyle->formatType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } + cur = cur -> next; + } + return ROK; +} - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB_TYPE")) && (cur->ns == ns)) +/******************************************************************* + * + * @brief Fill measurement info parameters + * + * @details + * + * Function : parseMeasurementInfo + * + * Functionality: Fill measurement info parmeters + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseMeasurementInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CmLListCp *measurementInfoList) +{ + CmLList *node; + char *tempName; + MeasurementInfoForAction *measurementInfoForAction; + + DU_ALLOC(measurementInfoForAction, sizeof(MeasurementInfoForAction)); + if(!measurementInfoForAction) + { + return RFAILED; + } + + cur = cur->xmlChildrenNode; + while (cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"ID")) && (cur->ns == ns)) { - siSchedInfo->sibType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + measurementInfoForAction->measurementTypeId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_VAL_TAG")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME")) && (cur->ns == ns)) { - siSchedInfo->sibValTag = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tempName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + strcpy((char*)measurementInfoForAction->measurementTypeName, tempName); } cur = cur -> next; } + + DU_ALLOC(node, sizeof(CmLList)); + if(node) + { + node->node = (PTR) measurementInfoForAction; + cmLListAdd2Tail(measurementInfoList, node); + } + else + { + DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction)); + return RFAILED; + } + return ROK; } /******************************************************************* * - * @brief Fill SIB1 Parameters + * @brief Fill report style parameters * * @details * - * Function : parseSib1Params + * Function : parseReportStyle * - * Functionality: Fill SIB1 Parameters + * Functionality: Fill report style parmeters * * @params[in] XML document pointer * XML namespace @@ -4987,71 +4656,89 @@ uint8_t parseSiSchedInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SiSchedInfo * RFAILED - failure * * ****************************************************************/ -uint8_t parseSib1Params(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Sib1Params *sib1Params) +uint8_t parseReportStyle(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RicReportStyle *ricReportStyle) { - memset(sib1Params, 0, sizeof(Sib1Params)); - cur = cur -> xmlChildrenNode; - while(cur != NULL) + xmlNodePtr child = NULLP; + memset(ricReportStyle, 0, sizeof(RicReportStyle)); + + cur = cur->xmlChildrenNode; + while (cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_STYLE")) && (cur->ns == ns)) { - if(parsePlmn(doc, ns, cur, &sib1Params->plmn) != ROK) + if(parseRicStyle(doc, ns, cur, &ricReportStyle->reportStyle) != ROK) { return RFAILED; } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns)) - { - sib1Params-> tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"RANAC")) && (cur->ns == ns)) - { - sib1Params->ranac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_IDENTITY")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MEASUREMENT_INFO_LIST")) && (cur->ns == ns)) { - sib1Params->cellIdentity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + child = cur->xmlChildrenNode; + while(child != NULL) + { + if ((!xmlStrcmp(child->name, (const xmlChar *)"MEASUREMENT_INFO")) && (child->ns == ns)) + { + if(parseMeasurementInfo(doc, ns, child, &ricReportStyle->measurementInfoList) != ROK) + { + return RFAILED; + } + } + child = child -> next; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_RESVD_OPUSE")) && (cur->ns == ns)) - { - sib1Params->cellResvdForOpUse = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } + cur = cur -> next; + } + return ROK; +} - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_CNT")) && (cur->ns == ns)) - { - sib1Params->connEstFailCnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } +/******************************************************************* + * + * @brief Fill RAN function name parameters + * + * @details + * + * Function : parseRanFuncName + * + * Functionality: Fill RAN function name parmeters + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseRanFuncName(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RanFunctionName *ranFunctionName) +{ + char *tempShortName; + char *tempServiceModelOid; + char *tempDiscription; - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_OFF_VALID")) && (cur->ns == ns)) - { - sib1Params->connEstFailOffValidity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } + memset(ranFunctionName, 0, sizeof(RanFunctionName)); - if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_OFFSET")) && (cur->ns == ns)) + cur = cur->xmlChildrenNode; + while (cur != NULL) + { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SHORT_NAME")) && (cur->ns == ns)) { - sib1Params->connEstFailOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + tempShortName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + strcpy((char*)ranFunctionName->shortName, tempShortName); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SI_SHED_INFO")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEVICE_MODEL_OID")) && (cur->ns == ns)) { - if(parseSiSchedInfo(doc, ns, cur, &sib1Params->siSchedInfo) != ROK) - { - return RFAILED; - } + tempServiceModelOid =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + strcpy((char*)ranFunctionName->serviceModelOID, tempServiceModelOid); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SRV_CELLCFG_COM_SIB")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESCRIPTION")) && (cur->ns == ns)) { - if(parseSrvCellCfgCmnSib(doc, ns, cur, &sib1Params->srvCellCfgCommSib) != ROK) - { - return RFAILED; - } + tempDiscription =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + strcpy((char*)ranFunctionName->description, tempDiscription); } - cur = cur -> next; } return ROK; @@ -5059,13 +4746,13 @@ uint8_t parseSib1Params(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Sib1Params *s /******************************************************************* * - * @brief Fill RRM Policy List + * @brief Fill RAN function parameters * * @details * - * Function : parseRrmPolicyList + * Function : parseRanFunctionParams * - * Functionality: Fill RRM Policy List + * Functionality: Fill RAN function parmeters * * @params[in] XML document pointer * XML namespace @@ -5075,28 +4762,94 @@ uint8_t parseSib1Params(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Sib1Params *s * RFAILED - failure * * ****************************************************************/ -uint8_t parseRrmPolicyList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,RrmPolicyMemberList *rrmPolicyMemberList) +uint8_t parseRanFunctionParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RanFunction *ranFunction) { - memset(rrmPolicyMemberList, 0, sizeof(RrmPolicyMemberList)); + xmlNodePtr child = NULLP; + uint8_t eventTriggerStyleIdx=0, reportStyleIdx=0; + + memset(ranFunction, 0, sizeof(RanFunction)); + cur = cur->xmlChildrenNode; - while(cur != NULL) + + while (cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"ID")) && (cur->ns == ns)) { - if(parsePlmn(doc, ns, cur, &rrmPolicyMemberList->plmn) != ROK) + ranFunction->id = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RAN_FUNCTION_NAME")) && (cur->ns == ns)) + { + if(parseRanFuncName(doc, ns, cur, &ranFunction->name) != ROK) { return RFAILED; } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SNSSAI")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"REVISION_COUNTER")) && (cur->ns == ns)) { - if(parseSnssai(doc, ns, cur, &rrmPolicyMemberList->snssai) != ROK) + ranFunction->revisionCounter = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_EVENT_TRIGGER_STYLE_SUPPORTED")) && (cur->ns == ns)) + { + ranFunction->numOfEventTriggerStyleSupported = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"EVENT_TRIGGERED_STYLE_LIST")) && (cur->ns == ns)) + { + child = cur->xmlChildrenNode; + while(child != NULL) { - return RFAILED; + if ((!xmlStrcmp(child->name, (const xmlChar *)"EVENT_TRIGGERED_STYLE")) && (child->ns == ns)) + { + if(parseRicStyle(doc, ns, child,&ranFunction->eventTriggerStyleList[eventTriggerStyleIdx]) != ROK) + { + return RFAILED; + } + eventTriggerStyleIdx++; + + } + child = child -> next; + } + + } + + child = NULLP; + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_REPORT_STYLE_SUPPORTED")) && (cur->ns == ns)) + { + ranFunction->numOfReportStyleSupported = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"REPORT_STYLE_SUPPORTED_LIST")) && (cur->ns == ns)) + { + child = cur->xmlChildrenNode; + while(child != NULL) + { + if ((!xmlStrcmp(child->name, (const xmlChar *)"REPORT_STYLE")) && (child->ns == ns)) + { + if(parseReportStyle(doc, ns, child,&ranFunction->reportStyleList[reportStyleIdx]) != ROK) + { + return RFAILED; + } + reportStyleIdx++; + + } + child = child -> next; } + + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_INDICATION_HEADER_FORMAT")) && (cur->ns == ns)) + { + ranFunction->ricIndicationHeaderFormat = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_INDICATION_MESSAGE_FORMAT")) && (cur->ns == ns)) + { + ranFunction->ricIndicationMessageFormat = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } cur = cur -> next; } return ROK; @@ -5104,13 +4857,13 @@ uint8_t parseRrmPolicyList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,RrmPolicyM /******************************************************************* * - * @brief Fill RRM Policy Ratio + * @brief Fill E2 config Parameters * * @details * - * Function : parseRrmPolicyRatio + * Function : parseE2ConfigParams * - * Functionality: Fill RRM Policy Ratio + * Functionality: Fill E2 config Parmeters * * @params[in] XML document pointer * XML namespace @@ -5120,25 +4873,65 @@ uint8_t parseRrmPolicyList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,RrmPolicyM * RFAILED - failure * * ****************************************************************/ -uint8_t parseRrmPolicyRatio(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RrmPolicyRatio *rrmPolicyRatio) +uint8_t parseE2ConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, E2apDb *e2apDb) { - memset(rrmPolicyRatio, 0, sizeof(RrmPolicyRatio)); - cur = cur -> xmlChildrenNode; - while(cur != NULL) + uint8_t tnlIdx=0,ranFuncIdx=0; + xmlNodePtr child = NULLP; + + memset(e2apDb, 0, sizeof(E2apDb)); + cur = cur->xmlChildrenNode; + while (cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_RATIO")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"E2_NODE_ID")) && (cur->ns == ns)) { - rrmPolicyRatio->maxRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + e2apDb->e2NodeId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIN_RATIO")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_TNL_ASSOC")) && (cur->ns == ns)) { - rrmPolicyRatio->minRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + e2apDb->numOfTNLAssoc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEDICATED_RATIO")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"TNL_ASSOC_LIST")) && (cur->ns == ns)) { - rrmPolicyRatio->dedicatedRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + child = cur->xmlChildrenNode; + while(child != NULL) + { + if ((!xmlStrcmp(child->name, (const xmlChar *)"TNL_ASSOC")) && (child->ns == ns)) + { + if(parseTnlAssoc(doc, ns, child,&e2apDb->tnlAssoc[tnlIdx]) != ROK) + { + return RFAILED; + } + tnlIdx++; + + } + child = child -> next; + } + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_RAN_FUNCTION")) && (cur->ns == ns)) + { + e2apDb->numOfRanFunction = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RAN_FUNCTION_LIST")) && (cur->ns == ns)) + { + child = cur->xmlChildrenNode; + while(child != NULL) + { + if ((!xmlStrcmp(child->name, (const xmlChar *)"RAN_FUNCTION")) && (child->ns == ns)) + { + if(parseRanFunctionParams(doc, ns, child,&e2apDb->ranFunction[ranFuncIdx]) != ROK) + { + return RFAILED; + } + cmLListInit(&e2apDb->ranFunction[ranFuncIdx].subscriptionList); + ranFuncIdx++; + + } + child = child -> next; + } } cur = cur -> next; @@ -5146,16 +4939,15 @@ uint8_t parseRrmPolicyRatio(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RrmPolic return ROK; } -/******************************************************************* /******************************************************************* * - * @brief Fill MAC Slice RRM Policy + * @brief Fill Global config Parameters * * @details * - * Function : parseMacSliceRrmPolicy + * Function : parseGlobalConfigParams * - * Functionality: Fill MAC Slice RRM Policy + * Functionality: Fill Global config Parmeters * * @params[in] XML document pointer * XML namespace @@ -5165,122 +4957,186 @@ uint8_t parseRrmPolicyRatio(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RrmPolic * RFAILED - failure * * ****************************************************************/ -uint8_t parseMacSliceRrmPolicy(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, MacSliceRrmPolicy *rrmPolicy) +uint8_t parseGlobalConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { - uint8_t memIdx = 0; - memset(rrmPolicy, 0, sizeof(MacSliceRrmPolicy)); - cur = cur -> xmlChildrenNode; - while(cur != NULL) + memset(&gConfigInfo, 0, sizeof(GConfiguration)); + cur = cur->xmlChildrenNode; + while (cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"RESOURCE_TYPE")) && (cur->ns == ns)) - { - rrmPolicy->resourceType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RRC_POLICY_MEM")) && (cur->ns == ns)) - { - rrmPolicy->numOfRrmPolicyMem = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"RRM_POLICY_MUM_LIST")) && (cur->ns == ns)) - { - DU_ALLOC_SHRABL_BUF(rrmPolicy->rRMPolicyMemberList,\ - rrmPolicy->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*)); + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RADIO_FRAME_DURATION")) && (cur->ns == ns)) + { + gConfigInfo.gRadioFrameDuration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"ODU_UE_THROUGHPUT_PRINT_TIME_INTERVAL")) && (cur->ns == ns)) + { + gConfigInfo.gUeThrptTimeIntervl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL")) && (cur->ns == ns)) + { + gConfigInfo.gSnssaiThrptTimeIntervl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PHY_DELTA_DL")) && (cur->ns == ns)) + { + gConfigInfo.gPhyDeltaDl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PHY_DELTA_UL")) && (cur->ns == ns)) + { + gConfigInfo.gPhyDeltaUl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + cur = cur -> next; + } + return ROK; +} - if(!rrmPolicy->rRMPolicyMemberList) - { - DU_LOG("\nERROR --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__); - return RFAILED; - } +/******************************************************************* + * + * @brief Free the memory allocate for slice supported list + * + * @details + * + * Function : parseDuCfgParams + * + * Functionality: Free the memory allocate for slice supported list + * + * @return void + * + * ****************************************************************/ +void freeSliceSuppLst(SupportedSliceList *sliceSuppLst) +{ + uint8_t sliceIdx=0; - for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++) + if(sliceSuppLst->numSupportedSlices&&sliceSuppLst->snssai) + { + for(sliceIdx=0;sliceIdxnumSupportedSlices;sliceIdx++) + { + if(sliceSuppLst->snssai) { - DU_ALLOC_SHRABL_BUF(rrmPolicy->rRMPolicyMemberList[memIdx], sizeof(RrmPolicyMemberList)); - if (rrmPolicy->rRMPolicyMemberList[memIdx] == NULLP) - { - DU_LOG("\nERROR --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__); - return RFAILED; - } - - if(parseRrmPolicyList(doc, ns, cur, rrmPolicy->rRMPolicyMemberList[memIdx]) != ROK) + if(sliceSuppLst->snssai[sliceIdx]) { - return RFAILED; + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, sliceSuppLst->snssai[sliceIdx], sizeof(Snssai)); } + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \ + sliceSuppLst->snssai, (sliceSuppLst->numSupportedSlices) * sizeof(Snssai*)); } } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"RRM_POLICY_RATIO")) && (cur->ns == ns)) - { - if(parseRrmPolicyRatio(doc, ns, cur, &rrmPolicy->policyRatio) != ROK) - { - return RFAILED; - } - } - - cur = cur -> next; } - return ROK; } /******************************************************************* * - * @brief Fill MAC Slice Configuration + * @brief Free the memory allocate in parseDuCfgParams * * @details * - * Function : parseMacSliceCfgReq + * Function : parseDuCfgParams * - * Functionality: Fill MAC Slice Configuration + * Functionality: Free the memory allocate in parseDuCfgParams * - * @params[in] XML document pointer - * XML namespace - * Current node in XML - * Pointer to structure to be filled - * @return ROK - success - * RFAILED - failure + * @return void * * ****************************************************************/ -uint8_t parseMacSliceCfgReq(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacSliceCfgReq *macSliceCfgReq) +void freeDuCfgParams() { - uint8_t policyIdx = 0; - memset(macSliceCfgReq, 0, sizeof(MacSliceCfgReq)); - cur = cur -> xmlChildrenNode; - while(cur != NULL) + uint8_t ranFuncIdx=0,reportStyleIdx=0; + uint8_t policyIdx = 0,memIdx=0; + MacSliceRrmPolicy *rrmPolicy =NULLP; + MacSliceCfgReq *macSliceCfgReq=NULLP; + F1DuSysInfo *sysInfo; + CsiRsCfg *csiRsCfg; + RanFunction *ranFunction; + RicReportStyle *ricReportStyle; + CmLListCp *measurementInfoList; + CmLList *measInfoNode = NULLP; + + if(duCfgParam.duName) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RRC_POLICY")) && (cur->ns == ns)) - { - macSliceCfgReq->numOfRrmPolicy = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } + DU_FREE(duCfgParam.duName, strlen(duCfgParam.duName)); + } + + freeSliceSuppLst(&duCfgParam.macCellCfg.cellCfg.plmnInfoList[0].suppSliceList); + csiRsCfg=&duCfgParam.macCellCfg.csiRsCfg; + if(csiRsCfg->csiFreqDomainAlloc) + { + DU_FREE(csiRsCfg->csiFreqDomainAlloc, sizeof(uint8_t)); + } + if(duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu) + { + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \ + duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu, duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1PduLen); + } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_SLICE_RRM_POLICY")) && (cur->ns == ns)) + if(duCb.e2apDb.numOfRanFunction) + { + for(ranFuncIdx=0;ranFuncIdxlistOfRrmPolicy, macSliceCfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*)); - if(!macSliceCfgReq->listOfRrmPolicy) + ranFunction=&duCb.e2apDb.ranFunction[ranFuncIdx]; + for(reportStyleIdx=0;reportStyleIdxnumOfReportStyleSupported;reportStyleIdx++) { - DU_LOG("\nERROR --> DU APP: %s: Memory allocation failed at line %d", __func__, __LINE__); - return RFAILED; + ricReportStyle=&ranFunction->reportStyleList[reportStyleIdx]; + measurementInfoList=&ricReportStyle->measurementInfoList; + CM_LLIST_FIRST_NODE(measurementInfoList, measInfoNode); + while(measInfoNode) + { + MeasurementInfoForAction *measurementInfoForAction; + measurementInfoForAction= (MeasurementInfoForAction*)measInfoNode->node; + cmLListDelFrm(measurementInfoList, measInfoNode); + DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction)); + DU_FREE(measInfoNode, sizeof(CmLList)); + CM_LLIST_FIRST_NODE(measurementInfoList, measInfoNode); + } } + } + } + + freeSliceSuppLst(&duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].taiSliceSuppLst); + sysInfo=&duCfgParam.srvdCellLst[0].duSysInfo; + if(sysInfo->mibMsg) + { + DU_FREE(sysInfo->mibMsg, sysInfo->mibLen); + } + if(sysInfo->sib1Msg) + { + DU_FREE(sysInfo->sib1Msg, sysInfo->sib1Len); + } - for(policyIdx = 0; policyIdx < macSliceCfgReq->numOfRrmPolicy; policyIdx++) + macSliceCfgReq=&duCfgParam.tempSliceCfg; + if(macSliceCfgReq->listOfRrmPolicy) + { + for(policyIdx = 0; policyIdx < macSliceCfgReq->numOfRrmPolicy; policyIdx++) + { + if (macSliceCfgReq->listOfRrmPolicy[policyIdx]) { - DU_ALLOC_SHRABL_BUF(macSliceCfgReq->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy)); - if (macSliceCfgReq->listOfRrmPolicy[policyIdx] == NULLP) - { - DU_LOG("\nERROR --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__); - } - - if(parseMacSliceRrmPolicy(doc, ns, cur, macSliceCfgReq->listOfRrmPolicy[policyIdx]) != ROK) + rrmPolicy=macSliceCfgReq->listOfRrmPolicy[policyIdx]; + if(rrmPolicy->rRMPolicyMemberList) { - return RFAILED; + for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++) + { + if (rrmPolicy->rRMPolicyMemberList[memIdx]) + { + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,\ + rrmPolicy->rRMPolicyMemberList[memIdx], sizeof(RrmPolicyMemberList)); + } + } + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,rrmPolicy->rRMPolicyMemberList,\ + rrmPolicy->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*)); } + + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \ + macSliceCfgReq->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy)); } } - cur = cur -> next; + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \ + macSliceCfgReq->listOfRrmPolicy, macSliceCfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*)); } - return ROK; } + /******************************************************************* * * @brief Fill DU Config Parmeters @@ -5300,6 +5156,7 @@ uint8_t parseMacSliceCfgReq(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacSliceC * ****************************************************************/ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { + uint8_t ret=ROK; char *tempDuName = ""; char *duIpV4Addr; char *cuIpV4Addr; @@ -5308,18 +5165,21 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) CmInetIpAddr cuIp; CmInetIpAddr ricIp; - memset(&duCfgParam, 0, sizeof(struct duCfgParams)); cur = cur->xmlChildrenNode; while(cur != NULL) { - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_DRB")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"THREAD_AFFINITY")) && (cur->ns == ns)) { - duCfgParam.maxNumDrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + if(parseThreadAffinity(doc, ns, cur, &duCfgParam.threadInfo) != ROK) + { + ret = RFAILED; + break; + } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_UE_SUPPORTED")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"GNB_ID")) && (cur->ns == ns)) { - duCfgParam.maxSupportedUes = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + duCb.gnbId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_ID")) && (cur->ns == ns)) @@ -5334,14 +5194,15 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) if(!duCfgParam.duName) { DU_LOG("\nERROR --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__); - return RFAILED; + ret = RFAILED; + break; } strcpy((char*)duCfgParam.duName, tempDuName); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_UE")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_DRB")) && (cur->ns == ns)) { - duCfgParam.maxUe = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + duCfgParam.maxNumDrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } #ifdef O1_ENABLE @@ -5377,7 +5238,8 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { if(parseSctpParams(doc, ns, cur, &duCfgParam.sctpParams) != ROK) { - return RFAILED; + ret = RFAILED; + break; } duCfgParam.sctpParams.duIpAddr.ipV4Pres = true; duCfgParam.sctpParams.duIpAddr.ipV4Addr = duIp; @@ -5391,28 +5253,31 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { if(parseEgtpParams(doc, ns, cur, &duCfgParam.egtpParams) != ROK) { - return RFAILED; + ret = RFAILED; + break; } duCfgParam.egtpParams.localIp.ipV4Addr = duIp; duCfgParam.egtpParams.localIp.ipV4Pres = true; duCfgParam.egtpParams.destIp.ipV4Pres = true; duCfgParam.egtpParams.destIp.ipV4Addr = cuIp; - duCfgParam.egtpParams.maxTunnelId = duCfgParam.maxNumDrb * duCfgParam.maxSupportedUes; + duCfgParam.egtpParams.maxTunnelId = duCfgParam.maxNumDrb * MAX_NUM_UE; } if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIB_PARAMS")) && (cur->ns == ns)) { if(parseMibParams(doc, ns, cur, &duCfgParam.mibParams) != ROK) { - return RFAILED; + ret = RFAILED; + break; } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_RRC_VERSION")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_PARAMS")) && (cur->ns == ns)) { - if(parseF1RrcVersion(doc, ns, cur, &duCfgParam.rrcVersion) != ROK) + if(parseSib1Params(doc, ns, cur, &duCfgParam.sib1Params) != ROK) { - return RFAILED; + ret = RFAILED; + break; } } @@ -5420,7 +5285,8 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { if(parseF1DuServedCellInfo(doc, ns, cur, &duCfgParam.srvdCellLst[0]) != ROK) { - return RFAILED; + ret = RFAILED; + break; } } @@ -5428,31 +5294,64 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { if(parseMacCellCfg(doc, ns, cur, &duCfgParam.macCellCfg) != ROK) { - return RFAILED; + ret = RFAILED; + break; } } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_PARAMS")) && (cur->ns == ns)) +#ifndef O1_ENABLE + if ((!xmlStrcmp(cur->name, (const xmlChar *)"SLICE_CFG")) && (cur->ns == ns)) { - if(parseSib1Params(doc, ns, cur, &duCfgParam.sib1Params) != ROK) + if(parseMacSliceCfgReq(doc, ns, cur, &duCfgParam.tempSliceCfg) != ROK) { - return RFAILED; + ret = RFAILED; + break; } } +#endif - if ((!xmlStrcmp(cur->name, (const xmlChar *)"SLICE_CFG")) && (cur->ns == ns)) + if((!xmlStrcmp(cur->name, (const xmlChar *)"DU_TIMER_INFO")) && (cur->ns == ns)) { - if(parseMacSliceCfgReq(doc, ns, cur, &duCfgParam.tempSliceCfg) != ROK) + if(parseDuTimerParams(doc, ns, cur, &duCb.duTimersInfo) != ROK) { - return RFAILED; + ret = RFAILED; + break; + } + } + + if((!xmlStrcmp(cur->name, (const xmlChar *)"E2AP_CFG")) && (cur->ns == ns)) + { + if(parseE2ConfigParams(doc, ns, cur, &duCb.e2apDb) != ROK) + { + ret = RFAILED; + break; + } + else + { + cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2SetupTimer), 1); + cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.ricServiceUpdateTimer.timer), 1); + cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2NodeConfigUpdate.timer), 1); + } + } + + if((!xmlStrcmp(cur->name, (const xmlChar *)"GLOBAL_CFG")) && (cur->ns == ns)) + { + if(parseGlobalConfigParams(doc, ns, cur) != ROK) + { + ret = RFAILED; + break; } } cur = cur -> next; } - return ROK; + + if(ret != ROK) + { + freeDuCfgParams(); + } + return ret; } -#endif /******************************************************************* * @@ -5473,11 +5372,18 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) * ****************************************************************/ uint8_t duReadCfg() { - const char *filename = "../build/config/odu_config.xml"; +#ifdef NR_TDD + const char *filename = "../build/config/tdd_odu_config.xml"; +#else + const char *filename = "../build/config/fdd_odu_config.xml"; +#endif xmlDocPtr doc = NULLP; xmlNodePtr cur = NULLP; xmlNsPtr ns = NULLP; + Pst pst; + Buffer *mBuf; + /* Parse, store and print DU configurations from XML file */ doc = xmlParseFile(filename); if(doc == NULL) { @@ -5495,24 +5401,12 @@ uint8_t duReadCfg() return RFAILED; } -#ifdef XML_BASED_CONFIG parseDuCfgParams(doc, ns, cur); -#endif + printDuConfig(); xmlFreeDoc(doc); xmlCleanupParser(); - Pst pst; - Buffer *mBuf; - - /* Read configs into duCfgParams */ - if(readCfg() != ROK) - { - DU_LOG("\nERROR --> DU_APP : Reading configuration failed"); - return RFAILED; - } - printDuConfig(); - /* Fill pst structure */ memset(&(pst), 0, sizeof(Pst)); pst.srcEnt = (Ent)ENTDUAPP; @@ -5525,21 +5419,7 @@ uint8_t duReadCfg() pst.selector = ODU_SELECTOR_TC; pst.pool= DU_POOL; - /* Initialize the timer blocks */ - cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2SetupTimer), 1); - cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.ricServiceUpdateTimer.timer), 1); - cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2NodeConfigUpdate.timer), 1); - /* Initialzie the timer queue */ - memset(&(duCb.duTimersInfo.tmrTq), 0, sizeof(CmTqType) * DU_TQ_SIZE); - - /* Initialize the timer control point */ - memset(&(duCb.duTimersInfo.tmrTqCp), 0, sizeof(CmTqCp)); - duCb.duTimersInfo.tmrTqCp.tmrLen = DU_TQ_SIZE; - - /* Initialize the timer resolution */ - duCb.duTimersInfo.tmrRes = DU_TIMER_RESOLUTION; - /* Timer Registration request to system services */ if (ODU_REG_TMR_MT(pst.srcEnt, pst.srcInst, duCb.duTimersInfo.tmrRes, duActvTmr) != ROK) { @@ -5579,6 +5459,9 @@ uint8_t duReadCfg() * ****************************************************************/ void printDuConfig() { + + uint16_t ranFuncIdx; + uint8_t reportStyleIdx =0, eventStyleIdx=0, tnlIdx=0; uint8_t sliceIdx = 0, pfIdx = 0, rsrcIdx = 0, ssbMaskIdx = 0, fdmIdx = 0; uint8_t monitoringSymbIdx = 0, poIdx = 0, policyIdx = 0, memIdx = 0; __attribute__((unused)) SctpParams *sctp; @@ -5636,7 +5519,11 @@ void printDuConfig() MacSliceRrmPolicy *rrmPolicy; __attribute__((unused)) RrmPolicyRatio *rrmPolicyRatio; __attribute__((unused)) RrmPolicyMemberList *rrmPolicyMemberList; - + CmLList *node; + E2apDb *e2apDb; + RanFunction *ranFunc; + CmLListCp *measurementInfoList; + MeasurementInfoForAction *measurementInfoForAction; #ifdef NR_TDD F1NrTddInfo *f1NrTddInfo; TDDCfg *tddCfg; @@ -5645,9 +5532,17 @@ void printDuConfig() DU_LOG("\n ** DU CONFIGURATION ** \n"); DU_LOG("DU ID %d\n", duCfgParam.duId); DU_LOG("DU Name %s\n", duCfgParam.duName); + + DU_LOG("\n ** Thread Affinity ** \n"); + DU_LOG("DU APP CORE ID %d\n", duCfgParam.threadInfo.duAppCoreId); + DU_LOG("EGTP CORE ID %d\n", duCfgParam.threadInfo.egtpCoreId); + DU_LOG("SCTP CORE ID %d\n", duCfgParam.threadInfo.sctpCoreId); + DU_LOG("RLC-UL CORE ID %d\n", duCfgParam.threadInfo.rlcUlCoreId); + DU_LOG("RLC-DL and MAC CORE ID %d\n", duCfgParam.threadInfo.rlcMacCoreId); + DU_LOG("SCH CORE ID %d\n", duCfgParam.threadInfo.schCoreId); + DU_LOG("Lower MAC CORE ID %d\n", duCfgParam.threadInfo.lwrMacCoreId); + DU_LOG("MAX NUM DRB %d\n", duCfgParam.maxNumDrb); - DU_LOG("MAX SUPPORTED UE %d\n", duCfgParam.maxSupportedUes); - DU_LOG("MAX UE %d\n",duCfgParam.maxUe); sctp = &duCfgParam.sctpParams; DU_LOG("\n ** SCTP PARAMETER ** \n"); @@ -5682,11 +5577,6 @@ void printDuConfig() DU_LOG("Cell Barred %ld\n", mib->cellBarred); DU_LOG("Intra Frequency Reselection %ld\n", mib->intraFreqReselection); - f1RrcVersion = &duCfgParam.rrcVersion; - DU_LOG("\n ** RRC Version ** \n"); - DU_LOG("RRC Version %s\n", f1RrcVersion->rrcVer); - DU_LOG("Extended RRC Version %d\n", f1RrcVersion->extRrcVer); - duSysInfo = &duCfgParam.srvdCellLst[0].duSysInfo; DU_LOG("\n ** DU System Information ** \n"); DU_LOG("MIB length %d\n", duSysInfo->mibLen); @@ -5850,8 +5740,8 @@ void printDuConfig() DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 ** \n"); sib1Cfg = &cellCfg->sib1Cfg; - DU_LOG("SIB1 PDU Length %d", sib1Cfg->sib1PduLen); - DU_LOG("SIB1 PDU %s", sib1Cfg->sib1Pdu); + DU_LOG("SIB1 PDU Length %d\n", sib1Cfg->sib1PduLen); + DU_LOG("SIB1 PDU %s\n", sib1Cfg->sib1Pdu); DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 : Paging Configuration ** \n"); pageCfg = &sib1Cfg->pagingCfg; @@ -5957,7 +5847,7 @@ void printDuConfig() DU_LOG("Beam ID %d\n", ssbCfg->beamId[0]); DU_LOG("BETA PSS %d\n", ssbCfg->betaPss); DU_LOG("BCH Payloag Flag %d\n", ssbCfg->bchPayloadFlag); - DU_LOG("MIB PDU %d %d %d", ssbCfg->mibPdu[0], ssbCfg->mibPdu[1], ssbCfg->mibPdu[2]); + DU_LOG("MIB PDU %d %d %d \n", ssbCfg->mibPdu[0], ssbCfg->mibPdu[1], ssbCfg->mibPdu[2]); DU_LOG("DMRS Type-A Position %d\n", ssbCfg->dmrsTypeAPos); DU_LOG("\n ** MAC Cell Configuration : CSI RS Configuration ** \n"); @@ -6219,7 +6109,7 @@ void printDuConfig() for(policyIdx = 0; policyIdx < macSliceCfg->numOfRrmPolicy; policyIdx++) { rrmPolicy = macSliceCfg->listOfRrmPolicy[policyIdx]; - DU_LOG("RRM Policy [%d]", policyIdx); + DU_LOG("RRM Policy [%d]\n", policyIdx); DU_LOG("\tResource Type %d\n", rrmPolicy->resourceType); rrmPolicyRatio = &rrmPolicy ->policyRatio; @@ -6231,7 +6121,7 @@ void printDuConfig() for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++) { rrmPolicyMemberList = rrmPolicy->rRMPolicyMemberList[memIdx]; - DU_LOG("\tRRM Policy Member [%d]", memIdx); + DU_LOG("\tRRM Policy Member [%d]\n", memIdx); DU_LOG("\t\tPLMN : mcc[0] %d\n", rrmPolicyMemberList->plmn.mcc[0]); DU_LOG("\t\tPLMN : mcc[1] %d\n", rrmPolicyMemberList->plmn.mcc[1]); DU_LOG("\t\tPLMN : mcc[2] %d\n", rrmPolicyMemberList->plmn.mcc[2]); @@ -6242,6 +6132,65 @@ void printDuConfig() DU_LOG("\t\tSD %d %d %d\n",rrmPolicyMemberList->snssai.sd[0],rrmPolicyMemberList->snssai.sd[1],rrmPolicyMemberList->snssai.sd[2]); } } + + DU_LOG("\n ** E2 configuration ** \n"); + e2apDb = &duCb.e2apDb; + DU_LOG("E2 node id %lu\n", e2apDb->e2NodeId); + DU_LOG("Number of RAN function %d\n", e2apDb->numOfRanFunction); + for(ranFuncIdx=0; ranFuncIdxnumOfRanFunction; ranFuncIdx++) + { + ranFunc = &e2apDb->ranFunction[ranFuncIdx]; + DU_LOG("RAN function id %d\n", ranFunc->id); + DU_LOG("Short Name %s\n", ranFunc->name.shortName); + DU_LOG("Service Model OID %s\n", ranFunc->name.serviceModelOID); + DU_LOG("Description %s\n", ranFunc->name.description); + + DU_LOG("RevisionCounter %d\n",ranFunc->revisionCounter); + DU_LOG("NUM of Event Trigger Style Supported %d\n",ranFunc->numOfEventTriggerStyleSupported); + for(eventStyleIdx=0;eventStyleIdxnumOfEventTriggerStyleSupported; eventStyleIdx++) + { + DU_LOG("Style Type %d\n",ranFunc->eventTriggerStyleList[eventStyleIdx].styleType); + DU_LOG("Name %s\n",ranFunc->eventTriggerStyleList[eventStyleIdx].name); + DU_LOG("Format type %d\n",ranFunc->eventTriggerStyleList[eventStyleIdx].formatType); + } + + DU_LOG("Num of Report Style Supported %d\n",ranFunc->numOfReportStyleSupported); + for(reportStyleIdx=0;reportStyleIdxnumOfReportStyleSupported; reportStyleIdx++) + { + DU_LOG("Style Type %d\n",ranFunc->reportStyleList[reportStyleIdx].reportStyle.styleType); + DU_LOG("Name %s\n",ranFunc->reportStyleList[reportStyleIdx].reportStyle.name); + DU_LOG("Format type %d\n",ranFunc->reportStyleList[reportStyleIdx].reportStyle.formatType); + measurementInfoList = &ranFunc->reportStyleList[reportStyleIdx].measurementInfoList; + if(measurementInfoList->count) + { + CM_LLIST_FIRST_NODE(measurementInfoList, node); + while(node) + { + measurementInfoForAction = (MeasurementInfoForAction*) node->node; + if(measurementInfoForAction) + { + DU_LOG("Measurement Type Name %s\n",measurementInfoForAction->measurementTypeName); + DU_LOG("Measurement Type Id %d\n",measurementInfoForAction->measurementTypeId); + } + node = node->next; + } + } + } + DU_LOG("Ric Indication header format %d\n",ranFunc->ricIndicationHeaderFormat); + DU_LOG("Ric indication message format %d\n",ranFunc->ricIndicationMessageFormat); + + } + DU_LOG("Number of TNL association %d\n", e2apDb->numOfTNLAssoc); + for(tnlIdx=0;tnlIdxnumOfTNLAssoc;tnlIdx++) + { + DU_LOG("Local IPv4 Address present %u\n", e2apDb->tnlAssoc[tnlIdx].localIpAddress.ipV4Pres); + DU_LOG("local IP Address %u\n", e2apDb->tnlAssoc[tnlIdx].localIpAddress.ipV4Addr); + DU_LOG("Destination IPv4 Address present %u\n", e2apDb->tnlAssoc[tnlIdx].destIpAddress.ipV4Pres); + DU_LOG("Destination IP Address %u\n", e2apDb->tnlAssoc[tnlIdx].destIpAddress.ipV4Addr); + DU_LOG("Local port %d\n", e2apDb->tnlAssoc[tnlIdx].localPort); + DU_LOG("Destination port %d\n", e2apDb->tnlAssoc[tnlIdx].destPort); + DU_LOG("Tnl usage %d\n", e2apDb->tnlAssoc[tnlIdx].usage); + } } /**********************************************************************