e437fc6daf1c4fee95ac2ca5dfc3537283d37291
[o-du/l2.git] / src / du_app / du_cfg.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17  *******************************************************************************/
18
19 /* This file contains all utility functions */
20 #include "common_def.h"
21
22 #include <libxml/parser.h>
23 #include <libxml/tree.h>
24 #include <libxml/xmlmemory.h>
25 #include <arpa/inet.h>
26
27 #include "du_tmr.h"
28 #include "legtp.h"
29 #include "lrg.h"
30 #include "lkw.x"
31 #include "lrg.x"
32 #include "du_app_mac_inf.h"
33 #include "du_app_rlc_inf.h"
34 #include "du_e2ap_mgr.h"
35 #include "du_cfg.h"
36 #include "du_mgr.h"
37 #include "du_utils.h"
38 #include "du_f1ap_conversions.h"
39 #include "OCTET_STRING.h"
40 #include "BIT_STRING.h"
41 #include "odu_common_codec.h"
42 #include "MIB.h"
43 #include "SearchSpace.h"
44 #include "SIB-TypeInfo.h"
45 #include "SchedulingInfo.h"
46 #include "SI-SchedulingInfo.h"
47 #include "ConnEstFailureControl.h"
48 #include "PLMN-IdentityInfo.h"
49 #include "PDSCH-TimeDomainResourceAllocation.h"
50 #include "BCCH-Config.h"
51 #include "PagingCycle.h"
52 #include "PCCH-Config.h"
53 #include "TimeAlignmentTimer.h"
54 #include "BCCH-DL-SCH-Message.h"
55 #include "RACH-ConfigGeneric.h"
56 #include "PUSCH-TimeDomainResourceAllocation.h"
57 #include "PUCCH-ConfigCommon.h"
58 #include "SubcarrierSpacing.h"
59 #include "TDD-UL-DL-Pattern.h"
60 #include "RACH-ConfigCommon.h"
61 #include "BWP-DownlinkCommon.h"
62 #include "BWP-UplinkCommon.h"
63 #include "TDD-UL-DL-ConfigCommon.h"
64 #include "du_sys_info_hdl.h"
65
66 #ifdef O1_ENABLE
67 #include "CmInterface.h"
68 extern StartupConfig g_cfg;
69 extern NRCellDU cellParams;
70 #endif
71
72 char encBuf[ENC_BUF_MAX_LEN];
73
74
75 /* Filling Slot configuration as :
76  * 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
77  *   0   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
78  *   1   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
79  *   2   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
80      3   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
81      4   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
82      5   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
83      6   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
84      7   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    F     UL
85      8   UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL
86      9   UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL  
87  */
88
89 /*******************************************************************
90  * @brief Reads the CL Configuration.
91  *
92  * @details
93  *
94  *    Function : readMacCfg
95  *
96  *    Functionality:
97  *       - Fills up the cell configuration for CL.
98  *       - Calls FillSlotConfig()  
99  *
100  * @params[in] void
101  * @return ROK     - success
102  *         RFAILED - failure
103  *
104  * ****************************************************************/
105
106 uint8_t readMacCfg()
107 {
108    uint8_t idx=0, sliceIdx=0,plmnIdx = 0;
109    SupportedSliceList *taiSliceSuppLst;
110
111    /* DL carrier configuration */
112 #ifdef O1_ENABLE
113    duCfgParam.macCellCfg.cellId = cellParams.cellLocalId;
114    duCfgParam.macCellCfg.carrCfg.dlBw = cellParams.bSChannelBwDL;
115    duCfgParam.macCellCfg.carrCfg.arfcnDL = cellParams.arfcnDL;
116 #else
117    duCfgParam.macCellCfg.cellId = NR_CELL_ID;
118    duCfgParam.macCellCfg.carrCfg.dlBw = NR_BANDWIDTH;
119    duCfgParam.macCellCfg.carrCfg.arfcnDL  = NR_DL_ARFCN;
120 #endif
121    duCfgParam.macCellCfg.carrCfg.numTxAnt = NUM_TX_ANT;
122    /* UL Carrier configuration */
123 #ifdef O1_ENABLE
124    duCfgParam.macCellCfg.carrCfg.ulBw = cellParams.bSChannelBwUL;
125    duCfgParam.macCellCfg.carrCfg.arfcnUL = cellParams.arfcnUL;
126 #else   
127    duCfgParam.macCellCfg.carrCfg.ulBw = NR_BANDWIDTH;
128    duCfgParam.macCellCfg.carrCfg.arfcnUL =  NR_UL_ARFCN;
129 #endif   
130    duCfgParam.macCellCfg.carrCfg.numRxAnt = NUM_RX_ANT;
131
132    /* Cell configuration */
133 #ifdef O1_ENABLE
134    duCfgParam.macCellCfg.cellCfg.opState    = cellParams.operationalState;
135    duCfgParam.macCellCfg.cellCfg.adminState = cellParams.administrativeState;
136    duCfgParam.macCellCfg.cellCfg.cellState  = cellParams.cellState;
137    duCfgParam.macCellCfg.cellCfg.phyCellId  = cellParams.nRPCI;
138    duCfgParam.macCellCfg.cellCfg.tac        = cellParams.nRTAC;
139    duCfgParam.macCellCfg.cellCfg.ssbFreq    = cellParams.ssbFrequency;
140 #else
141    duCfgParam.macCellCfg.cellCfg.opState    = OP_DISABLED; 
142    duCfgParam.macCellCfg.cellCfg.adminState = ADMIN_UNLOCKED;
143    duCfgParam.macCellCfg.cellCfg.cellState  = CELL_INACTIVE;
144    duCfgParam.macCellCfg.cellCfg.phyCellId  = NR_PCI;
145    duCfgParam.macCellCfg.cellCfg.tac        = DU_TAC; 
146    duCfgParam.macCellCfg.cellCfg.ssbFreq    = SSB_FREQUENCY;
147 #endif
148    /* Plmn And SNSSAI Configuration */
149    for(plmnIdx = 0; plmnIdx < MAX_PLMN; plmnIdx++)
150    {
151       memcpy(&duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].plmn, &duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[plmnIdx].plmn,\
152             sizeof(Plmn));
153       taiSliceSuppLst = &duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[plmnIdx].taiSliceSuppLst;
154       duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices = taiSliceSuppLst->numSupportedSlices;
155       if(taiSliceSuppLst->snssai)
156       {
157          DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai, (duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices) * sizeof(Snssai*));
158          if(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai == NULLP)
159          {
160             DU_LOG("\nERROR  --> DU_APP: Memory allocation failed at readMacCfg");
161             return RFAILED;
162          }
163       }
164       for(sliceIdx=0; sliceIdx < taiSliceSuppLst->numSupportedSlices; sliceIdx++)
165       {
166          if(taiSliceSuppLst->snssai[sliceIdx] != NULLP)
167          {
168             DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai[sliceIdx], sizeof(Snssai));
169             if(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai[sliceIdx] == NULLP)
170             {
171                DU_LOG("\nERROR  --> DU_APP: Memory allocation failed at readMacCfg");
172                return RFAILED;
173             }
174             memcpy(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai[sliceIdx], taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
175          }
176       }
177    }
178    duCfgParam.macCellCfg.cellCfg.subCarrSpacing = NR_SCS;
179    duCfgParam.macCellCfg.cellCfg.dupType    = DUPLEX_MODE;
180
181    /* SSB configuration */
182    duCfgParam.macCellCfg.ssbCfg.ssbPbchPwr = SSB_PBCH_PWR;
183    duCfgParam.macCellCfg.ssbCfg.bchPayloadFlag = BCH_PAYLOAD;
184    duCfgParam.macCellCfg.ssbCfg.ssbOffsetPointA = OFFSET_TO_POINT_A;
185    duCfgParam.macCellCfg.ssbCfg.betaPss = BETA_PSS;
186 #ifdef O1_ENABLE
187    duCfgParam.macCellCfg.ssbCfg.scsCmn = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
188    duCfgParam.macCellCfg.ssbCfg.ssbPeriod = convertSSBPeriodicityToEnum(cellParams.ssbPeriodicity);
189    duCfgParam.macCellCfg.ssbCfg.ssbScOffset = cellParams.ssbOffset;
190 #else
191    duCfgParam.macCellCfg.ssbCfg.scsCmn = NR_SCS;
192    duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PRDCTY_MS_20;
193    duCfgParam.macCellCfg.ssbCfg.ssbScOffset = SSB_SUBCARRIER_OFFSET;
194 #endif
195    duCfgParam.macCellCfg.ssbCfg.ssbMask[0] = 1; /* only one SSB is transmitted */
196    if(BuildMibPdu() != ROK)
197    {
198       DU_LOG("\nERROR  -->  Failed to build MIB PDU");
199       memset(&duCfgParam.macCellCfg.ssbCfg.mibPdu, 0, 3*sizeof(uint8_t));
200    }
201    else
202    {
203       memcpy(&duCfgParam.macCellCfg.ssbCfg.mibPdu, encBuf,encBufSize);
204    }
205
206    /* PRACH configuration */
207    duCfgParam.macCellCfg.prachCfg.prachSeqLen = PRACH_SEQ_LEN;
208    duCfgParam.macCellCfg.prachCfg.prachSubcSpacing = convertScsEnumValToScsVal(PRACH_SUBCARRIER_SPACING);
209    duCfgParam.macCellCfg.prachCfg.prachCfgIdx = PRACH_CONFIG_IDX;
210    duCfgParam.macCellCfg.prachCfg.msg1Fdm = NUM_PRACH_FDM;
211    duCfgParam.macCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX;
212    duCfgParam.macCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ;
213    duCfgParam.macCellCfg.prachCfg.fdm[0].k1 = 0;
214    duCfgParam.macCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
215    duCfgParam.macCellCfg.prachCfg.prachRstSetCfg = PRACH_RESTRICTED_SET_CFG;
216    duCfgParam.macCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH;
217    duCfgParam.macCellCfg.prachCfg.msg1FreqStart = PRACH_FREQ_START;
218
219    duCfgParam.macCellCfg.prachCfg.totalNumRaPreamble = NUM_RA_PREAMBLE;
220    duCfgParam.macCellCfg.prachCfg.numCbPreamblePerSsb = CB_PREAMBLE_PER_SSB;
221    duCfgParam.macCellCfg.prachCfg.raRspWindow = RA_RSP_WINDOW;
222    
223    /* TDD configuration */
224 #ifdef NR_TDD   
225    duCfgParam.macCellCfg.tddCfg.tddPeriod = TDD_PERIODICITY;
226    duCfgParam.macCellCfg.tddCfg.nrOfDlSlots = NUM_DL_SLOTS;
227    duCfgParam.macCellCfg.tddCfg.nrOfDlSymbols = NUM_DL_SYMBOLS;
228    duCfgParam.macCellCfg.tddCfg.nrOfUlSlots = NUM_UL_SLOTS;
229    duCfgParam.macCellCfg.tddCfg.nrOfUlSymbols = NUM_UL_SYMBOLS;
230
231    //FillSlotConfig();
232
233 #endif
234
235    /* fill SIB1 configuration */
236    duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len;
237    DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
238    memcpy(duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, \
239          duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
240    duCfgParam.macCellCfg.cellCfg.sib1Cfg.pdcchCfgSib1.coresetZeroIndex = CORESET_0_INDEX;
241    duCfgParam.macCellCfg.cellCfg.sib1Cfg.pdcchCfgSib1.searchSpaceZeroIndex = SEARCHSPACE_0_INDEX;
242
243    duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.numPO = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg.ns;
244    if((duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg.firstPDCCHMontioringType != \
245             PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_NOTHING) && (duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.numPO != 0))
246    {
247       duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.poPresent = TRUE;
248       memcpy(duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.pagingOcc, 
249             duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg.firstPDCCHMontioringInfo,MAX_PO_PER_PF);
250    }
251    else
252    {
253       duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.poPresent = FALSE;
254    }
255
256    /* fill Intial DL BWP */
257    duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.firstPrb = 0;
258    duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.numPrb = MAX_NUM_RB; /* configured to total BW */
259    duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.scs = duCfgParam.macCellCfg.ssbCfg.scsCmn;
260    duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
261    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId = SEARCHSPACE_1_INDEX;
262    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.coresetId = CORESET_0_INDEX;
263    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot =
264       SS_MONITORING_SLOT_SL1; /* sl1 - all slots */
265    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.duration = 0;
266    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol =
267       SS_MONITORING_SYMBOL;
268    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
269       candidate.aggLevel1       = 8;
270    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
271       candidate.aggLevel2       = 4;
272    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
273       candidate.aggLevel4       = 2;
274    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
275       candidate.aggLevel8       = 1;
276    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
277       candidate.aggLevel16      = 0;
278
279    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.numTimeDomAlloc = NUM_TIME_DOM_RSRC_ALLOC;
280    idx = 0;
281    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].k0 = PDSCH_K0_CFG1;
282    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].mappingType = 
283       PDSCH_MAPPING_TYPE_A;
284    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].startSymbol = 
285       PDSCH_START_SYMBOL;
286    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].lengthSymbol =
287       PDSCH_LENGTH_SYMBOL;
288
289    idx++;
290    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].k0 = PDSCH_K0_CFG2;
291    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].mappingType = 
292       PDSCH_MAPPING_TYPE_A;
293    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].startSymbol = 
294       PDSCH_START_SYMBOL;
295    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].lengthSymbol =
296       PDSCH_LENGTH_SYMBOL;
297
298    /* ra-searchSpace ID is set to 1 */
299    duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.raSearchSpaceId = SEARCHSPACE_1_INDEX;
300
301    /* fill Intial UL BWP */
302    duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.firstPrb = 0;
303    duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.numPrb = MAX_NUM_RB; /* configured to total BW */
304    duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.scs = duCfgParam.macCellCfg.ssbCfg.scsCmn;
305    duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
306    duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.numTimeDomRsrcAlloc = 2;
307    duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].k2 = PUSCH_K2_CFG1;
308    duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].mappingType = 
309       PUSCH_MAPPING_TYPE_A;
310    duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].startSymbol = 
311       PUSCH_START_SYMBOL;
312    duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].symbolLength =
313       PUSCH_LENGTH_SYMBOL;
314
315    duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].k2 = PUSCH_K2_CFG2;
316    duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].mappingType = 
317       PUSCH_MAPPING_TYPE_A;
318    duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].startSymbol = 
319       PUSCH_START_SYMBOL;
320    duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].symbolLength =
321       PUSCH_LENGTH_SYMBOL;
322
323    duCfgParam.macCellCfg.ssbCfg.dmrsTypeAPos = DMRS_TYPE_A_POS; 
324
325    /* fill PUCCH config common */
326    duCfgParam.macCellCfg.cellCfg.initialUlBwp.pucchCommon.pucchResourceCommon = PUCCH_RSRC_COMMON;
327    duCfgParam.macCellCfg.cellCfg.initialUlBwp.pucchCommon.pucchGroupHopping = PUCCH_NEITHER_HOPPING;
328
329    return ROK;
330 }
331
332 /*******************************************************************
333  *
334  * @brief Configures the DU Parameters
335  *
336  * @details
337  *
338  *    Function : calcSliv
339  *
340  *    Functionality:
341  *       - calculate SLIV value from start and length field
342  *
343  * @params[in] start symbol
344  * @params[in] length of symbols
345  * @return SLIV value
346  *
347  * ****************************************************************/
348 uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol)
349 {
350    uint16_t sliv = 0;
351    if((lengthSymbol-1) <= 7)
352    {
353       sliv = NUM_SYMBOLS_PER_SLOT * (lengthSymbol-1) + startSymbol;
354    }
355    else
356    {
357       sliv = NUM_SYMBOLS_PER_SLOT * (NUM_SYMBOLS_PER_SLOT - lengthSymbol + 1) \
358              + (NUM_SYMBOLS_PER_SLOT - 1 - startSymbol);
359    }
360    return sliv;
361 }
362
363
364 /*******************************************************************
365  *
366  * @brief Configures serving cell config common in sib1
367  *
368  * @details
369  *
370  *    Function : fillServCellCfgCommSib
371  *
372  *    Functionality:
373  *       - fills Serving cell config common for SIB1
374  *
375  * @params[in] SrvCellCfgCommSib pointer
376  * @return ROK     - success
377  *         RFAILED - failure
378  * 
379  ** ****************************************************************/
380 uint8_t fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm)
381 {
382    PdcchCfgCommon   pdcchCfg;
383    PdschCfgCommon   pdschCfg;
384    PcchCfg          pcchCfg;
385    RachCfgCommon    rachCfg;
386    PuschCfgCommon   puschCfg;
387    PucchCfgCommon   pucchCfg;
388    TddUlDlCfgCommon   tddCfg;
389
390 #ifdef O1_ENABLE
391    srvCellCfgComm->scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
392 #else
393    srvCellCfgComm->scs = NR_SCS;
394 #endif
395
396    /* Configuring DL Config Common for SIB1*/
397    srvCellCfgComm->dlCfg.freqBandInd = NR_FREQ_BAND; 
398    srvCellCfgComm->dlCfg.offsetToPointA = OFFSET_TO_POINT_A;
399 #ifdef O1_ENABLE
400    srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset =  cellParams.ssbOffset;
401    srvCellCfgComm->dlCfg.dlScsCarrier.scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
402    srvCellCfgComm->dlCfg.dlScsCarrier.scsBw =  cellParams.bSChannelBwUL;
403 #else
404    srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET;
405    srvCellCfgComm->dlCfg.dlScsCarrier.scs = NR_SCS;
406    srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = NR_BANDWIDTH;
407 #endif   
408    srvCellCfgComm->dlCfg.locAndBw = FREQ_LOC_BW;
409
410    /* Configuring PDCCH Config Common For SIB1 */
411    pdcchCfg.present = BWP_DownlinkCommon__pdcch_ConfigCommon_PR_setup;
412    pdcchCfg.ctrlRsrcSetZero = CORESET_0_INDEX;
413    pdcchCfg.searchSpcZero = SEARCHSPACE_0_INDEX;
414    pdcchCfg.searchSpcId = PDCCH_SEARCH_SPACE_ID;
415    pdcchCfg.ctrlRsrcSetId = PDCCH_CTRL_RSRC_SET_ID;
416    pdcchCfg.monitorSlotPrdAndOffPresent = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
417    //pdcchCfg.monitorSlotPrdAndOff = \
418    SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
419    pdcchCfg.monitorSymbolsInSlot[0] = 128;
420    pdcchCfg.monitorSymbolsInSlot[1] = 0;
421    pdcchCfg.numCandAggLvl1 = SearchSpace__nrofCandidates__aggregationLevel1_n8;
422    pdcchCfg.numCandAggLvl2 = SearchSpace__nrofCandidates__aggregationLevel2_n4;
423    pdcchCfg.numCandAggLvl4 = SearchSpace__nrofCandidates__aggregationLevel4_n2;
424    pdcchCfg.numCandAggLvl8 = SearchSpace__nrofCandidates__aggregationLevel8_n1;
425    pdcchCfg.numCandAggLvl16 = SearchSpace__nrofCandidates__aggregationLevel16_n0;
426    pdcchCfg.searchSpcType = SearchSpace__searchSpaceType_PR_common;
427    pdcchCfg.commSrchSpcDciFrmt = PDCCH_SERACH_SPACE_DCI_FORMAT;
428    pdcchCfg.searchSpcSib1 = PDCCH_SEARCH_SPACE_ID_SIB1;
429    pdcchCfg.pagingSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING;
430    pdcchCfg.raSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING;
431    srvCellCfgComm->dlCfg.pdcchCfg = pdcchCfg;
432
433    /* Configuring PDSCH Config Common For SIB1 */
434    pdschCfg.present = BWP_DownlinkCommon__pdsch_ConfigCommon_PR_setup;
435    pdschCfg.numTimeDomRsrcAlloc = 2;
436    pdschCfg.timeDomAlloc[0].k0 = PDSCH_K0_CFG1;
437    pdschCfg.timeDomAlloc[0].mapType = PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
438    pdschCfg.timeDomAlloc[0].sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL);
439
440    pdschCfg.timeDomAlloc[1].k0 = PDSCH_K0_CFG2;
441    pdschCfg.timeDomAlloc[1].mapType = PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
442    pdschCfg.timeDomAlloc[1].sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL);
443
444    srvCellCfgComm->dlCfg.pdschCfg = pdschCfg;
445
446    /* Configuring BCCH Config for SIB1 */
447    srvCellCfgComm->dlCfg.bcchCfg.modPrdCoeff = BCCH_Config__modificationPeriodCoeff_n16;
448
449    /* Configuring PCCH Config for SIB1 */
450    pcchCfg.dfltPagingCycle = convertPagingCycleEnumToValue(PagingCycle_rf256);
451    pcchCfg.nAndPagingFrmOffsetType = PCCH_Config__nAndPagingFrameOffset_PR_oneT;
452    pcchCfg.pageFrameOffset = 0;
453    pcchCfg.ns = convertNsEnumToValue(PCCH_Config__ns_one);
454    pcchCfg.firstPDCCHMontioringType = PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_sCS30KHZoneT_SCS15KHZhalfT;
455    memset(pcchCfg.firstPDCCHMontioringInfo, 0, sizeof(uint16_t));
456    pcchCfg.firstPDCCHMontioringInfo[0] = 44;
457    
458    srvCellCfgComm->dlCfg.pcchCfg = pcchCfg;
459
460
461    /* Configuring UL Config Common */
462 #ifdef O1_ENABLE
463    srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset =  cellParams.ssbOffset;
464    srvCellCfgComm->ulCfg.ulScsCarrier.scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
465    srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = cellParams.bSChannelBwUL; 
466 #else
467    srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET;
468    srvCellCfgComm->ulCfg.ulScsCarrier.scs = NR_SCS;
469    srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = NR_BANDWIDTH;
470 #endif   
471    srvCellCfgComm->ulCfg.freqBandInd = NR_FREQ_BAND;
472    srvCellCfgComm->ulCfg.pMax = UL_P_MAX;
473    srvCellCfgComm->ulCfg.locAndBw = FREQ_LOC_BW;
474    srvCellCfgComm->ulCfg.timeAlignTimerComm = TimeAlignmentTimer_infinity;
475
476    /* Configuring RACH Config Common for SIB1 */
477    rachCfg.present = BWP_UplinkCommon__rach_ConfigCommon_PR_setup;
478    rachCfg.prachCfgIdx = PRACH_CONFIG_IDX;
479    rachCfg.msg1Fdm = RACH_ConfigGeneric__msg1_FDM_one;
480    rachCfg.msg1FreqStart = PRACH_FREQ_START;
481    rachCfg.zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
482    rachCfg.preambleRcvdTgtPwr = PRACH_PREAMBLE_RCVD_TGT_PWR;
483    rachCfg.preambleTransMax = RACH_ConfigGeneric__preambleTransMax_n200;
484    rachCfg.pwrRampingStep = RACH_ConfigGeneric__powerRampingStep_dB2;
485    rachCfg.raRspWindow = RACH_ConfigGeneric__ra_ResponseWindow_sl10;
486    rachCfg.numRaPreamble = NUM_RA_PREAMBLE;
487    rachCfg.numSsbPerRachOcc = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one;
488    rachCfg.numCbPreamblePerSsb = CB_PREAMBLE_PER_SSB;
489    rachCfg.contResTimer = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64;
490    rachCfg.rsrpThreshSsb = RSRP_THRESHOLD_SSB;
491    rachCfg.rootSeqIdxPresent = RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139;
492    rachCfg.rootSeqIdx = ROOT_SEQ_IDX;
493    rachCfg.msg1Scs = PRACH_SUBCARRIER_SPACING ;
494    rachCfg.restrictedSetCfg = PRACH_RESTRICTED_SET_CFG;
495    srvCellCfgComm->ulCfg.rachCfg = rachCfg;
496
497    /* Configuring PUSCH Config Common for SIB1 */
498    puschCfg.puschCfgPresent = BWP_UplinkCommon__pusch_ConfigCommon_PR_setup;
499    puschCfg.numTimeDomRsrcAlloc = 2;
500    puschCfg.timeDomAllocList[0].k2 = PUSCH_K2_CFG1;
501    puschCfg.timeDomAllocList[0].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
502    puschCfg.timeDomAllocList[0].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
503    puschCfg.timeDomAllocList[1].k2 = PUSCH_K2_CFG2;
504    puschCfg.timeDomAllocList[1].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
505    puschCfg.timeDomAllocList[1].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
506    puschCfg.msg3DeltaPreamble = PUSCH_MSG3_DELTA_PREAMBLE;
507    puschCfg.p0NominalWithGrant = PUSCH_P0_NOMINAL_WITH_GRANT;
508    srvCellCfgComm->ulCfg.puschCfg = puschCfg;
509
510    /* Configuring PUCCH Config Common for SIB1 */
511    pucchCfg.present = BWP_UplinkCommon__pucch_ConfigCommon_PR_setup;
512    pucchCfg.rsrcComm = PUCCH_RSRC_COMMON;
513    pucchCfg.grpHop = PUCCH_ConfigCommon__pucch_GroupHopping_neither;
514    pucchCfg.p0Nominal = PUCCH_P0_NOMINAL;
515    srvCellCfgComm->ulCfg.pucchCfg = pucchCfg;
516
517    /* Configuring TDD UL DL config common */
518    tddCfg.refScs = SubcarrierSpacing_kHz30;
519    tddCfg.txPrd = TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5;
520    tddCfg.numDlSlots = NUM_DL_SLOTS;
521    tddCfg.numDlSymbols = NUM_DL_SYMBOLS;
522    tddCfg.numUlSlots = NUM_UL_SLOTS;
523    tddCfg.numUlSymbols = NUM_UL_SYMBOLS;
524    srvCellCfgComm->tddCfg = tddCfg;
525
526    srvCellCfgComm->ssbPosInBurst = 192;
527    srvCellCfgComm->ssbPrdServingCell = SSB_PERIODICITY;
528    srvCellCfgComm->ssPbchBlockPwr = SSB_PBCH_PWR;
529
530    return ROK;
531 }
532
533 /*******************************************************************
534  *
535  * @brief Configures the DU Parameters
536  *
537  * @details
538  *
539  *    Function : readCfg
540  *
541  *    Functionality:
542  *       - Initializes the DuCfg members.  
543  *       - Calls readMacCfg()  
544  *
545  * @params[in] system task ID
546  * @return ROK     - success
547  *         RFAILED - failure
548  *
549  * ****************************************************************/
550
551 uint8_t readCfg()
552 {
553    CmLList *node;
554    uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx, ranFuncIdx, eventTriggerStyleIdx, reportStyleIdx, tnlAssocIdx;
555    uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx;
556    MibParams mib;
557    Sib1Params sib1;
558    SupportedSliceList *taiSliceSuppLst;
559    uint8_t measurementInfoIdx =0, measurementInfoLen=0;
560    char shortName[] = SHORT_NAME;
561    char serviceModelOID[]= SERVICE_MODEL_OID;
562    char  description[] = DESCRIPTION;
563    char event_trigger_style_name[]= EVENT_TRIGGER_STYLE_NAME;
564    char ric_report_style_name[]= REPORT_STYLE_NAME;
565
566 #ifndef O1_ENABLE
567    /* Note: Added these below variable for local testing*/
568    Snssai snssai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}};
569 #endif
570
571    duCb.e2apDb.e2TransInfo.transIdCounter = 0;
572    duCb.e2apDb.numOfRanFunction = 1;
573    for(ranFuncIdx =0; ranFuncIdx<duCb.e2apDb.numOfRanFunction; ranFuncIdx++)
574    {
575       duCb.e2apDb.ranFunction[ranFuncIdx].id = ranFuncIdx + 1;
576       memcpy(&duCb.e2apDb.ranFunction[ranFuncIdx].name.shortName, shortName, sizeof(shortName));
577       memcpy(&duCb.e2apDb.ranFunction[ranFuncIdx].name.serviceModelOID, serviceModelOID, sizeof(serviceModelOID));
578       memcpy(&duCb.e2apDb.ranFunction[ranFuncIdx].name.description, description, sizeof(description));
579       duCb.e2apDb.ranFunction[ranFuncIdx].revisionCounter = 0;
580       
581       duCb.e2apDb.ranFunction[ranFuncIdx].numOfEventTriggerStyleSupported  = NUM_OF_EVENT_TRIGGER_STYLE_SUPPORTED;
582       for(eventTriggerStyleIdx=0; eventTriggerStyleIdx<duCb.e2apDb.ranFunction[ranFuncIdx].numOfEventTriggerStyleSupported; eventTriggerStyleIdx++)
583       {
584          duCb.e2apDb.ranFunction[ranFuncIdx].eventTriggerStyleList[eventTriggerStyleIdx].styleType = EVENT_TRIGGER_STYLE_TYPE;
585          duCb.e2apDb.ranFunction[ranFuncIdx].eventTriggerStyleList[eventTriggerStyleIdx].formatType = EVENT_TRIGGER_STYLE_FORMAT_TYPE;
586          memcpy(duCb.e2apDb.ranFunction[ranFuncIdx].eventTriggerStyleList[eventTriggerStyleIdx].name, event_trigger_style_name, sizeof(event_trigger_style_name));
587       }
588       
589       duCb.e2apDb.ranFunction[ranFuncIdx].numOfReportStyleSupported= NUM_OF_RIC_REPORT_STYLE_SUPPORTED;
590       for(reportStyleIdx=0; reportStyleIdx<duCb.e2apDb.ranFunction[ranFuncIdx].numOfReportStyleSupported; reportStyleIdx++)
591       {
592          duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.styleType = REPORT_STYLE_TYPE;
593          duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.formatType = REPORT_ACTION_FORMAT_TYPE;
594          memcpy(duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.name, ric_report_style_name, sizeof(ric_report_style_name));
595          
596          for(measurementInfoIdx =0; measurementInfoIdx<NUM_OF_MEASUREMENT_INFO_SUPPORTED(CONFIG_ADD); measurementInfoIdx++)
597          {
598             measurementInfoLen= strlen(MEASUREMENT_TYPE_NAME[measurementInfoIdx]);
599             MeasurementInfoForAction *measurementInfoForAction;
600             DU_ALLOC(measurementInfoForAction, sizeof(MeasurementInfoForAction));
601             if(measurementInfoForAction)
602             {
603                measurementInfoForAction->measurementTypeId = measurementInfoIdx+1;
604                memcpy(measurementInfoForAction->measurementTypeName, MEASUREMENT_TYPE_NAME[measurementInfoIdx], measurementInfoLen+1);
605             }
606             DU_ALLOC(node, sizeof(CmLList));
607             if(node)
608             {
609                node->node = (PTR) measurementInfoForAction;
610                cmLListAdd2Tail(&duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].measurementInfoList, node);
611             }
612             else
613             {
614
615                DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction));
616             }
617          }
618       }
619       
620       duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationHeaderFormat = RIC_INDICATION_HEADER_FORMAT;
621       duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationMessageFormat = RIC_INDICATION_MESSAGE_FORMAT; 
622
623       cmLListInit(&duCb.e2apDb.ranFunction[ranFuncIdx].subscriptionList);
624    }
625    memset(duCb.e2apDb.e2TransInfo.e2InitTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
626    memset(duCb.e2apDb.e2TransInfo.ricInitTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
627    
628    /* SIB1 Params */
629    memset(&sib1.plmn, 0, sizeof(Plmn));
630    sib1.plmn.mcc[0] = PLMN_MCC0;
631    sib1.plmn.mcc[1] = PLMN_MCC1;
632    sib1.plmn.mcc[2] = PLMN_MCC2;
633    sib1.plmn.mnc[0] = PLMN_MNC0;
634    sib1.plmn.mnc[1] = PLMN_MNC1;
635    sib1.ranac = DU_RANAC;
636
637 #ifdef O1_ENABLE
638    sib1.tac =  cellParams.nRTAC;
639    sib1.cellIdentity =  CELL_IDENTITY *  cellParams.cellLocalId;
640    DU_LOG("\nDEBUG --> DU_APP: readCfg(): OAM CellLocalId=%d", \
641               sib1.cellIdentity);
642 #else
643    sib1.tac = DU_TAC;
644    sib1.cellIdentity = CELL_IDENTITY * NR_CELL_ID;
645 #endif
646    sib1.cellResvdForOpUse = PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
647    sib1.connEstFailCnt = ConnEstFailureControl__connEstFailCount_n3;
648    sib1.connEstFailOffValidity = ConnEstFailureControl__connEstFailOffsetValidity_s900;
649    sib1.connEstFailOffset = 15;
650    sib1.siSchedInfo.winLen = SI_SchedulingInfo__si_WindowLength_s5;
651    sib1.siSchedInfo.broadcastSta = SchedulingInfo__si_BroadcastStatus_broadcasting;
652    sib1.siSchedInfo.preiodicity = SchedulingInfo__si_Periodicity_rf8;
653    sib1.siSchedInfo.sibType = SIB_TypeInfo__type_sibType2;
654    sib1.siSchedInfo.sibValTag = SIB1_VALUE_TAG;
655
656    fillServCellCfgCommSib(&sib1.srvCellCfgCommSib);
657
658    duCfgParam.sib1Params = sib1;
659
660    for(srvdCellIdx=0; srvdCellIdx<DEFAULT_CELLS; srvdCellIdx++)
661    { 
662       memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn, 0, sizeof(Plmn));
663       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
664       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
665       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
666       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
667       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
668
669       /*Cell ID */
670  #ifdef O1_ENABLE
671       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = cellParams.nRPCI;
672  #else
673       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = NR_PCI;
674 #endif
675       /* List of Available PLMN */
676       for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
677       {
678          /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
679           * followed by either 2 digit or 3 digits of mnc */ 
680
681          memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn, 0,\
682          sizeof(Plmn));
683  #ifdef O1_ENABLE
684          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = cellParams.plmnList[srvdPlmnIdx].mcc[0];
685          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = cellParams.plmnList[srvdPlmnIdx].mcc[1];
686          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = cellParams.plmnList[srvdPlmnIdx].mcc[2];
687          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = cellParams.plmnList[srvdPlmnIdx].mnc[0];
688          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = cellParams.plmnList[srvdPlmnIdx].mnc[1];
689          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[2] = cellParams.plmnList[srvdPlmnIdx].mnc[2];
690  #else
691          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = PLMN_MCC0;
692          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = PLMN_MCC1;
693          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = PLMN_MCC2;
694          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = PLMN_MNC0;
695          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = PLMN_MNC1;
696 #endif
697       }
698       /* List of Extended PLMN */
699       for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
700       {
701          /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
702           * followed by either 2 digit or 3 digits of mnc */ 
703
704          memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn, 0, sizeof(Plmn));
705          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[0] = PLMN_MCC0;
706          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[1] = PLMN_MCC1;
707          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[2] = PLMN_MCC2;
708          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[0] = PLMN_MNC0;
709          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[1] = PLMN_MNC1;
710       } 
711       /* List of Supporting Slices */
712       for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
713       {
714          taiSliceSuppLst = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].\
715          taiSliceSuppLst;
716          
717          /* TODO Calculte the exact number of supported slices once will get
718           * cell configuration from O1 */
719          taiSliceSuppLst->numSupportedSlices = NUM_OF_SUPPORTED_SLICE;
720          if(taiSliceSuppLst->numSupportedSlices > MAX_NUM_OF_SLICE_ITEMS)
721          {
722             DU_LOG("\nERROR --> DU_APP: readCfg(): Number of supported slice [%d] is more than 1024",\
723             taiSliceSuppLst->numSupportedSlices);
724             return RFAILED;
725          }
726
727          DU_ALLOC(taiSliceSuppLst->snssai, taiSliceSuppLst->numSupportedSlices*sizeof(Snssai*));
728          if(taiSliceSuppLst->snssai == NULLP)
729          {
730             DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
731             return RFAILED;
732          }
733          
734          for(sliceIdx=0; sliceIdx<taiSliceSuppLst->numSupportedSlices; sliceIdx++)
735          {
736             DU_ALLOC(taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
737             if(taiSliceSuppLst->snssai[sliceIdx] == NULLP)
738             {
739                DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
740                return RFAILED;
741             }
742 #ifdef O1_ENABLE
743             memcpy(taiSliceSuppLst->snssai[sliceIdx]->sd, cellParams.plmnList[sliceIdx].sd, \
744                   SD_SIZE*sizeof(uint8_t));
745             taiSliceSuppLst->snssai[sliceIdx]->sst = cellParams.plmnList[sliceIdx].sst;
746 #else
747             memcpy(taiSliceSuppLst->snssai[sliceIdx], &snssai[sliceIdx], sizeof(Snssai));
748 #endif
749          }
750       }
751
752       /* NR Mode info */
753 #ifdef NR_TDD
754       /* NR TDD Mode info */
755 #ifdef O1_ENABLE      
756       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = cellParams.arfcnUL;
757       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
758       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);                
759 #else
760       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_UL_ARFCN;
761       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
762       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;                 
763 #endif      
764       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_273;         
765
766       for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
767       {
768          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].nrFreqBand =\
769                                                                                                                      NR_FREQ_BAND;
770          for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
771          {
772             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].sulBand[bandIdx]\
773                = SUL_BAND;      
774          }
775       }
776 #else
777       /* NR FDD Mode info */
778 #ifdef O1_ENABLE
779       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = cellParams.arfcnUL;
780       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
781       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
782       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
783       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = cellParams.arfcnDL;
784       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
785       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
786       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
787 #else
788       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_UL_ARFCN;
789       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
790       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = NR_SCS;
791       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
792       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_DL_ARFCN;
793       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
794       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
795       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = NR_SCS;
796 #endif
797       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
798       for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
799       {
800          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
801          nrFreqBand = NR_FREQ_BAND;
802          for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
803          {
804             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
805             sulBand[bandIdx] = SUL_BAND;
806          }
807       }
808       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
809       for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
810       {
811          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
812          nrFreqBand = NR_FREQ_BAND;
813          for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
814          {
815             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
816             sulBand[bandIdx] = SUL_BAND;
817          }
818       }
819
820       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
821       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
822 #endif
823
824       /*Measurement Config and Cell Config */ 
825       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.measTimeCfgDuration = TIME_CFG; 
826
827       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellDir = DL_UL; 
828
829       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellType=CELL_TYPE;
830
831       /* Broadcast PLMN Identity */
832       for(brdcstPlmnIdx=0; brdcstPlmnIdx<MAX_BPLMN_NRCELL_MINUS_1; brdcstPlmnIdx++)
833       { 
834          for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
835          {
836             memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx],\
837             0, sizeof(Plmn));
838             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[0] =\
839             PLMN_MCC0;
840             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[1] =\
841             PLMN_MCC1;
842             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[2] =\
843             PLMN_MCC2;
844             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[0] =\
845             PLMN_MNC0;
846             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[1] =\
847             PLMN_MNC1;
848          }
849          /* Extended PLMN List */        
850          for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
851          {
852             memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
853             extPlmn[plmnIdx], 0, sizeof(Plmn));
854             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
855             extPlmn[plmnIdx].mcc[0] = PLMN_MCC0;
856             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
857             extPlmn[plmnIdx].mcc[1] = PLMN_MCC1;
858             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
859             extPlmn[plmnIdx].mcc[2] = PLMN_MCC2;
860             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
861             extPlmn[plmnIdx].mnc[0] = PLMN_MNC0;
862             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
863             extPlmn[plmnIdx].mnc[1] = PLMN_MNC1;
864          }
865 #ifdef O1_ENABLE
866          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = cellParams.nRTAC; //TODO : to check and fill
867          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = cellParams.nRTAC;
868          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = cellParams.nRTAC;
869          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = cellParams.cellLocalId;
870 #else       
871          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = DU_TAC; //TODO : to check and fill
872          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = DU_TAC;
873          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = DU_TAC;
874          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = NR_CELL_ID;
875 #endif     
876          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].ranac = NR_RANAC;
877       }
878
879       /*gnb DU System Info mib msg*/
880       BuildMibMsg();
881       DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBufSize);
882       if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg))
883       {
884          DU_LOG("\nERROR  -->  DU APP : Memory allocation failure at readCfg");
885          return RFAILED;
886       }
887       memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBuf, encBufSize);
888       duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibLen = encBufSize;
889
890       /*gnb DU System Info mib msg*/
891       BuildSib1Msg();
892       DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
893             encBufSize);
894       if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg))
895       {
896          DU_LOG("\nERROR  -->  DU APP : Memory allocation failure at readCfg");
897          return RFAILED;
898       }
899       memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
900             encBuf,encBufSize);
901       duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Len = encBufSize;
902
903    }
904
905    if(readMacCfg() != ROK)
906    {
907       DU_LOG("\nERROR  -->  DU_APP : Failed while reading MAC config");
908       return RFAILED;
909    }
910
911    return ROK;
912 }
913
914 /*******************************************************************
915  *
916  * @brief Copy Slice Cfg in temp structre in duCfgParams 
917  *
918  * @details
919  *
920  *    Function : cpyRrmPolicyInDuCfgParams
921  *
922  *    Functionality:
923  *      - Copy Slice Cfg in temp structre in duCfgParams 
924  *
925  * @params[in] RrmPolicy rrmPolicy[], uint8_t policyNum, uint8_t memberList
926  * @return ROK     - success
927  *         RFAILED - failure
928  *
929  * ****************************************************************/
930 uint8_t cpyRrmPolicyInDuCfgParams(RrmPolicyList rrmPolicy[], uint8_t policyNum, MacSliceCfgReq *tempSliceCfg)
931 {
932    uint8_t policyIdx = 0, memberListIdx = 0;
933    if(policyNum)
934    {
935       tempSliceCfg->numOfRrmPolicy = policyNum;
936       DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy, tempSliceCfg->numOfRrmPolicy  * sizeof(MacSliceRrmPolicy*));
937       if(!tempSliceCfg->listOfRrmPolicy)
938       {
939          DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
940          return RFAILED;
941       }
942
943       for(policyIdx = 0; policyIdx<tempSliceCfg->numOfRrmPolicy; policyIdx++)
944       {
945          DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy));
946          if(!tempSliceCfg->listOfRrmPolicy[policyIdx])
947          {
948             DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
949             return RFAILED;
950          }
951
952          tempSliceCfg->listOfRrmPolicy[policyIdx]->resourceType = rrmPolicy[policyIdx].resourceType;
953
954          tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem = rrmPolicy[policyIdx].rRMMemberNum;
955
956          if(tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem)
957          {
958             DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList,\
959             tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*));
960
961             if(!tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList)
962             {
963                DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
964                return RFAILED;
965             }
966
967
968             for(memberListIdx = 0; memberListIdx<tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem; memberListIdx++)
969             {
970                DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx], sizeof(RrmPolicyMemberList));
971                if(!tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx])
972                {
973                   DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
974                   return RFAILED;
975                }
976                memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->snssai.sd,\
977                &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].sd, 3 * sizeof(uint8_t));
978                memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->snssai.sst,\
979                &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].sst, sizeof(uint8_t));
980                memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->plmn.mcc,\
981                &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].mcc, 3 * sizeof(uint8_t));
982                memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->plmn.mnc,\
983                &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].mnc, 3 * sizeof(uint8_t));
984             }
985             tempSliceCfg->listOfRrmPolicy[policyIdx]->policyRatio.maxRatio = rrmPolicy[policyIdx].rRMPolicyMaxRatio;
986             tempSliceCfg->listOfRrmPolicy[policyIdx]->policyRatio.minRatio = rrmPolicy[policyIdx].rRMPolicyMinRatio;
987             tempSliceCfg->listOfRrmPolicy[policyIdx]->policyRatio.dedicatedRatio = rrmPolicy[policyIdx].rRMPolicyDedicatedRatio;
988          }
989       }
990    }
991
992    return ROK;
993 }
994
995 /*******************************************************************
996  *
997  * @brief Fill SCTP Parameters
998  *
999  * @details
1000  *
1001  *    Function : parseSctpParams
1002  *
1003  *    Functionality: Fill SCTP Parameters
1004  *
1005  * @params[in] XML document pointer
1006  *             XML namespace
1007  *             Current node in XML
1008  *             Pointer to structure to be filled
1009  * @return ROK     - success
1010  *         RFAILED - failure
1011  *
1012  * ****************************************************************/
1013 uint8_t parseSctpParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SctpParams *sctp)
1014 {
1015    uint8_t max_du_port = 0;
1016    uint16_t f1_sctp_port = 0;
1017    uint16_t e2_sctp_port = 0;
1018
1019    memset(sctp, 0, sizeof(SctpParams));
1020    cur = cur->xmlChildrenNode;
1021    while (cur != NULL) 
1022    {
1023 #ifdef O1_ENABLE
1024       sctp->duPort[F1_INTERFACE] = g_cfg.DU_Port;
1025       sctp->duPort[E2_INTERFACE] = g_cfg.RIC_Port;
1026       sctp->cuPort = g_cfg.CU_Port;
1027       sctp->ricPort = g_cfg.RIC_Port;
1028 #else
1029       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_DU_PORT")) && (cur->ns == ns))
1030       {
1031          max_du_port = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1032          if (max_du_port == 2 )
1033          {
1034             sctp->duPort[F1_INTERFACE] = f1_sctp_port;     /* DU Port idx  0  */
1035             sctp->duPort[E2_INTERFACE] = e2_sctp_port;    /* RIC Port idx 1  */
1036          }
1037       }
1038
1039       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SCTP_PORT")) && (cur->ns == ns))
1040       {
1041          f1_sctp_port = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1042       }
1043       if ((!xmlStrcmp(cur->name, (const xmlChar *)"E2_SCTP_PORT")) && (cur->ns == ns))
1044       {
1045          e2_sctp_port = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1046       }
1047
1048       sctp->cuPort = f1_sctp_port;
1049       sctp->ricPort = e2_sctp_port;
1050 #endif
1051       cur = cur->next;
1052    }
1053    return ROK;
1054 }
1055
1056 /*******************************************************************
1057  *
1058  * @brief Fill EGTP Parameters
1059  *
1060  * @details
1061  *
1062  *    Function : parseEgtpParams
1063  *
1064  *    Functionality: Fill EGTP Parmeters
1065  *
1066  * @params[in] XML document pointer
1067  *             XML namespace
1068  *             Current node in XML
1069  *             Pointer to structure to be filled
1070  * @return ROK     - success
1071  *         RFAILED - failure
1072  *
1073  * ****************************************************************/
1074 uint8_t parseEgtpParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1EgtpParams *egtp) 
1075 {
1076    memset(egtp, 0, sizeof(F1EgtpParams));
1077    cur = cur->xmlChildrenNode;
1078    while (cur != NULL) 
1079    {
1080       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOCAL_F1_EGTP_PORT")) && (cur->ns == ns))
1081       {
1082          egtp->localPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1083       }
1084       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEST_F1_EGTP_PORT")) && (cur->ns == ns))
1085       {
1086          egtp->destPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1087       }
1088       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIN_TEID")) && (cur->ns == ns))
1089       {
1090          egtp->minTunnelId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1091       }
1092       cur = cur -> next;
1093    }
1094    return ROK;
1095 }
1096
1097 /*******************************************************************
1098  *
1099  * @brief Fill MIB configuration 
1100  *
1101  * @details
1102  *
1103  *    Function : parseMibParams
1104  *
1105  *    Functionality: Fill MIB configuration
1106  *
1107  * @params[in] XML document pointer
1108  *             XML namespace
1109  *             Current node in XML
1110  *             Pointer to structure to be filled
1111  * @return ROK     - success
1112  *         RFAILED - failure
1113  *
1114  * ****************************************************************/
1115 uint8_t parseMibParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, MibParams *mib)
1116 {
1117    memset(mib, 0, sizeof(MibParams));
1118    cur = cur -> xmlChildrenNode;
1119    while(cur != NULL)
1120    {
1121       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SYS_FRAME_NUM")) && (cur->ns == ns))
1122       {
1123          mib->sysFrmNum = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1124       }
1125       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUB_CARR_SPACE")) && (cur->ns == ns))
1126       {
1127          mib->subCarrierSpacingCommon = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1128       }
1129       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SC_OFFSET")) && (cur->ns == ns))
1130       {
1131          mib->ssb_SubcarrierOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1132       }
1133       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DMRS_TYPEA_POSITION")) && (cur->ns == ns))
1134       {
1135          mib->dmrs_TypeA_Position = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1136       }
1137       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns))
1138       {
1139          mib->controlResourceSetZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1140       }
1141       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_0_INDEX")) && (cur->ns == ns))
1142       {
1143          mib->searchSpaceZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1144       }
1145       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_BARRED")) && (cur->ns == ns))
1146       {
1147          mib->cellBarred = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1148       }
1149       if ((!xmlStrcmp(cur->name, (const xmlChar *)"INTRA_FREQ_RESELECT")) && (cur->ns == ns))
1150       {
1151          mib->intraFreqReselection = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1152       }
1153       cur = cur -> next;
1154    }
1155    return ROK;
1156 }
1157
1158 /*******************************************************************
1159  *
1160  * @brief Fill PLMN ID
1161  *
1162  * @details
1163  *
1164  *    Function : parsePlmn
1165  *
1166  *    Functionality: Fill PLMN ID
1167  *
1168  * @params[in] XML document pointer
1169  *             XML namespace
1170  *             Current node in XML
1171  *             Pointer to structure to be filled
1172  * @return ROK     - success
1173  *         RFAILED - failure
1174  *
1175  * ****************************************************************/
1176 uint8_t parsePlmn(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Plmn *plmn)
1177 {
1178    xmlNodePtr child = NULLP;
1179
1180    memset(plmn, 0, sizeof(Plmn));
1181    cur = cur->xmlChildrenNode;
1182    while(cur != NULL)
1183    {
1184       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MCC")) && (cur->ns == ns))
1185       {
1186          child = cur->xmlChildrenNode;
1187          while (child != NULL)
1188          {
1189             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MCC0")) && (child->ns == ns))
1190             {
1191                plmn->mcc[0] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
1192             }
1193
1194             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MCC1")) && (child->ns == ns))
1195             {
1196                plmn->mcc[1] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
1197             }
1198
1199             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MCC2")) && (child->ns == ns))
1200             {
1201                plmn->mcc[2] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
1202             }
1203
1204             child = child->next;
1205          }
1206       }
1207
1208       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MNC")) && (cur->ns == ns))
1209       {
1210          child = cur->xmlChildrenNode;
1211          while (child != NULL)
1212          {
1213             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MNC0")) && (child->ns == ns))
1214             {
1215                plmn->mnc[0] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));  
1216             }
1217
1218             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MNC1")) && (child->ns == ns))
1219             {
1220                plmn->mnc[1] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
1221             }
1222
1223             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MNC2")) && (child->ns == ns))
1224             {
1225                plmn->mnc[2] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
1226             }
1227
1228             child = child->next;
1229          }
1230       }
1231
1232       cur = cur -> next;
1233    }
1234    return ROK;
1235 }
1236
1237 /*******************************************************************
1238  *
1239  * @brief Fill NR CGI
1240  *
1241  * @details
1242  *
1243  *    Function : parseNrCgi
1244  *
1245  *    Functionality: Fill NR CGI
1246  *
1247  * @params[in] XML document pointer
1248  *             XML namespace
1249  *             Current node in XML
1250  *             Pointer to structure to be filled
1251  * @return ROK     - success
1252  *         RFAILED - failure
1253  *
1254  * ****************************************************************/
1255 uint8_t parseNrCgi(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, NrEcgi *nrCgi)
1256 {
1257    memset(nrCgi, 0, sizeof(NrEcgi));
1258    cur = cur->xmlChildrenNode;
1259    while(cur != NULL)
1260    {
1261       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
1262       {
1263          if(parsePlmn(doc, ns, cur, &nrCgi->plmn) != ROK)
1264          {
1265             return RFAILED;
1266          }
1267       }
1268
1269       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_ID")) && (cur->ns == ns))
1270       {
1271          nrCgi-> cellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1272       }
1273
1274       cur = cur -> next;
1275    }
1276    return ROK;
1277 }
1278
1279 /*******************************************************************
1280  *
1281  * @brief Fill SNSSAI
1282  *
1283  * @details
1284  *
1285  *    Function : parseSnssai
1286  *
1287  *    Functionality: Fill SNSSAI
1288  *
1289  * @params[in] XML document pointer
1290  *             XML namespace
1291  *             Current node in XML
1292  *             Pointer to structure to be filled
1293  * @return ROK     - success
1294  *         RFAILED - failure
1295  *
1296  * ****************************************************************/
1297 uint8_t parseSnssai(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Snssai *snssai)
1298 {
1299    uint8_t sdIdx = 0;
1300    xmlNodePtr child;
1301
1302    memset(snssai, 0, sizeof(Snssai));
1303    cur = cur ->xmlChildrenNode;
1304    while(cur != NULL)
1305    {
1306       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SST")) && (cur->ns == ns))
1307       {
1308          snssai->sst = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1309       }
1310
1311       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SD_SIZE")) && (cur->ns == ns))
1312       {
1313          child = cur->xmlChildrenNode;
1314          while(child != NULL)
1315          {
1316             if ((!xmlStrcmp(child->name, (const xmlChar *)"SD")) && (child->ns == ns))
1317             {
1318                snssai->sd[sdIdx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
1319                sdIdx++;
1320             }
1321             child = child -> next;
1322          }
1323       }
1324
1325       cur = cur -> next;
1326    }
1327    return ROK;
1328 }
1329
1330 #ifdef XML_BASED_CONFIG
1331 /*******************************************************************
1332  *
1333  * @brief Fill Supported Slice List
1334  *
1335  * @details
1336  *
1337  *    Function : parseSupportedSliceList
1338  *
1339  *    Functionality: Fill Supported Slice List
1340  *
1341  * @params[in] XML document pointer
1342  *             XML namespace
1343  *             Current node in XML
1344  *             Pointer to structure to be filled
1345  * @return ROK     - success
1346  *         RFAILED - failure
1347  *
1348  * ****************************************************************/
1349 uint8_t parseSupportedSliceList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SupportedSliceList *sliceSuppLst)
1350 {
1351    uint8_t sliceIdx = 0;
1352    xmlNodePtr child = NULLP;
1353    xmlNodePtr snssaiNode = NULLP;
1354
1355    memset(sliceSuppLst, 0, sizeof(SupportedSliceList));
1356    cur = cur->xmlChildrenNode;
1357    while(cur != NULL)
1358    {
1359       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_SUPPORT_SLICE")) && (cur->ns == ns))
1360       {
1361          sliceSuppLst->numSupportedSlices = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1362          if(sliceSuppLst->numSupportedSlices > MAX_NUM_OF_SLICE_ITEMS)
1363          {
1364             DU_LOG("\nERROR --> DU_APP: %s: Number of supported slice [%d] is more than 1024",\
1365                   __func__, sliceSuppLst->numSupportedSlices);
1366             return RFAILED;
1367          }
1368       }
1369
1370       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SNSSAI_LIST")) && (cur->ns == ns))
1371       {
1372          DU_ALLOC_SHRABL_BUF(sliceSuppLst->snssai, (sliceSuppLst->numSupportedSlices) * sizeof(Snssai*));
1373          if (sliceSuppLst->snssai == NULLP)
1374          {
1375             DU_LOG("\nERROR  --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
1376             return RFAILED;
1377          }
1378
1379          for (sliceIdx = 0; sliceIdx < sliceSuppLst->numSupportedSlices; sliceIdx++)
1380          {
1381             DU_ALLOC_SHRABL_BUF(sliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
1382             if (sliceSuppLst->snssai[sliceIdx] == NULLP)
1383             {
1384                DU_LOG("\nERROR  --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
1385                return RFAILED;
1386             }
1387             else
1388             {
1389 #ifdef O1_ENABLE
1390                memcpy(sliceSuppLst->snssai[sliceIdx]->sd, cellParams.plmnList[sliceIdx].sd, SD_SIZE*sizeof(uint8_t));
1391                sliceSuppLst->snssai[sliceIdx]->sst = cellParams.plmnList[sliceIdx].sst;
1392 #endif
1393             }
1394          }
1395
1396 #ifndef O1_ENABLE
1397          child = cur->xmlChildrenNode;
1398          while (child != NULL)
1399          {
1400             if ((!xmlStrcmp(child->name, (const xmlChar *)"LIST")) && (child->ns == ns))
1401             {     
1402                sliceIdx = 0;
1403                snssaiNode = child->xmlChildrenNode;
1404                while (snssaiNode != NULL)
1405                {
1406                   if ((!xmlStrcmp(snssaiNode->name, (const xmlChar *)"SNSSAI")) && (snssaiNode->ns == ns))
1407                   {
1408                      if(parseSnssai(doc, ns, snssaiNode, sliceSuppLst->snssai[sliceIdx]) != ROK)
1409                      {
1410                         return RFAILED;
1411                      }
1412                      sliceIdx++;
1413                   }
1414                   snssaiNode = snssaiNode->next;
1415                }
1416             }
1417             child = child->next;
1418          }
1419 #endif
1420       }
1421
1422       cur = cur -> next;
1423    }
1424    return ROK;
1425 }
1426
1427 /*******************************************************************
1428  *
1429  * @brief Fill Served PLMN
1430  *
1431  * @details
1432  *
1433  *    Function : parseF1SrvdPlmn
1434  *
1435  *    Functionality: Fill Served PLMN
1436  *
1437  * @params[in] XML document pointer
1438  *             XML namespace
1439  *             Current node in XML
1440  *             Pointer to structure to be filled
1441  * @return ROK     - success
1442  *         RFAILED - failure
1443  *
1444  * ****************************************************************/
1445 uint8_t parseF1SrvdPlmn(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1SrvdPlmn *srvdPlmn, uint8_t srvdPlmnIdx)
1446 {
1447    memset(srvdPlmn, 0, sizeof(F1SrvdPlmn));
1448    cur = cur->xmlChildrenNode;
1449    while(cur != NULL)
1450    {
1451 #ifdef O1_ENABLE
1452       fillPlmnFromO1(&srvdPlmn ->plmn, srvdPlmnIdx);
1453 #else
1454       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
1455       {
1456          if(parsePlmn(doc, ns, cur, &srvdPlmn->plmn) != ROK)
1457          {
1458             return RFAILED;
1459          }
1460       }
1461 #endif 
1462
1463       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EXT_PLMN")) && (cur->ns == ns))
1464       {
1465          if(parsePlmn(doc, ns, cur, &srvdPlmn->extPlmn) != ROK)
1466          {
1467             return RFAILED;
1468          }
1469       }
1470
1471       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SLICE_SUPP_LST")) && (cur->ns == ns))
1472       {
1473          if(parseSupportedSliceList(doc, ns, cur, &srvdPlmn->taiSliceSuppLst) != ROK)
1474          {
1475             return RFAILED;
1476          }
1477       }
1478
1479       cur = cur -> next;
1480    }
1481    return ROK;
1482 }
1483
1484 /*******************************************************************
1485  *
1486  * @brief Fill cell information
1487  *
1488  * @details
1489  *
1490  *    Function : parseF1CellInfo
1491  *
1492  *    Functionality: Fill cell information
1493  *
1494  * @params[in] XML document pointer
1495  *             XML namespace
1496  *             Current node in XML
1497  *             Pointer to structure to be filled
1498  * @return ROK     - success
1499  *         RFAILED - failure
1500  *
1501  * ****************************************************************/
1502 uint8_t parseF1CellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1CellInfo *f1CellInfo)
1503 {
1504    memset(f1CellInfo, 0, sizeof(F1CellInfo));
1505    cur = cur->xmlChildrenNode;
1506    while(cur != NULL)
1507    {
1508       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_CGI")) && (cur->ns == ns))
1509       {
1510          if(parseNrCgi(doc, ns, cur, &f1CellInfo->nrCgi) != ROK)
1511          {
1512             return RFAILED;
1513          }
1514       }
1515
1516 #ifdef O1_ENABLE
1517       f1CellInfo->nrPci = cellParams.nRPCI;
1518 #else
1519       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_PCI")) && (cur->ns == ns))
1520       {
1521          f1CellInfo->nrPci = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1522       }
1523 #endif   
1524
1525       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SRVD_PLMN")) && (cur->ns == ns))
1526       {
1527          if(parseF1SrvdPlmn(doc, ns, cur, &f1CellInfo->srvdPlmn[0], 0) != ROK)
1528          {
1529             return RFAILED;
1530          }
1531       }
1532
1533       cur = cur -> next;
1534    }
1535    return ROK;
1536 }
1537
1538 /*******************************************************************
1539  *
1540  * @brief Fill Frequency Band
1541  *
1542  * @details
1543  *
1544  *    Function : parseF1FreqBand
1545  *
1546  *    Functionality: Fill Frequency Band
1547  *
1548  * @params[in] XML document pointer
1549  *             XML namespace
1550  *             Current node in XML
1551  *             Pointer to structure to be filled
1552  * @return ROK     - success
1553  *         RFAILED - failure
1554  *
1555  * ****************************************************************/
1556 uint8_t parseF1FreqBand(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1FreqBand *freqBand)
1557 {
1558    uint8_t sulIdx = 0;
1559    uint16_t sulValue = 0;
1560    xmlNodePtr child;
1561    xmlNodePtr sulChild;
1562
1563    memset(freqBand, 0, sizeof(F1FreqBand));
1564    cur = cur->xmlChildrenNode;
1565    while(cur != NULL)
1566    {
1567       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns))
1568       {
1569          freqBand->nrFreqBand = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1570       }
1571
1572       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUL_BAND_LIST")) && (cur->ns == ns))
1573       {
1574          child = cur->xmlChildrenNode;
1575          while (child != NULL) 
1576          {
1577             if ((!xmlStrcmp(child->name, (const xmlChar *)"LIST")) && (child->ns == ns)) 
1578             {
1579                sulChild = child->xmlChildrenNode;
1580                sulIdx = 0;
1581                while (sulChild != NULL) 
1582                {
1583                   if ((!xmlStrcmp(sulChild->name, (const xmlChar *)"SUL_BAND")) && (sulChild->ns == ns)) 
1584                   {
1585                      sulValue = atoi((char *)xmlNodeListGetString(doc, sulChild->xmlChildrenNode, 1));
1586                      if (sulIdx < MAX_NRCELL_BANDS) 
1587                      {
1588                         freqBand->sulBand[sulIdx] = sulValue;
1589                         sulIdx++;
1590                      } 
1591                      else 
1592                      {
1593                         DU_LOG("ERROR  -->  DU_APP : %s :  SUL_BAND array overflow\n", __func__);
1594                         return RFAILED;
1595                      }
1596                   }
1597                   sulChild = sulChild->next;
1598                }
1599             }
1600             child = child->next;
1601          }
1602       }
1603       cur = cur -> next;
1604    }
1605    return ROK;
1606 }
1607
1608 /*******************************************************************
1609  *
1610  * @brief Fill Frequency Band List
1611  *
1612  * @details
1613  *
1614  *    Function : parseF1FreqBandList
1615  *
1616  *    Functionality: Fill Frequency Band List
1617  *
1618  * @params[in] XML document pointer
1619  *             XML namespace
1620  *             Current node in XML
1621  *             Pointer to structure to be filled
1622  * @return ROK     - success
1623  *         RFAILED - failure
1624  *
1625  * ****************************************************************/
1626 uint8_t parseF1FreqBandList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFreqInfo *nrFreqInfo)
1627 {
1628    uint8_t idx = 0;
1629
1630    xmlNodePtr child;
1631    cur = cur->xmlChildrenNode;
1632    while(cur != NULL)
1633    {
1634       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns))
1635       {
1636          child = cur->xmlChildrenNode;
1637          while(child != NULL)
1638          {
1639             if ((!xmlStrcmp(child->name, (const xmlChar *)"F1_FREQ_BAND")) && (child->ns == ns))
1640             {
1641                if(parseF1FreqBand(doc, ns, child, &nrFreqInfo->freqBand[idx]) != ROK)
1642                {
1643                   return RFAILED;
1644                }
1645                idx++;
1646             }
1647             child = child -> next;
1648          }
1649       }
1650
1651       cur = cur -> next;
1652    }
1653    return ROK;
1654 }
1655
1656 /*******************************************************************
1657  *
1658  * @brief Fill Transmission Bandwidth
1659  *
1660  * @details
1661  *
1662  *    Function : parseF1TxBw
1663  *
1664  *    Functionality: Fill Transmission Bandwidth
1665  *
1666  * @params[in] XML document pointer
1667  *             XML namespace
1668  *             Current node in XML
1669  *             Pointer to structure to be filled
1670  * @return ROK     - success
1671  *         RFAILED - failure
1672  *
1673  * ****************************************************************/
1674 uint8_t parseF1TxBw(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1TxBw *txBw)
1675 {
1676    memset(txBw, 0, sizeof(F1TxBw));
1677    cur = cur->xmlChildrenNode;
1678    while(cur != NULL)
1679    {
1680       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_SCS")) && (cur->ns == ns))
1681       {
1682          txBw->nrScs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1683       }
1684
1685       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NRB")) && (cur->ns == ns))
1686       {
1687          txBw->nrb =  atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1688       }
1689
1690       cur = cur -> next;
1691    }
1692    return ROK;
1693 }
1694
1695 /*******************************************************************
1696  *
1697  * @brief Fill SUL Info
1698  *
1699  * @details
1700  *
1701  *    Function : parseF1SulInfo
1702  *
1703  *    Functionality: Fill SUL Info
1704  *
1705  * @params[in] XML document pointer
1706  *             XML namespace
1707  *             Current node in XML
1708  *             Pointer to structure to be filled
1709  * @return ROK     - success
1710  *         RFAILED - failure
1711  *
1712  * ****************************************************************/
1713 uint8_t parseF1SulInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1SulInfo *sulInfo)
1714 {
1715    memset(sulInfo, 0, sizeof(F1SulInfo));
1716    cur = cur->xmlChildrenNode;
1717    while(cur != NULL)
1718    {
1719       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUL_ARFCN")) && (cur->ns == ns))
1720       {
1721          sulInfo->sulArfcn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1722       }
1723
1724       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_TX_BW")) && (cur->ns == ns))
1725       {
1726          if(parseF1TxBw(doc, ns, cur, &sulInfo->sulTxBw) != ROK)
1727          {
1728             return RFAILED;
1729          }
1730       }
1731
1732       cur = cur -> next;
1733    }
1734    return ROK;
1735 }
1736
1737 /*******************************************************************
1738  *
1739  * @brief Fill NR Frequency Info 
1740  *
1741  * @details
1742  *
1743  *    Function : parseF1NrFreqInfo
1744  *
1745  *    Functionality: Fill NR Frequency Info
1746  *
1747  * @params[in] XML document pointer
1748  *             XML namespace
1749  *             Current node in XML
1750  *             Pointer to structure to be filled
1751  * @return ROK     - success
1752  *         RFAILED - failure
1753  *
1754  * ****************************************************************/
1755 uint8_t parseF1NrFreqInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFreqInfo *nrFreqInfo)
1756 {
1757    memset(nrFreqInfo, 0, sizeof(F1NrFreqInfo));
1758    cur = cur->xmlChildrenNode;
1759    while(cur != NULL)
1760    {
1761       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_ARFCN")) && (cur->ns == ns))
1762       {
1763          nrFreqInfo->nrArfcn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1764       }
1765
1766       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SUL_INFO")) && (cur->ns == ns))
1767       {
1768          if(parseF1SulInfo(doc, ns, cur, &nrFreqInfo->sulInfo) != ROK)
1769          {
1770             return RFAILED;
1771          }
1772       }
1773
1774       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_FREQ_BAND_LIST")) && (cur->ns == ns))
1775       {
1776          if(parseF1FreqBandList(doc, ns, cur, nrFreqInfo) != ROK)
1777          {
1778             return RFAILED;
1779          }
1780       }
1781
1782       cur = cur -> next;
1783    }
1784    return ROK;
1785 }
1786
1787 /*******************************************************************
1788  *
1789  * @brief Fill NR FDD Info
1790  *
1791  * @details
1792  *
1793  *    Function : parseF1NrFddInfo 
1794  *
1795  *    Functionality: Fill NR FDD Info
1796  *
1797  * @params[in] XML document pointer
1798  *             XML namespace
1799  *             Current node in XML
1800  *             Pointer to structure to be filled
1801  * @return ROK     - success
1802  *         RFAILED - failure
1803  *
1804  * ****************************************************************/
1805 uint8_t parseF1NrFddInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFddInfo *fddInfo)
1806 {
1807    memset(fddInfo, 0, sizeof(F1NrFddInfo));
1808    cur = cur->xmlChildrenNode;
1809    while(cur != NULL)
1810    {
1811       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FREQ_INFO_UL")) && (cur->ns == ns))
1812       {
1813          if(parseF1NrFreqInfo(doc, ns, cur, &fddInfo->ulNrFreqInfo) != ROK)
1814          {
1815             return RFAILED;
1816          }
1817       }
1818
1819       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FREQ_INFO_DL")) && (cur->ns == ns))
1820       {
1821          if(parseF1NrFreqInfo(doc, ns, cur, &fddInfo->dlNrFreqInfo) != ROK)
1822          {
1823             return RFAILED;
1824          }
1825       }
1826
1827       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_TX_BW_UL")) && (cur->ns == ns))
1828       {
1829          if(parseF1TxBw(doc, ns, cur, &fddInfo->ulTxBw) != ROK)
1830          {
1831             return RFAILED;
1832          }
1833       }
1834
1835       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_TX_BW_DL")) && (cur->ns == ns))
1836       {
1837          if(parseF1TxBw(doc, ns, cur, &fddInfo->dlTxBw) != ROK)
1838          {
1839             return RFAILED;
1840          }
1841       }
1842
1843       cur = cur -> next;
1844    }
1845    return ROK;
1846 }
1847
1848 /*******************************************************************
1849  *
1850  * @brief Fill NR TDD Info
1851  *
1852  * @details
1853  *
1854  *    Function : parseF1NrTddInfo
1855  *
1856  *    Functionality: Fill NR TDD Info
1857  *
1858  * @params[in] XML document pointer
1859  *             XML namespace
1860  *             Current node in XML
1861  *             Pointer to structure to be filled
1862  * @return ROK     - success
1863  *         RFAILED - failure
1864  *
1865  * ****************************************************************/
1866 uint8_t parseF1NrTddInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrTddInfo *tddInfo)
1867 {
1868    memset(tddInfo, 0, sizeof(F1NrTddInfo));
1869    cur = cur->xmlChildrenNode;
1870    while(cur != NULL)
1871    {
1872       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FREQ_INFO")) && (cur->ns == ns))
1873       {
1874          if(parseF1NrFreqInfo(doc, ns, cur, &tddInfo->nrFreqInfo) != ROK)
1875          {
1876             return RFAILED;
1877          }
1878       }
1879
1880       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_TX_BW")) && (cur->ns == ns))
1881       {
1882          if(parseF1TxBw(doc, ns, cur, &tddInfo->nrTxBw) != ROK)
1883          {
1884             return RFAILED;
1885          }
1886       }
1887
1888       cur = cur -> next;
1889    }
1890    return ROK;
1891 }
1892
1893 /*******************************************************************
1894  *
1895  * @brief Fill NR Mode Info
1896  *
1897  * @details
1898  *
1899  *    Function : parseNrModeInfo
1900  *
1901  *    Functionality: Fill NR Mode Info
1902  *
1903  * @params[in] XML document pointer
1904  *             XML namespace
1905  *             Current node in XML
1906  *             Pointer to structure to be filled
1907  * @return ROK     - success
1908  *         RFAILED - failure
1909  *
1910  * ****************************************************************/
1911 uint8_t parseNrModeInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, NrModeInfo *nrModeInfo)
1912 {
1913    char  modeCfg[10];
1914
1915    memset(nrModeInfo, 0, sizeof(NrModeInfo));
1916    cur = cur->xmlChildrenNode;
1917    while(cur != NULL)
1918    {
1919       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_MODE")) && (cur->ns == ns))
1920       {
1921          strcpy((char*)modeCfg, (char*)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));      
1922       }
1923
1924       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FDD_INFO")) && (cur->ns == ns))
1925       {
1926          if(strcmp(modeCfg, "FDD") == 0)
1927          {
1928             if(parseF1NrFddInfo(doc, ns, cur, &nrModeInfo->mode.fdd) != ROK)
1929             {
1930                return RFAILED;
1931             }
1932          }
1933       }
1934
1935       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_TDD_INFO")) && (cur->ns == ns))
1936       {
1937          if(strcmp(modeCfg, "TDD") == 0)
1938          {
1939             if(parseF1NrTddInfo(doc, ns, cur, &nrModeInfo->mode.tdd) != ROK)
1940             {
1941                return RFAILED;
1942             }
1943          }
1944       }
1945
1946       cur = cur -> next;
1947    }
1948    return ROK;
1949 }
1950
1951 /*******************************************************************
1952  *
1953  * @brief Fill Broadcast PLMN Information
1954  *
1955  * @details
1956  *
1957  *    Function : parseF1BrdcstPlmnInfo
1958  *
1959  *    Functionality: Fill Broadcast PLMN Information
1960  *
1961  * @params[in] XML document pointer
1962  *             XML namespace
1963  *             Current node in XML
1964  *             Pointer to structure to be filled
1965  * @return ROK     - success
1966  *         RFAILED - failure
1967  *
1968  * ****************************************************************/
1969 uint8_t parseF1BrdcstPlmnInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1BrdcstPlmnInfo *brdcstPlmnInfo)
1970 {
1971    memset(brdcstPlmnInfo, 0, sizeof(F1BrdcstPlmnInfo));
1972    cur = cur->xmlChildrenNode;
1973    while(cur != NULL)
1974    {
1975       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
1976       {
1977          if(parsePlmn(doc, ns, cur, &brdcstPlmnInfo->plmn[0]) != ROK)
1978          {
1979             return RFAILED;
1980          }
1981       }
1982
1983       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EXT_PLMN")) && (cur->ns == ns))
1984       {
1985          if(parsePlmn(doc, ns, cur, &brdcstPlmnInfo->extPlmn[0]) != ROK)
1986          {
1987             return RFAILED;
1988          }
1989       } 
1990
1991       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
1992       {
1993          brdcstPlmnInfo->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1994       }
1995
1996       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_CELL_ID")) && (cur->ns == ns))
1997       {
1998          brdcstPlmnInfo->nrCellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1999       }
2000
2001       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_RANAC")) && (cur->ns == ns))
2002       {
2003          brdcstPlmnInfo->ranac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2004       }
2005
2006       cur = cur -> next;
2007    }
2008    return ROK;
2009 }
2010
2011 /*******************************************************************
2012  *
2013  * @brief Fill DU Cell Information 
2014  *
2015  * @details
2016  *
2017  *    Function : parseF1DuCellInfo
2018  *
2019  *    Functionality: Fill DU Cell Information
2020  *
2021  * @params[in] XML document pointer
2022  *             XML namespace
2023  *             Current node in XML
2024  *             Pointer to structure to be filled
2025  * @return ROK     - success
2026  *         RFAILED - failure
2027  *
2028  * ****************************************************************/
2029 uint8_t parseF1DuCellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1DuCellInfo *duCellInfo)
2030 {
2031    memset(duCellInfo, 0, sizeof(F1DuCellInfo));
2032    cur = cur->xmlChildrenNode;
2033    while(cur != NULL)
2034    {
2035       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_CELL_INFO")) && (cur->ns == ns))
2036       {
2037          if(parseF1CellInfo(doc, ns, cur, &duCellInfo->cellInfo) != ROK)
2038          {
2039             return RFAILED;
2040          }
2041       }
2042
2043       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
2044       {
2045          duCellInfo->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2046       }
2047
2048       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EPS_TAC")) && (cur->ns == ns))
2049       {
2050          duCellInfo->epsTac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2051       }
2052
2053       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_MODE_INFO")) && (cur->ns == ns))
2054       {
2055          if(parseNrModeInfo(doc, ns, cur, &duCellInfo->f1Mode) != ROK)
2056          {
2057             return RFAILED;
2058          }
2059       }
2060
2061       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIME_CFG")) && (cur->ns == ns))
2062       {
2063          duCellInfo->measTimeCfgDuration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2064       }
2065
2066       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_CELL_DIR")) && (cur->ns == ns))
2067       {
2068          duCellInfo->cellDir = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2069       }
2070
2071       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_CELL_TYPE")) && (cur->ns == ns))
2072       {
2073          duCellInfo->cellType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2074       }
2075
2076       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_BRDCST_PLMN_INFO")) && (cur->ns == ns))
2077       {
2078          if(parseF1BrdcstPlmnInfo(doc, ns, cur, &duCellInfo->brdcstPlmnInfo[0]) != ROK)
2079          {
2080             return RFAILED;
2081          }
2082       }
2083
2084       cur = cur -> next;
2085    }
2086    return ROK;
2087 }
2088
2089 /*******************************************************************
2090  *
2091  * @brief Fill DU served cell information 
2092  *
2093  * @details
2094  *
2095  *    Function : parseF1DuServedCellInfo
2096  *
2097  *    Functionality: Fill DU served cell information
2098  *
2099  * @params[in] XML document pointer
2100  *             XML namespace
2101  *             Current node in XML
2102  *             Pointer to structure to be filled
2103  * @return ROK     - success
2104  *         RFAILED - failure
2105  *
2106  * ****************************************************************/
2107 uint8_t parseF1DuServedCellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1DuSrvdCellInfo *srvdCellInfo)
2108 {
2109    memset(srvdCellInfo, 0, sizeof(F1DuSrvdCellInfo));
2110    cur = cur->xmlChildrenNode;
2111    while(cur != NULL)
2112    {
2113       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_DU_CELL_INFO")) && (cur->ns == ns))
2114       {
2115          if(parseF1DuCellInfo(doc, ns, cur, &srvdCellInfo->duCellInfo) != ROK)
2116          {
2117             return RFAILED;
2118          }
2119       }
2120       cur = cur -> next;
2121    }
2122
2123    if(fillDuSrvdCellSysInfo(&srvdCellInfo->duSysInfo) != ROK)
2124    {
2125       return RFAILED;
2126    }
2127    return ROK;
2128 }
2129
2130 /*******************************************************************
2131  *
2132  * @brief Fill DU Served Cell System Information
2133  *
2134  * @details
2135  *
2136  *    Function : fillDuSrvdCellSysInfo
2137  *
2138  *    Functionality: Fill DU Served Cell System Information
2139  *
2140  * @params[in] Served Cell System Information
2141  * @return ROK     - success
2142  *         RFAILED - failure
2143  *
2144  * ****************************************************************/
2145 uint8_t fillDuSrvdCellSysInfo(F1DuSysInfo *sysInfo)
2146 {
2147    /* GNB DU System Info MIB msg */
2148    BuildMibMsg();
2149    DU_ALLOC(sysInfo->mibMsg, encBufSize);
2150    if(!(sysInfo->mibMsg))
2151    {
2152       DU_LOG("\nERROR  -->  DU APP : %s : Memory allocation failure at line %d", __func__, __LINE__);
2153       return RFAILED;
2154    }
2155    memcpy(sysInfo->mibMsg, encBuf, encBufSize);
2156    sysInfo->mibLen = encBufSize;
2157
2158    /* GNB DU System Info SIB1 msg */
2159    BuildSib1Msg();
2160    DU_ALLOC(sysInfo->sib1Msg, encBufSize);
2161    if(!(sysInfo->sib1Msg))
2162    {
2163       DU_LOG("\nERROR  -->  DU APP : %s : Memory allocation failure at line %d", __func__, __LINE__);
2164       return RFAILED;
2165    }
2166    memcpy(sysInfo->sib1Msg, encBuf,encBufSize);
2167    sysInfo->sib1Len = encBufSize;
2168
2169    return ROK;
2170 }
2171
2172 #ifdef O1_ENABLED
2173 /*******************************************************************
2174  *
2175  * @brief Fill PLMN received from O1 interface
2176  *
2177  * @details
2178  *
2179  *    Function : fillPlmnFromO1
2180  *
2181  *    Functionality: Fill PLMN received from O1 interface
2182  *
2183  * @params[in] XML document pointer
2184  *             XML namespace
2185  *             Current node in XML
2186  *             Pointer to structure to be filled
2187  * @return ROK     - success
2188  *         RFAILED - failure
2189  *
2190  * ****************************************************************/
2191 void fillPlmnFromO1(Plmn *PLMN, uint8_t srvdPlmnIdx)
2192 {
2193    PLMN->mcc[0] = cellParams.plmnList[srvdPlmnIdx].mcc[0];
2194    PLMN->mcc[1] = cellParams.plmnList[srvdPlmnIdx].mcc[1];
2195    PLMN->mcc[2] = cellParams.plmnList[srvdPlmnIdx].mcc[2];
2196    PLMN->mnc[0] = cellParams.plmnList[srvdPlmnIdx].mnc[0];
2197    PLMN->mnc[1] = cellParams.plmnList[srvdPlmnIdx].mnc[1];
2198    PLMN->mnc[2] = cellParams.plmnList[srvdPlmnIdx].mnc[2];
2199 }
2200 #endif
2201
2202 /*******************************************************************
2203  *
2204  * @brief Fill Beamforming Configuration
2205  *
2206  * @details
2207  *
2208  *    Function : parseBeamformingConfig
2209  *
2210  *    Functionality: Fill Beamforming Configuration
2211  *
2212  * @params[in] XML document pointer
2213  *             XML namespace
2214  *             Current node in XML
2215  *             Pointer to structure to be filled
2216  * @return ROK     - success
2217  *         RFAILED - failure
2218  *
2219  * ****************************************************************/
2220 uint8_t parseBeamformingConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, BeamformingConf *beamformingCfg)
2221 {
2222    memset(beamformingCfg, 0, sizeof(BeamformingConf));
2223    cur = cur -> xmlChildrenNode;
2224    while(cur != NULL)
2225    {
2226       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_BEAMS")) && (cur->ns == ns))
2227       {
2228          beamformingCfg->numOfBeams = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2229       }
2230
2231       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TX_RUS")) && (cur->ns == ns))
2232       {
2233          beamformingCfg->numTxRUs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2234       }
2235
2236       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_IDX")) && (cur->ns == ns))
2237       {
2238          beamformingCfg->beamIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2239       }
2240
2241       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_TYPE")) && (cur->ns == ns))
2242       {
2243          beamformingCfg->beamType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2244       }
2245
2246       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_AZIMUTH")) && (cur->ns == ns))
2247       {
2248          beamformingCfg->beamAzimuth = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2249       }
2250
2251       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_TILT")) && (cur->ns == ns))
2252       {
2253          beamformingCfg->beamTilt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2254       }
2255
2256       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_HORIZ_WIDTH")) && (cur->ns == ns))
2257       {
2258          beamformingCfg->beamHorizWidth = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2259       }
2260
2261       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_VERT_WIDTH")) && (cur->ns == ns))
2262       {
2263          beamformingCfg->beamVertWidth = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2264       }
2265
2266       if ((!xmlStrcmp(cur->name, (const xmlChar *)"COVER_SHAPE")) && (cur->ns == ns))
2267       {
2268          beamformingCfg->coverageShape = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2269       }
2270
2271       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DIGI_TILT")) && (cur->ns == ns))
2272       {
2273          beamformingCfg->digitalTilt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2274       }
2275
2276       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DIGI_AZIMUTH")) && (cur->ns == ns))
2277       {
2278          beamformingCfg->digitalAzimuth = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2279       }
2280
2281       cur = cur -> next;
2282    }
2283    return ROK;
2284 }
2285
2286 /*******************************************************************
2287  *
2288  * @brief Fill Precoding Configuration
2289  *
2290  * @details
2291  *
2292  *    Function : parsePrecodingConfig
2293  *
2294  *    Functionality:  Fill Precoding Configuration
2295  *
2296  * @params[in] XML document pointer
2297  *             XML namespace
2298  *             Current node in XML
2299  *             Pointer to structure to be filled
2300  * @return ROK     - success
2301  *         RFAILED - failure
2302  *
2303  * ****************************************************************/
2304 uint8_t parsePrecodingConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PrecodingConf *precodCfg)
2305 {
2306    memset(precodCfg, 0, sizeof(PrecodingConf));
2307    cur = cur -> xmlChildrenNode;
2308    while(cur != NULL)
2309    {
2310       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_LAYERS")) && (cur->ns == ns))
2311       {
2312          precodCfg->numLayers = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2313       }
2314
2315       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_ANT_PORTS")) && (cur->ns == ns))
2316       {
2317          precodCfg->numAntPorts  = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2318       }
2319
2320       cur = cur -> next;
2321    }
2322    return ROK;
2323 }
2324
2325 /*******************************************************************
2326  *
2327  * @brief Fill PRACH FDM Information
2328  *
2329  * @details
2330  *
2331  *    Function : parsePrachFdmInfo
2332  *
2333  *    Functionality: Fill PRACH FDM Information
2334  *
2335  * @params[in] XML document pointer
2336  *             XML namespace
2337  *             Current node in XML
2338  *             Pointer to structure to be filled
2339  * @return ROK     - success
2340  *         RFAILED - failure
2341  *
2342  * ****************************************************************/
2343 uint8_t parsePrachFdmInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PrachFdmInfo *prachFdmInfo)
2344 {
2345    memset(prachFdmInfo, 0, sizeof(PrachFdmInfo));
2346    cur = cur -> xmlChildrenNode;
2347    while(cur != NULL)
2348    {
2349       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX")) && (cur->ns == ns))
2350       {
2351          prachFdmInfo->rootSeqIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2352       }
2353
2354       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_ROOT_SEQ")) && (cur->ns == ns))
2355       {
2356          prachFdmInfo->numRootSeq = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2357       }
2358
2359       if ((!xmlStrcmp(cur->name, (const xmlChar *)"K1")) && (cur->ns == ns))
2360       {
2361          prachFdmInfo->k1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2362       }
2363
2364       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ZERO_CORR_ZONE_CFG")) && (cur->ns == ns))
2365       {
2366          prachFdmInfo->zeroCorrZoneCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2367       }
2368
2369       cur = cur -> next;
2370    }
2371    return ROK;
2372 }
2373
2374 /*******************************************************************
2375  *
2376  * @brief Fill PRACH configuration
2377  *
2378  * @details
2379  *
2380  *    Function : parsePrachCfg
2381  *
2382  *    Functionality: Fill PRACH configuration
2383  *
2384  * @params[in] XML document pointer
2385  *             XML namespace
2386  *             Current node in XML
2387  *             Pointer to structure to be filled
2388  * @return ROK     - success
2389  *         RFAILED - failure
2390  *
2391  * ****************************************************************/
2392 uint8_t parsePrachCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PrachCfg *prachCfg)
2393 {
2394    xmlNodePtr child;
2395    uint8_t fdmIdx = 0;
2396    uint8_t maxNumRbs = 0;
2397    uint8_t prachMaxPrb = 0;
2398
2399    memset(prachCfg, 0, sizeof(PrachCfg));
2400    cur = cur -> xmlChildrenNode;
2401    while(cur != NULL)
2402    {
2403       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_SEQ_LEN")) && (cur->ns == ns))
2404       {
2405          prachCfg->prachSeqLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2406       }
2407
2408       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
2409       {
2410          prachCfg->prachSubcSpacing = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2411       }
2412
2413       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CONFIG_IDX")) && (cur->ns == ns))
2414       {
2415          prachCfg->prachCfgIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2416       }
2417
2418       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PRACH_FDM")) && (cur->ns == ns))
2419       {
2420          prachCfg->msg1Fdm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2421       }
2422
2423       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FDM_LIST")) && (cur->ns == ns))
2424       {
2425          child = cur->xmlChildrenNode;
2426          while(child != NULL)
2427          {
2428             if ((!xmlStrcmp(child->name, (const xmlChar *)"FDM_INFO")) && (child->ns == ns))
2429             {
2430                if(parsePrachFdmInfo(doc, ns, child, &prachCfg->fdm[fdmIdx]) != ROK)
2431                {
2432                   return RFAILED;
2433                }
2434                fdmIdx++;
2435             }
2436             child = child -> next;
2437          }
2438       }
2439
2440       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_RESTRICTED_SET_CFG")) && (cur->ns == ns))
2441       {
2442          prachCfg->prachRstSetCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2443       }
2444
2445       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PER_RACH")) && (cur->ns == ns))
2446       {
2447          prachCfg->ssbPerRach = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2448       }
2449
2450       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RA_PREAMBLE")) && (cur->ns == ns))
2451       {
2452          prachCfg->totalNumRaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2453       }
2454
2455       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CB_PREAMBLE_PER_SSB")) && (cur->ns == ns))
2456       {
2457          prachCfg->totalNumRaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2458       }
2459
2460       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_RB")) && (cur->ns == ns))
2461       {
2462          maxNumRbs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2463       }
2464
2465       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_MAX_PRB")) && (cur->ns == ns))
2466       {
2467          prachMaxPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2468       }
2469
2470       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RSRP_THRESHOLD_SSB")) && (cur->ns == ns))
2471       {
2472          prachCfg->rsrpThreshSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2473       }
2474
2475       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_RSP_WINDOW")) && (cur->ns == ns))
2476       {
2477          prachCfg->raRspWindow = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2478       }
2479
2480       cur = cur -> next;
2481    }
2482
2483    prachCfg->msg1FreqStart = maxNumRbs - prachMaxPrb;
2484    return ROK;
2485 }
2486
2487 /*******************************************************************
2488  *
2489  * @brief Fill CSI RS configuration
2490  *
2491  * @details
2492  *
2493  *    Function : parseCsiRsCfg
2494  *
2495  *    Functionality: Fill CSI RS configuration
2496  *
2497  * @params[in] XML document pointer
2498  *             XML namespace
2499  *             Current node in XML
2500  *             Pointer to structure to be filled
2501  * @return ROK     - success
2502  *         RFAILED - failure
2503  *
2504  * ****************************************************************/
2505 uint8_t parseCsiRsCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CsiRsCfg *csiRsCfg)
2506 {
2507    memset(csiRsCfg, 0, sizeof(CsiRsCfg));
2508    cur = cur -> xmlChildrenNode;
2509    while(cur != NULL)
2510    {
2511       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_FREQ")) && (cur->ns == ns))
2512       {
2513          csiRsCfg->csiFreqDomainAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2514       }
2515
2516       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_PORTS")) && (cur->ns == ns))
2517       {
2518          csiRsCfg->csiNrofPorts = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2519       }
2520
2521       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_OFDM_PORT")) && (cur->ns == ns))
2522       {
2523          csiRsCfg->csirsfirstOFDMSymbolInTimeDomain = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2524       }
2525
2526       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_OFDM_PORT_2")) && (cur->ns == ns))
2527       {
2528          csiRsCfg->csirsfirstOFDMSymbolInTimeDomain2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2529       }
2530
2531       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DM_TYPE")) && (cur->ns == ns))
2532       {
2533          csiRsCfg->csirscdmType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2534       }
2535
2536       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DENSITY")) && (cur->ns == ns))
2537       {
2538          csiRsCfg->csirsdensity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2539       }
2540
2541       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DENSITY_DOT_5")) && (cur->ns == ns))
2542       {
2543          csiRsCfg->csirsdensitydot5 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2544       }
2545
2546       if ((!xmlStrcmp(cur->name, (const xmlChar *)"POWER_CONTROL_OFFSET")) && (cur->ns == ns))
2547       {
2548          csiRsCfg->powerControlOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2549       }
2550
2551       if ((!xmlStrcmp(cur->name, (const xmlChar *)"POWER_CONTROL_OFFSET_SS")) && (cur->ns == ns))
2552       {
2553          csiRsCfg->powerControlOffsetSS = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2554       }
2555
2556       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PERIODICITY_OFFSET")) && (cur->ns == ns))
2557       {
2558          csiRsCfg->periodicityAndOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2559       }
2560
2561       cur = cur -> next;
2562    }
2563    return ROK;
2564 }
2565
2566 /*******************************************************************
2567  *
2568  * @brief Fill SSB Configuration
2569  *
2570  * @details
2571  *
2572  *    Function : parseSsbCfg
2573  *
2574  *    Functionality: Fill SSB Configuration
2575  *
2576  * @params[in] XML document pointer
2577  *             XML namespace
2578  *             Current node in XML
2579  *             Pointer to structure to be filled
2580  * @return ROK     - success
2581  *         RFAILED - failure
2582  *
2583  * ****************************************************************/
2584 uint8_t parseSsbCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SsbCfg *ssbCfg)
2585 {
2586    xmlNodePtr child;
2587    uint8_t ssbMaskIdx = 0;
2588
2589    memset(ssbCfg, 0, sizeof( SsbCfg));
2590    cur = cur -> xmlChildrenNode;
2591    while(cur != NULL)
2592    {
2593       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBSC_PWR")) && (cur->ns == ns))
2594       {
2595          ssbCfg->ssbPbchPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2596       }
2597
2598       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_CMN")) && (cur->ns == ns))
2599       {
2600          ssbCfg->scsCmn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2601       }
2602
2603       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_OFF_PT_A")) && (cur->ns == ns))
2604       {
2605          ssbCfg->ssbOffsetPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2606       }
2607
2608       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIOD")) && (cur->ns == ns))
2609       {
2610          ssbCfg->ssbPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2611       }
2612
2613       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SC_OFF")) && (cur->ns == ns))
2614       {
2615          ssbCfg->ssbScOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2616       }
2617
2618       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_LIST")) && (cur->ns == ns))
2619       {
2620          child = cur -> xmlChildrenNode;
2621          while(child != NULL)
2622          {
2623             if ((!xmlStrcmp(child->name, (const xmlChar *)"SSB_MASK")) && (child->ns == ns))
2624             {
2625                ssbCfg->ssbMask[ssbMaskIdx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
2626                ssbMaskIdx++;
2627             }
2628             child = child -> next;
2629          }
2630       }
2631
2632       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_ID")) && (cur->ns == ns))
2633       {
2634          ssbCfg->beamId[0] = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2635       }
2636
2637       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BETA_PSS")) && (cur->ns == ns))
2638       {
2639          ssbCfg->betaPss = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2640       }
2641
2642       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCH_PAY_FLAG")) && (cur->ns == ns))
2643       {
2644          ssbCfg->bchPayloadFlag = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2645       }
2646
2647       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DMRS_TYPE_A_PROS")) && (cur->ns == ns))
2648       {
2649          ssbCfg->dmrsTypeAPos = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2650       }
2651
2652       cur = cur -> next;
2653    }
2654    return ROK;
2655 }
2656
2657 /*******************************************************************
2658  *
2659  * @brief Fill Carrier Configuration
2660  *
2661  * @details
2662  *
2663  *    Function : parseCarrierCfg
2664  *
2665  *    Functionality: Fill Carrier Configuration
2666  *
2667  * @params[in] XML document pointer
2668  *             XML namespace
2669  *             Current node in XML
2670  *             Pointer to structure to be filled
2671  * @return ROK     - success
2672  *         RFAILED - failure
2673  *
2674  * ****************************************************************/
2675 uint8_t parseCarrierCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CarrierCfg *carrierCfg)
2676 {
2677    memset(carrierCfg, 0, sizeof(CarrierCfg));
2678    cur = cur -> xmlChildrenNode;
2679    while(cur != NULL)
2680    {
2681       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DL_BW")) && (cur->ns == ns))
2682       {
2683          carrierCfg->dlBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2684       }
2685
2686       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_DL_ARFCN")) && (cur->ns == ns))
2687       {
2688          carrierCfg->arfcnDL = convertArfcnToFreqKhz(atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)));
2689       }
2690
2691       if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_BW")) && (cur->ns == ns))
2692       {
2693          carrierCfg->ulBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2694       }
2695
2696       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_UL_ARFCN")) && (cur->ns == ns))
2697       {
2698          carrierCfg->arfcnUL = convertArfcnToFreqKhz(atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)));
2699       }
2700
2701       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TX_ANT")) && (cur->ns == ns))
2702       {
2703          carrierCfg->numTxAnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2704       }
2705
2706       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RX_ANT")) && (cur->ns == ns))
2707       {
2708          carrierCfg->numRxAnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2709       }
2710
2711       cur = cur -> next;
2712    }
2713    return ROK;
2714 }
2715
2716 /*******************************************************************
2717  *
2718  * @brief Fill PLMN Information List
2719  *
2720  * @details
2721  *
2722  *    Function : parsePlmnInfo
2723  *
2724  *    Functionality: Fill PLMN Information List
2725  *
2726  * @params[in] XML document pointer
2727  *             XML namespace
2728  *             Current node in XML
2729  *             Pointer to structure to be filled
2730  * @return ROK     - success
2731  *         RFAILED - failure
2732  *
2733  * ****************************************************************/
2734 uint8_t parsePlmnInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PlmnInfoList *plmnInfoList)
2735 {
2736
2737    memset(plmnInfoList, 0, sizeof(PlmnInfoList));
2738    cur = cur -> xmlChildrenNode;
2739    while(cur != NULL)
2740    {
2741       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
2742       {
2743          if(parsePlmn(doc, ns, cur,&plmnInfoList->plmn) != ROK)
2744          {
2745             return RFAILED;
2746          }
2747       }
2748
2749       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SLICE_SUPP_LST")) && (cur->ns == ns))
2750       {
2751          if(parseSupportedSliceList(doc, ns, cur,&plmnInfoList -> suppSliceList) != ROK)
2752          {
2753             return RFAILED;
2754          }
2755       }
2756
2757       cur = cur -> next;
2758    }
2759    return ROK;
2760 }
2761
2762 /*******************************************************************
2763  *
2764  * @brief Fill PUCCH Configuration Common
2765  *
2766  * @details
2767  *
2768  *    Function : parsePucchConfigCommon
2769  *
2770  *    Functionality: Fill PUCCH Configuration Common
2771  *
2772  * @params[in] XML document pointer
2773  *             XML namespace
2774  *             Current node in XML
2775  *             Pointer to structure to be filled
2776  * @return ROK     - success
2777  *         RFAILED - failure
2778  *
2779  * ****************************************************************/
2780 uint8_t parsePucchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PucchConfigCommon *pucchCfgCmn)
2781 {
2782    memset(pucchCfgCmn, 0, sizeof(PucchConfigCommon));
2783    cur = cur -> xmlChildrenNode;
2784    while(cur != NULL)
2785    {
2786       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_RSRC_COMMON")) && (cur->ns == ns))
2787       {
2788          pucchCfgCmn->pucchResourceCommon = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2789       }
2790
2791       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_NEITHER_HOPPING")) && (cur->ns == ns))
2792       {
2793          pucchCfgCmn->pucchGroupHopping = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2794       }
2795
2796       cur = cur -> next;
2797    }
2798    return ROK;
2799 }
2800
2801 /*******************************************************************
2802  *
2803  * @brief Fill PUSCH Common Time Allocation
2804  *
2805  * @details
2806  *
2807  *    Function :  parsePuschTimeDomRsrcAlloc
2808  *
2809  *    Functionality: Fill PUSCH Common Time Allocation
2810  *
2811  * @params[in] XML document pointer
2812  *             XML namespace
2813  *             Current node in XML
2814  *             Pointer to structure to be filled
2815  * @return ROK     - success
2816  *         RFAILED - failure
2817  *
2818  * ****************************************************************/
2819 uint8_t parsePuschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschTimeDomRsrcAlloc *puschTimeDomRsrsAlloc)
2820 {
2821    memset(puschTimeDomRsrsAlloc, 0, sizeof(PuschTimeDomRsrcAlloc));
2822    cur = cur -> xmlChildrenNode;
2823    while(cur != NULL)
2824    {
2825       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_K2_CFG")) && (cur->ns == ns))
2826       {
2827          puschTimeDomRsrsAlloc->k2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2828       }
2829
2830       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_MAPPING_TYPE")) && (cur->ns == ns))
2831       {
2832          puschTimeDomRsrsAlloc->mappingType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2833       }
2834
2835       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_START_SYMBOL")) && (cur->ns == ns))
2836       {
2837          puschTimeDomRsrsAlloc->startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2838       }
2839
2840       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
2841       {
2842          puschTimeDomRsrsAlloc->symbolLength= atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2843       }
2844
2845       cur = cur -> next;
2846    }
2847
2848    puschTimeDomRsrsAlloc -> startSymbolAndLength = \
2849       calcSliv(puschTimeDomRsrsAlloc->startSymbol, puschTimeDomRsrsAlloc->symbolLength);
2850    return ROK;
2851 }
2852
2853 /*******************************************************************
2854  *
2855  * @brief Fill PUSCH Configuration Common 
2856  *
2857  * @details
2858  *
2859  *    Function : parsePuschConfigCommon
2860  *
2861  *    Functionality: Fill PUSCH Configuration Common
2862  *
2863  * @params[in] XML document pointer
2864  *             XML namespace
2865  *             Current node in XML
2866  *             Pointer to structure to be filled
2867  * @return ROK     - success
2868  *         RFAILED - failure
2869  *
2870  * ****************************************************************/
2871 uint8_t parsePuschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschConfigCommon *puschCfgCmn)
2872 {
2873    uint8_t idx = 0;
2874    xmlNodePtr child = NULLP;
2875    xmlNodePtr pdschNode = NULLP;
2876
2877    memset(puschCfgCmn, 0, sizeof(PuschConfigCommon));
2878    cur = cur -> xmlChildrenNode;
2879    while(cur != NULL)
2880    {
2881       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns))
2882       {
2883          puschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2884       }
2885
2886       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC_LIST")) && (cur->ns == ns))
2887       {
2888          child = cur->xmlChildrenNode;
2889          while(child != NULL)
2890          {
2891             if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns))
2892             {
2893                pdschNode = child->xmlChildrenNode;
2894                while(pdschNode != NULL)
2895                {
2896                   if ((!xmlStrcmp(pdschNode->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC")) && (pdschNode->ns == ns))
2897                   {
2898                      if(parsePuschTimeDomRsrcAlloc(doc, ns, child,&puschCfgCmn->timeDomRsrcAllocList[idx]) != ROK)
2899                      {
2900                         return RFAILED;
2901                      }
2902                      idx++;
2903                   }
2904                   pdschNode = pdschNode -> next;
2905                }
2906             }
2907
2908             child = child -> next;
2909          }
2910       }
2911       cur = cur -> next;
2912    }
2913    return ROK;
2914 }
2915
2916 /*******************************************************************
2917  *
2918  * @brief Fill BWP Configuration
2919  *
2920  * @details
2921  *
2922  *    Function : parseBwp
2923  *
2924  *    Functionality: Fill BWP Configuration
2925  *
2926  * @params[in] XML document pointer
2927  *             XML namespace
2928  *             Current node in XML
2929  *             Pointer to structure to be filled
2930  * @return ROK     - success
2931  *         RFAILED - failure
2932  *
2933  * ****************************************************************/
2934 uint8_t parseBwp(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpParams *bwp)
2935 {
2936    memset(bwp, 0, sizeof(BwpParams));
2937    cur = cur -> xmlChildrenNode;
2938    while(cur != NULL)
2939    {
2940       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PRB")) && (cur->ns == ns))
2941       {
2942          bwp->firstPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2943       }
2944
2945       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PRB")) && (cur->ns == ns))
2946       {
2947          bwp->numPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2948       }
2949
2950       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
2951       {
2952          bwp->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2953       }
2954
2955       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NORMAL_CYCLIC_PREFIX")) && (cur->ns == ns))
2956       {
2957          bwp->cyclicPrefix = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2958       }
2959
2960       cur = cur -> next;
2961    }
2962    return ROK;
2963 }
2964
2965 /*******************************************************************
2966  *
2967  * @brief Fill UL BWP Configuration
2968  *
2969  * @details
2970  *
2971  *    Function : parseBwpULConfig 
2972  *
2973  *    Functionality: Fill UL BWP Configuration
2974  *
2975  * @params[in] XML document pointer
2976  *             XML namespace
2977  *             Current node in XML
2978  *             Pointer to structure to be filled
2979  * @return ROK     - success
2980  *         RFAILED - failure
2981  *
2982  * ****************************************************************/
2983 uint8_t parseBwpULConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpUlConfig *bwpUlCfg)
2984 {
2985    memset(bwpUlCfg, 0, sizeof(BwpUlConfig));
2986    cur = cur -> xmlChildrenNode;
2987    while(cur != NULL)
2988    {
2989       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_PARAMS")) && (cur->ns == ns))
2990       {
2991          if(parseBwp(doc, ns, cur, &bwpUlCfg->bwp) != ROK)
2992          {
2993             return RFAILED;
2994          }
2995       }
2996
2997       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_CFG_COMMON")) && (cur->ns == ns))
2998       {
2999          if(parsePucchConfigCommon(doc, ns, cur, &bwpUlCfg->pucchCommon) != ROK)
3000          {
3001             return RFAILED;
3002          }
3003       }
3004
3005       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_COMMON")) && (cur->ns == ns))
3006       {
3007          if(parsePuschConfigCommon(doc, ns, cur, &bwpUlCfg->puschCommon) != ROK)
3008          {
3009             return RFAILED;
3010          }
3011       }
3012       cur = cur -> next;
3013    }
3014    return ROK;
3015 }
3016
3017 /*******************************************************************
3018  *
3019  * @brief Fill Page Configuration
3020  *
3021  * @details
3022  *
3023  *    Function : parsePageCfg
3024  *
3025  *    Functionality: Fill Page Configuration
3026  *
3027  * @params[in] XML document pointer
3028  *             XML namespace
3029  *             Current node in XML
3030  *             Pointer to structure to be filled
3031  * @return ROK     - success
3032  *         RFAILED - failure
3033  *
3034  * ****************************************************************/
3035 uint8_t parsePageCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SchPageCfg *pageCfg)
3036 {
3037    char *poPresent;
3038
3039    memset(pageCfg, 0, sizeof(SchPageCfg));
3040    cur = cur -> xmlChildrenNode;
3041    while(cur != NULL)
3042    {
3043       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PO")) && (cur->ns == ns))
3044       {
3045          pageCfg->numPO = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3046       }
3047
3048       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PO_PRESENT")) && (cur->ns == ns))
3049       {
3050          poPresent = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
3051          if(!strcmp(poPresent, "TRUE"))
3052          {
3053             pageCfg->poPresent = true;
3054          }
3055          else
3056          {
3057             pageCfg->poPresent = false;
3058          }
3059       }
3060
3061       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PAGING_OCC")) && (cur->ns == ns))
3062       {
3063          pageCfg->pagingOcc[0] = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3064       }
3065
3066       cur = cur -> next;
3067    }
3068    return ROK;
3069 }
3070
3071 /*******************************************************************
3072  *
3073  * @brief Fill SIB1 PDCCH Configuration
3074  *
3075  * @details
3076  *
3077  *    Function : parsePdcchCfgSib1
3078  *
3079  *    Functionality: Fill SIB1 PDCCH Configuration
3080  *
3081  * @params[in] XML document pointer
3082  *             XML namespace
3083  *             Current node in XML
3084  *             Pointer to structure to be filled
3085  * @return ROK     - success
3086  *         RFAILED - failure
3087  *
3088  * ****************************************************************/
3089 uint8_t parsePdcchCfgSib1(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfigSib1 *pdcchConfigSib1)
3090 {
3091    memset(pdcchConfigSib1, 0, sizeof(PdcchConfigSib1));
3092    cur = cur -> xmlChildrenNode;
3093    while(cur != NULL)
3094    {
3095       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_ZERO_INDEX")) && (cur->ns == ns))
3096       {
3097          pdcchConfigSib1->coresetZeroIndex = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3098       }
3099
3100       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_ZERO_INDEX")) && (cur->ns == ns))
3101       {
3102          pdcchConfigSib1->searchSpaceZeroIndex = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3103       }
3104
3105       cur = cur -> next;
3106    }
3107    return ROK;
3108 }
3109
3110 /*******************************************************************
3111  *
3112  * @brief Fill SIB1 Cell Configuration
3113  *
3114  * @details
3115  *
3116  *    Function : parseSib1CellCfg 
3117  *
3118  *    Functionality: Fill SIB1 Cell Configuration
3119  *
3120  * @params[in] XML document pointer
3121  *             XML namespace
3122  *             Current node in XML
3123  *             Pointer to structure to be filled
3124  * @return ROK     - success
3125  *         RFAILED - failure
3126  *
3127  * ****************************************************************/
3128 uint8_t parseSib1CellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Sib1CellCfg *sib1CellCfg)
3129 {
3130    memset(sib1CellCfg, 0, sizeof( Sib1CellCfg));
3131    cur = cur -> xmlChildrenNode;
3132    while(cur != NULL)
3133    {
3134       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCH_PAGE_CFG")) && (cur->ns == ns))
3135       {
3136          if(parsePageCfg(doc, ns, cur, &sib1CellCfg->pagingCfg) != ROK)
3137          {
3138             return RFAILED;
3139          }
3140       }
3141
3142       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CONFIG_SIB1")) && (cur->ns == ns))
3143       {
3144          if(parsePdcchCfgSib1(doc, ns, cur, &sib1CellCfg->pdcchCfgSib1) != ROK)
3145          {
3146             return RFAILED;
3147          }
3148       }
3149
3150       cur = cur -> next;
3151    }
3152    return ROK;
3153 }
3154
3155 /*******************************************************************
3156  *
3157  * @brief Fill Aggregation Level Candidates Information
3158  *
3159  * @details
3160  *
3161  *    Function : parseCandidateInfo 
3162  *
3163  *    Functionality: Fill Aggregation Level Candidates Information
3164  *
3165  * @params[in] XML document pointer
3166  *             XML namespace
3167  *             Current node in XML
3168  *             Pointer to structure to be filled
3169  * @return ROK     - success
3170  *         RFAILED - failure
3171  *
3172  * ****************************************************************/
3173 uint8_t parseCandidateInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CandidatesInfo *candInfo)
3174 {
3175    memset(candInfo, 0, sizeof(CandidatesInfo));
3176    cur = cur -> xmlChildrenNode;
3177    while(cur != NULL)
3178    {
3179       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL1")) && (cur->ns == ns))
3180       {
3181          candInfo->aggLevel1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3182       }
3183
3184       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL2")) && (cur->ns == ns))
3185       {
3186          candInfo->aggLevel2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3187       }
3188
3189       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL4")) && (cur->ns == ns))
3190       {
3191          candInfo->aggLevel4 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3192       }
3193
3194       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL8")) && (cur->ns == ns))
3195       {
3196          candInfo->aggLevel8 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3197       }
3198
3199       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL16")) && (cur->ns == ns))
3200       {
3201          candInfo->aggLevel16 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3202       }
3203
3204       cur = cur -> next;
3205    }
3206    return ROK;
3207 }
3208
3209 /*******************************************************************
3210  *
3211  * @brief Fill Search Space Connfiguration
3212  *
3213  * @details
3214  *
3215  *    Function : parseSearchSpaceCfg
3216  *
3217  *    Functionality: Fill Search Space Configuration
3218  *
3219  * @params[in] XML document pointer
3220  *             XML namespace
3221  *             Current node in XML
3222  *             Pointer to structure to be filled
3223  * @return ROK     - success
3224  *         RFAILED - failure
3225  *
3226  * ****************************************************************/
3227 uint8_t parseSearchSpaceCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SearchSpaceCfg *searchSpaceCfg)
3228 {
3229    memset(searchSpaceCfg, 0, sizeof(SearchSpaceCfg));
3230    cur = cur -> xmlChildrenNode;
3231    while(cur != NULL)
3232    {
3233       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_1_INDEX")) && (cur->ns == ns))
3234       {
3235          searchSpaceCfg->searchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3236       }
3237
3238       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns))
3239       {
3240          searchSpaceCfg->coresetId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3241       }
3242
3243       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SS_MONITORING_SLOT_SL1")) && (cur->ns == ns))
3244       {
3245          searchSpaceCfg->monitoringSlot = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3246       }
3247
3248       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DURATION")) && (cur->ns == ns))
3249       {
3250          searchSpaceCfg->duration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3251       }
3252
3253       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SS_MONITORING_SYMBOL")) && (cur->ns == ns))
3254       {
3255          searchSpaceCfg->monitoringSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3256       }
3257
3258       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CANDIDATE_INFO")) && (cur->ns == ns))
3259       {
3260          if(parseCandidateInfo(doc, ns, cur, &searchSpaceCfg->candidate) != ROK)
3261          {
3262             return RFAILED;
3263          }
3264       }
3265
3266       cur = cur -> next;
3267    }
3268    return ROK;
3269 }
3270
3271 /*******************************************************************
3272  *
3273  * @brief Fill PDCCH Configuration Common
3274  *
3275  * @details
3276  *
3277  *    Function : parsePdcchCfgCommon
3278  *
3279  *    Functionality: Fill PDCCH Configuration Common
3280  *
3281  * @params[in] XML document pointer
3282  *             XML namespace
3283  *             Current node in XML
3284  *             Pointer to structure to be filled
3285  * @return ROK     - success
3286  *         RFAILED - failure
3287  *
3288  * ****************************************************************/
3289 uint8_t parsePdcchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfigCommon *pdcchCfgCm)
3290 {
3291    memset(pdcchCfgCm, 0, sizeof(PdcchConfigCommon));
3292    cur = cur -> xmlChildrenNode;
3293    while(cur != NULL)
3294    {
3295       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_CFG")) && (cur->ns == ns))
3296       {
3297          if(parseSearchSpaceCfg(doc, ns, cur, &pdcchCfgCm->commonSearchSpace) != ROK)
3298          {
3299             return RFAILED;
3300          }
3301       }
3302
3303       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_1_INDEX")) && (cur->ns == ns))
3304       {
3305          pdcchCfgCm->raSearchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3306       }
3307
3308       cur = cur -> next;
3309    }
3310
3311    return ROK;
3312 }
3313
3314 /*******************************************************************
3315  *
3316  * @brief Fill PDSCH Common Time Domain Resource Allocation
3317  *
3318  * @details
3319  *
3320  *    Function : parsePdschCmnTimeDomRsrcAlloc
3321  *
3322  *    Functionality: Fill PDSCH Common Time Domain Resource Allocation
3323  *
3324  * @params[in] XML document pointer
3325  *             XML namespace
3326  *             Current node in XML
3327  *             Pointer to structure to be filled
3328  * @return ROK     - success
3329  *         RFAILED - failure
3330  *
3331  * ****************************************************************/
3332 uint8_t parsePdschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,\
3333       PdschCfgCommTimeDomRsrcAlloc *pdschTimeDomRsrcAlloc)
3334 {
3335    memset(pdschTimeDomRsrcAlloc, 0, sizeof(PdschCfgCommTimeDomRsrcAlloc));
3336    cur = cur -> xmlChildrenNode;
3337    while(cur != NULL)
3338    {
3339       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_K0_CFG")) && (cur->ns == ns))
3340       {
3341          pdschTimeDomRsrcAlloc->k0 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3342       }
3343       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_MAPPING_TYPE")) && (cur->ns == ns))
3344       {
3345          pdschTimeDomRsrcAlloc->mappingType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3346       }
3347       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_START_SYMBOL")) && (cur->ns == ns))
3348       {
3349          pdschTimeDomRsrcAlloc->startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3350       }
3351       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
3352       {
3353          pdschTimeDomRsrcAlloc->lengthSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3354       }
3355
3356       cur = cur -> next;
3357    }
3358    return ROK;
3359 }
3360
3361 /*******************************************************************
3362  *
3363  * @brief Fill PDSCH Configuration Common
3364  *
3365  * @details
3366  *
3367  *    Function : parsePdschConfigCommon
3368  *
3369  *    Functionality: Fill PDSCH Configuration Common
3370  *
3371  * @params[in] XML document pointer
3372  *             XML namespace
3373  *             Current node in XML
3374  *             Pointer to structure to be filled
3375  * @return ROK     - success
3376  *         RFAILED - failure
3377  *
3378  * ****************************************************************/
3379 uint8_t parsePdschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PdschConfigCommon *pdschCfgCmn)
3380 {
3381    uint8_t idx = 0;
3382    xmlNodePtr child = NULLP;
3383    xmlNodePtr pdschNode = NULLP;
3384
3385    memset(pdschCfgCmn, 0, sizeof(PdschConfigCommon));
3386    cur = cur -> xmlChildrenNode;
3387    while(cur != NULL)
3388    {
3389       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns))
3390       {
3391          pdschCfgCmn->numTimeDomAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3392       }
3393
3394       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC_LIST")) && (cur->ns == ns))
3395       {
3396          child = cur->xmlChildrenNode;
3397          while(child != NULL)  
3398          {
3399             if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns))
3400             {
3401                pdschNode = child->xmlChildrenNode;
3402                while(pdschNode != NULL)
3403                {
3404                   if ((!xmlStrcmp(pdschNode->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC")) && (pdschNode->ns == ns))
3405                   {   
3406                      if(parsePdschCmnTimeDomRsrcAlloc(doc, ns, child, &pdschCfgCmn->timeDomRsrcAllocList[idx]) != ROK)
3407                      {
3408                         return RFAILED;
3409                      }
3410                      idx++;
3411                   }
3412                   pdschNode = pdschNode -> next;
3413                }
3414             }
3415
3416             child = child -> next;
3417          }
3418       }
3419       cur = cur -> next;
3420    }
3421    return ROK;
3422 }
3423
3424 /*******************************************************************
3425  *
3426  * @brief Fill DL BWP Configuration
3427  *
3428  * @details
3429  *
3430  *    Function : parseBwpDLConfig
3431  *
3432  *    Functionality: Fill DL BWP Configuration
3433  *
3434  * @params[in] XML document pointer
3435  *             XML namespace
3436  *             Current node in XML
3437  *             Pointer to structure to be filled
3438  * @return ROK     - success
3439  *         RFAILED - failure
3440  *
3441  * ****************************************************************/
3442 uint8_t parseBwpDLConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpDlConfig *bwpDlCfg)
3443 {
3444    memset(bwpDlCfg, 0, sizeof(BwpDlConfig));
3445    cur = cur -> xmlChildrenNode;
3446    while(cur != NULL)
3447    {
3448       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_PARAMS")) && (cur->ns == ns))
3449       {
3450          if(parseBwp(doc, ns, cur, &bwpDlCfg->bwp) != ROK)
3451          {
3452             return RFAILED;
3453          }
3454       }
3455
3456       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CFG_COMMON")) && (cur->ns == ns))
3457       {
3458          if(parsePdcchCfgCommon(doc, ns, cur, &bwpDlCfg->pdcchCommon) != ROK)
3459          {
3460             return RFAILED;
3461          }
3462       }
3463
3464       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_CFG_COMMON")) && (cur->ns == ns))
3465       {
3466          if(parsePdschConfigCommon(doc, ns, cur, &bwpDlCfg->pdschCommon) != ROK)
3467          {
3468             return RFAILED;
3469          }
3470       }
3471
3472       cur = cur -> next;
3473    }
3474    return ROK;
3475 }
3476
3477 /*******************************************************************
3478  *
3479  * @brief Fill Cell Configuration
3480  *
3481  * @details
3482  *
3483  *    Function : parseCellCfg
3484  *
3485  *    Functionality: Fill Cell Configuration
3486  *
3487  * @params[in] XML document pointer
3488  *             XML namespace
3489  *             Current node in XML
3490  *             Pointer to structure to be filled
3491  * @return ROK     - success
3492  *         RFAILED - failure
3493  *
3494  * ****************************************************************/
3495 uint8_t parseCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CellCfg *cellCfg)
3496 {
3497    memset(cellCfg, 0, sizeof(CellCfg));
3498    cur = cur -> xmlChildrenNode;
3499    while(cur != NULL)
3500    {
3501       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_OP_STATE")) && (cur->ns == ns))
3502       {
3503          cellCfg->opState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3504       }
3505
3506       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_ADMIN_STATE")) && (cur->ns == ns))
3507       {
3508          cellCfg->adminState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3509       }
3510
3511       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_CELL_STATE")) && (cur->ns == ns))
3512       {
3513          cellCfg->cellState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3514       }
3515
3516       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN_INFO")) && (cur->ns == ns))
3517       {
3518          if(parsePlmnInfo(doc, ns, cur, &cellCfg->plmnInfoList[0]) != ROK)
3519          {
3520             return RFAILED;
3521          }
3522       }
3523
3524       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_PCI")) && (cur->ns == ns))
3525       {
3526          cellCfg->phyCellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3527       }
3528
3529       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
3530       {
3531          cellCfg->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3532       }
3533
3534       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_FREQUENCY")) && (cur->ns == ns))
3535       {
3536          cellCfg->ssbFreq = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3537       }
3538
3539       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
3540       {
3541          cellCfg->subCarrSpacing  = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3542       }
3543
3544       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DUPLEX_MODE")) && (cur->ns == ns))
3545       {
3546          cellCfg->dupType  = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3547       }
3548
3549       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_CELL_CFG")) && (cur->ns == ns))
3550       {
3551          if(parseSib1CellCfg(doc, ns, cur, &cellCfg->sib1Cfg) != ROK)
3552          {
3553             return RFAILED;
3554          }
3555       }
3556
3557       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_DL_CFG")) && (cur->ns == ns))
3558       {
3559          if(parseBwpDLConfig(doc, ns, cur, &cellCfg->initialDlBwp) != ROK)
3560          {
3561             return RFAILED;
3562          }
3563       }
3564
3565       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_UL_CFG")) && (cur->ns == ns))
3566       {
3567          if(parseBwpULConfig(doc, ns, cur, &cellCfg->initialUlBwp) != ROK)
3568          {
3569             return RFAILED;
3570          }
3571       }
3572
3573       cur = cur -> next;
3574    }
3575    return ROK;
3576 }
3577
3578 #ifdef NR_TDD
3579 /*******************************************************************
3580  *
3581  * @brief Fill TDD slot configuration
3582  *
3583  * @details
3584  *
3585  *    Function : parseTddCfg
3586  *
3587  *    Functionality: Fill TDD slot configuration
3588  *
3589  * @params[in] XML document pointer
3590  *             XML namespace
3591  *             Current node in XML
3592  *             Pointer to structure to be filled
3593  * @return ROK     - success
3594  *         RFAILED - failure
3595  *
3596  * ****************************************************************/
3597 uint8_t parseTddCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TDDCfg *tddCfg)
3598 {
3599    memset(tddCfg, 0, sizeof(TDDCfg));
3600    cur = cur -> xmlChildrenNode;
3601    while(cur != NULL)
3602    {
3603       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_PERIODICITY")) && (cur->ns == ns))
3604       {
3605          tddCfg->tddPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3606       }
3607
3608       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SLOTS")) && (cur->ns == ns))
3609       {
3610          tddCfg->nrOfDlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3611       }
3612
3613       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SYMBOLS")) && (cur->ns == ns))
3614       {
3615          tddCfg->nrOfDlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3616       }
3617
3618       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SLOTS")) && (cur->ns == ns))
3619       {
3620          tddCfg->nrOfUlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3621       }
3622
3623       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SYMBOLS")) && (cur->ns == ns))
3624       {
3625          tddCfg->nrOfUlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3626       }
3627
3628       cur = cur -> next;
3629    }
3630    return ROK;
3631 }
3632 #endif
3633
3634 /*******************************************************************
3635  *
3636  * @brief Fill MAC Cell Configuration
3637  *
3638  * @details
3639  *
3640  *    Function : parseMacCellCfg
3641  *
3642  *    Functionality: Fill MAC Cell Configuration
3643  *
3644  * @params[in] XML document pointer
3645  *             XML namespace
3646  *             Current node in XML
3647  *             Pointer to structure to be filled
3648  * @return ROK     - success
3649  *         RFAILED - failure
3650  *
3651  * ****************************************************************/
3652 uint8_t parseMacCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacCellCfg *macCellCfg)
3653 {
3654    memset(macCellCfg, 0, sizeof(MacCellCfg));
3655    cur = cur -> xmlChildrenNode;
3656    while(cur != NULL)
3657    {
3658       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_ID")) && (cur->ns == ns))
3659       {
3660          macCellCfg->cellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3661       }
3662
3663       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARRIER_CFG")) && (cur->ns == ns))
3664       {
3665          if(parseCarrierCfg(doc, ns, cur, &macCellCfg->carrCfg) != ROK)
3666          {
3667             return RFAILED;
3668          }
3669       }
3670
3671       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_CFG")) && (cur->ns == ns))
3672       {
3673          if(parseCellCfg(doc, ns, cur, &macCellCfg->cellCfg) != ROK)
3674          {
3675             return RFAILED;
3676          }
3677       }
3678
3679       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_CFG")) && (cur->ns == ns))
3680       {
3681          if(parseSsbCfg(doc, ns, cur, &macCellCfg->ssbCfg) != ROK)
3682          {
3683             return RFAILED;
3684          }
3685       }
3686
3687       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_CFG")) && (cur->ns == ns))
3688       {
3689          if(parseCsiRsCfg(doc, ns, cur, &macCellCfg->csiRsCfg) != ROK)
3690          {
3691             return RFAILED;
3692          }
3693       }
3694
3695       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CFG")) && (cur->ns == ns))
3696       {
3697          if(parsePrachCfg(doc, ns, cur, &macCellCfg->prachCfg) != ROK)
3698          {
3699             return RFAILED;
3700          }
3701       }
3702
3703 #ifdef NR_TDD
3704       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_CFG")) && (cur->ns == ns))
3705       {
3706          if(parseTddCfg(doc, ns, cur, &macCellCfg->tddCfg) != ROK)
3707          {
3708             return RFAILED;
3709          }
3710       }
3711 #endif 
3712
3713       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRE_CODE_CFG")) && (cur->ns == ns))
3714       {
3715          if(parsePrecodingConfig(doc, ns, cur, &macCellCfg->precodingConf) != ROK)
3716          {
3717             return RFAILED;
3718          }
3719       }
3720
3721       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_FORM_CFG")) && (cur->ns == ns))
3722       {
3723          if(parseBeamformingConfig(doc, ns, cur, &macCellCfg->beamCfg) != ROK)
3724          {
3725             return RFAILED;
3726          }
3727       }
3728
3729       cur = cur -> next;
3730    }
3731    return ROK;
3732 }
3733
3734 /*******************************************************************
3735  *
3736  * @brief Fill PUSCH Configuration Common Time Domain 
3737  *    Resource Allocation
3738  *
3739  * @details
3740  *
3741  *    Function : parsePuschCmnTimeDomRsrcAlloc
3742  *
3743  *    Functionality: Fill PUSCH Configuration Common Time Domain
3744  *       Resource Allocation
3745  *
3746  * @params[in] XML document pointer
3747  *             XML namespace
3748  *             Current node in XML
3749  *             Pointer to structure to be filled
3750  * @return ROK     - success
3751  *         RFAILED - failure
3752  *
3753  * ****************************************************************/
3754 uint8_t parsePuschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgCmnTimeDomAlloc *puschCmnTimeDomAlloc)
3755 {
3756    uint16_t startSymbol;
3757    uint16_t lenSymbol;
3758
3759    memset(puschCmnTimeDomAlloc, 0, sizeof(PuschCfgCmnTimeDomAlloc));
3760    cur = cur -> xmlChildrenNode;
3761    while(cur != NULL)
3762    {
3763       if ((!xmlStrcmp(cur->name, (const xmlChar *)"K2")) && (cur->ns == ns))
3764       {
3765          puschCmnTimeDomAlloc->k2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3766       }
3767       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAP_TYPE")) && (cur->ns == ns))
3768       {
3769          puschCmnTimeDomAlloc->mapType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3770       }
3771       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_START_SYMBOL")) && (cur->ns == ns))
3772       {
3773          startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3774       }
3775       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
3776       {
3777          lenSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3778       }
3779       cur = cur -> next;
3780    }
3781    puschCmnTimeDomAlloc->sliv = calcSliv(startSymbol, lenSymbol);
3782    return ROK;
3783 }
3784
3785 /*******************************************************************
3786  *
3787  * @brief Fill PUSCH Configuration Common
3788  *
3789  * @details
3790  *
3791  *    Function : parsePuschCfgCommon
3792  *
3793  *    Functionality: Fill PUSCH Configuration Common
3794  *
3795  * @params[in] XML document pointer
3796  *             XML namespace
3797  *             Current node in XML
3798  *             Pointer to structure to be filled
3799  * @return ROK     - success
3800  *         RFAILED - failure
3801  *
3802  * ****************************************************************/
3803 uint8_t parsePuschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgCommon *puschCfgCmn)
3804 {
3805    uint8_t rsrcIdx = 0;
3806    xmlNodePtr child = NULLP;
3807    xmlNodePtr rsrcNode = NULLP;
3808
3809    memset(puschCfgCmn, 0, sizeof(PuschCfgCommon));
3810    cur = cur -> xmlChildrenNode;
3811    while(cur != NULL)
3812    {
3813       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_PRESENT")) && (cur->ns == ns))
3814       {
3815          puschCfgCmn->puschCfgPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3816       }
3817
3818       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_MSG3_DELTA_PREAMBLE")) && (cur->ns == ns))
3819       {
3820          puschCfgCmn->msg3DeltaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3821       }
3822
3823       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_P0_NOMINAL_WITH_GRANT")) && (cur->ns == ns))
3824       {
3825          puschCfgCmn->p0NominalWithGrant = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3826       }
3827
3828       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns))
3829       {
3830          puschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3831       }
3832
3833       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_TIME_DOM_RSRC_ALLOC_LIST")) && (cur->ns == ns))
3834       {
3835          child = cur->xmlChildrenNode;
3836          while (child != NULL)
3837          {
3838             if ((!xmlStrcmp(child->name, (const xmlChar *)"LIST")) && (child->ns == ns))
3839             {
3840                rsrcNode = child->xmlChildrenNode;
3841                while (rsrcNode != NULL)
3842                {
3843                   if ((!xmlStrcmp(rsrcNode->name, (const xmlChar *)"PUSCH_TIME_DOM_RSRC_ALLOC")) \
3844                      && (rsrcNode->ns == ns))
3845                   {
3846                      if(parsePuschCmnTimeDomRsrcAlloc(doc, ns, rsrcNode, &puschCfgCmn->timeDomAllocList[rsrcIdx]) != ROK)
3847                      {
3848                         return RFAILED;
3849                      }
3850                      rsrcIdx++;
3851                   }
3852                   rsrcNode = rsrcNode->next;
3853                }
3854             }
3855             child = child->next;
3856          }
3857       }
3858       cur = cur -> next;
3859    }
3860    return ROK;
3861 }
3862
3863 /*******************************************************************
3864  *
3865  * @brief Fill PUCCH Configuration Common 
3866  *
3867  * @details
3868  *
3869  *    Function : parsePucchCfgCommon
3870  *
3871  *    Functionality: Fill PUCCH Configuration Common
3872  *
3873  * @params[in] XML document pointer
3874  *             XML namespace
3875  *             Current node in XML
3876  *             Pointer to structure to be filled
3877  * @return ROK     - success
3878  *         RFAILED - failure
3879  *
3880  * ****************************************************************/
3881 uint8_t parsePucchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PucchCfgCommon *pucchCfgCmn)
3882 {
3883    memset(pucchCfgCmn, 0, sizeof(PucchCfgCommon));
3884    cur = cur -> xmlChildrenNode;
3885    while(cur != NULL)
3886    {
3887       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
3888       {
3889          pucchCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3890       }
3891
3892       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_RSRC_COMMON")) && (cur->ns == ns))
3893       {
3894          pucchCfgCmn->rsrcComm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3895       }
3896
3897       if ((!xmlStrcmp(cur->name, (const xmlChar *)"GRP_HOP")) && (cur->ns == ns))
3898       {
3899          pucchCfgCmn->grpHop = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3900       }
3901
3902       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_P0_NOMINAL")) && (cur->ns == ns))
3903       {
3904          pucchCfgCmn->p0Nominal = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3905       }
3906
3907       cur = cur -> next;
3908    }
3909    return ROK;
3910 }
3911
3912 /*******************************************************************
3913  *
3914  * @brief Fill RACH Configuration Common
3915  *
3916  * @details
3917  *
3918  *    Function : parseRachCfgCommon
3919  *
3920  *    Functionality: Fill RACH Configuration Common
3921  *
3922  * @params[in] XML document pointer
3923  *             XML namespace
3924  *             Current node in XML
3925  *             Pointer to structure to be filled
3926  * @return ROK     - success
3927  *         RFAILED - failure
3928  *
3929  * ****************************************************************/
3930 uint8_t parseRachCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RachCfgCommon *rachCfgCmn)
3931 {
3932    long   maxNumRb;
3933    long   prachMaxPrb;
3934
3935    memset(rachCfgCmn, 0, sizeof(RachCfgCommon));
3936    cur = cur -> xmlChildrenNode;
3937    while(cur != NULL)
3938    {
3939       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
3940       {
3941          rachCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3942       }
3943
3944       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CONFIG_IDX")) && (cur->ns == ns))
3945       {
3946          rachCfgCmn->prachCfgIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3947       }
3948
3949       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MSG_1_FDM")) && (cur->ns == ns))
3950       {
3951          rachCfgCmn->msg1Fdm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3952       }
3953
3954       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_RB")) && (cur->ns == ns))
3955       {
3956          maxNumRb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3957       }
3958       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_MAX_PRB")) && (cur->ns == ns))
3959       {
3960          prachMaxPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3961       }
3962
3963       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ZERO_CORRELATION_ZONE_CFG")) && (cur->ns == ns))
3964       {
3965          rachCfgCmn->zeroCorrZoneCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3966       }
3967
3968       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_PREAMBLE_RCVD_TGT_PWR")) && (cur->ns == ns))
3969       {
3970          rachCfgCmn->preambleRcvdTgtPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3971       }
3972
3973       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PREAMBLE_TRANS_MAX")) && (cur->ns == ns))
3974       {
3975          rachCfgCmn->preambleTransMax = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3976       }
3977
3978       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PWR_RAMPING_STEP")) && (cur->ns == ns))
3979       {
3980          rachCfgCmn->pwrRampingStep = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3981       }
3982
3983       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_RSP_WINDOW")) && (cur->ns == ns))
3984       {
3985          rachCfgCmn->raRspWindow = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3986       }
3987
3988       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RA_PREAMBLE")) && (cur->ns == ns))
3989       {
3990          rachCfgCmn->numRaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3991       }
3992
3993       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_SSB_PER_RACH_OCC")) && (cur->ns == ns))
3994       {
3995          rachCfgCmn->numSsbPerRachOcc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3996       }
3997
3998       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CB_PREAMBLE_PER_SSB")) && (cur->ns == ns))
3999       {
4000          rachCfgCmn->numCbPreamblePerSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4001       }
4002
4003       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONT_RES_TIMER")) && (cur->ns == ns))
4004       {
4005          rachCfgCmn->contResTimer = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4006       }
4007
4008       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RSRP_THRESHOLD_SSB")) && (cur->ns == ns))
4009       {
4010          rachCfgCmn->rsrpThreshSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4011       }
4012
4013       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX_PRESENT")) && (cur->ns == ns))
4014       {
4015          rachCfgCmn->rootSeqIdxPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4016       }
4017
4018       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX")) && (cur->ns == ns))
4019       {
4020          rachCfgCmn->rootSeqIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4021       }
4022
4023       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_SUBCARRIER_SPACING")) && (cur->ns == ns))
4024       {
4025          rachCfgCmn->msg1Scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4026       }
4027
4028       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_RESTRICTED_SET_CFG")) && (cur->ns== ns))
4029       {
4030          rachCfgCmn->restrictedSetCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4031       }
4032
4033       cur = cur -> next;
4034    }
4035
4036    rachCfgCmn->msg1FreqStart = ((maxNumRb) - (prachMaxPrb));
4037    return ROK;
4038 }
4039
4040 /*******************************************************************
4041  *
4042  * @brief Fill SCS Specific Carrier
4043  *
4044  * @details
4045  *
4046  *    Function : parseScsSpecCarrier
4047  *
4048  *    Functionality: Fill SCS Specific Carrier
4049  *
4050  * @params[in] XML document pointer
4051  *             XML namespace
4052  *             Current node in XML
4053  *             Pointer to structure to be filled
4054  * @return ROK     - success
4055  *         RFAILED - failure
4056  *
4057  * ****************************************************************/
4058 uint8_t parseScsSpecCarrier(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,ScsSpecCarrier *scsSpecCrr)
4059 {
4060    memset(scsSpecCrr, 0, sizeof(ScsSpecCarrier));
4061    cur = cur -> xmlChildrenNode;
4062    while(cur != NULL)
4063    {
4064       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SUBCARRIER_OFFSET")) && (cur->ns == ns))
4065       {
4066          scsSpecCrr->scsOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4067       }
4068
4069       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
4070       {
4071          scsSpecCrr->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4072       }
4073
4074       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_BW")) && (cur->ns == ns))
4075       {
4076          scsSpecCrr->scsBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4077       }
4078       cur = cur -> next;
4079    }
4080    return ROK;
4081 }
4082
4083 /*******************************************************************
4084  *
4085  * @brief Fill UL Config Common 
4086  *
4087  * @details
4088  *
4089  *    Function : parseUlCfgCommon
4090  *
4091  *    Functionality: Fill UL Config Common
4092  *
4093  * @params[in] XML document pointer
4094  *             XML namespace
4095  *             Current node in XML
4096  *             Pointer to structure to be filled
4097  * @return ROK     - success
4098  *         RFAILED - failure
4099  *
4100  * ****************************************************************/
4101 uint8_t parseUlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,UlCfgCommon *ulCfgCmn)
4102 {
4103    memset(ulCfgCmn, 0, sizeof(UlCfgCommon));
4104    cur = cur -> xmlChildrenNode;
4105    while(cur != NULL)
4106    {
4107       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns))
4108       {
4109          ulCfgCmn->freqBandInd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4110       }
4111
4112       if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_P_MAX")) && (cur->ns == ns))
4113       {
4114          ulCfgCmn->pMax = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4115       }
4116
4117       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FREQ_LOC_BW")) && (cur->ns == ns))
4118       {
4119          ulCfgCmn->locAndBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4120       }
4121
4122       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIME_ALLIGN_TIMER_COMM")) && (cur->ns == ns))
4123       {
4124          ulCfgCmn->timeAlignTimerComm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4125       }
4126
4127       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_SPEC_CARRIER")) && (cur->ns == ns))
4128       {
4129          if(parseScsSpecCarrier(doc, ns, cur, &ulCfgCmn->ulScsCarrier) != ROK)
4130          {
4131             return RFAILED;
4132          }
4133       }
4134
4135       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RACH_CFG_COMMON")) && (cur->ns == ns))
4136       {
4137          if(parseRachCfgCommon(doc, ns, cur, &ulCfgCmn->rachCfg) != ROK)
4138          {
4139             return RFAILED;
4140          }
4141       }
4142
4143       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_COMMON")) && (cur->ns == ns))
4144       {
4145          if(parsePuschCfgCommon(doc, ns, cur, &ulCfgCmn->puschCfg) != ROK)
4146          {
4147             return RFAILED;
4148          }
4149       }
4150       
4151       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_CFG_COMMON")) && (cur->ns == ns))
4152       {
4153          if(parsePucchCfgCommon(doc, ns, cur, &ulCfgCmn->pucchCfg) != ROK)
4154          {
4155             return RFAILED;
4156          }
4157       }
4158
4159       cur = cur -> next;
4160    }
4161    return ROK;
4162 }
4163
4164 /*******************************************************************
4165  *
4166  * @brief Fill TDD UL DL Configuration Common
4167  *
4168  * @details
4169  *
4170  *    Function : parseTddUlDlCfgCommon
4171  *
4172  *    Functionality: Fill TDD UL DL Configuration Common
4173  *
4174  * @params[in] XML document pointer
4175  *             XML namespace
4176  *             Current node in XML
4177  *             Pointer to structure to be filled
4178  * @return ROK     - success
4179  *         RFAILED - failure
4180  *
4181  * ****************************************************************/
4182 uint8_t parseTddUlDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TddUlDlCfgCommon *tddUlDlCfgCmn)
4183 {
4184    memset(tddUlDlCfgCmn, 0, sizeof(TddUlDlCfgCommon));
4185    cur = cur -> xmlChildrenNode;
4186    while(cur != NULL)
4187    {
4188       if ((!xmlStrcmp(cur->name, (const xmlChar *)"REF_SCS")) && (cur->ns == ns))
4189       {
4190          tddUlDlCfgCmn->refScs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4191       }
4192
4193       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TX_PRD")) && (cur->ns == ns))
4194       {
4195          tddUlDlCfgCmn->txPrd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4196       }
4197
4198       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SLOTS")) && (cur->ns == ns))
4199       {
4200          tddUlDlCfgCmn->numDlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4201       }
4202
4203       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SYMBOLS")) && (cur->ns == ns))
4204       {
4205          tddUlDlCfgCmn->numDlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4206       }
4207
4208       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SLOTS")) && (cur->ns == ns))
4209       {
4210          tddUlDlCfgCmn->numUlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4211       }
4212
4213       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SYMBOLS")) && (cur->ns == ns))
4214       {
4215          tddUlDlCfgCmn->numUlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4216       }
4217
4218       cur = cur -> next;
4219    }
4220    return ROK;
4221 }
4222
4223 /*******************************************************************
4224  *
4225  * @brief Fill PCCH Configuration 
4226  *
4227  * @details
4228  *
4229  *    Function : parsePcchCfg
4230  *
4231  *    Functionality: Fill PCCH Configuration
4232  *
4233  * @params[in] XML document pointer
4234  *             XML namespace
4235  *             Current node in XML
4236  *             Pointer to structure to be filled
4237  * @return ROK     - success
4238  *         RFAILED - failure
4239  *
4240  * ****************************************************************/
4241 uint8_t parsePcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PcchCfg *pcchCfg)
4242 {
4243    xmlNodePtr child = NULLP;
4244    xmlNodePtr firstPdcchNode = NULLP;
4245    uint8_t  idx = 0;
4246
4247    memset(pcchCfg, 0, sizeof(PcchCfg));
4248    cur = cur -> xmlChildrenNode;
4249    while(cur != NULL)
4250    {
4251       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DFLT_PAGING_CYCLE")) && (cur->ns == ns))
4252       {
4253          pcchCfg->dfltPagingCycle = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4254       }
4255
4256       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAND_PAGING_FRM_OFFSET")) && (cur->ns == ns))
4257       {
4258          pcchCfg->nAndPagingFrmOffsetType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4259       }
4260
4261       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PAGE_FRM_OFFSET")) && (cur->ns == ns))
4262       {
4263          pcchCfg->pageFrameOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4264       }
4265
4266       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NS")) && (cur->ns == ns))
4267       {
4268          pcchCfg->ns = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4269       }
4270
4271       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PDCCH_MONITORING_TYPE")) && (cur->ns == ns))
4272       {
4273          pcchCfg->firstPDCCHMontioringType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4274       }
4275
4276       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns))
4277       {
4278          child = cur->xmlChildrenNode;
4279          while(child != NULL)
4280          {
4281             if ((!xmlStrcmp(child->name, (const xmlChar *)"FIRST_PDCCH_LIST")) && (child->ns == ns))
4282             {
4283                firstPdcchNode = child->xmlChildrenNode;
4284                while (firstPdcchNode != NULL)
4285                {
4286                   if ((!xmlStrcmp(firstPdcchNode->name, (const xmlChar *)"FIRST_PDCCH_MONITORING_INFO")) && (firstPdcchNode->ns == ns))
4287                   {
4288                      pcchCfg->firstPDCCHMontioringInfo[idx] = atoi((char *)xmlNodeListGetString(doc, firstPdcchNode->xmlChildrenNode, 1));
4289                      idx++;
4290                   }
4291                   firstPdcchNode = firstPdcchNode->next;
4292                }
4293             }
4294             child = child -> next;
4295          }
4296       }
4297       cur = cur -> next;
4298    }
4299    return ROK;
4300 }
4301
4302 /*******************************************************************
4303  *
4304  * @brief Fill PDSCH Time Domain Resource Allocation
4305  *
4306  * @details
4307  *
4308  *    Function : parsePdschTimeDomRsrcAlloc
4309  *
4310  *    Functionality: Fill PDSCH Time Domain Resource Allocation
4311  *
4312  * @params[in] XML document pointer
4313  *             XML namespace
4314  *             Current node in XML
4315  *             Pointer to structure to be filled
4316  * @return ROK     - success
4317  *         RFAILED - failure
4318  *
4319  * ****************************************************************/
4320 uint8_t parsePdschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschTimeDomainRsrcAlloc *pdschTimeDomRsrcAlloc)
4321 {
4322    uint16_t startSymbol;
4323    uint16_t lenSymbol;
4324
4325    memset(pdschTimeDomRsrcAlloc, 0, sizeof(PdschTimeDomainRsrcAlloc));
4326    cur = cur -> xmlChildrenNode;
4327    while(cur != NULL)
4328    {
4329       if ((!xmlStrcmp(cur->name, (const xmlChar *)"K0")) && (cur->ns == ns))
4330       {
4331          pdschTimeDomRsrcAlloc->k0 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4332       }
4333
4334       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAP_TYPE")) && (cur->ns == ns))
4335       {
4336          pdschTimeDomRsrcAlloc->mapType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4337       }
4338
4339       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_START_SYMBOL")) && (cur->ns == ns))
4340       {
4341          startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4342       }
4343
4344       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
4345       {
4346          lenSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4347       }
4348
4349       cur = cur -> next;
4350    }
4351    pdschTimeDomRsrcAlloc->sliv = calcSliv(startSymbol, lenSymbol);
4352    return ROK;
4353 }
4354
4355 /*******************************************************************
4356  *
4357  * @brief Fill PDSCH Configuration Common
4358  *
4359  * @details
4360  *
4361  *    Function : parsePdschCfgCommon
4362  *
4363  *    Functionality: Fill PDSCH Configuration Common
4364  *
4365  * @params[in] XML document pointer
4366  *             XML namespace
4367  *             Current node in XML
4368  *             Pointer to structure to be filled
4369  * @return ROK     - success
4370  *         RFAILED - failure
4371  *
4372  * ****************************************************************/
4373 uint8_t parsePdschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschCfgCommon *pdschCfgCmn)
4374 {
4375    uint8_t     idx = 0;
4376    xmlNodePtr  child = NULLP; 
4377    xmlNodePtr  listChild = NULLP; 
4378
4379    memset(pdschCfgCmn, 0, sizeof(PdschCfgCommon));
4380    cur = cur -> xmlChildrenNode;
4381    while(cur != NULL)
4382    {
4383       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
4384       {
4385          pdschCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4386       }
4387
4388       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRS_ALLOC")) && (cur->ns == ns))
4389       {
4390          pdschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4391       }
4392
4393       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_TIME_DOM_RSRC_ALLOC_LIST")) && (cur->ns == ns))
4394       {
4395          child = cur->xmlChildrenNode;
4396          while (child != NULL)
4397          {
4398             if ((!xmlStrcmp(child->name, (const xmlChar *)"LIST")) && (child->ns == ns))
4399             {
4400                listChild = child->xmlChildrenNode;
4401                while (listChild != NULL)
4402                {
4403                   if ((!xmlStrcmp(listChild->name, (const xmlChar *)"PDSCH_TIME_DOM_RSRC_ALLOC")) && (listChild->ns == ns))
4404                   {
4405                      if(parsePdschTimeDomRsrcAlloc(doc, ns, listChild, &pdschCfgCmn->timeDomAlloc[idx]) != ROK)
4406                      {
4407                         return RFAILED;
4408                      }
4409                      idx++;
4410                   }
4411                   listChild = listChild->next;
4412                }
4413             }
4414             child = child->next;
4415          }
4416       }
4417       cur = cur -> next;
4418    }
4419    return ROK;
4420 }
4421
4422 /*******************************************************************
4423  *
4424  * @brief Fill BCCH Configuration
4425  *
4426  * @details
4427  *
4428  *    Function : parseBcchCfg
4429  *
4430  *    Functionality: Fill BCCH Configuration
4431  *
4432  * @params[in] XML document pointer
4433  *             XML namespace
4434  *             Current node in XML
4435  *             Pointer to structure to be filled
4436  * @return ROK     - success
4437  *         RFAILED - failure
4438  *
4439  * ****************************************************************/
4440 uint8_t parseBcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, BcchCfg *bcchCfg)
4441 {
4442    memset(bcchCfg, 0, sizeof(BcchCfg));
4443    cur = cur -> xmlChildrenNode;
4444    while(cur != NULL)
4445    {
4446       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MOB_PRD_COEFF")) && (cur->ns == ns))
4447       {
4448          bcchCfg->modPrdCoeff = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4449       }
4450       cur = cur -> next;
4451    }
4452    return ROK;
4453 }
4454
4455 /*******************************************************************
4456  *
4457  * @brief Fill PDCCH Configuration Common
4458  *
4459  * @details
4460  *
4461  *    Function : parsePdcchConfigCommon
4462  *
4463  *    Functionality: Fill PDCCH Configuration Common
4464  *
4465  * @params[in] XML document pointer
4466  *             XML namespace
4467  *             Current node in XML
4468  *             Pointer to structure to be filled
4469  * @return ROK     - success
4470  *         RFAILED - failure
4471  *
4472  * ****************************************************************/
4473 uint8_t parsePdcchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PdcchCfgCommon *pdccgCfgCmn)
4474 {
4475    uint8_t idx = 0;
4476    xmlNodePtr child = NULLP;
4477    xmlNodePtr listChild = NULLP;
4478
4479    memset(pdccgCfgCmn, 0, sizeof( PdcchCfgCommon));
4480    cur = cur -> xmlChildrenNode;
4481    while(cur != NULL)
4482    {
4483       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
4484       {
4485          pdccgCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4486       }
4487
4488       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns))
4489       {
4490          pdccgCfgCmn->ctrlRsrcSetZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4491       }
4492
4493       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_0_INDEX")) && (cur->ns == ns))
4494       {
4495          pdccgCfgCmn->searchSpcZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4496       }
4497
4498       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID")) && (cur->ns == ns))
4499       {
4500          pdccgCfgCmn->searchSpcId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4501       }
4502
4503       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CTRL_RSRC_SET_ID")) && (cur->ns == ns))
4504       {
4505          pdccgCfgCmn->ctrlRsrcSetId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4506       }
4507
4508       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MONITOR_SLOT_PRD_OFFPRESENT")) && (cur->ns == ns))
4509       {
4510          pdccgCfgCmn->monitorSlotPrdAndOffPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4511       }
4512
4513       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns))
4514       {
4515          child = cur->xmlChildrenNode;
4516          while (child)
4517          {
4518             if ((!xmlStrcmp(child->name, (const xmlChar *)"MONITOR_LIST")) && (child->ns == ns))
4519             {
4520                listChild = child->xmlChildrenNode;
4521                while (listChild != NULL)
4522                {
4523                   if ((!xmlStrcmp(listChild->name, (const xmlChar *)"MONITOR_SYMBOL_INSLOT")) && (listChild->ns == ns))
4524                   {
4525                      pdccgCfgCmn->monitorSymbolsInSlot[idx] = atoi((char *)xmlNodeListGetString(doc, listChild->xmlChildrenNode, 1));
4526                      idx++;
4527                   }
4528                   listChild = listChild->next;
4529                }
4530             }
4531             child = child->next;
4532          }
4533       }
4534
4535       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUMC_AGG_LVL1")) && (cur->ns == ns))
4536       {
4537          pdccgCfgCmn->numCandAggLvl1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4538       }
4539
4540       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUMC_AGG_LVL2")) && (cur->ns == ns))
4541       {
4542          pdccgCfgCmn->numCandAggLvl2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4543       }
4544
4545       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUMC_AGG_LVL4")) && (cur->ns == ns))
4546       {
4547          pdccgCfgCmn->numCandAggLvl4 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4548       }
4549
4550       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUMC_AGG_LVL8")) && (cur->ns == ns))
4551       {
4552          pdccgCfgCmn->numCandAggLvl8 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4553       }
4554
4555       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUMC_AGG_LVL16")) && (cur->ns == ns))
4556       {
4557          pdccgCfgCmn->numCandAggLvl16 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4558       }
4559
4560       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPC_TYPE")) && (cur->ns == ns))
4561       {
4562          pdccgCfgCmn->searchSpcType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4563       }
4564
4565       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SERACH_SPACE_DCI_FORMAT")) && (cur->ns == ns))
4566       {
4567          pdccgCfgCmn->commSrchSpcDciFrmt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4568       }
4569
4570       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_SIB1")) && (cur->ns == ns))
4571       {
4572          pdccgCfgCmn->searchSpcSib1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4573       }
4574
4575       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_PAGING")) && (cur->ns == ns))
4576       {
4577          pdccgCfgCmn->pagingSearchSpc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4578       }
4579
4580       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_PDCCH_SEARCH_SPACE_ID_PAGING")) && (cur->ns == ns))
4581       {
4582          pdccgCfgCmn->raSearchSpc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4583       }
4584
4585       cur = cur -> next;
4586    }
4587    return ROK;
4588 }
4589
4590 /*******************************************************************
4591  *
4592  * @brief Fill DL Configuration Common
4593  *
4594  * @details
4595  *
4596  *    Function : parseDlCfgCommon
4597  *
4598  *    Functionality: Fill DL Configuration Common
4599  *
4600  * @params[in] XML document pointer
4601  *             XML namespace
4602  *             Current node in XML
4603  *             Pointer to structure to be filled
4604  * @return ROK     - success
4605  *         RFAILED - failure
4606  *
4607  * ****************************************************************/
4608 uint8_t parseDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,DlCfgCommon *dlCfgCmn)
4609 {
4610    memset(dlCfgCmn, 0, sizeof(DlCfgCommon));
4611    cur = cur -> xmlChildrenNode;
4612    while(cur != NULL)
4613    {
4614       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns))
4615       {
4616          dlCfgCmn->freqBandInd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4617       }
4618
4619       if ((!xmlStrcmp(cur->name, (const xmlChar *)"OFFSET_TO_POINT_A")) && (cur->ns == ns))
4620       {
4621          dlCfgCmn->offsetToPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4622       }
4623
4624       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FREQ_LOC_BW")) && (cur->ns == ns))
4625       {
4626          dlCfgCmn->locAndBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4627       }
4628
4629       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_SPEC_CARRIER")) && (cur->ns == ns))
4630       {
4631          if(parseScsSpecCarrier(doc, ns, cur, &dlCfgCmn->dlScsCarrier) != ROK)
4632          {
4633             return RFAILED;
4634          }
4635       }
4636
4637       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CFG_COMMON")) && (cur->ns == ns))
4638       {
4639          if(parsePdcchConfigCommon(doc, ns, cur, &dlCfgCmn->pdcchCfg) != ROK)
4640          {
4641             return RFAILED;
4642          }
4643       }
4644
4645       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_CFG_COMMON")) && (cur->ns == ns))
4646       {
4647          if(parsePdschCfgCommon(doc, ns, cur, &dlCfgCmn->pdschCfg) != ROK)
4648          {
4649             return RFAILED;
4650          }
4651       }
4652
4653       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCCH_CFG")) && (cur->ns == ns))
4654       {
4655          if(parseBcchCfg(doc, ns, cur, &dlCfgCmn->bcchCfg) != ROK)
4656          {
4657             return RFAILED;
4658          }
4659       }
4660
4661       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PCCH_CFG")) && (cur->ns == ns))
4662       {
4663          if(parsePcchCfg(doc, ns, cur, &dlCfgCmn->pcchCfg) != ROK)
4664          {
4665             return RFAILED;
4666          }
4667       }
4668
4669       cur = cur -> next;
4670    }
4671    return ROK;
4672 }
4673 /*******************************************************************
4674  *
4675  * @brief Fill Serving Cell Config Common SIB
4676  *
4677  * @details
4678  *
4679  *    Function : parseSrvCellCfgCmnSib
4680  *
4681  *    Functionality: Fill Serving Cell Config Common SIB
4682  *
4683  * @params[in] XML document pointer
4684  *             XML namespace
4685  *             Current node in XML
4686  *             Pointer to structure to be filled
4687  * @return ROK     - success
4688  *         RFAILED - failure
4689  *
4690  * ****************************************************************/
4691 uint8_t parseSrvCellCfgCmnSib(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SrvCellCfgCommSib *srvCellCfgCmnSib)
4692 {
4693    memset(srvCellCfgCmnSib, 0, sizeof(SrvCellCfgCommSib));
4694    cur = cur -> xmlChildrenNode;
4695    while(cur != NULL)
4696    {
4697       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
4698       {
4699          srvCellCfgCmnSib->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4700       }
4701
4702       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_POS_INBURST")) && (cur->ns == ns))
4703       {
4704          srvCellCfgCmnSib->ssbPosInBurst = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4705       }
4706
4707       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIODICITY")) && (cur->ns == ns))
4708       {
4709          srvCellCfgCmnSib->ssbPrdServingCell = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4710       }
4711
4712       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBCH_PWR")) && (cur->ns == ns))
4713       {
4714          srvCellCfgCmnSib->ssPbchBlockPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4715       }
4716
4717       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DL_CFG_COMMON")) && (cur->ns == ns))
4718       {
4719          if(parseDlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->dlCfg) != ROK)
4720          {
4721             return RFAILED;
4722          }
4723       }
4724
4725       if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_CFG_COMMON")) && (cur->ns == ns))
4726       {
4727          if(parseUlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->ulCfg) != ROK)
4728          {
4729             return RFAILED;
4730          }
4731       }
4732
4733       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_UL_DL_CFG_COMMON")) && (cur->ns == ns))
4734       {
4735          if(parseTddUlDlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->tddCfg) != ROK)
4736          {
4737             return RFAILED;
4738          }
4739       }
4740
4741       cur = cur -> next;
4742    }
4743    return ROK;
4744 }
4745
4746 /*******************************************************************
4747  *
4748  * @brief Fill SI Scheduling Information 
4749  *
4750  * @details
4751  *
4752  *    Function : parseSiSchedInfo
4753  *
4754  *    Functionality: Fill SI Scheduling Information
4755  *
4756  * @params[in] XML document pointer
4757  *             XML namespace
4758  *             Current node in XML
4759  *             Pointer to structure to be filled
4760  * @return ROK     - success
4761  *         RFAILED - failure
4762  *
4763  * ****************************************************************/
4764 uint8_t parseSiSchedInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SiSchedInfo *siSchedInfo)
4765 {
4766    memset(siSchedInfo, 0, sizeof(SiSchedInfo));
4767    cur = cur -> xmlChildrenNode;
4768    while(cur != NULL)
4769    {
4770       if ((!xmlStrcmp(cur->name, (const xmlChar *)"WIN_LEN")) && (cur->ns == ns))
4771       {
4772          siSchedInfo->winLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4773       }
4774
4775       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BROADCAST_STA")) && (cur->ns == ns))
4776       {
4777          siSchedInfo->broadcastSta = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4778       }
4779
4780       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PERIODICITY")) && (cur->ns == ns))
4781       {
4782          siSchedInfo->preiodicity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4783       }
4784
4785       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB_TYPE")) && (cur->ns == ns))
4786       {
4787          siSchedInfo->sibType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4788       }
4789
4790       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_VAL_TAG")) && (cur->ns == ns))
4791       {
4792          siSchedInfo->sibValTag = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4793       }
4794
4795       cur = cur -> next;
4796    }
4797    return ROK;
4798 }
4799
4800 /*******************************************************************
4801  *
4802  * @brief Fill SIB1 Parameters
4803  *
4804  * @details
4805  *
4806  *    Function : parseSib1Params
4807  *
4808  *    Functionality: Fill SIB1 Parameters
4809  *
4810  * @params[in] XML document pointer
4811  *             XML namespace
4812  *             Current node in XML
4813  *             Pointer to structure to be filled
4814  * @return ROK     - success
4815  *         RFAILED - failure
4816  *
4817  * ****************************************************************/
4818 uint8_t parseSib1Params(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Sib1Params *sib1Params)
4819 {
4820    memset(sib1Params, 0, sizeof(Sib1Params));
4821    cur = cur -> xmlChildrenNode;
4822    while(cur != NULL)
4823    {
4824       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
4825       {
4826          if(parsePlmn(doc, ns, cur, &sib1Params->plmn) != ROK)
4827          {
4828             return RFAILED;
4829          }
4830       }
4831
4832       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
4833       {
4834          sib1Params-> tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4835       }
4836
4837       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RANAC")) && (cur->ns == ns))
4838       {
4839          sib1Params->ranac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4840       }
4841
4842       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_IDENTITY")) && (cur->ns == ns))
4843       {
4844          sib1Params->cellIdentity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4845       }
4846
4847       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_RESVD_OPUSE")) && (cur->ns == ns))
4848       {
4849          sib1Params->cellResvdForOpUse = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4850       }
4851
4852       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_CNT")) && (cur->ns == ns))
4853       {
4854          sib1Params->connEstFailCnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4855       }
4856
4857       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_OFF_VALID")) && (cur->ns == ns))
4858       {
4859          sib1Params->connEstFailOffValidity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4860       }
4861
4862       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_OFFSET")) && (cur->ns == ns))
4863       {
4864          sib1Params->connEstFailOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4865       }
4866
4867       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SI_SHED_INFO")) && (cur->ns == ns))
4868       {
4869          if(parseSiSchedInfo(doc, ns, cur, &sib1Params->siSchedInfo) != ROK)
4870          {
4871             return RFAILED;
4872          }
4873       }
4874
4875       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SRV_CELLCFG_COM_SIB")) && (cur->ns == ns))
4876       {
4877          if(parseSrvCellCfgCmnSib(doc, ns, cur, &sib1Params->srvCellCfgCommSib) != ROK)
4878          {
4879             return RFAILED;
4880          }
4881       }
4882
4883       cur = cur -> next;
4884    }
4885    return ROK;
4886 }
4887 #endif
4888
4889 #ifndef O1_ENABLE
4890 /*******************************************************************
4891  *
4892  * @brief Fill RRM Policy List
4893  *
4894  * @details
4895  *
4896  *    Function : parseRrmPolicyList
4897  *
4898  *    Functionality: Fill RRM Policy List
4899  *
4900  * @params[in] XML document pointer
4901  *             XML namespace
4902  *             Current node in XML
4903  *             Pointer to structure to be filled
4904  * @return ROK     - success
4905  *         RFAILED - failure
4906  *
4907  * ****************************************************************/
4908 uint8_t parseRrmPolicyList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,RrmPolicyMemberList *rrmPolicyMemberList)
4909 {
4910    memset(rrmPolicyMemberList, 0, sizeof(RrmPolicyMemberList));
4911    cur = cur->xmlChildrenNode;
4912    while(cur != NULL)
4913    {
4914       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
4915       {
4916          if(parsePlmn(doc, ns, cur, &rrmPolicyMemberList->plmn) != ROK)
4917          {
4918             return RFAILED;
4919          }
4920       }
4921
4922       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SNSSAI")) && (cur->ns == ns))
4923       {
4924          if(parseSnssai(doc, ns, cur, &rrmPolicyMemberList->snssai) != ROK)
4925          {
4926             return RFAILED;
4927          }
4928       }
4929
4930       cur = cur -> next;
4931    }
4932    return ROK;
4933 }
4934
4935 /*******************************************************************
4936  *
4937  * @brief Fill RRM Policy Ratio
4938  *
4939  * @details
4940  *
4941  *    Function : parseRrmPolicyRatio
4942  *
4943  *    Functionality: Fill RRM Policy Ratio
4944  *
4945  * @params[in] XML document pointer
4946  *             XML namespace
4947  *             Current node in XML
4948  *             Pointer to structure to be filled
4949  * @return ROK     - success
4950  *         RFAILED - failure
4951  *
4952  * ****************************************************************/
4953 uint8_t parseRrmPolicyRatio(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RrmPolicyRatio *rrmPolicyRatio)
4954 {
4955    memset(rrmPolicyRatio, 0, sizeof(RrmPolicyRatio));
4956    cur = cur -> xmlChildrenNode;
4957    while(cur != NULL)
4958    {
4959       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_RATIO")) && (cur->ns == ns))
4960       {
4961          rrmPolicyRatio->maxRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4962       }
4963
4964       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIN_RATIO")) && (cur->ns == ns))
4965       {
4966          rrmPolicyRatio->minRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4967       }
4968
4969       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEDICATED_RATIO")) && (cur->ns == ns))
4970       {
4971          rrmPolicyRatio->dedicatedRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4972       }
4973
4974       cur = cur -> next;
4975    }
4976    return ROK;
4977 }
4978
4979 /*******************************************************************
4980  *
4981  * @brief Fill MAC Slice RRM Policy
4982  *
4983  * @details
4984  *
4985  *    Function : parseMacSliceRrmPolicy
4986  *
4987  *    Functionality: Fill MAC Slice RRM Policy
4988  *
4989  * @params[in] XML document pointer
4990  *             XML namespace
4991  *             Current node in XML
4992  *             Pointer to structure to be filled
4993  * @return ROK     - success
4994  *         RFAILED - failure
4995  *
4996  * ****************************************************************/
4997 uint8_t parseMacSliceRrmPolicy(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, MacSliceRrmPolicy *rrmPolicy)
4998 {
4999    uint8_t memIdx = 0;
5000
5001    memset(rrmPolicy, 0, sizeof(MacSliceRrmPolicy));
5002    cur = cur -> xmlChildrenNode;
5003    while(cur != NULL)
5004    {
5005       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RESOURCE_TYPE")) && (cur->ns == ns))
5006       {
5007          rrmPolicy->resourceType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5008       }
5009
5010       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RRM_POLICY_MEMBER")) && (cur->ns == ns))
5011       {
5012          rrmPolicy->numOfRrmPolicyMem = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5013       }
5014
5015       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RRM_POLICY_MEMBER_LIST")) && (cur->ns == ns))
5016       {
5017          DU_ALLOC_SHRABL_BUF(rrmPolicy->rRMPolicyMemberList,\
5018                rrmPolicy->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*));
5019
5020          if(!rrmPolicy->rRMPolicyMemberList)
5021          {
5022             DU_LOG("\nERROR  --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__);
5023             return RFAILED;
5024          }
5025
5026          for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++)
5027          {
5028             DU_ALLOC_SHRABL_BUF(rrmPolicy->rRMPolicyMemberList[memIdx], sizeof(RrmPolicyMemberList));
5029             if (rrmPolicy->rRMPolicyMemberList[memIdx] == NULLP)
5030             {
5031                DU_LOG("\nERROR  --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
5032                return RFAILED;
5033             }
5034
5035             if(parseRrmPolicyList(doc, ns, cur, rrmPolicy->rRMPolicyMemberList[memIdx]) != ROK)
5036             {
5037                return RFAILED;
5038             }
5039          }
5040       }
5041
5042       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RRM_POLICY_RATIO")) && (cur->ns == ns))
5043       {
5044          if(parseRrmPolicyRatio(doc, ns, cur, &rrmPolicy->policyRatio) != ROK)
5045          {
5046             return RFAILED;
5047          }
5048       }
5049
5050       cur = cur -> next;
5051    }
5052    return ROK;
5053 }
5054
5055 /*******************************************************************
5056  *
5057  * @brief Fill MAC Slice Configuration
5058  *
5059  * @details
5060  *
5061  *    Function : parseMacSliceCfgReq
5062  *
5063  *    Functionality: Fill MAC Slice Configuration
5064  *
5065  * @params[in] XML document pointer
5066  *             XML namespace
5067  *             Current node in XML
5068  *             Pointer to structure to be filled
5069  * @return ROK     - success
5070  *         RFAILED - failure
5071  *
5072  * ****************************************************************/
5073 uint8_t parseMacSliceCfgReq(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacSliceCfgReq *macSliceCfgReq)
5074 {
5075    uint8_t policyIdx = 0;
5076    memset(macSliceCfgReq, 0, sizeof(MacSliceCfgReq));
5077    cur = cur -> xmlChildrenNode;
5078    while(cur != NULL)
5079    {
5080       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RRM_POLICY")) && (cur->ns == ns))
5081       {
5082          macSliceCfgReq->numOfRrmPolicy = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5083       }
5084
5085       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_SLICE_RRM_POLICY")) && (cur->ns == ns))
5086       {
5087          DU_ALLOC_SHRABL_BUF(macSliceCfgReq->listOfRrmPolicy,  macSliceCfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*));
5088          if(!macSliceCfgReq->listOfRrmPolicy)
5089          {
5090             DU_LOG("\nERROR  --> DU APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
5091             return RFAILED;
5092          }
5093
5094          for(policyIdx = 0; policyIdx < macSliceCfgReq->numOfRrmPolicy; policyIdx++)
5095          {
5096             DU_ALLOC_SHRABL_BUF(macSliceCfgReq->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy));
5097             if (macSliceCfgReq->listOfRrmPolicy[policyIdx] == NULLP)
5098             {
5099                DU_LOG("\nERROR  --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
5100             }
5101             
5102             if(parseMacSliceRrmPolicy(doc, ns, cur, macSliceCfgReq->listOfRrmPolicy[policyIdx]) != ROK)
5103             {
5104                return RFAILED;
5105             }
5106          }
5107       }
5108       cur = cur -> next;
5109    }
5110    return ROK;
5111 }
5112 #endif
5113
5114 #ifdef THREAD_AFFINITY
5115 /*******************************************************************
5116  *
5117  * @brief Set thread affinity to the core configured via XML file
5118  *
5119  * @details
5120  *
5121  *    Function : parseThreadAffinity
5122  *
5123  *    Functionality: Set thread affinity to the core configured 
5124  *       via XML file
5125  *
5126  * @params[in] XML document pointer
5127  *             XML namespace
5128  *             Current node in XML
5129  *             Thread information
5130  * @return ROK     - success
5131  *         RFAILED - failure
5132  *
5133  * ****************************************************************/
5134 uint8_t parseThreadAffinity(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, ThreadInfo *threads)
5135 {
5136    cur = cur -> xmlChildrenNode;
5137    while(cur != NULL)
5138    {
5139       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_APP_CORE")) && (cur->ns == ns))
5140       {
5141          threads->duAppCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5142          ODU_SET_THREAD_AFFINITY(&threads->duAppSTskId, SS_AFFINITY_MODE_EXCL, threads->duAppCoreId, 0);
5143       }
5144
5145       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EGTP_CORE")) && (cur->ns == ns))
5146       {
5147          threads->egtpCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5148          ODU_SET_THREAD_AFFINITY(&threads->egtpSTskId, SS_AFFINITY_MODE_EXCL, threads->egtpCoreId, 0);
5149       }
5150
5151       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RLC_MAC_CORE")) && (cur->ns == ns))
5152       {
5153          threads->rlcMacCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5154          ODU_SET_THREAD_AFFINITY(&threads->rlcMacSTskId, SS_AFFINITY_MODE_EXCL, threads->rlcMacCoreId, 0);
5155       }
5156
5157       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RLC_UL_CORE")) && (cur->ns == ns))
5158       {
5159          threads->rlcUlCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5160          ODU_SET_THREAD_AFFINITY(&threads->rlcUlSTskId, SS_AFFINITY_MODE_EXCL, threads->rlcUlCoreId, 0);
5161       }
5162
5163       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCH_CORE")) && (cur->ns == ns))
5164       {
5165          threads->schCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5166          ODU_SET_THREAD_AFFINITY(&threads->schSTskId, SS_AFFINITY_MODE_EXCL, threads->schCoreId, 0);
5167       }
5168
5169       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCTP_CORE")) && (cur->ns == ns))
5170       {
5171          threads->sctpCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5172          ODU_SET_THREAD_AFFINITY(&threads->sctpSTskId, SS_AFFINITY_MODE_EXCL, threads->sctpCoreId, 0);
5173       }
5174
5175       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOWER_MAC_CORE")) && (cur->ns == ns))
5176       {
5177          threads->lwrMacCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5178          ODU_SET_THREAD_AFFINITY(&threads->lwrMacSTskId, SS_AFFINITY_MODE_EXCL, threads->lwrMacCoreId, 0);
5179       }
5180
5181       cur = cur -> next;
5182    }
5183    return ROK;
5184 }
5185 #endif
5186
5187 /*******************************************************************
5188  *
5189  * @brief Fill tmrTqCp
5190  *
5191  * @details
5192  *
5193  *    Function : parseTmrTqCp
5194  *
5195  *    Functionality: Fill tmrTqCp
5196  *
5197  * @params[in] XML document pointer
5198  *             XML namespace
5199  *             Current node in XML
5200  *             Pointer to structure to be filled
5201  * @return ROK     - success
5202  *         RFAILED - failure
5203  *
5204  * ****************************************************************/
5205 uint8_t parseTmrTqCp(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CmTqCp *tmrTqCp)
5206 {
5207    memset(tmrTqCp, 0, sizeof(CmTqCp));
5208    cur = cur ->xmlChildrenNode;
5209    while(cur != NULL)
5210    {
5211       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_LEN")) && (cur->ns == ns))
5212       {
5213          tmrTqCp->tmrLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5214       }
5215       cur = cur -> next;
5216    }
5217    return ROK;
5218 }
5219
5220 /*******************************************************************
5221  *
5222  * @brief Fill DU timer Parameters
5223  *
5224  * @details
5225  *
5226  *    Function : parseDuTimerParams
5227  *
5228  *    Functionality: Fill DU timer Parmeters
5229  *
5230  * @params[in] XML document pointer
5231  *             XML namespace
5232  *             Current node in XML
5233  *             Pointer to structure to be filled
5234  * @return ROK     - success
5235  *         RFAILED - failure
5236  *
5237  * ****************************************************************/
5238 uint8_t parseDuTimerParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, DuTimers  *duTimers)
5239 {
5240    memset(duTimers, 0, sizeof(DuTimers));
5241    
5242    cur = cur->xmlChildrenNode;
5243    while (cur != NULL)
5244    {
5245       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_TQ_CP")) && (cur->ns == ns))
5246       {
5247          if(parseTmrTqCp(doc, ns, cur, &duTimers->tmrTqCp) != ROK)
5248          {
5249             return RFAILED;
5250          }
5251          else
5252          {
5253             /* Initialzie the timer queue */   
5254             memset(&(duTimers->tmrTq), 0, sizeof(CmTqType) * duTimers->tmrTqCp.tmrLen);
5255          }
5256       }
5257
5258       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_RESOLUTION")) && (cur->ns == ns))
5259       {
5260          duTimers->tmrRes = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5261       }
5262       cur = cur -> next;
5263    }
5264    return ROK;
5265 }
5266
5267 /*******************************************************************
5268  *
5269  * @brief Fill TNL assoc 
5270  *
5271  * @details
5272  *
5273  *    Function : parseTnlAssoc
5274  *
5275  *    Functionality: Fill TNL assoc
5276  *
5277  * @params[in] XML document pointer
5278  *             XML namespace
5279  *             Current node in XML
5280  *             Pointer to structure to be filled
5281  * @return ROK     - success
5282  *         RFAILED - failure
5283  *
5284  * ****************************************************************/
5285 uint8_t parseTnlAssoc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TNLAssociation *tnlAssoc)
5286 {
5287    char *duIpV4Addr;
5288    char *ricIpV4Addr;
5289    CmInetIpAddr duIp;
5290    CmInetIpAddr ricIp;
5291
5292    memset(tnlAssoc, 0, sizeof(TNLAssociation));
5293    cur = cur ->xmlChildrenNode;
5294    while(cur != NULL)
5295    {
5296       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOCAL_IP")) && (cur->ns == ns))
5297       {
5298          duIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5299          cmInetAddr(duIpV4Addr, &(duIp));
5300          tnlAssoc->localIpAddress.ipV4Pres = true;
5301          tnlAssoc->localIpAddress.ipV4Addr = duIp;
5302       }
5303
5304       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOCAL_PORT")) && (cur->ns == ns))
5305       {
5306          tnlAssoc->localPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5307       }
5308
5309       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESTINATION_IP")) && (cur->ns == ns))
5310       {
5311          ricIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5312          cmInetAddr(ricIpV4Addr, &(ricIp));
5313          tnlAssoc->destIpAddress.ipV4Pres = true;
5314          tnlAssoc->destIpAddress.ipV4Addr = ricIp;
5315       }
5316
5317       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESTINATION_PORT")) && (cur->ns == ns))
5318       {
5319          tnlAssoc->destPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5320       }
5321
5322       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ASSOC_USAGE")) && (cur->ns == ns))
5323       {
5324          tnlAssoc->usage = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5325       }
5326       cur = cur -> next;
5327    }
5328    return ROK;
5329 }
5330
5331 /*******************************************************************
5332  *
5333  * @brief Fill E2 config Parameters
5334  *
5335  * @details
5336  *
5337  *    Function : parseE2ConfigParams
5338  *
5339  *    Functionality: Fill E2 config Parmeters
5340  *
5341  * @params[in] XML document pointer
5342  *             XML namespace
5343  *             Current node in XML
5344  *             Pointer to structure to be filled
5345  * @return ROK     - success
5346  *         RFAILED - failure
5347  *
5348  * ****************************************************************/
5349 uint8_t parseE2ConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, E2apDb *e2apDb)
5350 {
5351    uint8_t tnlIdx=0;
5352    xmlNodePtr child = NULLP;
5353
5354    memset(e2apDb, 0, sizeof(E2apDb));
5355    cur = cur->xmlChildrenNode;
5356    while (cur != NULL)
5357    {
5358       if ((!xmlStrcmp(cur->name, (const xmlChar *)"E2_NODE_ID")) && (cur->ns == ns))
5359       {
5360          e2apDb->e2NodeId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5361       }
5362
5363       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_TNL_ASSOC")) && (cur->ns == ns))
5364       {
5365          e2apDb->numOfTNLAssoc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5366       }
5367
5368       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TNL_ASSOC_LIST")) && (cur->ns == ns))
5369       {
5370          child = cur->xmlChildrenNode;
5371          while(child != NULL)
5372          {
5373             if ((!xmlStrcmp(child->name, (const xmlChar *)"TNL_ASSOC")) && (child->ns == ns))
5374            {
5375               if(parseTnlAssoc(doc, ns, child,&e2apDb->tnlAssoc[tnlIdx]) != ROK)
5376               {
5377                  return RFAILED;
5378               }
5379               tnlIdx++;
5380
5381            }
5382            child = child -> next;
5383         }
5384      }
5385      cur = cur -> next;
5386    }
5387    return ROK;
5388 }
5389
5390 /*******************************************************************
5391  *
5392  * @brief Fill DU Config Parmeters 
5393  *
5394  * @details
5395  *
5396  *    Function : parseDuCfgParams
5397  *
5398  *    Functionality:
5399  *
5400  * @params[in] XML document pointer
5401  *             XML namespace
5402  *             Current node in XML
5403  * @return ROK     - success
5404  *         RFAILED - failure
5405  *
5406  * ****************************************************************/
5407 uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
5408 {
5409    char *tempDuName = "";
5410    char *duIpV4Addr;
5411    char *cuIpV4Addr;
5412    char *ricIpV4Addr;
5413    CmInetIpAddr duIp;
5414    CmInetIpAddr cuIp;
5415    CmInetIpAddr ricIp;
5416
5417    cur = cur->xmlChildrenNode;
5418    while(cur != NULL)
5419    {
5420       if ((!xmlStrcmp(cur->name, (const xmlChar *)"THREAD_AFFINITY")) && (cur->ns == ns))
5421       {
5422 #ifdef THREAD_AFFINITY      
5423          if(parseThreadAffinity(doc, ns, cur, &duCfgParam.threadInfo) != ROK)
5424          {
5425             return RFAILED;
5426          }
5427 #endif         
5428       }
5429
5430       if ((!xmlStrcmp(cur->name, (const xmlChar *)"GNB_ID")) && (cur->ns == ns))
5431       {
5432          duCb.gnbId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5433       }
5434
5435       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_ID")) && (cur->ns == ns))
5436       {
5437          duCfgParam.duId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5438       }
5439
5440       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_NAME")) && (cur->ns == ns))
5441       {
5442          tempDuName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5443          DU_ALLOC(duCfgParam.duName, strlen(tempDuName));
5444          if(!duCfgParam.duName)
5445          {
5446             DU_LOG("\nERROR --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
5447             return RFAILED;
5448          }
5449          strcpy((char*)duCfgParam.duName, tempDuName);
5450       }
5451
5452       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_DRB")) && (cur->ns == ns))
5453       {
5454          duCfgParam.maxNumDrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5455       }
5456
5457       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_UE_SUPPORTED")) && (cur->ns == ns))
5458       {
5459          duCfgParam.maxSupportedUes = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5460       }
5461
5462       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_UE")) && (cur->ns == ns))
5463       {
5464          duCfgParam.maxUe = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5465       }
5466
5467 #ifdef O1_ENABLE
5468       if( getStartupConfig(&g_cfg) != ROK )
5469       {
5470          RETVALUE(RFAILED);
5471       }
5472       cmInetAddr((S8*)g_cfg.DU_IPV4_Addr, &duIp);
5473       cmInetAddr((S8*)g_cfg.CU_IPV4_Addr, &cuIp);
5474       cmInetAddr((S8*)g_cfg.RIC_IPV4_Addr, &ricIp);
5475
5476 #else
5477       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_IP_V4_ADDR")) && (cur->ns == ns))
5478       {
5479          duIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5480          cmInetAddr(duIpV4Addr, &(duIp));
5481       }
5482
5483       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CU_IP_V4_ADDR")) && (cur->ns == ns))
5484       {
5485          cuIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5486          cmInetAddr(cuIpV4Addr, &(cuIp));
5487       }
5488
5489       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_IP_V4_ADDR")) && (cur->ns == ns))
5490       {
5491          ricIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5492          cmInetAddr(ricIpV4Addr, &(ricIp));
5493       }
5494 #endif
5495
5496       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCTP")) && (cur->ns == ns))
5497       {
5498          if(parseSctpParams(doc, ns, cur, &duCfgParam.sctpParams) != ROK)
5499          {
5500             return RFAILED;
5501          }
5502          duCfgParam.sctpParams.duIpAddr.ipV4Pres = true;
5503          duCfgParam.sctpParams.duIpAddr.ipV4Addr = duIp;
5504          duCfgParam.sctpParams.cuIpAddr.ipV4Pres = true;
5505          duCfgParam.sctpParams.cuIpAddr.ipV4Addr = cuIp;
5506          duCfgParam.sctpParams.ricIpAddr.ipV4Pres = true;
5507          duCfgParam.sctpParams.ricIpAddr.ipV4Addr = ricIp;
5508       }
5509
5510       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EGTP")) && (cur->ns == ns))
5511       {
5512          if(parseEgtpParams(doc, ns, cur, &duCfgParam.egtpParams) != ROK)
5513          {
5514             return RFAILED;
5515          }
5516          duCfgParam.egtpParams.localIp.ipV4Addr = duIp;
5517          duCfgParam.egtpParams.localIp.ipV4Pres = true;
5518          duCfgParam.egtpParams.destIp.ipV4Pres = true;
5519          duCfgParam.egtpParams.destIp.ipV4Addr = cuIp;
5520          duCfgParam.egtpParams.maxTunnelId = duCfgParam.maxNumDrb * duCfgParam.maxSupportedUes; 
5521       }
5522
5523       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIB_PARAMS")) && (cur->ns == ns))
5524       {
5525          if(parseMibParams(doc, ns, cur, &duCfgParam.mibParams) != ROK)
5526          {
5527             return RFAILED;
5528          }
5529       }
5530
5531 #ifdef XML_BASED_CONFIG
5532       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_PARAMS")) && (cur->ns == ns))
5533       {
5534          if(parseSib1Params(doc, ns, cur, &duCfgParam.sib1Params) != ROK)
5535          {
5536             return RFAILED;
5537          }
5538       }
5539
5540       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_DU_SRVD_CELL_INFO")) && (cur->ns == ns))
5541       {
5542          if(parseF1DuServedCellInfo(doc, ns, cur, &duCfgParam.srvdCellLst[0]) != ROK)
5543          {
5544             return RFAILED;
5545          }
5546       }
5547
5548       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_CELL_CFG")) && (cur->ns == ns))
5549       {
5550          if(parseMacCellCfg(doc, ns, cur, &duCfgParam.macCellCfg) != ROK)
5551          {
5552             return RFAILED;
5553          }
5554       }
5555 #endif      
5556
5557 #ifndef O1_ENABLE
5558       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SLICE_CFG")) && (cur->ns == ns))
5559       {
5560          if(parseMacSliceCfgReq(doc, ns, cur, &duCfgParam.tempSliceCfg) != ROK)
5561          {
5562             return RFAILED;
5563          }
5564       }
5565 #endif      
5566
5567       if((!xmlStrcmp(cur->name, (const xmlChar *)"DU_TIMER_INFO")) && (cur->ns == ns))
5568       {
5569          if(parseDuTimerParams(doc, ns, cur, &duCb.duTimersInfo) != ROK)
5570          {
5571             return RFAILED;
5572          }
5573       }
5574
5575       if((!xmlStrcmp(cur->name, (const xmlChar *)"E2AP_CFG")) && (cur->ns == ns))
5576       {
5577          if(parseE2ConfigParams(doc, ns, cur, &duCb.e2apDb) != ROK)
5578          {
5579             return RFAILED;
5580          }
5581       }
5582       cur = cur -> next;
5583    }
5584    return ROK;
5585 }
5586
5587 /*******************************************************************
5588  *
5589  * @brief Reads config and posts message to du_app on completion
5590  *
5591  * @details
5592  *
5593  *    Function : duReadCfg
5594  *
5595  *    Functionality:
5596  *      - Reads configuration from xml file and stores in DB
5597  *      - Post to du_app for further processing
5598  *
5599  * @params[in] void
5600  * @return ROK     - success
5601  *         RFAILED - failure
5602  *
5603  * ****************************************************************/
5604 uint8_t duReadCfg()
5605 {
5606    const char *filename = "../build/config/odu_config.xml";
5607    xmlDocPtr doc = NULLP;
5608    xmlNodePtr cur = NULLP;
5609    xmlNsPtr ns = NULLP;
5610
5611    doc = xmlParseFile(filename);
5612    if(doc == NULL)
5613    {
5614       DU_LOG("\nERROR  --> DU_APP: Failed to parse the XML file");
5615       return RFAILED;
5616    }
5617
5618    cur = xmlDocGetRootElement(doc);
5619    ns = xmlSearchNsByHref(doc, cur, (const xmlChar *)"urn:o-ran:odu:configuration");
5620    if(ns == NULL)
5621    {
5622       DU_LOG("\nERROR  --> DU_APP: XML Namespace not found.\n");
5623       xmlFreeDoc(doc);
5624       xmlCleanupParser();
5625       return RFAILED;
5626    }
5627
5628    parseDuCfgParams(doc, ns, cur);
5629
5630    xmlFreeDoc(doc);
5631    xmlCleanupParser();
5632
5633    Pst pst;
5634    Buffer *mBuf;
5635
5636    /* Read configs into duCfgParams */
5637    if(readCfg() != ROK)
5638    {
5639       DU_LOG("\nERROR  -->  DU_APP : Reading configuration failed");
5640       return RFAILED;
5641    }
5642    printDuConfig();
5643
5644    /* Fill pst structure */
5645    memset(&(pst), 0, sizeof(Pst));
5646    pst.srcEnt = (Ent)ENTDUAPP;
5647    pst.srcInst = (Inst)DU_INST;
5648    pst.srcProcId = DU_PROC;
5649    pst.dstEnt = pst.srcEnt;
5650    pst.dstInst = pst.srcInst;
5651    pst.dstProcId = pst.srcProcId;
5652    pst.event = EVTCFG;
5653    pst.selector = ODU_SELECTOR_TC;
5654    pst.pool= DU_POOL;
5655
5656    /* Initialize the timer blocks */
5657    cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2SetupTimer), 1);
5658    cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.ricServiceUpdateTimer.timer), 1);
5659    cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2NodeConfigUpdate.timer), 1);
5660
5661    /* Timer Registration request to system services */
5662    if (ODU_REG_TMR_MT(pst.srcEnt, pst.srcInst, duCb.duTimersInfo.tmrRes, duActvTmr) != ROK)
5663    {
5664       DU_LOG("\nERROR  -->  DU_APP : Failed to register timer");
5665       return RFAILED;
5666    }   
5667               
5668    if(ODU_GET_MSG_BUF(DFLT_REGION, DU_POOL, &mBuf) != ROK)
5669    {
5670       DU_LOG("\nERROR  -->  DU_APP : Memory allocation failed in duReadCfg");
5671       return RFAILED;
5672    }
5673
5674    if (ODU_POST_TASK(&pst, mBuf) != ROK)
5675    {
5676       DU_LOG("\nERROR  -->  DU_APP : ODU_POST_TASK failed in duReadCfg");
5677       return RFAILED;
5678    }
5679
5680    return ROK;
5681 }
5682
5683 /*******************************************************************
5684  *
5685  * @brief Prints all DU Configuration
5686  *
5687  * @details
5688  *
5689  *    Function : printDuConfig
5690  *
5691  *    Functionality:
5692  *      - Prints all DU configurations
5693  *
5694  * @params[in] void
5695  * @return void
5696  *
5697  * ****************************************************************/
5698 void printDuConfig()
5699 {
5700    uint8_t sliceIdx = 0, pfIdx = 0, rsrcIdx = 0, ssbMaskIdx = 0, fdmIdx = 0;
5701    uint8_t monitoringSymbIdx = 0, poIdx = 0, policyIdx = 0, memIdx = 0;
5702    __attribute__((unused)) SctpParams *sctp;
5703    __attribute__((unused)) F1EgtpParams *egtp;
5704    __attribute__((unused)) MibParams *mib;
5705    __attribute__((unused)) F1RrcVersion *f1RrcVersion;
5706    F1DuCellInfo *f1DuCellInfo;
5707    F1CellInfo *f1CellInfo;
5708    __attribute__((unused)) F1DuSysInfo *duSysInfo;
5709    __attribute__((unused)) F1BrdcstPlmnInfo *brdcstPlmnInfo;
5710    NrModeInfo *nrModeInfo; 
5711    __attribute__((unused)) F1NrFddInfo *f1NrFddInfo;
5712    F1SrvdPlmn *srvdPlmn;
5713    SupportedSliceList *sliceSuppLst;
5714    MacCellCfg *macCellCfg;
5715    __attribute__((unused)) CarrierCfg *carrierCfg;
5716    CellCfg *cellCfg;
5717    PlmnInfoList *plmnInfoList;
5718    Sib1CellCfg *sib1Cfg;
5719    SchPageCfg *pageCfg;
5720    __attribute__((unused)) PdcchConfigSib1 *pdcchConfigSib1;
5721    BwpDlConfig *bwpDlCfg;
5722    __attribute__((unused)) BwpParams *bwp;
5723    PdcchConfigCommon *pdcchCfgCmn;
5724    SearchSpaceCfg *searchSpaceCfg;
5725    __attribute__((unused)) CandidatesInfo *candidateInfo;
5726    PdschConfigCommon *pdschCfgCmn;
5727    __attribute__((unused)) PdschCfgCommTimeDomRsrcAlloc *pdschCmnTimeDomRsrcAlloc;
5728    BwpUlConfig *bwpUlCfg;
5729    __attribute__((unused)) PucchConfigCommon *pucchCfgCmn;
5730    PuschConfigCommon *puschCfgCmn;
5731    __attribute__((unused)) PuschTimeDomRsrcAlloc *puschTimeDomRsrcAlloc;
5732    __attribute__((unused)) SsbCfg *ssbCfg;
5733    __attribute__((unused)) CsiRsCfg *csiRsCfg;
5734    PrachCfg *prachCfg;
5735    __attribute__((unused)) PrachFdmInfo *prachFdmInfo;
5736    __attribute__((unused)) PrecodingConf *precodCfg;
5737    __attribute__((unused)) BeamformingConf *beamFormingCfg;
5738    Sib1Params *sib1Params;
5739    __attribute__((unused)) SiSchedInfo *siSchedInfo;
5740    SrvCellCfgCommSib *srvCellCfgCmnSib;
5741    DlCfgCommon *dlCfgCmn;
5742    PdcchCfgCommon *pdcchCfgCommon;
5743    PdschCfgCommon *pdschCfgCommon;
5744    __attribute__((unused)) PdschTimeDomainRsrcAlloc *pdschTimeDomRsrcAlloc;
5745    __attribute__((unused)) BcchCfg *bcchCfg;
5746    __attribute__((unused)) PcchCfg *pcchCfg;
5747    UlCfgCommon *ulCfgCmn;
5748    RachCfgCommon *rachCfgCmn;
5749    PuschCfgCommon *puschCfgCommon;
5750    __attribute__((unused)) PuschCfgCmnTimeDomAlloc *puschCmnTimeDomRsrsAlloc;
5751    PucchCfgCommon *pucchCfgCommon;
5752    __attribute__((unused)) TddUlDlCfgCommon *tddUlDlCfgCmn;
5753    MacSliceCfgReq *macSliceCfg;
5754    MacSliceRrmPolicy *rrmPolicy;
5755    __attribute__((unused)) RrmPolicyRatio *rrmPolicyRatio;
5756    __attribute__((unused)) RrmPolicyMemberList *rrmPolicyMemberList;
5757
5758 #ifdef NR_TDD
5759    F1NrTddInfo *f1NrTddInfo;
5760    TDDCfg *tddCfg;
5761 #endif
5762
5763    DU_LOG("\n ** DU CONFIGURATION ** \n");
5764    DU_LOG("DU ID %d\n", duCfgParam.duId);
5765    DU_LOG("DU Name %s\n", duCfgParam.duName);
5766
5767    DU_LOG("\n ** Thread Affinity ** \n");
5768    DU_LOG("DU APP CORE ID %d\n", duCfgParam.threadInfo.duAppCoreId);
5769    DU_LOG("EGTP CORE ID %d\n", duCfgParam.threadInfo.egtpCoreId);
5770    DU_LOG("SCTP CORE ID %d\n", duCfgParam.threadInfo.sctpCoreId);
5771    DU_LOG("RLC-UL CORE ID %d\n", duCfgParam.threadInfo.rlcUlCoreId);
5772    DU_LOG("RLC-DL and MAC CORE ID %d\n", duCfgParam.threadInfo.rlcMacCoreId);
5773    DU_LOG("SCH CORE ID %d\n", duCfgParam.threadInfo.schCoreId);
5774    DU_LOG("Lower MAC CORE ID %d\n", duCfgParam.threadInfo.lwrMacCoreId);
5775
5776    DU_LOG("MAX NUM DRB %d\n", duCfgParam.maxNumDrb);
5777    DU_LOG("MAX SUPPORTED UE %d\n", duCfgParam.maxSupportedUes);
5778    DU_LOG("MAX UE %d\n",duCfgParam.maxUe);
5779
5780    sctp = &duCfgParam.sctpParams;
5781    DU_LOG("\n ** SCTP PARAMETER ** \n");
5782    DU_LOG("DU IPv4 Address present %u\n", sctp->duIpAddr.ipV4Pres);
5783    DU_LOG("DU IP Address %u\n", sctp->duIpAddr.ipV4Addr);
5784    DU_LOG("CU IPv4 Address present %u\n", sctp->cuIpAddr.ipV4Pres);
5785    DU_LOG("CU IP Address %u\n", sctp->cuIpAddr.ipV4Addr);
5786    DU_LOG("RIC IPv4 Address present %u\n", sctp->ricIpAddr.ipV4Pres);
5787    DU_LOG("RIC IP Address %u\n", sctp->ricIpAddr.ipV4Addr);
5788    DU_LOG("SCTP Port at DU for F1 Interface %d\n", sctp->duPort[F1_INTERFACE]);
5789    DU_LOG("SCTP Port at CU for F1 Interface %d\n", sctp->cuPort);
5790    DU_LOG("SCTP Port at DU for E2 Interface %d\n", sctp->duPort[E2_INTERFACE]);
5791    DU_LOG("SCTP Port at RIC for E2 Interface %d\n", sctp->ricPort);
5792
5793    egtp = &duCfgParam.egtpParams;
5794    DU_LOG("\n ** EGTP PARAMETER ** \n");
5795    DU_LOG("DU IP Address %d\n", egtp->localIp.ipV4Addr);
5796    DU_LOG("CU IP Address %d\n", egtp->destIp.ipV4Addr);
5797    DU_LOG("EGTP Port at DU %d\n", egtp->localPort);
5798    DU_LOG("EGTP Port at CU %d\n", egtp->destPort);
5799    DU_LOG("Minimum Tunnel ID %d\n", egtp->minTunnelId);
5800    DU_LOG("Maximum Tunnel ID %d\n",egtp->maxTunnelId);
5801
5802    mib = &duCfgParam.mibParams;
5803    DU_LOG("\n ** MIB PARAMETER ** \n");
5804    DU_LOG("System Frame Number %d\n", mib->sysFrmNum);
5805    DU_LOG("Subcarrier Spacing Common %ld\n", mib->subCarrierSpacingCommon);
5806    DU_LOG("SSB Subcarrier Offset %ld\n", mib->ssb_SubcarrierOffset);
5807    DU_LOG("DMRS Type-A Position %ld\n", mib->dmrs_TypeA_Position);
5808    DU_LOG("Control Resource Set Zero %ld\n", mib->controlResourceSetZero);
5809    DU_LOG("Search Space Zero %ld\n", mib->searchSpaceZero);
5810    DU_LOG("Cell Barred %ld\n", mib->cellBarred);
5811    DU_LOG("Intra Frequency Reselection %ld\n", mib->intraFreqReselection);
5812    
5813    duSysInfo = &duCfgParam.srvdCellLst[0].duSysInfo;
5814    DU_LOG("\n ** DU System Information ** \n");
5815    DU_LOG("MIB length %d\n", duSysInfo->mibLen);
5816    DU_LOG("MIB message  %s\n", duSysInfo->mibMsg);
5817    DU_LOG("SIB1 length  %d\n", duSysInfo->sib1Len);
5818    DU_LOG("SIB1 message  %s\n", duSysInfo->sib1Msg);
5819    
5820    f1DuCellInfo = &duCfgParam.srvdCellLst[0].duCellInfo;
5821    DU_LOG("\n ** DU Cell Information ** \n");
5822
5823    f1CellInfo = &f1DuCellInfo->cellInfo;
5824    DU_LOG("NR PCI %d\n", f1CellInfo->nrPci);
5825    DU_LOG("DU TAC %d\n", f1DuCellInfo->tac);   
5826    DU_LOG("EPS TAC %d\n", f1DuCellInfo->epsTac);
5827    DU_LOG("Measurement Time Configuration Duration %d\n", f1DuCellInfo->measTimeCfgDuration);
5828    DU_LOG("Cell Direction %d\n", f1DuCellInfo->cellDir);
5829    DU_LOG("Cell Type %d\n", f1DuCellInfo->cellType);
5830
5831    DU_LOG("\n ** Cell  Info : NR CGI ** \n");
5832    DU_LOG("Cell Id %d\n",f1CellInfo->nrCgi.cellId);
5833    DU_LOG("PLMN : mcc[0] %d\n", f1CellInfo->nrCgi.plmn.mcc[0]);
5834    DU_LOG("PLMN : mcc[1] %d\n", f1CellInfo->nrCgi.plmn.mcc[1]);
5835    DU_LOG("PLMN : mcc[2] %d\n", f1CellInfo->nrCgi.plmn.mcc[2]);
5836    DU_LOG("PLMN : mnc[0] %d\n", f1CellInfo->nrCgi.plmn.mnc[0]);
5837    DU_LOG("PLMN : mnc[1] %d\n", f1CellInfo->nrCgi.plmn.mnc[1]);
5838    DU_LOG("PLMN : mnc[2] %d\n", f1CellInfo->nrCgi.plmn.mnc[2]);
5839
5840    srvdPlmn = &f1CellInfo->srvdPlmn[0];
5841    DU_LOG("\n ** Cell  Info : Served PLMN ** \n");
5842    DU_LOG("PLMN : mcc[0] %d\n", srvdPlmn->plmn.mcc[0]);
5843    DU_LOG("PLMN : mcc[1] %d\n", srvdPlmn->plmn.mcc[1]);
5844    DU_LOG("PLMN : mcc[2] %d\n", srvdPlmn->plmn.mcc[2]);
5845    DU_LOG("PLMN : mnc[0] %d\n", srvdPlmn->plmn.mnc[0]);
5846    DU_LOG("PLMN : mnc[1] %d\n", srvdPlmn->plmn.mnc[1]);
5847    DU_LOG("PLMN : mnc[2] %d\n", srvdPlmn->plmn.mnc[2]);
5848    DU_LOG("EXT_PLMN : mcc[0] %d\n", srvdPlmn->extPlmn.mcc[0]);
5849    DU_LOG("EXT_PLMN : mcc[1] %d\n", srvdPlmn->extPlmn.mcc[1]);
5850    DU_LOG("EXT_PLMN : mcc[2] %d\n", srvdPlmn->extPlmn.mcc[2]);
5851    DU_LOG("EXT_PLMN : mnc[0] %d\n", srvdPlmn->extPlmn.mnc[0]);
5852    DU_LOG("EXT_PLMN : mnc[1] %d\n", srvdPlmn->extPlmn.mnc[1]);
5853    DU_LOG("EXT_PLMN : mnc[2] %d\n", srvdPlmn->extPlmn.mnc[2]);
5854
5855    sliceSuppLst = &srvdPlmn->taiSliceSuppLst;
5856    DU_LOG("\n ** Cell  Info : Served PLMN : Supported Slice List ** \n");
5857    DU_LOG("Number of Slices supported %d\n", sliceSuppLst->numSupportedSlices);
5858    for (sliceIdx = 0; sliceIdx < sliceSuppLst->numSupportedSlices; sliceIdx++)
5859    {
5860       DU_LOG("Slice\n");
5861       DU_LOG("\tSST %d\n", (*sliceSuppLst->snssai[sliceIdx]).sst);
5862       DU_LOG("\tSD %d %d %d\n", (*sliceSuppLst->snssai[sliceIdx]).sd[0], (*sliceSuppLst->snssai[sliceIdx]).sd[1], \
5863          (*sliceSuppLst->snssai[sliceIdx]).sd[2]);
5864    }
5865    
5866    brdcstPlmnInfo = &f1DuCellInfo->brdcstPlmnInfo[0];
5867    DU_LOG("\n ** DU Cell Information : Broadcast PLMN Info ** \n");
5868    DU_LOG("TAC %d\n", brdcstPlmnInfo->tac);
5869    DU_LOG("NR Cell Id %d\n", brdcstPlmnInfo->nrCellId);
5870    DU_LOG("RANAC %d\n", brdcstPlmnInfo->ranac);
5871
5872    DU_LOG("PLMN : mcc[0] %d\n", brdcstPlmnInfo->plmn[0].mcc[0]);
5873    DU_LOG("PLMN : mcc[1] %d\n", brdcstPlmnInfo->plmn[0].mcc[1]);
5874    DU_LOG("PLMN : mcc[2] %d\n", brdcstPlmnInfo->plmn[0].mcc[2]);
5875    DU_LOG("PLMN : mnc[0] %d\n", brdcstPlmnInfo->plmn[0].mnc[0]);
5876    DU_LOG("PLMN : mnc[1] %d\n", brdcstPlmnInfo->plmn[0].mnc[1]);
5877    DU_LOG("PLMN : mnc[2] %d\n", brdcstPlmnInfo->plmn[0].mnc[2]);
5878     
5879    DU_LOG("EXT_PLMN : mcc[0] %d\n", brdcstPlmnInfo->extPlmn[0].mcc[0]);
5880    DU_LOG("EXT_PLMN : mcc[1] %d\n", brdcstPlmnInfo->extPlmn[0].mcc[1]);
5881    DU_LOG("EXT_PLMN : mcc[2] %d\n", brdcstPlmnInfo->extPlmn[0].mcc[2]);
5882    DU_LOG("EXT_PLMN : mnc[0] %d\n", brdcstPlmnInfo->extPlmn[0].mnc[0]);
5883    DU_LOG("EXT_PLMN : mnc[1] %d\n", brdcstPlmnInfo->extPlmn[0].mnc[1]);
5884    DU_LOG("EXT_PLMN : mnc[2] %d\n", brdcstPlmnInfo->extPlmn[0].mnc[2]);
5885
5886    nrModeInfo = &f1DuCellInfo->f1Mode;
5887    f1NrFddInfo = &nrModeInfo->mode.fdd;
5888    DU_LOG("\n ** DU Cell Information : NR Mode Info ** \n");
5889 #ifndef NR_TDD   
5890    DU_LOG("\n ** NR Mode Info : FDD ** \n");
5891    DU_LOG("\n ** NR Mode Info : FDD : UL NR Frequency ** \n");
5892    DU_LOG("NR ARFCN %d\n", f1NrFddInfo->ulNrFreqInfo.nrArfcn);
5893    DU_LOG("SUL : ARFCN %d\n",f1NrFddInfo->ulNrFreqInfo.sulInfo.sulArfcn);
5894    DU_LOG("SUL : Transmission BW Subcarrier Spacing %d\n", f1NrFddInfo->ulNrFreqInfo.sulInfo.sulTxBw.nrScs);
5895    DU_LOG("SUL : Number of RBs in Transmission BW %d\n", f1NrFddInfo->ulNrFreqInfo.sulInfo.sulTxBw.nrb);
5896    DU_LOG("NR Frequency Band %d\n", f1NrFddInfo->ulNrFreqInfo.freqBand[0].nrFreqBand);
5897    DU_LOG("SUL Band %d\n", f1NrFddInfo->ulNrFreqInfo.freqBand[0].sulBand[0]);
5898
5899    DU_LOG("\n ** NR Mode Info : FDD : DL NR Frequency ** \n");
5900    DU_LOG("NR ARFCN %d\n", f1NrFddInfo->dlNrFreqInfo.nrArfcn);
5901    DU_LOG("SUL : ARFCN %d\n",f1NrFddInfo->dlNrFreqInfo.sulInfo.sulArfcn);
5902    DU_LOG("SUL : Transmission BW Subcarrier Sapcing %d\n", f1NrFddInfo->dlNrFreqInfo.sulInfo.sulTxBw.nrScs);
5903    DU_LOG("SUL : Number of RBs in Transmission BW %d\n", f1NrFddInfo->dlNrFreqInfo.sulInfo.sulTxBw.nrb);
5904    DU_LOG("NR Frequency Band %d\n", f1NrFddInfo->dlNrFreqInfo.freqBand[0].nrFreqBand);
5905    DU_LOG("SUL Band %d\n", f1NrFddInfo->dlNrFreqInfo.freqBand[0].sulBand[0]);
5906
5907    DU_LOG("\n ** NR Mode Info : FDD : UL Transmission Bandwidth ** \n");
5908    DU_LOG("Subscarrier spacing %d\n", f1NrFddInfo->ulTxBw.nrScs);
5909    DU_LOG("Number of RBs %d\n", f1NrFddInfo->ulTxBw.nrb);
5910   
5911    DU_LOG("\n ** NR Mode Info : FDD : DL Transmission Bandwidth ** \n");
5912    DU_LOG("Subcarrier Spacing %d\n", f1NrFddInfo->dlTxBw.nrScs);
5913    DU_LOG("Number of RBs %d\n", f1NrFddInfo->dlTxBw.nrb);
5914
5915 #else
5916
5917    f1NrTddInfo = &nrModeInfo ->mode.tdd; 
5918
5919    DU_LOG("\n ** NR Mode Info : TDD : NR Frequency ** \n");
5920    DU_LOG("NR ARFCN %d\n", f1NrTddInfo->nrFreqInfo.nrArfcn);
5921    DU_LOG("SUL : ARFCN %d\n",f1NrTddInfo->nrFreqInfo.sulInfo.sulArfcn);
5922    DU_LOG("SUL : Transmission BW Subscarrier Spacing %d\n", f1NrTddInfo->nrFreqInfo.sulInfo.sulTxBw.nrScs);
5923    DU_LOG("SUL : Number of RBs in Transmission BW %d\n", f1NrTddInfo->nrFreqInfo.sulInfo.sulTxBw.nrb);
5924    DU_LOG("NR Frequency Band %d\n", f1NrTddInfo->nrFreqInfo.freqBand[0].nrFreqBand);
5925    DU_LOG("SUL Band %d\n", f1NrTddInfo->nrFreqInfo.freqBand[0].sulBand[0]);
5926
5927    DU_LOG("\n ** NR Mode Info : TDD : NR Transmission Bandwidth ** \n");
5928    DU_LOG("Subcarrier Spacing %d\n", f1NrTddInfo->nrTxBw.nrScs);
5929    DU_LOG("Number of RBs %d\n", f1NrTddInfo->nrTxBw.nrb);
5930 #endif
5931
5932    macCellCfg = &duCfgParam.macCellCfg;
5933    DU_LOG("\n ** MAC CELL CONFIGURATION ** \n");
5934    DU_LOG("Cell Id %d\n", macCellCfg->cellId);
5935
5936    DU_LOG("\n ** MAC Cell Configuration : Carrier Configuration ** \n");
5937    carrierCfg = &macCellCfg ->carrCfg;
5938    DU_LOG("DL Bandwidth %d\n", carrierCfg->dlBw);
5939    DU_LOG("DL ARFCN %d\n", carrierCfg->arfcnDL);
5940    DU_LOG("UL Bandwidth %d\n", carrierCfg->ulBw);
5941    DU_LOG("UL ARFCN %d\n", carrierCfg->arfcnUL);
5942    DU_LOG("Number of Transmission Antenna %d\n", carrierCfg->numTxAnt);
5943    DU_LOG("Number of Received Antenna %d\n", carrierCfg->numRxAnt);
5944
5945    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration ** \n");
5946    cellCfg = &macCellCfg ->cellCfg;
5947    DU_LOG("Operational State %d\n", cellCfg->opState);
5948    DU_LOG("Administration State %d\n", cellCfg->adminState);
5949    DU_LOG("Cell Current State %d\n", cellCfg->cellState);
5950    DU_LOG("NR PCI %d\n", cellCfg->phyCellId);
5951    DU_LOG("TAC: %d\n", cellCfg->tac);
5952    DU_LOG("SSB Freqeuncy %d\n", cellCfg->ssbFreq);
5953    DU_LOG("Subcarrier Spacing: %d\n", cellCfg->subCarrSpacing);
5954    DU_LOG("Duplex Mode %d\n", cellCfg->dupType);
5955
5956    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : PLMN Info List ** \n");
5957    plmnInfoList = &cellCfg ->plmnInfoList[0];
5958    DU_LOG("PLMN : mcc[0] %d\n", plmnInfoList->plmn.mcc[0]);
5959    DU_LOG("PLMN : mcc[1] %d\n", plmnInfoList->plmn.mcc[1]);
5960    DU_LOG("PLMN : mcc[2] %d\n", plmnInfoList->plmn.mcc[2]);
5961    DU_LOG("PLMN : mnc[0] %d\n", plmnInfoList->plmn.mnc[0]);
5962    DU_LOG("PLMN : mnc[1] %d\n", plmnInfoList->plmn.mnc[1]);
5963    DU_LOG("PLMN : mnc[2] %d\n", plmnInfoList->plmn.mnc[2]);
5964
5965    DU_LOG("Number of Slice supported %d\n", plmnInfoList->suppSliceList.numSupportedSlices);
5966    for(sliceIdx = 0; sliceIdx < plmnInfoList->suppSliceList.numSupportedSlices; sliceIdx++)
5967    {
5968       DU_LOG("Slice\n");
5969       DU_LOG("\nSST %d\n", (*plmnInfoList->suppSliceList.snssai[sliceIdx]).sst);
5970       DU_LOG("\nSD %d %d %d\n", (*plmnInfoList->suppSliceList.snssai[sliceIdx]).sd[0], \
5971          (*plmnInfoList->suppSliceList.snssai[sliceIdx]).sd[1],(*plmnInfoList->suppSliceList.snssai[sliceIdx]).sd[2]);
5972    }
5973    
5974    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 ** \n");
5975    sib1Cfg = &cellCfg->sib1Cfg;
5976    DU_LOG("SIB1 PDU Length %d", sib1Cfg->sib1PduLen);
5977    DU_LOG("SIB1 PDU %s", sib1Cfg->sib1Pdu);
5978
5979    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 : Paging Configuration ** \n");
5980    pageCfg = &sib1Cfg->pagingCfg;
5981
5982    DU_LOG("Number of Paging Occassion %d\n", pageCfg->numPO);
5983    if (pageCfg->poPresent == true)
5984       DU_LOG("FirstPDCCH-Monitoring Paging Occassion present : TRUE\n");
5985    else 
5986       DU_LOG("FirstPDCCH-Monitoring Paging Occassion present : FALSE\n");
5987
5988    for(pfIdx = 0; pfIdx < MAX_PO_PER_PF; pfIdx++)
5989    {
5990       DU_LOG("Paging Occassion at Paging Frame [%d] : %d\n", pfIdx, pageCfg->pagingOcc[pfIdx]);
5991    }
5992
5993    pdcchConfigSib1 = &sib1Cfg->pdcchCfgSib1;
5994    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 : PDCCH ** \n");
5995    DU_LOG("Coreset Zero Index %d\n", pdcchConfigSib1->coresetZeroIndex);
5996    DU_LOG("Search Space Zero Index %d\n", pdcchConfigSib1->searchSpaceZeroIndex);
5997
5998    bwpDlCfg = &cellCfg->initialDlBwp;
5999    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP Configuration ** \n");
6000
6001    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : BWP ** \n");
6002    bwp = &bwpDlCfg->bwp;
6003    DU_LOG("First PRB %d\n", bwp->firstPrb);
6004    DU_LOG("Number of PRBs %d\n", bwp->numPrb);
6005    DU_LOG("Subcarrier Spacing %d\n", bwp->scs);
6006    DU_LOG("Cyclic Perfix %d\n", bwp->cyclicPrefix);
6007
6008    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : PDCCH Config Common ** \n");
6009    pdcchCfgCmn = &bwpDlCfg->pdcchCommon;
6010    DU_LOG("RA Search Space ID %d\n", pdcchCfgCmn->raSearchSpaceId);
6011
6012    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : PDCCH Config Common : Search Space ** \n");
6013    searchSpaceCfg = &pdcchCfgCmn->commonSearchSpace;
6014    DU_LOG("Search Space ID %d\n", searchSpaceCfg->searchSpaceId);
6015    DU_LOG("Coreset ID %d\n", searchSpaceCfg->coresetId);
6016    DU_LOG("Monitoring Slot %d\n", searchSpaceCfg->monitoringSlot);
6017    DU_LOG("Duration %d\n", searchSpaceCfg->duration);
6018    DU_LOG("Monitoring Symbol %x\n", searchSpaceCfg->monitoringSymbol);
6019
6020    candidateInfo = &searchSpaceCfg->candidate;
6021    DU_LOG("Number of Candidates in Aggregation Level_1 %d\n", candidateInfo->aggLevel1);
6022    DU_LOG("Number of Candidates in Aggregation Level_2 %d\n", candidateInfo->aggLevel2);
6023    DU_LOG("Number of Candidates in Aggregation Level_4 %d\n", candidateInfo->aggLevel4);
6024    DU_LOG("Number of Candidates in Aggregation Level_8 %d\n", candidateInfo->aggLevel8);
6025    DU_LOG("Number of Candidates in Aggregation Level_16 %d\n", candidateInfo->aggLevel16);
6026
6027    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : PDSCH Config Common ** \n");
6028    pdschCfgCmn = &bwpDlCfg->pdschCommon;
6029    DU_LOG("Number of Time Domain Resource Allocation %d\n", pdschCfgCmn->numTimeDomAlloc);
6030   
6031    for (rsrcIdx = 0; rsrcIdx <  pdschCfgCmn->numTimeDomAlloc; rsrcIdx++)
6032    {
6033       DU_LOG("Time Domain Resource Allocation Idx %d\n", rsrcIdx);
6034       pdschCmnTimeDomRsrcAlloc = &pdschCfgCmn->timeDomRsrcAllocList[rsrcIdx];
6035       DU_LOG("\tK0 %d\n", pdschCmnTimeDomRsrcAlloc->k0);
6036       DU_LOG("\tPDSCH Mapping Type %d\n", pdschCmnTimeDomRsrcAlloc->mappingType);
6037       DU_LOG("\tPDSCH Start Symbol %d\n", pdschCmnTimeDomRsrcAlloc->startSymbol);
6038       DU_LOG("\tPDSCH Symbol Length %d\n", pdschCmnTimeDomRsrcAlloc->lengthSymbol);
6039    }
6040
6041    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP Configuration ** \n");
6042    bwpUlCfg = &cellCfg->initialUlBwp;
6043
6044    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP : BWP ** \n");
6045    DU_LOG("First PRB %d\n", bwpUlCfg->bwp.firstPrb);
6046    DU_LOG("Number of PRBs %d\n", bwpUlCfg->bwp.numPrb);
6047    DU_LOG("Subcarrier Spacing %d\n", bwpUlCfg->bwp.scs);
6048    DU_LOG("Cyclic Prefix %d\n", bwpUlCfg->bwp.cyclicPrefix);
6049    
6050    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP : PUCCH Config Common ** \n");
6051    pucchCfgCmn = &bwpUlCfg->pucchCommon;
6052    DU_LOG("PUCCH Resource Common %d\n", pucchCfgCmn->pucchResourceCommon);
6053    DU_LOG("Group Hopping %d\n", pucchCfgCmn->pucchGroupHopping);
6054
6055    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP : PUSCH Config Common ** \n");
6056    puschCfgCmn = &bwpUlCfg ->puschCommon;
6057    DU_LOG("Number of Time Domain Resource Allocation %d\n", puschCfgCmn->numTimeDomRsrcAlloc);
6058    for (rsrcIdx = 0; rsrcIdx <  puschCfgCmn->numTimeDomRsrcAlloc; rsrcIdx++)
6059    {
6060       DU_LOG("Time Domain Resource Allocation Idx %d\n", rsrcIdx);
6061       puschTimeDomRsrcAlloc = &puschCfgCmn->timeDomRsrcAllocList[rsrcIdx];
6062       DU_LOG("\tK2 %d\n", puschTimeDomRsrcAlloc->k2);
6063       DU_LOG("\tPUSCH Mapping Type %d\n", puschTimeDomRsrcAlloc->mappingType);
6064       DU_LOG("\tPUSCH Start Symbol %d\n", puschTimeDomRsrcAlloc->startSymbol);
6065       DU_LOG("\tPUSCH Symbol Length %d\n", puschTimeDomRsrcAlloc->symbolLength);
6066       DU_LOG("\tPUSCH Start Symbol And Length %d\n", puschTimeDomRsrcAlloc->startSymbolAndLength);
6067    }
6068
6069    DU_LOG("\n ** MAC Cell Configuration : SSB Configuration** \n");
6070    ssbCfg = &macCellCfg ->ssbCfg;
6071    DU_LOG("SSB PDCH Power %d\n", ssbCfg->ssbPbchPwr);
6072    DU_LOG("Subcarrier Spacing Common %d\n", ssbCfg->scsCmn);
6073    DU_LOG("SSB Offset from Point A %d\n", ssbCfg->ssbOffsetPointA);
6074    DU_LOG("SSB Periodicity in msec %d\n", ssbCfg->ssbPeriod);
6075    DU_LOG("SSB Subcarrier Offset %d\n", ssbCfg->ssbScOffset);
6076    for (ssbMaskIdx = 0; ssbMaskIdx < SSB_MASK_SIZE; ssbMaskIdx++)
6077    {
6078       DU_LOG("SSB Mask[%d] :%d\n", ssbMaskIdx, ssbCfg->ssbMask[ssbMaskIdx]);
6079    }
6080    DU_LOG("Beam ID %d\n", ssbCfg->beamId[0]);
6081    DU_LOG("BETA PSS %d\n", ssbCfg->betaPss);
6082    DU_LOG("BCH Payloag Flag %d\n", ssbCfg->bchPayloadFlag);
6083    DU_LOG("MIB PDU %d %d %d", ssbCfg->mibPdu[0], ssbCfg->mibPdu[1], ssbCfg->mibPdu[2]);
6084    DU_LOG("DMRS Type-A Position %d\n", ssbCfg->dmrsTypeAPos);
6085
6086    DU_LOG("\n ** MAC Cell Configuration : CSI RS Configuration ** \n");
6087    csiRsCfg = &macCellCfg->csiRsCfg;
6088    DU_LOG("Frequency Domain Allocation %s\n", csiRsCfg->csiFreqDomainAlloc);
6089    DU_LOG("Number of Ports %d\n", csiRsCfg->csiNrofPorts);
6090    DU_LOG("First OFDM Symbol in Time Domain %d\n", csiRsCfg->csirsfirstOFDMSymbolInTimeDomain);
6091    DU_LOG("First OFDM Symbol in Timer Domain 2 %d\n", csiRsCfg->csirsfirstOFDMSymbolInTimeDomain2);
6092    DU_LOG("CDM Type %d\n", csiRsCfg->csirscdmType);
6093    DU_LOG("Density %d\n", csiRsCfg->csirsdensity);
6094    DU_LOG("Density dot 5:%d\n", csiRsCfg->csirsdensitydot5);
6095    DU_LOG("Power Control Offset %d\n", csiRsCfg->powerControlOffset);
6096    DU_LOG("Power Control Offset Search Space %d\n", csiRsCfg->powerControlOffsetSS);
6097    DU_LOG("Periodicity And Offset %d\n", csiRsCfg->periodicityAndOffset);
6098
6099    DU_LOG("\n ** MAC Cell Configuration : PRACH Configuration ** \n");
6100    prachCfg = &macCellCfg->prachCfg;
6101    DU_LOG("PRACH Sequence Length %d\n", prachCfg->prachSeqLen);
6102    DU_LOG("Subcarrier Spacing %d\n", prachCfg->prachSubcSpacing);
6103    DU_LOG("Number of PRACH FDM %d\n", prachCfg->msg1Fdm);
6104    DU_LOG("PRACH Configuration Index %d\n", prachCfg->prachCfgIdx);
6105    DU_LOG("PRACH Restricted Set Configuration %d\n", prachCfg->prachRstSetCfg);
6106    DU_LOG("Number of SSB per RACH occassion %d\n", prachCfg->ssbPerRach);
6107    DU_LOG("Number of RA preambles %d\n", prachCfg->totalNumRaPreamble);
6108    DU_LOG("Number of Contention Based Preamble per SSB %d\n", prachCfg->numCbPreamblePerSsb);
6109    DU_LOG("PRACH Frequeny Start Offset %d\n", prachCfg->msg1FreqStart);
6110    DU_LOG("RA Contention Resolution Timer %d\n", prachCfg->raContResTmr);
6111    DU_LOG("RSRP Threshold %d\n", prachCfg->rsrpThreshSsb);
6112    DU_LOG("RA Response Window %d\n", prachCfg->raRspWindow); 
6113    for(fdmIdx = 0; fdmIdx < prachCfg->msg1Fdm; fdmIdx++)
6114    {
6115       prachFdmInfo = &prachCfg->fdm[fdmIdx];
6116       DU_LOG("FDM[%d]\n", fdmIdx);
6117       DU_LOG("\tRoot Sequence Index %d\n", prachFdmInfo->rootSeqIdx);
6118       DU_LOG("\tNumber of Root Sequence %d\n", prachFdmInfo->numRootSeq);
6119       DU_LOG("\tK1 %d\n", prachFdmInfo->k1);
6120       DU_LOG("\tZero Correlation Zone Configuration %d\n", prachFdmInfo->zeroCorrZoneCfg);   
6121    }
6122
6123 #ifdef NR_TDD
6124    DU_LOG("\n ** MAC Cell Configuration : TDD Configuration ** \n");
6125    tddCfg = &macCellCfg->tddCfg;
6126    DU_LOG("TDD Slot Periodicity %d\n", tddCfg->tddPeriod);
6127    DU_LOG("Number of DL Slots %d\n", tddCfg->nrOfDlSlots);
6128    DU_LOG("Number of DL Symbols %d\n", tddCfg->nrOfDlSymbols);
6129    DU_LOG("Number of UL Slots %d\n", tddCfg->nrOfUlSlots);
6130    DU_LOG("Number of UL Symbols %d\n", tddCfg->nrOfUlSymbols);
6131 #endif
6132
6133    DU_LOG("\n ** MAC Cell Configuration : Precoding Configuration ** \n");
6134    precodCfg = &macCellCfg->precodingConf;
6135    DU_LOG("Number of Layers %d\n", precodCfg->numLayers);
6136    DU_LOG("Number of Antenna Ports %d\n", precodCfg->numAntPorts);
6137
6138    DU_LOG("\n ** MAC Cell Config : BEAM FORMING  CFG ** \n");
6139    beamFormingCfg = &macCellCfg ->beamCfg;
6140    DU_LOG("Number of Beams %d\n", beamFormingCfg->numOfBeams);
6141    DU_LOG("Number of Tx RUs %d\n", beamFormingCfg->numTxRUs);
6142    DU_LOG("Beam Index %d\n", beamFormingCfg->beamIdx);
6143    DU_LOG("Beam Type %d\n", beamFormingCfg->beamType);
6144    DU_LOG("Beam Azimuth %d\n", beamFormingCfg->beamAzimuth);
6145    DU_LOG("Beam Tilt %d\n", beamFormingCfg->beamTilt);
6146    DU_LOG("Beam Horizontal Width %d\n", beamFormingCfg->beamHorizWidth);
6147    DU_LOG("Beam Vertical Width %d\n", beamFormingCfg->beamVertWidth);
6148    DU_LOG("Coverage Shape %d\n", beamFormingCfg->coverageShape);
6149    DU_LOG("Digitak Tilt %d\n",beamFormingCfg ->digitalTilt);
6150    DU_LOG("Digital Azimuth %d\n", beamFormingCfg->digitalAzimuth);
6151
6152    DU_LOG("\n ** SIB1 Configuration ** \n");
6153    sib1Params = &duCfgParam.sib1Params;
6154    DU_LOG("TAC %d\n", sib1Params->tac);
6155    DU_LOG("RANAC %ld\n", sib1Params->ranac);
6156    DU_LOG("Cell ID %d\n", sib1Params->cellIdentity);
6157    DU_LOG("Cell Reserved for Operational Use %ld\n", sib1Params->cellResvdForOpUse);
6158    DU_LOG("Connection Establishment Failure Count %ld\n", sib1Params->connEstFailCnt);
6159    DU_LOG("Connection Establishment Failure Offset Valid %ld\n", sib1Params->connEstFailOffValidity);
6160    DU_LOG("Connection Establishment Failure Offset %ld\n", sib1Params->connEstFailOffset);
6161    DU_LOG("PLMN : mcc[0] %d\n", sib1Params->plmn.mcc[0]);
6162    DU_LOG("PLMN : mcc[1] %d\n", sib1Params->plmn.mcc[1]);
6163    DU_LOG("PLMN : mcc[2] %d\n", sib1Params->plmn.mcc[2]);
6164    DU_LOG("PLMN : mnc[0] %d\n", sib1Params->plmn.mnc[0]);
6165    DU_LOG("PLMN : mnc[1] %d\n", sib1Params->plmn.mnc[1]);
6166    DU_LOG("PLMN : mnc[2] %d\n", sib1Params->plmn.mnc[2]);
6167
6168    DU_LOG("\n ** SIB1 : SI Scheduling Info ** \n");
6169    siSchedInfo = &sib1Params ->siSchedInfo;
6170    DU_LOG("Windown Length %ld\n", siSchedInfo->winLen);
6171    DU_LOG("Broadcast Status %ld\n", siSchedInfo->broadcastSta);
6172    DU_LOG("Periodicity %ld\n", siSchedInfo->preiodicity);
6173    DU_LOG("SIB Type %ld\n", siSchedInfo->sibType);
6174    DU_LOG("SIB Value Tag %ld\n", siSchedInfo->sibValTag);
6175
6176    DU_LOG("\n ** SIB1 : Serving Cell Configuration Common SIB ** \n");
6177    srvCellCfgCmnSib = &sib1Params->srvCellCfgCommSib;
6178    DU_LOG("Subcarrier Spacing %ld\n", srvCellCfgCmnSib->scs);
6179    DU_LOG("SSB Position in Burst %d\n", srvCellCfgCmnSib->ssbPosInBurst);
6180    DU_LOG("SSB Periodicity %ld\n", srvCellCfgCmnSib->ssbPrdServingCell);
6181    DU_LOG("SS PBCH Power %ld\n", srvCellCfgCmnSib->ssPbchBlockPwr);
6182
6183    DU_LOG("\n ** SIB1 : Serving Cell Config Common SIB : DL Config Common ** \n");
6184    dlCfgCmn = &srvCellCfgCmnSib->dlCfg;
6185    DU_LOG("Frequency Band Indicator %ld\n", dlCfgCmn->freqBandInd);
6186    DU_LOG("Offset to Point A %ld\n", dlCfgCmn->offsetToPointA);
6187    DU_LOG("Frequency Location And Bandwidth %ld\n", dlCfgCmn->locAndBw);
6188    DU_LOG("Offset to Point A considering Subcarrier Spacing %ld\n", dlCfgCmn->dlScsCarrier.scsOffset);
6189    DU_LOG("Subcarrier Spacing %ld\n", dlCfgCmn->dlScsCarrier.scs);
6190    DU_LOG("Bandwidth considering Subcarrier Spacing %ld\n", dlCfgCmn->dlScsCarrier.scsBw);
6191
6192    DU_LOG("\n ** SIB1 : Serving Cell Config Common SIB : DL Config Common : PDCCH Config Common ** \n");
6193    pdcchCfgCommon = &dlCfgCmn->pdcchCfg;
6194    if(pdcchCfgCommon->present)
6195    {
6196       DU_LOG("Control Resource Set Zero Index %ld\n", pdcchCfgCommon->ctrlRsrcSetZero);
6197       DU_LOG("Search Space Zero Index %ld\n", pdcchCfgCommon->searchSpcZero);
6198       DU_LOG("Search Space ID %ld\n", pdcchCfgCommon->searchSpcId);
6199       DU_LOG("Control Resource Set ID %ld\n", pdcchCfgCommon->ctrlRsrcSetId);
6200       DU_LOG("Monitoring Slot Periodicity and Offset Present %d\n", pdcchCfgCommon->monitorSlotPrdAndOffPresent);
6201       DU_LOG("Monitoring Slot Periodicity and Offset %ld\n", pdcchCfgCommon->monitorSlotPrdAndOff);
6202       for (monitoringSymbIdx = 0; monitoringSymbIdx < 2; monitoringSymbIdx++)
6203       {
6204          DU_LOG("Monitoring Symbols in Slot [%d] %d\n",monitoringSymbIdx,  pdcchCfgCommon->monitorSymbolsInSlot[monitoringSymbIdx]);
6205       }
6206       DU_LOG("Number of Candidates for Aggregation Level_1 %ld\n", pdcchCfgCommon->numCandAggLvl1);
6207       DU_LOG("Number of Candidates for Aggregation Level_2 %ld\n", pdcchCfgCommon->numCandAggLvl2);
6208       DU_LOG("Number of Candidates for Aggregation Level_4 %ld\n", pdcchCfgCommon->numCandAggLvl4);
6209       DU_LOG("Number of Candidates for Aggregation Level_8 %ld\n", pdcchCfgCommon->numCandAggLvl8);
6210       DU_LOG("Number of Candidates for Aggregation Level_16 %ld\n", pdcchCfgCommon->numCandAggLvl16);
6211       DU_LOG("Seach Space Type %d\n", pdcchCfgCommon->searchSpcType);
6212       DU_LOG("Common Search Space DCI Format %d\n", pdcchCfgCommon->commSrchSpcDciFrmt);
6213       DU_LOG("SIB1 Search Space ID %ld\n", pdcchCfgCommon->searchSpcSib1);
6214       DU_LOG("Paging Search Space ID %ld\n", pdcchCfgCommon->pagingSearchSpc);
6215       DU_LOG("RA Search Space ID %ld\n", pdcchCfgCommon->raSearchSpc);
6216    }
6217    else
6218    {
6219       DU_LOG("PDCCH Config Common not Present");
6220    }
6221
6222    DU_LOG("\n ** SIB1 : Serving Cell Config Common : DL Config Common : PDSCH Config Common ** \n");
6223    pdschCfgCommon = &dlCfgCmn->pdschCfg;
6224    DU_LOG("PDSCH Config Common Present %d\n", pdschCfgCommon->present);
6225    if(pdschCfgCommon->present)
6226    {
6227       DU_LOG("Number of Time Domain Resource Allocation %d\n", pdschCfgCommon->numTimeDomRsrcAlloc);
6228       for (rsrcIdx = 0; rsrcIdx < pdschCfgCommon->numTimeDomRsrcAlloc; rsrcIdx++)
6229       {
6230          pdschTimeDomRsrcAlloc = &pdschCfgCommon->timeDomAlloc[rsrcIdx];
6231          DU_LOG("PDSCH Timer Domain Resource Allocation [%d]", rsrcIdx);
6232          DU_LOG("K0 %ld\n", pdschTimeDomRsrcAlloc->k0);
6233          DU_LOG("MappingType %ld\n", pdschTimeDomRsrcAlloc->mapType);
6234          DU_LOG("SLIV %d\n", pdschTimeDomRsrcAlloc->sliv);
6235       }
6236    }
6237    else
6238    {
6239       DU_LOG("PDSCH Config Common not Present");
6240    }
6241
6242    DU_LOG("\n ** SIB1 : Serving Cell Config Common : DL Config Common : BCCH Config Common ** \n");
6243    bcchCfg = &dlCfgCmn->bcchCfg;
6244    DU_LOG("Modification Period Coefficient %ld\n", bcchCfg->modPrdCoeff);
6245
6246    DU_LOG("\n ** SIB1 : Serving Cell Config Common : DL Config Common : PCCH Config Common ** \n");
6247    pcchCfg = &dlCfgCmn->pcchCfg;
6248    DU_LOG("Default Paging Cycle %d\n", pcchCfg->dfltPagingCycle);
6249    DU_LOG("Number of PF in Paging Cycle %d\n", pcchCfg->nAndPagingFrmOffsetType);
6250    DU_LOG("PF Offset %d\n", pcchCfg->pageFrameOffset);
6251    DU_LOG("NS - Number of P0 in PF %d\n", pcchCfg->ns);
6252    DU_LOG("First PDCCH Monitoring Occassion of each P0 Type %d\n", pcchCfg->firstPDCCHMontioringType);
6253    for (poIdx = 0; poIdx < MAX_PO_PER_PF; poIdx++)
6254    {
6255       DU_LOG("First PDCCH Monitoring Occassion in P0 [%d] %d\n", poIdx, pcchCfg->firstPDCCHMontioringInfo[poIdx]);
6256    }
6257
6258    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common ** \n");
6259    ulCfgCmn = &srvCellCfgCmnSib->ulCfg;
6260    DU_LOG("Frequency Band Indicator %ld\n", ulCfgCmn->freqBandInd);
6261    DU_LOG("Maximum Transmission Power %ld\n", ulCfgCmn->pMax);
6262    DU_LOG("Frequency Location and Bandwidth %ld\n", ulCfgCmn->locAndBw);
6263    DU_LOG("Time Alignment Timer %ld\n", ulCfgCmn->timeAlignTimerComm);
6264    DU_LOG("Offset to Point A considering Subcarrier Spacing %ld\n", ulCfgCmn->ulScsCarrier.scsOffset);
6265    DU_LOG("Subcarrier Spacing %ld\n", ulCfgCmn->ulScsCarrier.scs);
6266    DU_LOG("Carrier BW considering Subcarrier Spacing %ld\n", ulCfgCmn->ulScsCarrier.scsBw);
6267
6268    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common : RACH Config Common ** \n");
6269    rachCfgCmn = &ulCfgCmn ->rachCfg;
6270    if(rachCfgCmn->present)
6271    {
6272       DU_LOG("PRACH Configuration Index %ld\n", rachCfgCmn->prachCfgIdx);
6273       DU_LOG("Number of PRACH FDM %ld\n", rachCfgCmn->msg1Fdm);
6274       DU_LOG("PRACH Frequeny Start Offset %ld\n", rachCfgCmn->msg1FreqStart);
6275       DU_LOG("Zero Correaltion Zone Configuration %ld\n", rachCfgCmn->zeroCorrZoneCfg);
6276       DU_LOG("Target Power Level of Received Preamble %ld\n", rachCfgCmn->preambleRcvdTgtPwr);
6277       DU_LOG("Maximum number of Preamble Transmission %ld\n", rachCfgCmn->preambleTransMax);
6278       DU_LOG("Power Ramping Step %ld\n", rachCfgCmn->pwrRampingStep);
6279       DU_LOG("RA Response Window %ld\n", rachCfgCmn->raRspWindow);
6280       DU_LOG("Total Number of RA Preambles %ld\n", rachCfgCmn->numRaPreamble);
6281       DU_LOG("Number of SSB per RACH Occassion %ld\n", rachCfgCmn->numSsbPerRachOcc);
6282       DU_LOG("Number of Contention Based Preamble per SSB %ld\n", rachCfgCmn->numCbPreamblePerSsb);
6283       DU_LOG("Contention Resolution Timer %ld\n", rachCfgCmn->contResTimer);
6284       DU_LOG("RSRP Threshold %ld\n", rachCfgCmn->rsrpThreshSsb);
6285       DU_LOG("Root Sequence Index Present %d\n", rachCfgCmn->rootSeqIdxPresent);
6286       DU_LOG("Root Sequence Index %ld\n", rachCfgCmn->rootSeqIdx);
6287       DU_LOG("Subcarrier Spacing %ld\n", rachCfgCmn->msg1Scs);
6288       DU_LOG("Restricted Set Configuration %ld\n", rachCfgCmn->restrictedSetCfg);
6289    }
6290    else
6291    {
6292       DU_LOG("RACH Config Common not present\n");
6293    }
6294
6295    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common : PUSCH Config Common ** \n");
6296    puschCfgCommon = &ulCfgCmn ->puschCfg;
6297    if(puschCfgCommon->puschCfgPresent)
6298    {
6299       DU_LOG("MSG3 Delta from RACH Preamble %ld\n", puschCfgCommon->msg3DeltaPreamble);
6300       DU_LOG("P0 Nominal With Grant %ld\n", puschCfgCommon->p0NominalWithGrant);
6301       DU_LOG("Number of Time Domain Resource Allocation %d\n", puschCfgCommon->numTimeDomRsrcAlloc);
6302       for(rsrcIdx = 0; rsrcIdx < puschCfgCommon->numTimeDomRsrcAlloc; rsrcIdx++)
6303       {
6304          puschCmnTimeDomRsrsAlloc = &puschCfgCommon ->timeDomAllocList[rsrcIdx];
6305          DU_LOG("Time Domain Resource Alloc [%d]", rsrcIdx);
6306          DU_LOG("\tK2 %ld\n", puschCmnTimeDomRsrsAlloc->k2);
6307          DU_LOG("\tMapping Type %ld\n", puschCmnTimeDomRsrsAlloc->mapType);
6308          DU_LOG("\tSLIV %d\n", puschCmnTimeDomRsrsAlloc->sliv);
6309       }
6310    }
6311    else
6312    {
6313       DU_LOG("PUSCH Config Common not present\n");
6314    }
6315    
6316    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common : PUCCH Config Common **\n");
6317    pucchCfgCommon = &ulCfgCmn->pucchCfg;
6318    if(pucchCfgCommon->present)
6319    {
6320       DU_LOG("Resource Common %ld\n", pucchCfgCommon->rsrcComm);
6321       DU_LOG("Group Hopping %ld\n", pucchCfgCommon->grpHop);
6322       DU_LOG("P0 Nominal %ld\n", pucchCfgCommon->p0Nominal);
6323    }
6324    else
6325    {
6326       DU_LOG("PUCCH Config Common not present\n");
6327    }
6328  
6329    DU_LOG("\n ** SIB1 : Serving Cell Config Common : TDD UL DL Config Common ** \n");
6330    tddUlDlCfgCmn = &srvCellCfgCmnSib->tddCfg;
6331    DU_LOG("Reference Subcarrier Spacing %ld\n", tddUlDlCfgCmn->refScs);
6332    DU_LOG("Transmission Periodicity %ld\n", tddUlDlCfgCmn->txPrd);
6333    DU_LOG("Number of DL Slots %ld\n", tddUlDlCfgCmn->numDlSlots);
6334    DU_LOG("Number of DL Symbols %ld\n", tddUlDlCfgCmn->numDlSymbols);
6335    DU_LOG("Number of UL Slots %ld\n", tddUlDlCfgCmn->numUlSlots);
6336    DU_LOG("Number of UL Symbols %ld\n", tddUlDlCfgCmn->numUlSymbols);
6337
6338    DU_LOG("\n ** MAC SLICE CONFIG REQUEST ** \n");
6339    macSliceCfg = &duCfgParam.tempSliceCfg;
6340    DU_LOG("Number of RRM Policy %d\n",macSliceCfg->numOfRrmPolicy);
6341
6342    for(policyIdx = 0; policyIdx < macSliceCfg->numOfRrmPolicy; policyIdx++)
6343    {
6344       rrmPolicy = macSliceCfg->listOfRrmPolicy[policyIdx];
6345       DU_LOG("RRM Policy [%d]\n", policyIdx);
6346       DU_LOG("\tResource Type %d\n", rrmPolicy->resourceType);
6347
6348       rrmPolicyRatio = &rrmPolicy ->policyRatio;
6349       DU_LOG("\tPolicy Maximum Ratio %d\n", rrmPolicyRatio->maxRatio);
6350       DU_LOG("\tPolicy Minimum Ratio %d\n", rrmPolicyRatio->minRatio);
6351       DU_LOG("\tPolicy Deidcated Ration %d\n", rrmPolicyRatio->dedicatedRatio);
6352       DU_LOG("\tNumber of RRM Policy Member %d\n", rrmPolicy->numOfRrmPolicyMem);   
6353       
6354       for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++)
6355       {
6356          rrmPolicyMemberList = rrmPolicy->rRMPolicyMemberList[memIdx];
6357          DU_LOG("\tRRM Policy Member [%d]\n", memIdx);
6358          DU_LOG("\t\tPLMN : mcc[0] %d\n", rrmPolicyMemberList->plmn.mcc[0]);
6359          DU_LOG("\t\tPLMN : mcc[1] %d\n", rrmPolicyMemberList->plmn.mcc[1]);
6360          DU_LOG("\t\tPLMN : mcc[2] %d\n", rrmPolicyMemberList->plmn.mcc[2]);
6361          DU_LOG("\t\tPLMN : mnc[0] %d\n", rrmPolicyMemberList->plmn.mnc[0]);
6362          DU_LOG("\t\tPLMN : mnc[1] %d\n", rrmPolicyMemberList->plmn.mnc[1]);
6363          DU_LOG("\t\tPLMN : mnc[2] %d\n", rrmPolicyMemberList->plmn.mnc[2]);
6364          DU_LOG("\t\tSST %d\n",rrmPolicyMemberList->snssai.sst);
6365          DU_LOG("\t\tSD %d %d %d\n",rrmPolicyMemberList->snssai.sd[0],rrmPolicyMemberList->snssai.sd[1],rrmPolicyMemberList->snssai.sd[2]);
6366       }
6367    }
6368 }
6369
6370 /**********************************************************************
6371   End of file
6372  **********************************************************************/
6373