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 = MAX_NUM_RB; /* 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 = MAX_NUM_RB; /* 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_NEITHER_HOPPING;
-
- return ROK;
-}
-
/*******************************************************************
*
* @brief Configures the DU Parameters
return sliv;
}
-/*******************************************************************
- *
- * @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()
-{
- uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx;
- uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx;
- Sib1Params sib1;
- SupportedSliceList *taiSliceSuppLst;
-
-#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
-
- for(srvdCellIdx=0; srvdCellIdx<DEFAULT_CELLS; srvdCellIdx++)
- {
- memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn, 0, sizeof(Plmn));
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
-
- /*Cell ID */
- #ifdef O1_ENABLE
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = cellParams.nRPCI;
- #else
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = NR_PCI;
-#endif
- /* List of Available PLMN */
- for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
- {
- /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
- * followed by either 2 digit or 3 digits of mnc */
-
- memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn, 0,\
- sizeof(Plmn));
- #ifdef O1_ENABLE
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = cellParams.plmnList[srvdPlmnIdx].mcc[0];
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = cellParams.plmnList[srvdPlmnIdx].mcc[1];
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = cellParams.plmnList[srvdPlmnIdx].mcc[2];
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = cellParams.plmnList[srvdPlmnIdx].mnc[0];
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = cellParams.plmnList[srvdPlmnIdx].mnc[1];
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[2] = cellParams.plmnList[srvdPlmnIdx].mnc[2];
- #else
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = PLMN_MCC0;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = PLMN_MCC1;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = PLMN_MCC2;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = PLMN_MNC0;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = PLMN_MNC1;
-#endif
- }
- /* List of Extended PLMN */
- for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
- {
- /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
- * followed by either 2 digit or 3 digits of mnc */
-
- memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn, 0, sizeof(Plmn));
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[0] = PLMN_MCC0;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[1] = PLMN_MCC1;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[2] = PLMN_MCC2;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[0] = PLMN_MNC0;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[1] = PLMN_MNC1;
- }
- /* List of Supporting Slices */
- for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
- {
- taiSliceSuppLst = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].\
- taiSliceSuppLst;
-
- /* TODO Calculte the exact number of supported slices once will get
- * cell configuration from O1 */
- taiSliceSuppLst->numSupportedSlices = 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; sliceIdx<taiSliceSuppLst->numSupportedSlices; 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<MAX_NRCELL_BANDS; freqBandIdx++)
- {
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].nrFreqBand =\
- NR_FREQ_BAND;
- for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
- {
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].sulBand[bandIdx]\
- = SUL_BAND;
- }
- }
-#else
- /* NR FDD Mode info */
-#ifdef O1_ENABLE
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = cellParams.arfcnUL;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = cellParams.arfcnDL;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
-#else
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_UL_ARFCN;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = NR_SCS;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_DL_ARFCN;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = NR_SCS;
-#endif
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
- for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
- {
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
- nrFreqBand = NR_FREQ_BAND;
- for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
- {
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
- sulBand[bandIdx] = SUL_BAND;
- }
- }
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
- for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
- {
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
- nrFreqBand = NR_FREQ_BAND;
- for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
- {
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
- sulBand[bandIdx] = SUL_BAND;
- }
- }
-
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
-#endif
-
- /*Measurement Config and Cell Config */
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.measTimeCfgDuration = TIME_CFG;
-
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellDir = DL_UL;
-
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellType=CELL_TYPE;
-
- /* Broadcast PLMN Identity */
- for(brdcstPlmnIdx=0; brdcstPlmnIdx<MAX_BPLMN_NRCELL_MINUS_1; brdcstPlmnIdx++)
- {
- for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
- {
- memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx],\
- 0, sizeof(Plmn));
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[0] =\
- PLMN_MCC0;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[1] =\
- PLMN_MCC1;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[2] =\
- PLMN_MCC2;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[0] =\
- PLMN_MNC0;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[1] =\
- PLMN_MNC1;
- }
- /* Extended PLMN List */
- for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
- {
- memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
- extPlmn[plmnIdx], 0, sizeof(Plmn));
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
- extPlmn[plmnIdx].mcc[0] = PLMN_MCC0;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
- extPlmn[plmnIdx].mcc[1] = PLMN_MCC1;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
- extPlmn[plmnIdx].mcc[2] = PLMN_MCC2;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
- extPlmn[plmnIdx].mnc[0] = PLMN_MNC0;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
- extPlmn[plmnIdx].mnc[1] = PLMN_MNC1;
- }
-#ifdef O1_ENABLE
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = cellParams.nRTAC; //TODO : to check and fill
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = cellParams.nRTAC;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = cellParams.nRTAC;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = cellParams.cellLocalId;
-#else
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = DU_TAC; //TODO : to check and fill
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = DU_TAC;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = DU_TAC;
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = NR_CELL_ID;
-#endif
- duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].ranac = NR_RANAC;
- }
-
- /*gnb DU System Info mib msg*/
- BuildMibMsg();
- DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBufSize);
- if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg))
- {
- DU_LOG("\nERROR --> 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
return ROK;
}
-#ifdef XML_BASED_CONFIG
/*******************************************************************
*
* @brief Fill Supported Slice List
{
uint8_t sliceIdx = 0;
xmlNodePtr child = NULLP;
- xmlNodePtr snssaiNode = NULLP;
memset(sliceSuppLst, 0, sizeof(SupportedSliceList));
cur = cur->xmlChildrenNode;
}
#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;
}
uint8_t sulIdx = 0;
uint16_t sulValue = 0;
xmlNodePtr child;
- xmlNodePtr sulChild;
memset(freqBand, 0, sizeof(F1FreqBand));
cur = cur->xmlChildrenNode;
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;
{
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;
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))
{
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))
{
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))
{
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)
{
}
}
}
-
- 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)
{
}
}
+#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));
{
duCellInfo->epsTac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
+#endif
if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_MODE_INFO")) && (cur->ns == ns))
{
return RFAILED;
}
}
-
cur = cur -> next;
}
return ROK;
return ROK;
}
-#ifdef O1_ENABLED
+#ifdef O1_ENABLE
/*******************************************************************
*
* @brief Fill PLMN received from O1 interface
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))
* ****************************************************************/
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))
{
- csiRsCfg->csiFreqDomainAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ 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))
cur = cur -> xmlChildrenNode;
while(cur != NULL)
{
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBSC_PWR")) && (cur->ns == ns))
+#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->ssbPbchPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ssbCfg->scsCmn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_CMN")) && (cur->ns == ns))
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIOD")) && (cur->ns == ns))
{
- ssbCfg->scsCmn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ssbCfg->ssbPeriod = 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 *)"SSB_SC_OFFSET")) && (cur->ns == ns))
{
- ssbCfg->ssbOffsetPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ssbCfg->ssbScOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
+#endif
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIOD")) && (cur->ns == ns))
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_OFFSET_PT_A")) && (cur->ns == ns))
{
- ssbCfg->ssbPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ssbCfg->ssbOffsetPointA = 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 *)"SSB_PBSC_PWR")) && (cur->ns == ns))
{
- ssbCfg->ssbScOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ ssbCfg->ssbPbchPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_LIST")) && (cur->ns == ns))
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_MASK_LIST")) && (cur->ns == ns))
{
child = cur -> xmlChildrenNode;
while(child != NULL)
ssbCfg->betaPss = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCH_PAY_FLAG")) && (cur->ns == ns))
+ 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_PROS")) && (cur->ns == ns))
+ 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;
}
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 = convertArfcnToFreqKhz(atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)));
+ carrierCfg->arfcnDL = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_BW")) && (cur->ns == ns))
if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_UL_ARFCN")) && (cur->ns == ns))
{
- carrierCfg->arfcnUL = convertArfcnToFreqKhz(atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)));
+ carrierCfg->arfcnUL = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
+#endif
if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TX_ANT")) && (cur->ns == ns))
{
{
uint8_t idx = 0;
xmlNodePtr child = NULLP;
- xmlNodePtr pdschNode = NULLP;
memset(puschCfgCmn, 0, sizeof(PuschConfigCommon));
cur = cur -> xmlChildrenNode;
child = cur->xmlChildrenNode;
while(child != NULL)
{
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns))
+ if ((!xmlStrcmp(child->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC")) && (child->ns == ns))
{
- pdschNode = child->xmlChildrenNode;
- while(pdschNode != NULL)
+ if(parsePuschTimeDomRsrcAlloc(doc, ns, child, &puschCfgCmn->timeDomRsrcAllocList[idx]) != ROK)
{
- 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;
}
+ idx++;
}
-
child = child -> next;
}
}
cur = cur -> next;
}
+
+ sib1CellCfg->sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len;
+ if(sib1CellCfg->sib1PduLen > 0)
+ {
+ DU_ALLOC_SHRABL_BUF(sib1CellCfg->sib1Pdu, sib1CellCfg->sib1PduLen);
+ if(!sib1CellCfg->sib1Pdu)
+ {
+ 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 *)"SEARCHSPACE_1_INDEX")) && (cur->ns == ns))
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_SEARCH_SPACE_INDEX")) && (cur->ns == ns))
{
pdcchCfgCm->raSearchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
{
uint8_t idx = 0;
xmlNodePtr child = NULLP;
- xmlNodePtr pdschNode = NULLP;
memset(pdschCfgCmn, 0, sizeof(PdschConfigCommon));
cur = cur -> xmlChildrenNode;
child = cur->xmlChildrenNode;
while(child != NULL)
{
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns))
- {
- pdschNode = child->xmlChildrenNode;
- while(pdschNode != NULL)
+ if ((!xmlStrcmp(child->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC")) && (child->ns == ns))
+ {
+ if(parsePdschCmnTimeDomRsrcAlloc(doc, ns, child, &pdschCfgCmn->timeDomRsrcAllocList[idx]) != ROK)
{
- 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;
+ return RFAILED;
}
+ idx++;
}
-
child = child -> next;
}
}
cur = cur -> xmlChildrenNode;
while(cur != NULL)
{
+#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))
{
cellCfg->opState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
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))
{
cellCfg->phyCellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
{
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)
+ {
+ return RFAILED;
+ }
+ }
if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
{
return RFAILED;
}
}
-
cur = cur -> next;
}
return ROK;
cur = cur -> xmlChildrenNode;
while(cur != NULL)
{
+#ifdef O1_ENABLE
+ macCellCfg->cellId = cellParams.cellLocalId;
+#else
if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_ID")) && (cur->ns == ns))
{
macCellCfg->cellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
+#endif
if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARRIER_CFG")) && (cur->ns == ns))
{
}
return ROK;
}
-#endif
/*******************************************************************
*
{
uint8_t rsrcIdx = 0;
xmlNodePtr child = NULLP;
- xmlNodePtr rsrcNode = NULLP;
memset(puschCfgCmn, 0, sizeof(PuschCfgCommon));
cur = cur -> xmlChildrenNode;
uint8_t parsePcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PcchCfg *pcchCfg)
{
xmlNodePtr child = NULLP;
- xmlNodePtr firstPdcchNode = NULLP;
uint8_t idx = 0;
memset(pcchCfg, 0, sizeof(PcchCfg));
#ifdef O1_ENABLE
sib1Params-> tac = cellParams.nRTAC;
sib1Params->cellIdentity = CELL_IDENTITY * cellParams.cellLocalId;
- DU_LOG("\nDEBUG --> DU_APP: readCfg(): OAM CellLocalId=%d", sib1Params->cellIdentity);
+ DU_LOG("\nDEBUG --> DU_APP: parseSib1Params(): OAM CellLocalId=%d", sib1Params->cellIdentity);
#else
if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
{
}
#endif
-#ifdef THREAD_AFFINITY
/*******************************************************************
*
* @brief Set thread affinity to the core configured via XML file
if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_APP_CORE")) && (cur->ns == ns))
{
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 *)"EGTP_CORE")) && (cur->ns == ns))
{
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 *)"RLC_MAC_CORE")) && (cur->ns == ns))
{
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 *)"RLC_UL_CORE")) && (cur->ns == ns))
{
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 *)"SCH_CORE")) && (cur->ns == ns))
{
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 *)"SCTP_CORE")) && (cur->ns == ns))
{
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 *)"LOWER_MAC_CORE")) && (cur->ns == ns))
{
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;
}
return ROK;
}
-#endif
/*******************************************************************
*
uint8_t parseReportStyle(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RicReportStyle *ricReportStyle)
{
xmlNodePtr child = NULLP;
- uint8_t numOfMeasurementInfo=0;
memset(ricReportStyle, 0, sizeof(RicReportStyle));
cur = cur->xmlChildrenNode;
}
}
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_MEASUREMENT_INFO")) && (cur->ns == ns))
- {
- numOfMeasurementInfo = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
- }
-
if ((!xmlStrcmp(cur->name, (const xmlChar *)"MEASUREMENT_INFO_LIST")) && (cur->ns == ns))
{
child = cur->xmlChildrenNode;
return ROK;
}
+/*******************************************************************
+ *
+ * @brief Fill Global config Parameters
+ *
+ * @details
+ *
+ * Function : parseGlobalConfigParams
+ *
+ * Functionality: Fill Global config 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 parseGlobalConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
+{
+
+ memset(&gConfigInfo, 0, sizeof(GConfiguration));
+ cur = cur->xmlChildrenNode;
+ while (cur != NULL)
+ {
+
+ 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;
+}
+
+/*******************************************************************
+ *
+ * @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;
+
+ if(sliceSuppLst->numSupportedSlices&&sliceSuppLst->snssai)
+ {
+ for(sliceIdx=0;sliceIdx<sliceSuppLst->numSupportedSlices;sliceIdx++)
+ {
+ if(sliceSuppLst->snssai)
+ {
+ if(sliceSuppLst->snssai[sliceIdx])
+ {
+ 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*));
+ }
+ }
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Free the memory allocate in parseDuCfgParams
+ *
+ * @details
+ *
+ * Function : parseDuCfgParams
+ *
+ * Functionality: Free the memory allocate in parseDuCfgParams
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void freeDuCfgParams()
+{
+ 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)
+ {
+ 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(duCb.e2apDb.numOfRanFunction)
+ {
+ for(ranFuncIdx=0;ranFuncIdx<duCb.e2apDb.numOfRanFunction;ranFuncIdx++)
+ {
+ ranFunction=&duCb.e2apDb.ranFunction[ranFuncIdx];
+ for(reportStyleIdx=0;reportStyleIdx<ranFunction->numOfReportStyleSupported;reportStyleIdx++)
+ {
+ 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);
+ }
+
+ macSliceCfgReq=&duCfgParam.tempSliceCfg;
+ if(macSliceCfgReq->listOfRrmPolicy)
+ {
+ for(policyIdx = 0; policyIdx < macSliceCfgReq->numOfRrmPolicy; policyIdx++)
+ {
+ if (macSliceCfgReq->listOfRrmPolicy[policyIdx])
+ {
+ rrmPolicy=macSliceCfgReq->listOfRrmPolicy[policyIdx];
+ if(rrmPolicy->rRMPolicyMemberList)
+ {
+ 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));
+ }
+ }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \
+ macSliceCfgReq->listOfRrmPolicy, macSliceCfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*));
+ }
+}
+
+
/*******************************************************************
*
* @brief Fill DU Config Parmeters
* ****************************************************************/
uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
{
+ uint8_t ret=ROK;
char *tempDuName = "";
char *duIpV4Addr;
char *cuIpV4Addr;
{
if ((!xmlStrcmp(cur->name, (const xmlChar *)"THREAD_AFFINITY")) && (cur->ns == ns))
{
-#ifdef THREAD_AFFINITY
if(parseThreadAffinity(doc, ns, cur, &duCfgParam.threadInfo) != ROK)
{
- return RFAILED;
+ ret = RFAILED;
+ break;
}
-#endif
}
if ((!xmlStrcmp(cur->name, (const xmlChar *)"GNB_ID")) && (cur->ns == ns))
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);
}
duCfgParam.maxNumDrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_UE_SUPPORTED")) && (cur->ns == ns))
- {
- duCfgParam.maxSupportedUes = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
- }
-
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_UE")) && (cur->ns == ns))
- {
- duCfgParam.maxUe = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
- }
-
#ifdef O1_ENABLE
if( getStartupConfig(&g_cfg) != ROK )
{
{
if(parseSctpParams(doc, ns, cur, &duCfgParam.sctpParams) != ROK)
{
- return RFAILED;
+ ret = RFAILED;
+ break;
}
duCfgParam.sctpParams.duIpAddr.ipV4Pres = true;
duCfgParam.sctpParams.duIpAddr.ipV4Addr = duIp;
{
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(parseSib1Params(doc, ns, cur, &duCfgParam.sib1Params) != ROK)
{
- return RFAILED;
+ ret = RFAILED;
+ break;
}
}
-#ifdef XML_BASED_CONFIG
if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_DU_SRVD_CELL_INFO")) && (cur->ns == ns))
{
if(parseF1DuServedCellInfo(doc, ns, cur, &duCfgParam.srvdCellLst[0]) != ROK)
{
- return RFAILED;
+ ret = RFAILED;
+ break;
}
}
{
if(parseMacCellCfg(doc, ns, cur, &duCfgParam.macCellCfg) != ROK)
{
- return RFAILED;
+ ret = RFAILED;
+ break;
}
}
-#endif
#ifndef O1_ENABLE
if ((!xmlStrcmp(cur->name, (const xmlChar *)"SLICE_CFG")) && (cur->ns == ns))
{
if(parseMacSliceCfgReq(doc, ns, cur, &duCfgParam.tempSliceCfg) != ROK)
{
- return RFAILED;
+ ret = RFAILED;
+ break;
}
}
#endif
{
if(parseDuTimerParams(doc, ns, cur, &duCb.duTimersInfo) != ROK)
{
- return RFAILED;
+ ret = RFAILED;
+ break;
}
}
{
if(parseE2ConfigParams(doc, ns, cur, &duCb.e2apDb) != ROK)
{
- return RFAILED;
+ ret = RFAILED;
+ break;
}
else
{
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;
}
/*******************************************************************
* ****************************************************************/
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)
{
}
parseDuCfgParams(doc, ns, cur);
+ 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;
* ****************************************************************/
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;
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;
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");
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;
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");
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; ranFuncIdx<e2apDb->numOfRanFunction; 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;eventStyleIdx<ranFunc->numOfEventTriggerStyleSupported; 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;reportStyleIdx<ranFunc->numOfReportStyleSupported; 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;tnlIdx<e2apDb->numOfTNLAssoc;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);
+ }
}
/**********************************************************************