1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /* This file contains all utility functions */
20 #include "common_def.h"
26 #include "du_app_mac_inf.h"
27 #include "du_app_rlc_inf.h"
28 #include "du_e2ap_mgr.h"
32 #include "du_f1ap_conversions.h"
33 #include "OCTET_STRING.h"
34 #include "BIT_STRING.h"
35 #include "odu_common_codec.h"
37 #include "SearchSpace.h"
38 #include "SIB-TypeInfo.h"
39 #include "SchedulingInfo.h"
40 #include "SI-SchedulingInfo.h"
41 #include "ConnEstFailureControl.h"
42 #include "PLMN-IdentityInfo.h"
43 #include "PDSCH-TimeDomainResourceAllocation.h"
44 #include "BCCH-Config.h"
45 #include "PagingCycle.h"
46 #include "PCCH-Config.h"
47 #include "TimeAlignmentTimer.h"
48 #include "BCCH-DL-SCH-Message.h"
49 #include "RACH-ConfigGeneric.h"
50 #include "PUSCH-TimeDomainResourceAllocation.h"
51 #include "PUCCH-ConfigCommon.h"
52 #include "SubcarrierSpacing.h"
53 #include "TDD-UL-DL-Pattern.h"
54 #include "RACH-ConfigCommon.h"
55 #include "BWP-DownlinkCommon.h"
56 #include "BWP-UplinkCommon.h"
57 #include "TDD-UL-DL-ConfigCommon.h"
58 #include "du_sys_info_hdl.h"
61 #include "CmInterface.h"
62 extern StartupConfig g_cfg;
63 extern NRCellDU cellParams;
66 char encBuf[ENC_BUF_MAX_LEN];
69 /* Filling Slot configuration as :
70 * 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
71 * 0 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
72 * 1 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
73 * 2 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
74 3 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
75 4 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
76 5 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
77 6 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
78 7 DL DL DL DL DL DL DL DL DL DL DL DL F UL
79 8 UL UL UL UL UL UL UL UL UL UL UL UL UL UL
80 9 UL UL UL UL UL UL UL UL UL UL UL UL UL UL
83 /*******************************************************************
84 * @brief Reads the CL Configuration.
88 * Function : readMacCfg
91 * - Fills up the cell configuration for CL.
92 * - Calls FillSlotConfig()
95 * @return ROK - success
98 * ****************************************************************/
102 uint8_t idx=0, sliceIdx=0,plmnIdx = 0;
103 F1TaiSliceSuppLst *taiSliceSuppLst;
105 /* DL carrier configuration */
107 duCfgParam.macCellCfg.cellId = cellParams.cellLocalId;
108 duCfgParam.macCellCfg.carrCfg.dlBw = cellParams.bSChannelBwDL;
109 duCfgParam.macCellCfg.carrCfg.dlFreq = convertArfcnToFreqKhz(cellParams.arfcnDL);
111 duCfgParam.macCellCfg.cellId = NR_CELL_ID;
112 duCfgParam.macCellCfg.carrCfg.dlBw = NR_BANDWIDTH;
113 duCfgParam.macCellCfg.carrCfg.dlFreq = convertArfcnToFreqKhz(NR_DL_ARFCN);
115 duCfgParam.macCellCfg.carrCfg.numTxAnt = NUM_TX_ANT;
116 /* UL Carrier configuration */
118 duCfgParam.macCellCfg.carrCfg.ulBw = cellParams.bSChannelBwUL;
119 duCfgParam.macCellCfg.carrCfg.ulFreq = convertArfcnToFreqKhz(cellParams.arfcnUL);
121 duCfgParam.macCellCfg.carrCfg.ulBw = NR_BANDWIDTH;
122 duCfgParam.macCellCfg.carrCfg.ulFreq = convertArfcnToFreqKhz(NR_UL_ARFCN);
124 duCfgParam.macCellCfg.carrCfg.numRxAnt = NUM_RX_ANT;
126 /* Cell configuration */
128 duCfgParam.macCellCfg.cellCfg.opState = cellParams.operationalState;
129 duCfgParam.macCellCfg.cellCfg.adminState = cellParams.administrativeState;
130 duCfgParam.macCellCfg.cellCfg.cellState = cellParams.cellState;
131 duCfgParam.macCellCfg.cellCfg.phyCellId = cellParams.nRPCI;
132 duCfgParam.macCellCfg.cellCfg.tac = cellParams.nRTAC;
133 duCfgParam.macCellCfg.cellCfg.ssbFreq = cellParams.ssbFrequency;
135 duCfgParam.macCellCfg.cellCfg.opState = OP_DISABLED;
136 duCfgParam.macCellCfg.cellCfg.adminState = ADMIN_UNLOCKED;
137 duCfgParam.macCellCfg.cellCfg.cellState = CELL_INACTIVE;
138 duCfgParam.macCellCfg.cellCfg.phyCellId = NR_PCI;
139 duCfgParam.macCellCfg.cellCfg.tac = DU_TAC;
140 duCfgParam.macCellCfg.cellCfg.ssbFreq = SSB_FREQUENCY;
142 /* Plmn And SNSSAI Configuration */
143 for(plmnIdx = 0; plmnIdx < MAX_PLMN; plmnIdx++)
145 memcpy(&duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].plmn, &duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[plmnIdx].plmn,\
147 taiSliceSuppLst = &duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[plmnIdx].taiSliceSuppLst;
148 duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].numSupportedSlice = taiSliceSuppLst->numSupportedSlices;
149 if(taiSliceSuppLst->snssai)
151 DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].snssai, (duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].numSupportedSlice) * sizeof(Snssai*));
152 if(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].snssai == NULLP)
154 DU_LOG("\nERROR --> DU_APP: Memory allocation failed at readMacCfg");
158 for(sliceIdx=0; sliceIdx < taiSliceSuppLst->numSupportedSlices; sliceIdx++)
160 if(taiSliceSuppLst->snssai[sliceIdx] != NULLP)
162 DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].snssai[sliceIdx], sizeof(Snssai));
163 if(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].snssai[sliceIdx] == NULLP)
165 DU_LOG("\nERROR --> DU_APP: Memory allocation failed at readMacCfg");
168 memcpy(duCfgParam.macCellCfg.cellCfg.plmnInfoList[plmnIdx].snssai[sliceIdx], taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
172 duCfgParam.macCellCfg.cellCfg.subCarrSpacing = NR_SCS;
173 duCfgParam.macCellCfg.cellCfg.dupType = DUPLEX_MODE;
175 /* SSB configuration */
176 duCfgParam.macCellCfg.ssbCfg.ssbPbchPwr = SSB_PBCH_PWR;
177 duCfgParam.macCellCfg.ssbCfg.bchPayloadFlag = BCH_PAYLOAD;
178 duCfgParam.macCellCfg.ssbCfg.ssbOffsetPointA = OFFSET_TO_POINT_A;
179 duCfgParam.macCellCfg.ssbCfg.betaPss = BETA_PSS;
181 duCfgParam.macCellCfg.ssbCfg.scsCmn = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
182 duCfgParam.macCellCfg.ssbCfg.ssbPeriod = convertSSBPeriodicityToEnum(cellParams.ssbPeriodicity);
183 duCfgParam.macCellCfg.ssbCfg.ssbScOffset = cellParams.ssbOffset;
185 duCfgParam.macCellCfg.ssbCfg.scsCmn = NR_SCS;
186 duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PRDCTY_MS_20;
187 duCfgParam.macCellCfg.ssbCfg.ssbScOffset = SSB_SUBCARRIER_OFFSET;
189 duCfgParam.macCellCfg.ssbCfg.ssbMask[0] = 1; /* only one SSB is transmitted */
190 if(BuildMibPdu() != ROK)
192 DU_LOG("\nERROR --> Failed to build MIB PDU");
193 memset(&duCfgParam.macCellCfg.ssbCfg.mibPdu, 0, 3*sizeof(uint8_t));
197 memcpy(&duCfgParam.macCellCfg.ssbCfg.mibPdu, encBuf,encBufSize);
200 /* PRACH configuration */
201 duCfgParam.macCellCfg.prachCfg.prachSeqLen = PRACH_SEQ_LEN;
202 duCfgParam.macCellCfg.prachCfg.prachSubcSpacing = convertScsEnumValToScsVal(PRACH_SUBCARRIER_SPACING);
203 duCfgParam.macCellCfg.prachCfg.prachCfgIdx = PRACH_CONFIG_IDX;
204 duCfgParam.macCellCfg.prachCfg.msg1Fdm = NUM_PRACH_FDM;
205 duCfgParam.macCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX;
206 duCfgParam.macCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ;
207 duCfgParam.macCellCfg.prachCfg.fdm[0].k1 = 0;
208 duCfgParam.macCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
209 duCfgParam.macCellCfg.prachCfg.prachRstSetCfg = PRACH_RESTRICTED_SET_CFG;
210 duCfgParam.macCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH;
211 duCfgParam.macCellCfg.prachCfg.msg1FreqStart = PRACH_FREQ_START;
213 duCfgParam.macCellCfg.prachCfg.totalNumRaPreamble = NUM_RA_PREAMBLE;
214 duCfgParam.macCellCfg.prachCfg.numCbPreamblePerSsb = CB_PREAMBLE_PER_SSB;
215 duCfgParam.macCellCfg.prachCfg.raRspWindow = RA_RSP_WINDOW;
217 /* TDD configuration */
219 duCfgParam.macCellCfg.tddCfg.tddPeriod = TDD_PERIODICITY;
220 duCfgParam.macCellCfg.tddCfg.nrOfDlSlots = NUM_DL_SLOTS;
221 duCfgParam.macCellCfg.tddCfg.nrOfDlSymbols = NUM_DL_SYMBOLS;
222 duCfgParam.macCellCfg.tddCfg.nrOfUlSlots = NUM_UL_SLOTS;
223 duCfgParam.macCellCfg.tddCfg.nrOfUlSymbols = NUM_UL_SYMBOLS;
229 /* fill SIB1 configuration */
230 duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len;
231 DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
232 memcpy(duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, \
233 duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
234 duCfgParam.macCellCfg.cellCfg.sib1Cfg.pdcchCfgSib1.coresetZeroIndex = CORESET_0_INDEX;
235 duCfgParam.macCellCfg.cellCfg.sib1Cfg.pdcchCfgSib1.searchSpaceZeroIndex = SEARCHSPACE_0_INDEX;
237 duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.numPO = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg.ns;
238 if((duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg.firstPDCCHMontioringType != \
239 PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_NOTHING) && (duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.numPO != 0))
241 duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.poPresent = TRUE;
242 memcpy(duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.pagingOcc,
243 duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg.firstPDCCHMontioringInfo,MAX_PO_PER_PF);
247 duCfgParam.macCellCfg.cellCfg.sib1Cfg.pagingCfg.poPresent = FALSE;
250 /* fill Intial DL BWP */
251 duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.firstPrb = 0;
252 duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */
253 duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.scs = duCfgParam.macCellCfg.ssbCfg.scsCmn;
254 duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
255 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId = SEARCHSPACE_1_INDEX;
256 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.coresetId = CORESET_0_INDEX;
257 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot =
258 SS_MONITORING_SLOT_SL1; /* sl1 - all slots */
259 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.duration = 0;
260 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol =
261 SS_MONITORING_SYMBOL;
262 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
263 candidate.aggLevel1 = 8;
264 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
265 candidate.aggLevel2 = 4;
266 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
267 candidate.aggLevel4 = 2;
268 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
269 candidate.aggLevel8 = 1;
270 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
271 candidate.aggLevel16 = 0;
273 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.numTimeDomAlloc = NUM_TIME_DOM_RSRC_ALLOC;
275 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].k0 = PDSCH_K0_CFG1;
276 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].mappingType =
277 PDSCH_MAPPING_TYPE_A;
278 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].startSymbol =
280 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].lengthSymbol =
284 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].k0 = PDSCH_K0_CFG2;
285 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].mappingType =
286 PDSCH_MAPPING_TYPE_A;
287 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].startSymbol =
289 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].lengthSymbol =
292 /* ra-searchSpace ID is set to 1 */
293 duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.raSearchSpaceId = SEARCHSPACE_1_INDEX;
295 /* fill Intial UL BWP */
296 duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.firstPrb = 0;
297 duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */
298 duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.scs = duCfgParam.macCellCfg.ssbCfg.scsCmn;
299 duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
300 duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.numTimeDomRsrcAlloc = 2;
301 duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].k2 = PUSCH_K2_CFG1;
302 duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].mappingType =
303 PUSCH_MAPPING_TYPE_A;
304 duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].startSymbol =
306 duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].symbolLength =
309 duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].k2 = PUSCH_K2_CFG2;
310 duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].mappingType =
311 PUSCH_MAPPING_TYPE_A;
312 duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].startSymbol =
314 duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].symbolLength =
317 duCfgParam.macCellCfg.ssbCfg.dmrsTypeAPos = DMRS_TYPE_A_POS;
319 /* fill PUCCH config common */
320 duCfgParam.macCellCfg.cellCfg.initialUlBwp.pucchCommon.pucchResourceCommon = PUCCH_RSRC_COMMON;
321 duCfgParam.macCellCfg.cellCfg.initialUlBwp.pucchCommon.pucchGroupHopping = PUCCH_GROUP_HOPPING;
326 /*Note: Static Configuration, when O1 is not configuring the RRM policy*/
327 RrmPolicyList rrmPolicy;
329 rrmPolicy.resourceType = PRB;
330 rrmPolicy.rRMMemberNum = 1;
331 memcpy(rrmPolicy.rRMPolicyMemberList[0].mcc,duCfgParam.macCellCfg.cellCfg.plmnInfoList[0].plmn.mcc, 3*sizeof(uint8_t));
332 memcpy(rrmPolicy.rRMPolicyMemberList[0].mnc,duCfgParam.macCellCfg.cellCfg.plmnInfoList[0].plmn.mnc, 3*sizeof(uint8_t));
333 rrmPolicy.rRMPolicyMemberList[0].sst = 1;
334 rrmPolicy.rRMPolicyMemberList[0].sd[0] = 2;
335 rrmPolicy.rRMPolicyMemberList[0].sd[1] = 3;
336 rrmPolicy.rRMPolicyMemberList[0].sd[2] = 4;
337 rrmPolicy.rRMPolicyMaxRatio = 90;
338 rrmPolicy.rRMPolicyMinRatio = 30;
339 rrmPolicy.rRMPolicyDedicatedRatio = 10;
341 cpyRrmPolicyInDuCfgParams(&rrmPolicy, 1, &duCfgParam.tempSliceCfg);
348 /*******************************************************************
350 * @brief Configures the DU Parameters
354 * Function : fillDuPort
357 * - fills the DU Ports.
359 * @params[in] duPort array to be filled
360 * @return ROK - success
363 * ****************************************************************/
364 uint8_t fillDuPort(uint16_t *duPort)
368 duPort[F1_INTERFACE] = g_cfg.DU_Port;
369 duPort[E2_INTERFACE] = g_cfg.RIC_Port;
371 duPort[F1_INTERFACE] = F1_SCTP_PORT; /* DU Port idx 0 38472 */
372 duPort[E2_INTERFACE] = E2_SCTP_PORT; /* RIC Port idx 1 36421 */
377 /*******************************************************************
379 * @brief Configures the DU Parameters
383 * Function : calcSliv
386 * - calculate SLIV value from start and length field
388 * @params[in] start symbol
389 * @params[in] length of symbols
392 * ****************************************************************/
393 uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol)
396 if((lengthSymbol-1) <= 7)
398 sliv = NUM_SYMBOLS_PER_SLOT * (lengthSymbol-1) + startSymbol;
402 sliv = NUM_SYMBOLS_PER_SLOT * (NUM_SYMBOLS_PER_SLOT - lengthSymbol + 1) \
403 + (NUM_SYMBOLS_PER_SLOT - 1 - startSymbol);
409 /*******************************************************************
411 * @brief Configures serving cell config common in sib1
415 * Function : fillServCellCfgCommSib
418 * - fills Serving cell config common for SIB1
420 * @params[in] SrvCellCfgCommSib pointer
421 * @return ROK - success
424 ** ****************************************************************/
425 uint8_t fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm)
427 PdcchCfgCommon pdcchCfg;
428 PdschCfgCommon pdschCfg;
430 RachCfgCommon rachCfg;
431 PuschCfgCommon puschCfg;
432 PucchCfgCommon pucchCfg;
433 TddUlDlCfgCommon tddCfg;
436 srvCellCfgComm->scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
438 srvCellCfgComm->scs = NR_SCS;
441 /* Configuring DL Config Common for SIB1*/
442 srvCellCfgComm->dlCfg.freqBandInd = NR_FREQ_BAND;
443 srvCellCfgComm->dlCfg.offsetToPointA = OFFSET_TO_POINT_A;
445 srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset = cellParams.ssbOffset;
446 srvCellCfgComm->dlCfg.dlScsCarrier.scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
447 srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = cellParams.bSChannelBwUL;
449 srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET;
450 srvCellCfgComm->dlCfg.dlScsCarrier.scs = NR_SCS;
451 srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = NR_BANDWIDTH;
453 srvCellCfgComm->dlCfg.locAndBw = FREQ_LOC_BW;
455 /* Configuring PDCCH Config Common For SIB1 */
456 pdcchCfg.present = BWP_DownlinkCommon__pdcch_ConfigCommon_PR_setup;
457 pdcchCfg.ctrlRsrcSetZero = CORESET_0_INDEX;
458 pdcchCfg.searchSpcZero = SEARCHSPACE_0_INDEX;
459 pdcchCfg.searchSpcId = PDCCH_SEARCH_SPACE_ID;
460 pdcchCfg.ctrlRsrcSetId = PDCCH_CTRL_RSRC_SET_ID;
461 pdcchCfg.monitorSlotPrdAndOffPresent = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
462 //pdcchCfg.monitorSlotPrdAndOff = \
463 SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
464 pdcchCfg.monitorSymbolsInSlot[0] = 128;
465 pdcchCfg.monitorSymbolsInSlot[1] = 0;
466 pdcchCfg.numCandAggLvl1 = SearchSpace__nrofCandidates__aggregationLevel1_n8;
467 pdcchCfg.numCandAggLvl2 = SearchSpace__nrofCandidates__aggregationLevel2_n4;
468 pdcchCfg.numCandAggLvl4 = SearchSpace__nrofCandidates__aggregationLevel4_n2;
469 pdcchCfg.numCandAggLvl8 = SearchSpace__nrofCandidates__aggregationLevel8_n1;
470 pdcchCfg.numCandAggLvl16 = SearchSpace__nrofCandidates__aggregationLevel16_n0;
471 pdcchCfg.searchSpcType = SearchSpace__searchSpaceType_PR_common;
472 pdcchCfg.commSrchSpcDciFrmt = PDCCH_SERACH_SPACE_DCI_FORMAT;
473 pdcchCfg.searchSpcSib1 = PDCCH_SEARCH_SPACE_ID_SIB1;
474 pdcchCfg.pagingSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING;
475 pdcchCfg.raSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING;
476 srvCellCfgComm->dlCfg.pdcchCfg = pdcchCfg;
478 /* Configuring PDSCH Config Common For SIB1 */
479 pdschCfg.present = BWP_DownlinkCommon__pdsch_ConfigCommon_PR_setup;
480 pdschCfg.numTimeDomRsrcAlloc = 2;
481 pdschCfg.timeDomAlloc[0].k0 = PDSCH_K0_CFG1;
482 pdschCfg.timeDomAlloc[0].mapType = PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
483 pdschCfg.timeDomAlloc[0].sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL);
485 pdschCfg.timeDomAlloc[1].k0 = PDSCH_K0_CFG2;
486 pdschCfg.timeDomAlloc[1].mapType = PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
487 pdschCfg.timeDomAlloc[1].sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL);
489 srvCellCfgComm->dlCfg.pdschCfg = pdschCfg;
491 /* Configuring BCCH Config for SIB1 */
492 srvCellCfgComm->dlCfg.bcchCfg.modPrdCoeff = BCCH_Config__modificationPeriodCoeff_n16;
494 /* Configuring PCCH Config for SIB1 */
495 pcchCfg.dfltPagingCycle = convertPagingCycleEnumToValue(PagingCycle_rf256);
496 pcchCfg.nAndPagingFrmOffsetType = PCCH_Config__nAndPagingFrameOffset_PR_oneT;
497 pcchCfg.pageFrameOffset = 0;
498 pcchCfg.ns = convertNsEnumToValue(PCCH_Config__ns_one);
499 pcchCfg.firstPDCCHMontioringType = PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_sCS30KHZoneT_SCS15KHZhalfT;
500 memset(pcchCfg.firstPDCCHMontioringInfo, 0, sizeof(uint16_t));
501 pcchCfg.firstPDCCHMontioringInfo[0] = 44;
503 srvCellCfgComm->dlCfg.pcchCfg = pcchCfg;
506 /* Configuring UL Config Common */
508 srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset = cellParams.ssbOffset;
509 srvCellCfgComm->ulCfg.ulScsCarrier.scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
510 srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = cellParams.bSChannelBwUL;
512 srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET;
513 srvCellCfgComm->ulCfg.ulScsCarrier.scs = NR_SCS;
514 srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = NR_BANDWIDTH;
516 srvCellCfgComm->ulCfg.freqBandInd = NR_FREQ_BAND;
517 srvCellCfgComm->ulCfg.pMax = UL_P_MAX;
518 srvCellCfgComm->ulCfg.locAndBw = FREQ_LOC_BW;
519 srvCellCfgComm->ulCfg.timeAlignTimerComm = TimeAlignmentTimer_infinity;
521 /* Configuring RACH Config Common for SIB1 */
522 rachCfg.present = BWP_UplinkCommon__rach_ConfigCommon_PR_setup;
523 rachCfg.prachCfgIdx = PRACH_CONFIG_IDX;
524 rachCfg.msg1Fdm = RACH_ConfigGeneric__msg1_FDM_one;
525 rachCfg.msg1FreqStart = PRACH_FREQ_START;
526 rachCfg.zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
527 rachCfg.preambleRcvdTgtPwr = PRACH_PREAMBLE_RCVD_TGT_PWR;
528 rachCfg.preambleTransMax = RACH_ConfigGeneric__preambleTransMax_n200;
529 rachCfg.pwrRampingStep = RACH_ConfigGeneric__powerRampingStep_dB2;
530 rachCfg.raRspWindow = RACH_ConfigGeneric__ra_ResponseWindow_sl10;
531 rachCfg.numRaPreamble = NUM_RA_PREAMBLE;
532 rachCfg.numSsbPerRachOcc = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one;
533 rachCfg.numCbPreamblePerSsb = CB_PREAMBLE_PER_SSB;
534 rachCfg.contResTimer = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64;
535 rachCfg.rsrpThreshSsb = RSRP_THRESHOLD_SSB;
536 rachCfg.rootSeqIdxPresent = RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139;
537 rachCfg.rootSeqIdx = ROOT_SEQ_IDX;
538 rachCfg.msg1Scs = PRACH_SUBCARRIER_SPACING ;
539 rachCfg.restrictedSetCfg = PRACH_RESTRICTED_SET_CFG;
540 srvCellCfgComm->ulCfg.rachCfg = rachCfg;
542 /* Configuring PUSCH Config Common for SIB1 */
543 puschCfg.puschCfgPresent = BWP_UplinkCommon__pusch_ConfigCommon_PR_setup;
544 puschCfg.numTimeDomRsrcAlloc = 2;
545 puschCfg.timeDomAllocList[0].k2 = PUSCH_K2_CFG1;
546 puschCfg.timeDomAllocList[0].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
547 puschCfg.timeDomAllocList[0].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
548 puschCfg.timeDomAllocList[1].k2 = PUSCH_K2_CFG2;
549 puschCfg.timeDomAllocList[1].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
550 puschCfg.timeDomAllocList[1].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
551 puschCfg.msg3DeltaPreamble = PUSCH_MSG3_DELTA_PREAMBLE;
552 puschCfg.p0NominalWithGrant = PUSCH_P0_NOMINAL_WITH_GRANT;
553 srvCellCfgComm->ulCfg.puschCfg = puschCfg;
555 /* Configuring PUCCH Config Common for SIB1 */
556 pucchCfg.present = BWP_UplinkCommon__pucch_ConfigCommon_PR_setup;
557 pucchCfg.rsrcComm = PUCCH_RSRC_COMMON;
558 pucchCfg.grpHop = PUCCH_ConfigCommon__pucch_GroupHopping_neither;
559 pucchCfg.p0Nominal = PUCCH_P0_NOMINAL;
560 srvCellCfgComm->ulCfg.pucchCfg = pucchCfg;
562 /* Configuring TDD UL DL config common */
563 tddCfg.refScs = SubcarrierSpacing_kHz30;
564 tddCfg.txPrd = TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5;
565 tddCfg.numDlSlots = NUM_DL_SLOTS;
566 tddCfg.numDlSymbols = NUM_DL_SYMBOLS;
567 tddCfg.numUlSlots = NUM_UL_SLOTS;
568 tddCfg.numUlSymbols = NUM_UL_SYMBOLS;
569 srvCellCfgComm->tddCfg = tddCfg;
571 srvCellCfgComm->ssbPosInBurst = 192;
572 srvCellCfgComm->ssbPrdServingCell = SSB_PERIODICITY;
573 srvCellCfgComm->ssPbchBlockPwr = SSB_PBCH_PWR;
578 /*******************************************************************
580 * @brief Configures the DU Parameters
587 * - Initializes the DuCfg members.
588 * - Calls readMacCfg()
590 * @params[in] system task ID
591 * @return ROK - success
594 * ****************************************************************/
599 uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx, ranFuncIdx, eventTriggerStyleIdx, reportStyleIdx, tnlAssocIdx;
600 uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx;
601 uint32_t ipv4_du, ipv4_cu, ipv4_ric;
604 F1TaiSliceSuppLst *taiSliceSuppLst;
605 uint8_t measurementInfoIdx =0, measurementInfoLen=0;
606 char shortName[] = SHORT_NAME;
607 char serviceModelOID[]= SERVICE_MODEL_OID;
608 char description[] = DESCRIPTION;
609 char event_trigger_style_name[]= EVENT_TRIGGER_STYLE_NAME;
610 char ric_report_style_name[]= REPORT_STYLE_NAME;
613 /* Note: Added these below variable for local testing*/
614 Snssai snssai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}};
621 if( getStartupConfig(&g_cfg) != ROK )
625 cmInetAddr((S8*)g_cfg.DU_IPV4_Addr, &ipv4_du);
626 cmInetAddr((S8*)g_cfg.CU_IPV4_Addr, &ipv4_cu);
627 cmInetAddr((S8*)g_cfg.RIC_IPV4_Addr, &ipv4_ric);
629 duCfgParam.sctpParams.cuPort = g_cfg.CU_Port;
630 duCfgParam.sctpParams.ricPort = g_cfg.RIC_Port;
632 cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du);
633 cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu);
634 cmInetAddr((S8*)RIC_IP_V4_ADDR, &ipv4_ric);
636 duCfgParam.sctpParams.cuPort = F1_SCTP_PORT;
637 duCfgParam.sctpParams.ricPort = E2_SCTP_PORT;
640 fillDuPort(duCfgParam.sctpParams.duPort);
642 /* F1 DU IP Address and Port*/
643 duCfgParam.sctpParams.duIpAddr.ipV4Addr = ipv4_du;
645 /* F1 CU IP Address and Port*/
646 duCfgParam.sctpParams.cuIpAddr.ipV4Addr = ipv4_cu;
648 /* Fill RIC Params */
649 duCfgParam.sctpParams.ricIpAddr.ipV4Addr = ipv4_ric;
651 /* EGTP Parameters */
652 duCfgParam.egtpParams.localIp.ipV4Pres = TRUE;
653 duCfgParam.egtpParams.localIp.ipV4Addr = ipv4_du;
654 duCfgParam.egtpParams.localPort = F1_EGTP_PORT;
655 duCfgParam.egtpParams.destIp.ipV4Pres = TRUE;
656 duCfgParam.egtpParams.destIp.ipV4Addr = ipv4_cu;
657 duCfgParam.egtpParams.destPort = F1_EGTP_PORT;
658 duCfgParam.egtpParams.minTunnelId = MIN_TEID;
659 duCfgParam.egtpParams.maxTunnelId = MAX_TEID;
661 duCfgParam.maxUe = 32; //TODO: Check
664 duCfgParam.duId = DU_ID;
665 DU_ALLOC(duCfgParam.duName, sizeof(DU_NAME));
666 if(!duCfgParam.duName)
668 DU_LOG("\nDEBUG --> DU_APP: readCfg(): Memory allocation failure for DU name");
671 strcpy((char*)duCfgParam.duName,DU_NAME);
673 memset(&duCb.e2apDb, 0, sizeof(E2apDb));
674 duCb.e2apDb.e2NodeId = DU_ID;
675 duCb.e2apDb.e2TransInfo.transIdCounter = 0;
677 duCb.e2apDb.numOfTNLAssoc = 1;
678 for(tnlAssocIdx =0; tnlAssocIdx<duCb.e2apDb.numOfTNLAssoc; tnlAssocIdx++)
680 duCb.e2apDb.tnlAssoc[tnlAssocIdx].localIpAddress.ipV4Pres = duCfgParam.sctpParams.duIpAddr.ipV4Pres;
681 duCb.e2apDb.tnlAssoc[tnlAssocIdx].localIpAddress.ipV4Addr = duCfgParam.sctpParams.duIpAddr.ipV4Addr;
682 duCb.e2apDb.tnlAssoc[tnlAssocIdx].localPort = duCfgParam.sctpParams.duPort[E2_INTERFACE];
683 duCb.e2apDb.tnlAssoc[tnlAssocIdx].destIpAddress.ipV4Pres = duCfgParam.sctpParams.ricIpAddr.ipV4Pres;
684 duCb.e2apDb.tnlAssoc[tnlAssocIdx].destIpAddress.ipV4Addr = duCfgParam.sctpParams.ricIpAddr.ipV4Addr;
685 duCb.e2apDb.tnlAssoc[tnlAssocIdx].destPort = duCfgParam.sctpParams.ricPort;
686 duCb.e2apDb.tnlAssoc[tnlAssocIdx].usage = BOTH_FUNCTIONALITY;
688 duCb.e2apDb.numOfRanFunction = 1;
689 for(ranFuncIdx =0; ranFuncIdx<duCb.e2apDb.numOfRanFunction; ranFuncIdx++)
691 duCb.e2apDb.ranFunction[ranFuncIdx].id = ranFuncIdx + 1;
692 memcpy(&duCb.e2apDb.ranFunction[ranFuncIdx].name.shortName, shortName, sizeof(shortName));
693 memcpy(&duCb.e2apDb.ranFunction[ranFuncIdx].name.serviceModelOID, serviceModelOID, sizeof(serviceModelOID));
694 memcpy(&duCb.e2apDb.ranFunction[ranFuncIdx].name.description, description, sizeof(description));
695 duCb.e2apDb.ranFunction[ranFuncIdx].revisionCounter = 0;
697 duCb.e2apDb.ranFunction[ranFuncIdx].numOfEventTriggerStyleSupported = NUM_OF_EVENT_TRIGGER_STYLE_SUPPORTED;
698 for(eventTriggerStyleIdx=0; eventTriggerStyleIdx<duCb.e2apDb.ranFunction[ranFuncIdx].numOfEventTriggerStyleSupported; eventTriggerStyleIdx++)
700 duCb.e2apDb.ranFunction[ranFuncIdx].eventTriggerStyleList[eventTriggerStyleIdx].styleType = EVENT_TRIGGER_STYLE_TYPE;
701 duCb.e2apDb.ranFunction[ranFuncIdx].eventTriggerStyleList[eventTriggerStyleIdx].formatType = EVENT_TRIGGER_STYLE_FORMAT_TYPE;
702 memcpy(duCb.e2apDb.ranFunction[ranFuncIdx].eventTriggerStyleList[eventTriggerStyleIdx].name, event_trigger_style_name, sizeof(event_trigger_style_name));
705 duCb.e2apDb.ranFunction[ranFuncIdx].numOfReportStyleSupported= NUM_OF_RIC_REPORT_STYLE_SUPPORTED;
706 for(reportStyleIdx=0; reportStyleIdx<duCb.e2apDb.ranFunction[ranFuncIdx].numOfReportStyleSupported; reportStyleIdx++)
708 duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.styleType = REPORT_STYLE_TYPE;
709 duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.formatType = REPORT_ACTION_FORMAT_TYPE;
710 memcpy(duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.name, ric_report_style_name, sizeof(ric_report_style_name));
712 for(measurementInfoIdx =0; measurementInfoIdx<NUM_OF_MEASUREMENT_INFO_SUPPORTED(CONFIG_ADD); measurementInfoIdx++)
714 measurementInfoLen= strlen(MEASUREMENT_TYPE_NAME[measurementInfoIdx]);
715 MeasurementInfoForAction *measurementInfoForAction;
716 DU_ALLOC(measurementInfoForAction, sizeof(MeasurementInfoForAction));
717 if(measurementInfoForAction)
719 measurementInfoForAction->measurementTypeId = measurementInfoIdx+1;
720 memcpy(measurementInfoForAction->measurementTypeName, MEASUREMENT_TYPE_NAME[measurementInfoIdx], measurementInfoLen+1);
722 DU_ALLOC(node, sizeof(CmLList));
725 node->node = (PTR) measurementInfoForAction;
726 cmLListAdd2Tail(&duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].measurementInfoList, node);
731 DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction));
736 duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationHeaderFormat = RIC_INDICATION_HEADER_FORMAT;
737 duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationMessageFormat = RIC_INDICATION_MESSAGE_FORMAT;
739 memset(duCb.e2apDb.e2TransInfo.e2InitTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
740 memset(duCb.e2apDb.e2TransInfo.ricInitTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
743 mib.sysFrmNum = SYS_FRAME_NUM;
745 mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs30or120;
747 mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs15or60;
749 mib.ssb_SubcarrierOffset = SSB_SC_OFFSET; //Kssb
750 mib.dmrs_TypeA_Position = MIB__dmrs_TypeA_Position_pos2;
751 mib.controlResourceSetZero = CORESET_0_INDEX;
752 mib.searchSpaceZero = SEARCHSPACE_0_INDEX;
753 mib.cellBarred = MIB__cellBarred_notBarred;
754 mib.intraFreqReselection = MIB__intraFreqReselection_notAllowed;
755 duCfgParam.mibParams = mib;
758 memset(&sib1.plmn, 0, sizeof(Plmn));
759 sib1.plmn.mcc[0] = PLMN_MCC0;
760 sib1.plmn.mcc[1] = PLMN_MCC1;
761 sib1.plmn.mcc[2] = PLMN_MCC2;
762 sib1.plmn.mnc[0] = PLMN_MNC0;
763 sib1.plmn.mnc[1] = PLMN_MNC1;
764 sib1.ranac = DU_RANAC;
767 sib1.tac = cellParams.nRTAC;
768 sib1.cellIdentity = CELL_IDENTITY * cellParams.cellLocalId;
769 DU_LOG("\nDEBUG --> DU_APP: readCfg(): OAM CellLocalId=%d", \
773 sib1.cellIdentity = CELL_IDENTITY * NR_CELL_ID;
775 sib1.cellResvdForOpUse = PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
776 sib1.connEstFailCnt = ConnEstFailureControl__connEstFailCount_n3;
777 sib1.connEstFailOffValidity = ConnEstFailureControl__connEstFailOffsetValidity_s900;
778 sib1.connEstFailOffset = 15;
779 sib1.siSchedInfo.winLen = SI_SchedulingInfo__si_WindowLength_s5;
780 sib1.siSchedInfo.broadcastSta = SchedulingInfo__si_BroadcastStatus_broadcasting;
781 sib1.siSchedInfo.preiodicity = SchedulingInfo__si_Periodicity_rf8;
782 sib1.siSchedInfo.sibType = SIB_TypeInfo__type_sibType2;
783 sib1.siSchedInfo.sibValTag = SIB1_VALUE_TAG;
785 fillServCellCfgCommSib(&sib1.srvCellCfgCommSib);
787 duCfgParam.sib1Params = sib1;
789 for(srvdCellIdx=0; srvdCellIdx<DEFAULT_CELLS; srvdCellIdx++)
791 memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn, 0, sizeof(Plmn));
792 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
793 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
794 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
795 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
796 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
800 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = cellParams.nRPCI;
802 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = NR_PCI;
804 /* List of Available PLMN */
805 for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
807 /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
808 * followed by either 2 digit or 3 digits of mnc */
810 memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn, 0,\
813 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = cellParams.plmnList[srvdPlmnIdx].mcc[0];
814 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = cellParams.plmnList[srvdPlmnIdx].mcc[1];
815 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = cellParams.plmnList[srvdPlmnIdx].mcc[2];
816 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = cellParams.plmnList[srvdPlmnIdx].mnc[0];
817 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = cellParams.plmnList[srvdPlmnIdx].mnc[1];
818 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[2] = cellParams.plmnList[srvdPlmnIdx].mnc[2];
820 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = PLMN_MCC0;
821 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = PLMN_MCC1;
822 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = PLMN_MCC2;
823 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = PLMN_MNC0;
824 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = PLMN_MNC1;
827 /* List of Extended PLMN */
828 for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
830 /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
831 * followed by either 2 digit or 3 digits of mnc */
833 memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn, 0, sizeof(Plmn));
834 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[0] = PLMN_MCC0;
835 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[1] = PLMN_MCC1;
836 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[2] = PLMN_MCC2;
837 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[0] = PLMN_MNC0;
838 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[1] = PLMN_MNC1;
840 /* List of Supporting Slices */
841 for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
843 taiSliceSuppLst = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].\
846 /* TODO Calculte the exact number of supported slices once will get
847 * cell configuration from O1 */
848 taiSliceSuppLst->numSupportedSlices = NUM_OF_SUPPORTED_SLICE;
849 if(taiSliceSuppLst->numSupportedSlices > MAX_NUM_OF_SLICE_ITEMS)
851 DU_LOG("\nERROR --> DU_APP: readCfg(): Number of supported slice [%d] is more than 1024",\
852 taiSliceSuppLst->numSupportedSlices);
856 DU_ALLOC(taiSliceSuppLst->snssai, taiSliceSuppLst->numSupportedSlices*sizeof(Snssai*));
857 if(taiSliceSuppLst->snssai == NULLP)
859 DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
863 for(sliceIdx=0; sliceIdx<taiSliceSuppLst->numSupportedSlices; sliceIdx++)
865 DU_ALLOC(taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
866 if(taiSliceSuppLst->snssai[sliceIdx] == NULLP)
868 DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
872 memcpy(taiSliceSuppLst->snssai[sliceIdx]->sd, cellParams.plmnList[sliceIdx].sd, \
873 SD_SIZE*sizeof(uint8_t));
874 taiSliceSuppLst->snssai[sliceIdx]->sst = cellParams.plmnList[sliceIdx].sst;
876 memcpy(taiSliceSuppLst->snssai[sliceIdx], &snssai[sliceIdx], sizeof(Snssai));
883 /* NR TDD Mode info */
885 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = cellParams.arfcnUL;
886 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
887 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
889 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_UL_ARFCN;
890 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
891 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
893 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_273;
895 for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
897 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].nrFreqBand =\
899 for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
901 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].sulBand[bandIdx]\
906 /* NR FDD Mode info */
908 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = cellParams.arfcnUL;
909 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
910 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
911 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
912 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = cellParams.arfcnDL;
913 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
914 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
915 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
917 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_UL_ARFCN;
918 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
919 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = NR_SCS;
920 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
921 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_DL_ARFCN;
922 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
923 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
924 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = NR_SCS;
926 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
927 for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
929 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
930 nrFreqBand = NR_FREQ_BAND;
931 for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
933 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
934 sulBand[bandIdx] = SUL_BAND;
937 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
938 for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
940 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
941 nrFreqBand = NR_FREQ_BAND;
942 for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
944 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
945 sulBand[bandIdx] = SUL_BAND;
949 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
950 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
953 /*Measurement Config and Cell Config */
954 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.measTimeCfgDuration = TIME_CFG;
956 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellDir = DL_UL;
958 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellType=CELL_TYPE;
960 /* Broadcast PLMN Identity */
961 for(brdcstPlmnIdx=0; brdcstPlmnIdx<MAX_BPLMN_NRCELL_MINUS_1; brdcstPlmnIdx++)
963 for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
965 memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx],\
967 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[0] =\
969 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[1] =\
971 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[2] =\
973 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[0] =\
975 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[1] =\
978 /* Extended PLMN List */
979 for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
981 memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
982 extPlmn[plmnIdx], 0, sizeof(Plmn));
983 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
984 extPlmn[plmnIdx].mcc[0] = PLMN_MCC0;
985 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
986 extPlmn[plmnIdx].mcc[1] = PLMN_MCC1;
987 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
988 extPlmn[plmnIdx].mcc[2] = PLMN_MCC2;
989 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
990 extPlmn[plmnIdx].mnc[0] = PLMN_MNC0;
991 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
992 extPlmn[plmnIdx].mnc[1] = PLMN_MNC1;
995 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = cellParams.nRTAC; //TODO : to check and fill
996 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = cellParams.nRTAC;
997 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = cellParams.nRTAC;
998 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = cellParams.cellLocalId;
1000 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = DU_TAC; //TODO : to check and fill
1001 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = DU_TAC;
1002 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = DU_TAC;
1003 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = NR_CELL_ID;
1005 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].ranac = NR_RANAC;
1008 /*gnb DU System Info mib msg*/
1010 DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBufSize);
1011 if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg))
1013 DU_LOG("\nERROR --> DU APP : Memory allocation failure at readCfg");
1016 memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBuf, encBufSize);
1017 duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibLen = encBufSize;
1019 /*gnb DU System Info mib msg*/
1021 DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
1023 if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg))
1025 DU_LOG("\nERROR --> DU APP : Memory allocation failure at readCfg");
1028 memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
1030 duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Len = encBufSize;
1034 if(readMacCfg() != ROK)
1036 DU_LOG("\nERROR --> DU_APP : Failed while reading MAC config");
1043 /*******************************************************************
1045 * @brief Copy Slice Cfg in temp structre in duCfgParams
1049 * Function : cpyRrmPolicyInDuCfgParams
1052 * - Copy Slice Cfg in temp structre in duCfgParams
1054 * @params[in] RrmPolicy rrmPolicy[], uint8_t policyNum, uint8_t memberList
1055 * @return ROK - success
1058 * ****************************************************************/
1059 uint8_t cpyRrmPolicyInDuCfgParams(RrmPolicyList rrmPolicy[], uint8_t policyNum, MacSliceCfgReq *tempSliceCfg)
1061 uint8_t policyIdx = 0, memberListIdx = 0;
1064 tempSliceCfg->numOfRrmPolicy = policyNum;
1065 DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy, tempSliceCfg->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*));
1066 if(!tempSliceCfg->listOfRrmPolicy)
1068 DU_LOG("\nERROR --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
1072 for(policyIdx = 0; policyIdx<tempSliceCfg->numOfRrmPolicy; policyIdx++)
1074 DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy));
1075 if(!tempSliceCfg->listOfRrmPolicy[policyIdx])
1077 DU_LOG("\nERROR --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
1081 tempSliceCfg->listOfRrmPolicy[policyIdx]->resourceType = rrmPolicy[policyIdx].resourceType;
1083 tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem = rrmPolicy[policyIdx].rRMMemberNum;
1085 if(tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem)
1087 DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList,\
1088 tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*));
1090 if(!tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList)
1092 DU_LOG("\nERROR --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
1097 for(memberListIdx = 0; memberListIdx<tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem; memberListIdx++)
1099 DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx], sizeof(RrmPolicyMemberList));
1100 if(!tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx])
1102 DU_LOG("\nERROR --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
1105 memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->snssai.sd,\
1106 &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].sd, 3 * sizeof(uint8_t));
1107 memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->snssai.sst,\
1108 &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].sst, sizeof(uint8_t));
1109 memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->plmn.mcc,\
1110 &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].mcc, 3 * sizeof(uint8_t));
1111 memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->plmn.mnc,\
1112 &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].mnc, 3 * sizeof(uint8_t));
1114 tempSliceCfg->listOfRrmPolicy[policyIdx]->policyRatio.maxRatio = rrmPolicy[policyIdx].rRMPolicyMaxRatio;
1115 tempSliceCfg->listOfRrmPolicy[policyIdx]->policyRatio.minRatio = rrmPolicy[policyIdx].rRMPolicyMinRatio;
1116 tempSliceCfg->listOfRrmPolicy[policyIdx]->policyRatio.dedicatedRatio = rrmPolicy[policyIdx].rRMPolicyDedicatedRatio;
1124 /*******************************************************************
1126 * @brief Reads config and posts message to du_app on completion
1134 * - Post to du_app for further processing
1137 * @return ROK - success
1140 * ****************************************************************/
1146 memset(&duCfgParam, 0, sizeof(DuCfgParams));
1148 //Read configs into duCfgParams
1149 if(readCfg() != ROK)
1151 DU_LOG("\nERROR --> DU_APP : Reading configuration failed");
1155 //Fill pst structure
1156 memset(&(pst), 0, sizeof(Pst));
1157 pst.srcEnt = (Ent)ENTDUAPP;
1158 pst.srcInst = (Inst)DU_INST;
1159 pst.srcProcId = DU_PROC;
1160 pst.dstEnt = pst.srcEnt;
1161 pst.dstInst = pst.srcInst;
1162 pst.dstProcId = pst.srcProcId;
1164 pst.selector = ODU_SELECTOR_TC;
1167 /* Initialize the timer blocks */
1168 cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2SetupTimer), 1);
1170 /* Initialzie the timer queue */
1171 memset(&(duCb.duTimersInfo.tmrTq), 0, sizeof(CmTqType) * DU_TQ_SIZE);
1173 /* Initialize the timer control point */
1174 memset(&(duCb.duTimersInfo.tmrTqCp), 0, sizeof(CmTqCp));
1175 duCb.duTimersInfo.tmrTqCp.tmrLen = DU_TQ_SIZE;
1177 /* Initialize the timer resolution */
1178 duCb.duTimersInfo.tmrRes = DU_TIMER_RESOLUTION;
1180 /* Timer Registration request to system services */
1181 if (ODU_REG_TMR_MT(pst.srcEnt, pst.srcInst, duCb.duTimersInfo.tmrRes, duActvTmr) != ROK)
1183 DU_LOG("\nERROR --> DU_APP : Failed to register timer");
1187 if(ODU_GET_MSG_BUF(DFLT_REGION, DU_POOL, &mBuf) != ROK)
1189 DU_LOG("\nERROR --> DU_APP : Memory allocation failed in duReadCfg");
1193 if (ODU_POST_TASK(&pst, mBuf) != ROK)
1195 DU_LOG("\nERROR --> DU_APP : ODU_POST_TASK failed in duReadCfg");
1202 /**********************************************************************
1204 **********************************************************************/