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