[Jira Id - ODUHIGH-400] Modified F1Setup and Gnb-Du Config Msg wrt TDD and Remove...
[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 #include "legtp.h"
22 #include "lrg.h"
23 #include "lkw.x"
24 #include "lrg.x"
25 #include "du_app_mac_inf.h"
26 #include "du_app_rlc_inf.h"
27 #include "du_cfg.h"
28 #include "du_mgr.h"
29 #include "du_utils.h"
30 #include "OCTET_STRING.h"
31 #include "BIT_STRING.h"
32 #include "odu_common_codec.h"
33 #include "du_sys_info_hdl.h"
34 #include "MIB.h"
35 #include "SearchSpace.h"
36 #include "SIB-TypeInfo.h"
37 #include "SchedulingInfo.h"
38 #include "SI-SchedulingInfo.h"
39 #include "ConnEstFailureControl.h"
40 #include "PLMN-IdentityInfo.h"
41 #include "PDSCH-TimeDomainResourceAllocation.h"
42 #include "BCCH-Config.h"
43 #include "PagingCycle.h"
44 #include "PCCH-Config.h"
45 #include "TimeAlignmentTimer.h"
46 #include "RACH-ConfigGeneric.h"
47 #include "PUSCH-TimeDomainResourceAllocation.h"
48 #include "PUCCH-ConfigCommon.h"
49 #include "SubcarrierSpacing.h"
50 #include "TDD-UL-DL-Pattern.h"
51 #include "RACH-ConfigCommon.h"
52 #include "BWP-DownlinkCommon.h"
53 #include "BWP-UplinkCommon.h"
54
55 #ifdef O1_ENABLE
56 #include "CmInterface.h"
57 extern StartupConfig g_cfg;
58 extern NRCellDU cellParams;
59 #endif
60
61 char encBuf[ENC_BUF_MAX_LEN];
62
63
64 /* Filling Slot configuration as :
65  * 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
66  *   0   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
67  *   1   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
68  *   2   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
69      3   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
70      4   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
71      5   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
72      6   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL
73      7   DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    DL    F     UL
74      8   UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL
75      9   UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL    UL  
76  */
77
78 #ifdef NR_TDD
79 /*******************************************************************
80  *
81  * @brief Fills the Slot configuration 
82  *
83  * @details
84  *
85  *    Function : FillSlotConfig
86  *
87  *    Functionality:Fill the Slot configuration values
88  * 
89  *  @params[in] void
90  * @return ROK     - success
91  *         RFAILED - failure
92  *
93  * ****************************************************************/
94 void FillSlotConfig()
95 {
96    uint8_t slot = 0;
97    uint8_t symbol =0;
98    
99    memset(duCfgParam.macCellCfg.tddCfg.slotCfg, 0, sizeof(duCfgParam.macCellCfg.tddCfg.slotCfg[slot][symbol]* \
100                            MAX_TDD_PERIODICITY_SLOTS*MAX_SYMB_PER_SLOT));
101    
102    //Filling the DL Slots and initializing flexi slot
103    for(slot = 0; slot <= NUM_DL_SLOTS; slot++)
104    {
105       for(symbol =0; symbol < MAX_SYMB_PER_SLOT; symbol++)
106       {
107          duCfgParam.macCellCfg.tddCfg.slotCfg[slot][symbol] = DL_SLOT;
108       }
109    }
110   
111    //Filling UL Slots
112    for(slot = NUM_DL_SLOTS+1; slot <= NUM_DL_SLOTS+NUM_UL_SLOTS; slot++)
113    {
114       for(symbol = 0; symbol < MAX_SYMB_PER_SLOT; symbol++)
115          duCfgParam.macCellCfg.tddCfg.slotCfg[slot][symbol] = UL_SLOT;
116    } 
117    //Updating Flexi Slot
118    slot = NUM_DL_SLOTS;
119    duCfgParam.macCellCfg.tddCfg.slotCfg[slot][12] = FLEXI_SLOT;
120    duCfgParam.macCellCfg.tddCfg.slotCfg[slot][13] = UL_SLOT;
121
122 }
123 #endif
124
125 /*******************************************************************
126  * @brief Reads the CL Configuration.
127  *
128  * @details
129  *
130  *    Function : readMacCfg
131  *
132  *    Functionality:
133  *       - Fills up the cell configuration for CL.
134  *       - Calls FillSlotConfig()  
135  *
136  * @params[in] void
137  * @return ROK     - success
138  *         RFAILED - failure
139  *
140  * ****************************************************************/
141
142 uint8_t readMacCfg()
143 {
144    uint8_t idx=0, sliceIdx=0;
145    F1TaiSliceSuppLst *taiSliceSuppLst;
146
147    duCfgParam.macCellCfg.carrierId = CARRIER_IDX;
148
149    /* Cell configuration */
150    duCfgParam.macCellCfg.numerology = NR_NUMEROLOGY;
151    duCfgParam.macCellCfg.dupType = DUPLEX_MODE;
152
153    /* DL carrier configuration */
154    duCfgParam.macCellCfg.dlCarrCfg.pres = TRUE;
155 #ifdef O1_ENABLE
156    duCfgParam.macCellCfg.cellId = cellParams.cellLocalId;
157    duCfgParam.macCellCfg.phyCellId = cellParams.nRPCI;
158    duCfgParam.macCellCfg.dlCarrCfg.bw = cellParams.bSChannelBwUL;
159    duCfgParam.macCellCfg.dlCarrCfg.freq = cellParams.bSChannelBwDL;
160 #else
161    duCfgParam.macCellCfg.cellId = NR_CELL_ID;
162    duCfgParam.macCellCfg.phyCellId = NR_PCI;
163    duCfgParam.macCellCfg.dlCarrCfg.bw = NR_BANDWIDTH;
164    duCfgParam.macCellCfg.dlCarrCfg.freq = NR_DL_ARFCN;
165 #endif
166    
167    duCfgParam.macCellCfg.dlCarrCfg.k0[0] = 1;
168    duCfgParam.macCellCfg.dlCarrCfg.k0[1] = 1;
169    duCfgParam.macCellCfg.dlCarrCfg.k0[2] = 1;
170    duCfgParam.macCellCfg.dlCarrCfg.k0[3] = 1;
171    duCfgParam.macCellCfg.dlCarrCfg.k0[4] = 1;
172    duCfgParam.macCellCfg.dlCarrCfg.gridSize[0] = 273;
173    duCfgParam.macCellCfg.dlCarrCfg.gridSize[1] = 1;
174    duCfgParam.macCellCfg.dlCarrCfg.gridSize[2] = 1;
175    duCfgParam.macCellCfg.dlCarrCfg.gridSize[3] = 1;
176    duCfgParam.macCellCfg.dlCarrCfg.gridSize[4] = 1;
177    duCfgParam.macCellCfg.dlCarrCfg.numAnt = NUM_TX_ANT;
178
179    /* UL Carrier configuration */
180    duCfgParam.macCellCfg.ulCarrCfg.pres = TRUE;
181 #ifdef O1_ENABLE
182    duCfgParam.macCellCfg.ulCarrCfg.bw = cellParams.bSChannelBwUL;
183    duCfgParam.macCellCfg.ulCarrCfg.freq = cellParams.bSChannelBwDL;
184 #else   
185    duCfgParam.macCellCfg.ulCarrCfg.bw = NR_BANDWIDTH;
186    duCfgParam.macCellCfg.ulCarrCfg.freq =  NR_UL_ARFCN;
187 #endif   
188    duCfgParam.macCellCfg.ulCarrCfg.k0[0] = 1;
189    duCfgParam.macCellCfg.ulCarrCfg.k0[1] = 1;
190    duCfgParam.macCellCfg.ulCarrCfg.k0[2] = 1;
191    duCfgParam.macCellCfg.ulCarrCfg.k0[3] = 1;
192    duCfgParam.macCellCfg.ulCarrCfg.k0[4] = 1;
193    duCfgParam.macCellCfg.ulCarrCfg.gridSize[0] = 1;
194    duCfgParam.macCellCfg.ulCarrCfg.gridSize[1] = 1;
195    duCfgParam.macCellCfg.ulCarrCfg.gridSize[2] = 1;
196    duCfgParam.macCellCfg.ulCarrCfg.gridSize[3] = 1;
197    duCfgParam.macCellCfg.ulCarrCfg.gridSize[4] = 1;
198    duCfgParam.macCellCfg.ulCarrCfg.numAnt = NUM_RX_ANT;
199
200    duCfgParam.macCellCfg.freqShft = FREQ_SHIFT_7P5KHZ;
201
202    /* SSB configuration */
203    duCfgParam.macCellCfg.ssbCfg.ssbPbchPwr = SSB_PBCH_PWR;
204    duCfgParam.macCellCfg.ssbCfg.bchPayloadFlag = BCH_PAYLOAD;
205    duCfgParam.macCellCfg.ssbCfg.ssbOffsetPointA = OFFSET_TO_POINT_A;
206    duCfgParam.macCellCfg.ssbCfg.betaPss = BETA_PSS;
207 #ifdef O1_ENABLE
208    duCfgParam.macCellCfg.ssbCfg.scsCmn = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
209    duCfgParam.macCellCfg.ssbCfg.ssbPeriod = convertScsPeriodicityToEnum(cellParams.ssbPeriodicity);
210    duCfgParam.macCellCfg.ssbCfg.ssbScOffset = cellParams.ssbOffset;
211 #else
212    duCfgParam.macCellCfg.ssbCfg.scsCmn = NR_SCS;
213    duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PRDCTY_MS_20;
214    duCfgParam.macCellCfg.ssbCfg.ssbScOffset = SSB_SUBCARRIER_OFFSET;
215 #endif
216    duCfgParam.macCellCfg.ssbCfg.ssbMask[0] = 1; /* only one SSB is transmitted */
217    duCfgParam.macCellCfg.ssbCfg.ssbMask[1] = 0;
218    if(BuildMibPdu() != ROK)
219    {
220       DU_LOG("\nERROR  -->  Failed to build MIB PDU");
221       memset(&duCfgParam.macCellCfg.ssbCfg.mibPdu, 0, 3*sizeof(uint8_t));
222    }
223    else
224    {
225       memcpy(&duCfgParam.macCellCfg.ssbCfg.mibPdu, encBuf,encBufSize);
226    }
227    duCfgParam.macCellCfg.ssbCfg.multCarrBand = SSB_MULT_CARRIER_BAND;
228    duCfgParam.macCellCfg.ssbCfg.multCellCarr = MULT_CELL_CARRIER;
229
230    /* PRACH configuration */
231    duCfgParam.macCellCfg.prachCfg.pres = TRUE;
232    duCfgParam.macCellCfg.prachCfg.prachCfgIdx = PRACH_CONFIG_IDX;
233    duCfgParam.macCellCfg.prachCfg.prachSeqLen = PRACH_SEQ_LEN;
234    duCfgParam.macCellCfg.prachCfg.prachSubcSpacing = convertScsEnumValToScsVal(PRACH_SUBCARRIER_SPACING);
235    duCfgParam.macCellCfg.prachCfg.prachRstSetCfg = PRACH_RESTRICTED_SET_CFG;
236    duCfgParam.macCellCfg.prachCfg.msg1Fdm = NUM_PRACH_FDM;
237    duCfgParam.macCellCfg.prachCfg.msg1FreqStart = PRACH_FREQ_START;
238    duCfgParam.macCellCfg.prachCfg.rootSeqLen    = ROOT_SEQ_LEN;
239    duCfgParam.macCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX;
240    duCfgParam.macCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ;
241    duCfgParam.macCellCfg.prachCfg.fdm[0].k1 = 0;
242    duCfgParam.macCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
243    duCfgParam.macCellCfg.prachCfg.fdm[0].numUnusedRootSeq = NUM_UNUSED_ROOT_SEQ;
244    if(duCfgParam.macCellCfg.prachCfg.fdm[0].numUnusedRootSeq != 0)
245    {
246         DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq, 
247         NUM_UNUSED_ROOT_SEQ * sizeof(uint8_t));
248         if(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP)
249         {
250             DU_LOG("\nERROR  -->  DU_APP : Memory allocation failed at readMacCfg");
251             return RFAILED;
252         }
253         *(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ;
254     }
255    duCfgParam.macCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH;
256    duCfgParam.macCellCfg.prachCfg.prachMultCarrBand = PRACH_MULT_CARRIER_BAND;
257    duCfgParam.macCellCfg.prachCfg.raContResTmr = RA_CONT_RES_TIMER;
258    duCfgParam.macCellCfg.prachCfg.rsrpThreshSsb = RSRP_THRESHOLD_SSB;
259    duCfgParam.macCellCfg.prachCfg.raRspWindow = RA_RSP_WINDOW;
260    duCfgParam.macCellCfg.prachCfg.prachRestrictedSet = PRACH_RESTRICTED_SET;
261 #ifdef NR_TDD   
262    /* TDD configuration */
263    duCfgParam.macCellCfg.tddCfg.pres = TRUE;
264    duCfgParam.macCellCfg.tddCfg.tddPeriod = TDD_PERIODICITY;
265
266    FillSlotConfig();
267
268 #endif
269    /* RSSI Measurement configuration */
270    duCfgParam.macCellCfg.rssiUnit = RSS_MEASUREMENT_UNIT;
271
272    /* fill SIB1 configuration */
273    duCfgParam.macCellCfg.sib1Cfg.sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len;
274    DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
275    memcpy(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, \
276          duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
277    duCfgParam.macCellCfg.sib1Cfg.sib1RepetitionPeriod = SIB1_REPETITION_PERIOD;
278    duCfgParam.macCellCfg.sib1Cfg.coresetZeroIndex = CORESET_0_INDEX;
279    duCfgParam.macCellCfg.sib1Cfg.searchSpaceZeroIndex = SEARCHSPACE_0_INDEX;
280    duCfgParam.macCellCfg.sib1Cfg.sib1Mcs = DEFAULT_MCS;
281
282
283    /* fill Intial DL BWP */
284    duCfgParam.macCellCfg.initialDlBwp.bwp.firstPrb = 0;
285    duCfgParam.macCellCfg.initialDlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */
286    duCfgParam.macCellCfg.initialDlBwp.bwp.scs = duCfgParam.macCellCfg.ssbCfg.scsCmn;
287    duCfgParam.macCellCfg.initialDlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
288    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId = SEARCHSPACE_1_INDEX;
289    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.coresetId = CORESET_0_INDEX;
290    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot =
291       SS_MONITORING_SLOT_SL1; /* sl1 - all slots */
292    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.duration = 0;
293    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol =
294       SS_MONITORING_SYMBOL;
295    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
296       candidate.aggLevel1       = 8;
297    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
298       candidate.aggLevel2       = 4;
299    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
300       candidate.aggLevel4       = 2;
301    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
302       candidate.aggLevel8       = 1;
303    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
304       candidate.aggLevel16      = 0;
305
306    duCfgParam.macCellCfg.initialDlBwp.pdschCommon.numTimeDomAlloc = 2;
307    idx = 0;
308    duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].k0 = PDSCH_K0_CFG1;
309    duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].mappingType = 
310       PDSCH_MAPPING_TYPE_A;
311    duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].startSymbol = 
312       PDSCH_START_SYMBOL;
313    duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].lengthSymbol =
314       PDSCH_LENGTH_SYMBOL;
315  
316    idx++;
317    duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].k0 = PDSCH_K0_CFG2;
318    duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].mappingType = 
319       PDSCH_MAPPING_TYPE_A;
320    duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].startSymbol = 
321       PDSCH_START_SYMBOL;
322    duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].lengthSymbol =
323       PDSCH_LENGTH_SYMBOL;
324
325    /* ra-searchSpace ID is set to 1 */
326    duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpaceId = SEARCHSPACE_1_INDEX;
327
328    /* fill Intial UL BWP */
329    duCfgParam.macCellCfg.initialUlBwp.bwp.firstPrb = 0;
330    duCfgParam.macCellCfg.initialUlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */
331    duCfgParam.macCellCfg.initialUlBwp.bwp.scs = duCfgParam.macCellCfg.ssbCfg.scsCmn;
332    duCfgParam.macCellCfg.initialUlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
333    duCfgParam.macCellCfg.initialUlBwp.puschCommon.numTimeDomRsrcAlloc = 2;
334    duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].k2 = PUSCH_K2_CFG1;
335    duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].mappingType = 
336       PUSCH_MAPPING_TYPE_A;
337    duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].startSymbol = 
338       PUSCH_START_SYMBOL;
339    duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].symbolLength =
340       PUSCH_LENGTH_SYMBOL;
341
342    duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].k2 = PUSCH_K2_CFG2;
343    duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].mappingType = 
344       PUSCH_MAPPING_TYPE_A;
345    duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].startSymbol = 
346       PUSCH_START_SYMBOL;
347    duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].symbolLength =
348       PUSCH_LENGTH_SYMBOL;
349
350    duCfgParam.macCellCfg.dmrsTypeAPos = DMRS_TYPE_A_POS; 
351
352    /* fill PUCCH config common */
353    duCfgParam.macCellCfg.initialUlBwp.pucchCommon.pucchResourceCommon = PUCCH_RSRC_COMMON;
354    duCfgParam.macCellCfg.initialUlBwp.pucchCommon.pucchGroupHopping = PUCCH_GROUP_HOPPING;
355    
356    /* Plmn And SNSSAI Configuration */
357    memset(&duCfgParam.macCellCfg.plmnInfoList.plmn, &duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn,\
358    sizeof(Plmn));
359    taiSliceSuppLst = &duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].taiSliceSuppLst;
360    duCfgParam.macCellCfg.plmnInfoList.numSupportedSlice = taiSliceSuppLst->numSupportedSlices;
361    if(taiSliceSuppLst->snssai)
362    {
363       DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.plmnInfoList.snssai, (duCfgParam.macCellCfg.plmnInfoList.numSupportedSlice) * sizeof(Snssai*));
364       if(duCfgParam.macCellCfg.plmnInfoList.snssai == NULLP)
365       {
366          DU_LOG("\nERROR  --> DU_APP: Memory allocation failed at readMacCfg");
367          return RFAILED;
368       }
369    }
370    for(sliceIdx=0; sliceIdx<taiSliceSuppLst->numSupportedSlices; sliceIdx++)
371    {
372       if(taiSliceSuppLst->snssai[sliceIdx] != NULLP)
373       {
374          DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
375          if(duCfgParam.macCellCfg.plmnInfoList.snssai[sliceIdx] == NULLP)
376          {
377             DU_LOG("\nERROR  --> DU_APP: Memory allocation failed at readMacCfg");
378             return RFAILED;
379          }
380          memcpy(duCfgParam.macCellCfg.plmnInfoList.snssai[sliceIdx], taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
381       }
382    }
383    return ROK;
384 }
385
386 /*******************************************************************
387  *
388  * @brief Configures the DU Parameters
389  *
390  * @details
391  *
392  *    Function : fillDuPort
393  *
394  *    Functionality:
395  *       - fills the DU Ports.  
396  *
397  * @params[in] duPort array to be filled
398  * @return ROK     - success
399  *         RFAILED - failure
400  *
401  * ****************************************************************/
402 uint8_t fillDuPort(uint16_t *duPort)
403 {
404
405 #ifdef O1_ENABLE
406    duPort[F1_INTERFACE]   = g_cfg.DU_Port;
407    duPort[E2_INTERFACE]   = g_cfg.RIC_Port;
408 #else
409    duPort[F1_INTERFACE]   = DU_PORT;     /* DU Port idx  0 38472 */
410    duPort[E2_INTERFACE]   = RIC_PORT;    /* RIC Port idx 1 38482 */
411 #endif
412    return ROK;
413 }
414
415 /*******************************************************************
416  *
417  * @brief Configures the DU Parameters
418  *
419  * @details
420  *
421  *    Function : calcSliv
422  *
423  *    Functionality:
424  *       - calculate SLIV value from start and length field
425  *
426  * @params[in] start symbol
427  * @params[in] length of symbols
428  * @return SLIV value
429  *
430  * ****************************************************************/
431 uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol)
432 {
433    uint16_t sliv = 0;
434    if((lengthSymbol-1) <= 7)
435    {
436       sliv = NUM_SYMBOLS_PER_SLOT * (lengthSymbol-1) + startSymbol;
437    }
438    else
439    {
440       sliv = NUM_SYMBOLS_PER_SLOT * (NUM_SYMBOLS_PER_SLOT - lengthSymbol + 1) \
441              + (NUM_SYMBOLS_PER_SLOT - 1 - startSymbol);
442    }
443    return sliv;
444 }
445
446
447 /*******************************************************************
448  *
449  * @brief Configures serving cell config common in sib1
450  *
451  * @details
452  *
453  *    Function : fillServCellCfgCommSib
454  *
455  *    Functionality:
456  *       - fills Serving cell config common for SIB1
457  *
458  * @params[in] SrvCellCfgCommSib pointer
459  * @return ROK     - success
460  *         RFAILED - failure
461  * 
462  ** ****************************************************************/
463 uint8_t fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm)
464 {
465    PdcchCfgCommon   pdcchCfg;
466    PdschCfgCommon   pdschCfg;
467    PcchCfg          pcchCfg;
468    RachCfgCommon    rachCfg;
469    PuschCfgCommon   puschCfg;
470    PucchCfgCommon   pucchCfg;
471    TddUlDlCfgCommon   tddCfg;
472
473    /* Configuring DL Config Common for SIB1*/
474    srvCellCfgComm->dlCfg.freqBandInd = NR_FREQ_BAND; 
475    srvCellCfgComm->dlCfg.offsetToPointA = OFFSET_TO_POINT_A;
476 #ifdef O1_ENABLE
477    srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset =  cellParams.ssbOffset;
478    srvCellCfgComm->dlCfg.dlScsCarrier.scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
479    srvCellCfgComm->dlCfg.dlScsCarrier.scsBw =  cellParams.bSChannelBwUL;
480 #else
481    srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET;
482    srvCellCfgComm->dlCfg.dlScsCarrier.scs = NR_SCS;
483    srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = NR_BANDWIDTH;
484 #endif   
485    srvCellCfgComm->dlCfg.locAndBw = FREQ_LOC_BW;
486
487    /* Configuring PDCCH Config Common For SIB1 */
488    pdcchCfg.present = BWP_DownlinkCommon__pdcch_ConfigCommon_PR_setup;
489    pdcchCfg.ctrlRsrcSetZero = CORESET_0_INDEX;
490    pdcchCfg.searchSpcZero = SEARCHSPACE_0_INDEX;
491    pdcchCfg.searchSpcId = PDCCH_SEARCH_SPACE_ID;
492    pdcchCfg.ctrlRsrcSetId = PDCCH_CTRL_RSRC_SET_ID;
493    pdcchCfg.monitorSlotPrdAndOffPresent = \
494       
495       SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
496    //pdcchCfg.monitorSlotPrdAndOff = \
497    SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
498    pdcchCfg.monitorSymbolsInSlot[0] = 128;
499    pdcchCfg.monitorSymbolsInSlot[1] = 0;
500    pdcchCfg.numCandAggLvl1 = SearchSpace__nrofCandidates__aggregationLevel1_n8;
501    pdcchCfg.numCandAggLvl2 = SearchSpace__nrofCandidates__aggregationLevel2_n4;
502    pdcchCfg.numCandAggLvl4 = SearchSpace__nrofCandidates__aggregationLevel4_n2;
503    pdcchCfg.numCandAggLvl8 = SearchSpace__nrofCandidates__aggregationLevel8_n1;
504    pdcchCfg.numCandAggLvl16 = SearchSpace__nrofCandidates__aggregationLevel16_n0;
505    pdcchCfg.searchSpcType = SearchSpace__searchSpaceType_PR_common;
506    pdcchCfg.commSrchSpcDciFrmt = PDCCH_SERACH_SPACE_DCI_FORMAT;
507    pdcchCfg.searchSpcSib1 = PDCCH_SEARCH_SPACE_ID_SIB1;
508    pdcchCfg.pagingSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING;
509    pdcchCfg.raSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING;
510    srvCellCfgComm->dlCfg.pdcchCfg = pdcchCfg;
511
512    /* Configuring PDSCH Config Common For SIB1 */
513    pdschCfg.present = BWP_DownlinkCommon__pdsch_ConfigCommon_PR_setup;
514    pdschCfg.numTimeDomRsrcAlloc = 2;
515    pdschCfg.timeDomAlloc[0].k0 = PDSCH_K0_CFG1;
516    pdschCfg.timeDomAlloc[0].mapType = \
517       PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
518    pdschCfg.timeDomAlloc[0].sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL);
519
520    pdschCfg.timeDomAlloc[1].k0 = PDSCH_K0_CFG2;
521    pdschCfg.timeDomAlloc[1].mapType = \
522       PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
523    pdschCfg.timeDomAlloc[1].sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL);
524
525    srvCellCfgComm->dlCfg.pdschCfg = pdschCfg;
526
527    /* Configuring BCCH Config for SIB1 */
528    srvCellCfgComm->dlCfg.bcchCfg.modPrdCoeff = \
529       BCCH_Config__modificationPeriodCoeff_n16;
530
531    /* Configuring PCCH Config for SIB1 */
532    pcchCfg.dfltPagingCycle = PagingCycle_rf256;
533    pcchCfg.nAndPagingFrmOffPresent = PCCH_Config__nAndPagingFrameOffset_PR_oneT;
534    pcchCfg.numPagingOcc = PCCH_Config__ns_four;
535    srvCellCfgComm->dlCfg.pcchCfg = pcchCfg;
536
537
538    /* Configuring UL Config Common */
539 #ifdef O1_ENABLE
540    srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset =  cellParams.ssbOffset;
541    srvCellCfgComm->ulCfg.ulScsCarrier.scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
542    srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = cellParams.bSChannelBwUL; 
543 #else
544    srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET;
545    srvCellCfgComm->ulCfg.ulScsCarrier.scs = NR_SCS;
546    srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = NR_BANDWIDTH;
547 #endif   
548    srvCellCfgComm->ulCfg.pMax = UL_P_MAX;
549    srvCellCfgComm->ulCfg.locAndBw = FREQ_LOC_BW;
550    srvCellCfgComm->ulCfg.timeAlignTimerComm = TimeAlignmentTimer_infinity;
551
552    /* Configuring RACH Config Common for SIB1 */
553    rachCfg.present = BWP_UplinkCommon__rach_ConfigCommon_PR_setup;
554    rachCfg.prachCfgIdx = PRACH_CONFIG_IDX;
555    rachCfg.msg1Fdm = RACH_ConfigGeneric__msg1_FDM_one;
556    rachCfg.msg1FreqStart = PRACH_FREQ_START;
557    rachCfg.zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
558    rachCfg.preambleRcvdTgtPwr = PRACH_PREAMBLE_RCVD_TGT_PWR;
559    rachCfg.preambleTransMax = RACH_ConfigGeneric__preambleTransMax_n200;
560    rachCfg.pwrRampingStep = RACH_ConfigGeneric__powerRampingStep_dB2;
561    rachCfg.raRspWindow = RACH_ConfigGeneric__ra_ResponseWindow_sl10;
562    rachCfg.numRaPreamble = NUM_RA_PREAMBLE;
563    rachCfg.ssbPerRachOccPresent = \
564       RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one;
565    rachCfg.numSsbPerRachOcc = SSB_PER_RACH;
566    rachCfg.contResTimer = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64;
567    rachCfg.rsrpThreshSsb = RSRP_THRESHOLD_SSB;
568    rachCfg.rootSeqIdxPresent = RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139;
569    rachCfg.rootSeqIdx = ROOT_SEQ_IDX;
570    rachCfg.msg1Scs = PRACH_SUBCARRIER_SPACING ;
571    rachCfg.restrictedSetCfg = PRACH_RESTRICTED_SET_CFG;
572    srvCellCfgComm->ulCfg.rachCfg = rachCfg;
573
574    /* Configuring PUSCH Config Common for SIB1 */
575    puschCfg.puschCfgPresent = BWP_UplinkCommon__pusch_ConfigCommon_PR_setup;
576    puschCfg.numTimeDomRsrcAlloc = 2;
577    puschCfg.timeDomAllocList[0].k2 = PUSCH_K2_CFG1;
578    puschCfg.timeDomAllocList[0].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
579    puschCfg.timeDomAllocList[0].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
580    puschCfg.timeDomAllocList[1].k2 = PUSCH_K2_CFG2;
581    puschCfg.timeDomAllocList[1].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
582    puschCfg.timeDomAllocList[1].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
583    puschCfg.msg3DeltaPreamble = PUSCH_MSG3_DELTA_PREAMBLE;
584    puschCfg.p0NominalWithGrant = PUSCH_P0_NOMINAL_WITH_GRANT;
585    srvCellCfgComm->ulCfg.puschCfg = puschCfg;
586
587    /* Configuring PUCCH Config Common for SIB1 */
588    pucchCfg.present = BWP_UplinkCommon__pucch_ConfigCommon_PR_setup;
589    pucchCfg.rsrcComm = PUCCH_RSRC_COMMON;
590    pucchCfg.grpHop = PUCCH_ConfigCommon__pucch_GroupHopping_neither;
591    pucchCfg.p0Nominal = PUCCH_P0_NOMINAL;
592    srvCellCfgComm->ulCfg.pucchCfg = pucchCfg;
593
594    /* Configuring TDD UL DL config common */
595    tddCfg.refScs = SubcarrierSpacing_kHz30;
596    tddCfg.txPrd = TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5;
597    tddCfg.numDlSlots = NUM_DL_SLOTS;
598    tddCfg.numDlSymbols = NUM_DL_SYMBOLS;
599    tddCfg.numUlSlots = NUM_UL_SLOTS;
600    tddCfg.numUlSymbols = NUM_UL_SYMBOLS;
601    srvCellCfgComm->tddCfg = tddCfg;
602
603    srvCellCfgComm->ssbPosInBurst = 192;
604    srvCellCfgComm->ssbPrdServingCell = SSB_PERIODICITY_20MS;
605    srvCellCfgComm->ssPbchBlockPwr = SSB_PBCH_PWR;
606
607    return ROK;
608 }
609
610 /*******************************************************************
611  *
612  * @brief Configures the DU Parameters
613  *
614  * @details
615  *
616  *    Function : readCfg
617  *
618  *    Functionality:
619  *       - Initializes the DuCfg members.  
620  *       - Calls readMacCfg()  
621  *
622  * @params[in] system task ID
623  * @return ROK     - success
624  *         RFAILED - failure
625  *
626  * ****************************************************************/
627
628 uint8_t readCfg()
629 {
630    uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx;
631    uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx;
632    uint32_t ipv4_du, ipv4_cu, ipv4_ric;
633    MibParams mib;
634    Sib1Params sib1;
635    F1TaiSliceSuppLst *taiSliceSuppLst;
636
637 #ifndef O1_ENABLE
638    /* Note: Added these below variable for local testing*/
639    Snssai snssai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}};
640 #endif
641
642 #ifdef O1_ENABLE
643    if( getStartupConfig(&g_cfg) != ROK )
644    {
645       RETVALUE(RFAILED);
646    }
647    cmInetAddr((S8*)g_cfg.DU_IPV4_Addr, &ipv4_du);
648    cmInetAddr((S8*)g_cfg.CU_IPV4_Addr, &ipv4_cu);
649    cmInetAddr((S8*)g_cfg.RIC_IPV4_Addr, &ipv4_ric);
650
651    duCfgParam.sctpParams.cuPort = g_cfg.CU_Port;
652    duCfgParam.sctpParams.ricPort = g_cfg.RIC_Port;
653 #else   
654    cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du);
655    cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu);
656    cmInetAddr((S8*)RIC_IP_V4_ADDR, &ipv4_ric);
657
658    duCfgParam.sctpParams.cuPort = CU_PORT;
659    duCfgParam.sctpParams.ricPort = RIC_PORT;
660 #endif
661
662    fillDuPort(duCfgParam.sctpParams.duPort);
663
664    /* F1 DU IP Address and Port*/
665    duCfgParam.sctpParams.duIpAddr.ipV4Addr = ipv4_du;
666
667    /* F1 CU IP Address and Port*/
668    duCfgParam.sctpParams.cuIpAddr.ipV4Addr = ipv4_cu;
669
670    /* Fill RIC Params */
671    duCfgParam.sctpParams.ricIpAddr.ipV4Addr = ipv4_ric;
672
673    /* EGTP Parameters */
674    duCfgParam.egtpParams.localIp.ipV4Pres = TRUE;
675    duCfgParam.egtpParams.localIp.ipV4Addr = ipv4_du;
676    duCfgParam.egtpParams.localPort = DU_EGTP_PORT;
677    duCfgParam.egtpParams.destIp.ipV4Pres = TRUE;
678    duCfgParam.egtpParams.destIp.ipV4Addr = ipv4_cu;
679    duCfgParam.egtpParams.destPort = CU_EGTP_PORT;
680    duCfgParam.egtpParams.minTunnelId = MIN_TEID;
681    duCfgParam.egtpParams.maxTunnelId = MAX_TEID;
682
683    duCfgParam.maxUe = 32; //TODO: Check
684    /* DU Info */        
685    duCfgParam.duId = DU_ID;     
686    strcpy((char*)duCfgParam.duName,DU_NAME);
687
688    /* Mib Params */
689    mib.sysFrmNum = SYS_FRAME_NUM;
690 #ifdef NR_TDD
691    mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs30or120;
692 #else
693    mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs15or60;
694 #endif
695    mib.ssb_SubcarrierOffset = SSB_SC_OFFSET; //Kssb
696    mib.dmrs_TypeA_Position = MIB__dmrs_TypeA_Position_pos2;
697    mib.controlResourceSetZero = CORESET_0_INDEX;
698    mib.searchSpaceZero = SEARCHSPACE_0_INDEX;
699    mib.cellBarred = MIB__cellBarred_notBarred;
700    mib.intraFreqReselection =
701       MIB__intraFreqReselection_notAllowed;
702    duCfgParam.mibParams = mib;
703
704    /* SIB1 Params */
705    memset(&sib1.plmn, 0, sizeof(Plmn));
706    sib1.plmn.mcc[0] = PLMN_MCC0;
707    sib1.plmn.mcc[1] = PLMN_MCC1;
708    sib1.plmn.mcc[2] = PLMN_MCC2;
709    sib1.plmn.mnc[0] = PLMN_MNC0;
710    sib1.plmn.mnc[1] = PLMN_MNC1;
711    sib1.ranac = DU_RANAC;
712
713 #ifdef O1_ENABLE
714    sib1.tac =  cellParams.nRTAC;
715    sib1.cellIdentity =  CELL_IDENTITY *  cellParams.cellLocalId;
716       DU_LOG("\n*********DEBUG --> DU_APP: readCfg(): OAM CellLocalId=%d", \
717               sib1.cellIdentity);
718 #else
719    sib1.tac = DU_TAC;
720    sib1.cellIdentity = CELL_IDENTITY * NR_CELL_ID;
721 #endif
722    sib1.cellResvdForOpUse = PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
723    sib1.connEstFailCnt = ConnEstFailureControl__connEstFailCount_n3;
724    sib1.connEstFailOffValidity = ConnEstFailureControl__connEstFailOffsetValidity_s120;
725    sib1.siSchedInfo.winLen = SI_SchedulingInfo__si_WindowLength_s5;
726    sib1.siSchedInfo.broadcastSta = SchedulingInfo__si_BroadcastStatus_broadcasting;
727    sib1.siSchedInfo.preiodicity = SchedulingInfo__si_Periodicity_rf8;
728    sib1.siSchedInfo.sibType = SIB_TypeInfo__type_sibType2;
729    sib1.siSchedInfo.sibValTag = SIB1_VALUE_TAG;
730
731    fillServCellCfgCommSib(&sib1.srvCellCfgCommSib);
732
733    duCfgParam.sib1Params = sib1;
734
735    for(srvdCellIdx=0; srvdCellIdx<DEFAULT_CELLS; srvdCellIdx++)
736    { 
737       memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn, 0, sizeof(Plmn));
738       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
739       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
740       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
741       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
742       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
743
744       /*Cell ID */
745  #ifdef O1_ENABLE
746       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = cellParams.nRPCI;
747  #else
748       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = NR_PCI;
749 #endif
750       /* List of Available PLMN */
751       for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
752       {
753          /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
754           * followed by either 2 digit or 3 digits of mnc */ 
755
756          memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn, 0,\
757          sizeof(Plmn));
758  #ifdef O1_ENABLE
759          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = cellParams.plmnList[srvdPlmnIdx].mcc[0];
760          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = cellParams.plmnList[srvdPlmnIdx].mcc[1];
761          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = cellParams.plmnList[srvdPlmnIdx].mcc[2];
762          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = cellParams.plmnList[srvdPlmnIdx].mnc[0];
763          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = cellParams.plmnList[srvdPlmnIdx].mnc[1];
764          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[2] = cellParams.plmnList[srvdPlmnIdx].mnc[2];
765  #else
766          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = PLMN_MCC0;
767          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = PLMN_MCC1;
768          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = PLMN_MCC2;
769          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = PLMN_MNC0;
770          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = PLMN_MNC1;
771 #endif
772       }
773       /* List of Extended PLMN */
774       for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
775       {
776          /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
777           * followed by either 2 digit or 3 digits of mnc */ 
778
779          memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn, 0, sizeof(Plmn));
780          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[0] = PLMN_MCC0;
781          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[1] = PLMN_MCC1;
782          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[2] = PLMN_MCC2;
783          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[0] = PLMN_MNC0;
784          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[1] = PLMN_MNC1;
785       } 
786       /* List of Supporting Slices */
787       for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
788       {
789          taiSliceSuppLst = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].\
790          taiSliceSuppLst;
791          
792          /* TODO Calculte the exact number of supported slices once will get
793           * cell configuration from O1 */
794          taiSliceSuppLst->numSupportedSlices = NUM_OF_SUPPORTED_SLICE;
795          if(taiSliceSuppLst->numSupportedSlices > MAX_NUM_OF_SLICE_ITEMS)
796          {
797             DU_LOG("\nERROR --> DU_APP: readCfg(): Number of supported slice [%d] is more than 1024",\
798             taiSliceSuppLst->numSupportedSlices);
799             return RFAILED;
800          }
801
802          DU_ALLOC(taiSliceSuppLst->snssai, taiSliceSuppLst->numSupportedSlices*sizeof(Snssai*));
803          if(taiSliceSuppLst->snssai == NULLP)
804          {
805             DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
806             return RFAILED;
807          }
808          
809          for(sliceIdx=0; sliceIdx<taiSliceSuppLst->numSupportedSlices; sliceIdx++)
810          {
811             DU_ALLOC(taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
812             if(taiSliceSuppLst->snssai[sliceIdx] == NULLP)
813             {
814                DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
815                return RFAILED;
816             }
817 #ifdef O1_ENABLE
818             memcpy(taiSliceSuppLst->snssai[sliceIdx]->sd, cellParams.plmnList[sliceIdx].sd, \
819                   SD_SIZE*sizeof(uint8_t));
820             taiSliceSuppLst->snssai[sliceIdx]->sst = cellParams.plmnList[sliceIdx].sst;
821 #else
822             memcpy(taiSliceSuppLst->snssai[sliceIdx], &snssai[sliceIdx], sizeof(Snssai));
823 #endif
824          }
825       }
826
827       /* NR Mode info */
828 #ifdef NR_TDD
829       /* NR TDD Mode info */
830 #ifdef O1_ENABLE      
831       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = cellParams.arfcnUL;
832       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
833       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsPeriodicityToEnum(cellParams.ssbPeriodicity);                 
834 #else
835       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_UL_ARFCN;
836       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
837       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = SSB_PRDCTY_MS_20;               
838 #endif      
839       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;         
840
841       for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
842       {
843          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].nrFreqBand =\
844                                                                                                                      NR_FREQ_BAND;
845          for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
846          {
847             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].sulBand[bandIdx]\
848                = SUL_BAND;      
849          }
850       }
851 #else
852       /* NR FDD Mode info */
853 #ifdef O1_ENABLE
854       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = cellParams.arfcnUL;
855       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
856       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = convertScsPeriodicityToEnum(cellParams.ssbPeriodicity);
857       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsPeriodicityToEnum(cellParams.ssbPeriodicity);
858       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = cellParams.arfcnDL;
859       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
860       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsPeriodicityToEnum(cellParams.ssbPeriodicity);
861       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = convertScsPeriodicityToEnum(cellParams.ssbPeriodicity);
862 #else
863       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_UL_ARFCN;
864       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
865       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = SSB_PRDCTY_MS_20;
866       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = SSB_PRDCTY_MS_20;
867       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_DL_ARFCN;
868       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
869       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = SSB_PRDCTY_MS_20;
870       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = SSB_PRDCTY_MS_20;
871 #endif
872       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
873       for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
874       {
875          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
876          nrFreqBand = NR_FREQ_BAND;
877          for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
878          {
879             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
880             sulBand[bandIdx] = SUL_BAND;
881          }
882       }
883       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
884       for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
885       {
886          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
887          nrFreqBand = NR_FREQ_BAND;
888          for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
889          {
890             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
891             sulBand[bandIdx] = SUL_BAND;
892          }
893       }
894
895       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
896       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
897 #endif
898
899       /*Measurement Config and Cell Config */ 
900       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.measTimeCfg = TIME_CFG; 
901
902       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellDir = DL_UL; 
903
904       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellType=CELL_TYPE;
905
906       /* Broadcast PLMN Identity */
907       for(brdcstPlmnIdx=0; brdcstPlmnIdx<MAX_BPLMN_NRCELL_MINUS_1; brdcstPlmnIdx++)
908       { 
909          for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
910          {
911             memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx],\
912             0, sizeof(Plmn));
913             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[0] =\
914             PLMN_MCC0;
915             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[1] =\
916             PLMN_MCC1;
917             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[2] =\
918             PLMN_MCC2;
919             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[0] =\
920             PLMN_MNC0;
921             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[1] =\
922             PLMN_MNC1;
923          }
924          /* Extended PLMN List */        
925          for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
926          {
927             memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
928             extPlmn[plmnIdx], 0, sizeof(Plmn));
929             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
930             extPlmn[plmnIdx].mcc[0] = PLMN_MCC0;
931             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
932             extPlmn[plmnIdx].mcc[1] = PLMN_MCC1;
933             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
934             extPlmn[plmnIdx].mcc[2] = PLMN_MCC2;
935             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
936             extPlmn[plmnIdx].mnc[0] = PLMN_MNC0;
937             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
938             extPlmn[plmnIdx].mnc[1] = PLMN_MNC1;
939          }
940 #ifdef O1_ENABLE
941          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = cellParams.nRTAC; //TODO : to check and fill
942          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = cellParams.nRTAC;
943          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = cellParams.nRTAC;
944          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = cellParams.cellLocalId;
945 #else       
946          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = DU_TAC; //TODO : to check and fill
947          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = DU_TAC;
948          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = DU_TAC;
949          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = NR_CELL_ID;
950 #endif     
951          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].ranac = NR_RANAC;
952       }
953
954       /*gnb DU System Info mib msg*/
955       BuildMibMsg();
956       DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBufSize);
957       if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg))
958       {
959          DU_LOG("\nERROR  -->  DU APP : Memory allocation failure at readCfg");
960          return RFAILED;
961       }
962       memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBuf, encBufSize);
963       duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibLen = encBufSize;
964
965       /*gnb DU System Info mib msg*/
966       BuildSib1Msg();
967       DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
968             encBufSize);
969       if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg))
970       {
971          DU_LOG("\nERROR  -->  DU APP : Memory allocation failure at readCfg");
972          return RFAILED;
973       }
974       memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
975             encBuf,encBufSize);
976       duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Len = encBufSize;
977
978    }
979
980    if(readMacCfg() != ROK)
981    {
982       DU_LOG("\nERROR  -->  DU_APP : Failed while reading MAC config");
983       return RFAILED;
984    }
985
986    return ROK;
987 }
988
989 /*******************************************************************
990  *
991  * @brief Copy Slice Cfg in temp structre in duCfgParams 
992  *
993  * @details
994  *
995  *    Function : cpyRrmPolicyInDuCfgParams
996  *
997  *    Functionality:
998  *      - Copy Slice Cfg in temp structre in duCfgParams 
999  *
1000  * @params[in] RrmPolicy rrmPolicy[], uint8_t policyNum, uint8_t memberList
1001  * @return ROK     - success
1002  *         RFAILED - failure
1003  *
1004  * ****************************************************************/
1005 #ifdef O1_ENABLE
1006 uint8_t cpyRrmPolicyInDuCfgParams(RrmPolicyList rrmPolicy[], uint8_t policyNum, CopyOfRecvdSliceCfg *tempSliceCfg)
1007 {
1008    uint8_t policyIdx = 0, memberListIdx = 0, count = 0;
1009
1010    if(policyNum)
1011    {
1012       tempSliceCfg->totalRrmPolicy = policyNum;
1013       DU_ALLOC(tempSliceCfg->rrmPolicy, tempSliceCfg->totalRrmPolicy * sizeof(RrmPolicy*));
1014       if(tempSliceCfg->rrmPolicy == NULLP)
1015       {
1016          DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
1017          return RFAILED;
1018       }
1019
1020       for(policyIdx = 0; policyIdx<tempSliceCfg->totalRrmPolicy; policyIdx++)
1021       {
1022          DU_ALLOC(tempSliceCfg->rrmPolicy[policyIdx],  sizeof(RrmPolicy));
1023          if(tempSliceCfg->rrmPolicy[policyIdx] == NULLP)
1024          {
1025             DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
1026             return RFAILED;
1027          }
1028          
1029          if(rrmPolicy[policyIdx].rRMMemberNum)
1030          {
1031             tempSliceCfg->rrmPolicy[policyIdx]->numMemberList = rrmPolicy[policyIdx].rRMMemberNum;  
1032             DU_ALLOC(tempSliceCfg->rrmPolicy[policyIdx]->memberList, tempSliceCfg->rrmPolicy[policyIdx]->numMemberList * sizeof(PolicyMemberList*))
1033             if(tempSliceCfg->rrmPolicy[policyIdx]->memberList == NULLP)
1034             {
1035                DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
1036                return RFAILED;
1037             }
1038
1039             for(memberListIdx = 0; memberListIdx<tempSliceCfg->rrmPolicy[policyIdx]->numMemberList; memberListIdx++)
1040             {
1041                DU_ALLOC(tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListIdx], sizeof(PolicyMemberList))
1042                if(tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListIdx] == NULLP)
1043                {
1044                   DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
1045                   return RFAILED;
1046                }
1047                memcpy(&tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListIdx]->snssai.sd, &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].sd, 3 * sizeof(uint8_t));
1048                memcpy(&tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListIdx]->snssai.sst, &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].sst, sizeof(uint8_t));
1049                memcpy(&tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListIdx]->plmn.mcc, &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].mcc, 3 * sizeof(uint8_t));
1050                memcpy(&tempSliceCfg->rrmPolicy[policyIdx]->memberList[memberListIdx]->plmn.mnc, &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].mnc, 3 * sizeof(uint8_t));
1051                count++;
1052             }
1053          }
1054          
1055          tempSliceCfg->rrmPolicy[policyIdx]->rsrcType  = rrmPolicy[policyIdx].resourceType;
1056          tempSliceCfg->rrmPolicy[policyIdx]->policyMaxRatio = rrmPolicy[policyIdx].rRMPolicyMaxRatio;
1057          tempSliceCfg->rrmPolicy[policyIdx]->policyMinRatio = rrmPolicy[policyIdx].rRMPolicyMinRatio;
1058          tempSliceCfg->rrmPolicy[policyIdx]->policyDedicatedRatio = rrmPolicy[policyIdx].rRMPolicyDedicatedRatio;
1059
1060       }
1061       tempSliceCfg->totalSliceCount = count;
1062    }
1063    return ROK;
1064 }
1065 #endif
1066 /*******************************************************************
1067  *
1068  * @brief Reads config and posts message to du_app on completion
1069  *
1070  * @details
1071  *
1072  *    Function : main
1073  *
1074  *    Functionality:
1075  *      - Calls readCfg()
1076  *      - Post to du_app for further processing
1077  *
1078  * @params[in] void
1079  * @return ROK     - success
1080  *         RFAILED - failure
1081  *
1082  * ****************************************************************/
1083 uint8_t duReadCfg()
1084 {
1085    Pst pst;
1086    Buffer *mBuf;
1087
1088    memset(&duCfgParam, 0, sizeof(DuCfgParams));
1089
1090    //Read configs into duCfgParams
1091    if(readCfg() != ROK)
1092    {
1093       DU_LOG("\nERROR  -->  DU_APP : Reading configuration failed");
1094       return RFAILED;
1095    }
1096
1097    //Fill pst structure
1098    memset(&(pst), 0, sizeof(Pst));
1099    pst.srcEnt = (Ent)ENTDUAPP;
1100    pst.srcInst = (Inst)DU_INST;
1101    pst.srcProcId = DU_PROC;
1102    pst.dstEnt = pst.srcEnt;
1103    pst.dstInst = pst.srcInst;
1104    pst.dstProcId = pst.srcProcId;
1105    pst.event = EVTCFG;
1106    pst.selector = ODU_SELECTOR_TC;
1107    pst.pool= DU_POOL;
1108
1109
1110    if(ODU_GET_MSG_BUF(DFLT_REGION, DU_POOL, &mBuf) != ROK)
1111    {
1112       DU_LOG("\nERROR  -->  DU_APP : Memory allocation failed in duReadCfg");
1113       return RFAILED;
1114    }
1115
1116    if (ODU_POST_TASK(&pst, mBuf) != ROK)
1117    {
1118       DU_LOG("\nERROR  -->  DU_APP : ODU_POST_TASK failed in duReadCfg");
1119       return RFAILED;
1120    }
1121
1122    return ROK;
1123 }
1124
1125 /**********************************************************************
1126   End of file
1127  **********************************************************************/
1128