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