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