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