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"
25 #include "du_app_mac_inf.h"
26 #include "du_app_rlc_inf.h"
30 #include "OCTET_STRING.h"
31 #include "BIT_STRING.h"
32 #include "odu_common_codec.h"
33 #include "du_sys_info_hdl.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"
56 #include "ConfigInterface.h"
57 extern StartupConfig g_cfg;
60 DuCfgParams duCfgParam;
61 char encBuf[ENC_BUF_MAX_LEN];
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
79 /*******************************************************************
81 * @brief Fills the Slot configuration
85 * Function : FillSlotConfig
87 * Functionality:Fill the Slot configuration values
90 * @return ROK - success
93 * ****************************************************************/
99 memset(duCfgParam.macCellCfg.tddCfg.slotCfg, 0, sizeof(duCfgParam.macCellCfg.tddCfg.slotCfg[slot][symbol]* \
100 MAX_TDD_PERIODICITY_SLOTS*MAX_SYMB_PER_SLOT));
102 //Filling the DL Slots and initializing flexi slot
103 for(slot = 0; slot <= NUM_DL_SLOTS; slot++)
105 for(symbol =0; symbol < MAX_SYMB_PER_SLOT; symbol++)
107 duCfgParam.macCellCfg.tddCfg.slotCfg[slot][symbol] = DL_SLOT;
112 for(slot = NUM_DL_SLOTS+1; slot <= NUM_DL_SLOTS+NUM_UL_SLOTS; slot++)
114 for(symbol = 0; symbol < MAX_SYMB_PER_SLOT; symbol++)
115 duCfgParam.macCellCfg.tddCfg.slotCfg[slot][symbol] = UL_SLOT;
117 //Updating Flexi Slot
119 duCfgParam.macCellCfg.tddCfg.slotCfg[slot][12] = FLEXI_SLOT;
120 duCfgParam.macCellCfg.tddCfg.slotCfg[slot][13] = UL_SLOT;
124 /*******************************************************************
125 * @brief Reads the CL Configuration.
129 * Function : readMacCfg
132 * - Fills up the cell configuration for CL.
133 * - Calls FillSlotConfig()
136 * @return ROK - success
139 * ****************************************************************/
142 /* This function is used to fill up the cell configuration for CL */
147 duCfgParam.macCellCfg.carrierId = CARRIER_IDX;
149 /* Cell configuration */
150 duCfgParam.macCellCfg.cellId = NR_CELL_ID;
151 duCfgParam.macCellCfg.phyCellId = NR_PCI;
152 duCfgParam.macCellCfg.numerology = NR_NUMEROLOGY;
153 duCfgParam.macCellCfg.dupType = DUPLEX_MODE;
155 /* DL carrier configuration */
156 duCfgParam.macCellCfg.dlCarrCfg.pres = TRUE;
158 duCfgParam.macCellCfg.dlCarrCfg.bw = BANDWIDTH_100MHZ;
160 duCfgParam.macCellCfg.dlCarrCfg.bw = BANDWIDTH_20MHZ;
162 duCfgParam.macCellCfg.dlCarrCfg.freq = NR_DL_ARFCN;
163 duCfgParam.macCellCfg.dlCarrCfg.k0[0] = 1;
164 duCfgParam.macCellCfg.dlCarrCfg.k0[1] = 1;
165 duCfgParam.macCellCfg.dlCarrCfg.k0[2] = 1;
166 duCfgParam.macCellCfg.dlCarrCfg.k0[3] = 1;
167 duCfgParam.macCellCfg.dlCarrCfg.k0[4] = 1;
168 duCfgParam.macCellCfg.dlCarrCfg.gridSize[0] = 273;
169 duCfgParam.macCellCfg.dlCarrCfg.gridSize[1] = 1;
170 duCfgParam.macCellCfg.dlCarrCfg.gridSize[2] = 1;
171 duCfgParam.macCellCfg.dlCarrCfg.gridSize[3] = 1;
172 duCfgParam.macCellCfg.dlCarrCfg.gridSize[4] = 1;
173 duCfgParam.macCellCfg.dlCarrCfg.numAnt = NUM_TX_ANT;
175 /* UL Carrier configuration */
176 duCfgParam.macCellCfg.ulCarrCfg.pres = TRUE;
178 duCfgParam.macCellCfg.dlCarrCfg.bw = BANDWIDTH_100MHZ;
180 duCfgParam.macCellCfg.ulCarrCfg.bw = BANDWIDTH_20MHZ;
182 duCfgParam.macCellCfg.ulCarrCfg.freq = NR_UL_ARFCN;
183 duCfgParam.macCellCfg.ulCarrCfg.k0[0] = 1;
184 duCfgParam.macCellCfg.ulCarrCfg.k0[1] = 1;
185 duCfgParam.macCellCfg.ulCarrCfg.k0[2] = 1;
186 duCfgParam.macCellCfg.ulCarrCfg.k0[3] = 1;
187 duCfgParam.macCellCfg.ulCarrCfg.k0[4] = 1;
188 duCfgParam.macCellCfg.ulCarrCfg.gridSize[0] = 1;
189 duCfgParam.macCellCfg.ulCarrCfg.gridSize[1] = 1;
190 duCfgParam.macCellCfg.ulCarrCfg.gridSize[2] = 1;
191 duCfgParam.macCellCfg.ulCarrCfg.gridSize[3] = 1;
192 duCfgParam.macCellCfg.ulCarrCfg.gridSize[4] = 1;
193 duCfgParam.macCellCfg.ulCarrCfg.numAnt = NUM_RX_ANT;
195 duCfgParam.macCellCfg.freqShft = FREQ_SHIFT_7P5KHZ;
197 /* SSB configuration */
198 duCfgParam.macCellCfg.ssbCfg.ssbPbchPwr = SSB_PBCH_PWR;
199 duCfgParam.macCellCfg.ssbCfg.bchPayloadFlag = BCH_PAYLOAD;
201 duCfgParam.macCellCfg.ssbCfg.scsCmn = SCS_30KHZ;
203 duCfgParam.macCellCfg.ssbCfg.scsCmn = SCS_15KHZ;
205 duCfgParam.macCellCfg.ssbCfg.ssbOffsetPointA = OFFSET_TO_POINT_A;
206 duCfgParam.macCellCfg.ssbCfg.betaPss = BETA_PSS;
207 duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PRDCTY_MS_20;
208 duCfgParam.macCellCfg.ssbCfg.ssbScOffset = SSB_SUBCARRIER_OFFSET;
209 duCfgParam.macCellCfg.ssbCfg.ssbMask[0] = 1; /* only one SSB is transmitted */
210 duCfgParam.macCellCfg.ssbCfg.ssbMask[1] = 0;
211 if(BuildMibPdu() != ROK)
213 DU_LOG("\nERROR --> Failed to build MIB PDU");
214 memset(&duCfgParam.macCellCfg.ssbCfg.mibPdu, 0, 3*sizeof(uint8_t));
218 memcpy(&duCfgParam.macCellCfg.ssbCfg.mibPdu, encBuf,encBufSize);
220 duCfgParam.macCellCfg.ssbCfg.multCarrBand = SSB_MULT_CARRIER_BAND;
221 duCfgParam.macCellCfg.ssbCfg.multCellCarr = MULT_CELL_CARRIER;
223 /* PRACH configuration */
224 duCfgParam.macCellCfg.prachCfg.pres = TRUE;
225 duCfgParam.macCellCfg.prachCfg.prachCfgIdx = PRACH_CONFIG_IDX;
226 duCfgParam.macCellCfg.prachCfg.prachSeqLen = PRACH_SEQ_LEN;
227 duCfgParam.macCellCfg.prachCfg.prachSubcSpacing = PRACH_SUBCARRIER_SPACING;
228 duCfgParam.macCellCfg.prachCfg.prachRstSetCfg = PRACH_RESTRICTED_SET_CFG;
229 duCfgParam.macCellCfg.prachCfg.msg1Fdm = NUM_PRACH_FDM;
230 duCfgParam.macCellCfg.prachCfg.msg1FreqStart = PRACH_FREQ_START;
231 duCfgParam.macCellCfg.prachCfg.rootSeqLen = ROOT_SEQ_LEN;
232 duCfgParam.macCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX;
233 duCfgParam.macCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ;
234 duCfgParam.macCellCfg.prachCfg.fdm[0].k1 = 0;
235 duCfgParam.macCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
236 duCfgParam.macCellCfg.prachCfg.fdm[0].numUnusedRootSeq = NUM_UNUSED_ROOT_SEQ;
237 if(duCfgParam.macCellCfg.prachCfg.fdm[0].numUnusedRootSeq != 0)
239 DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq,
240 NUM_UNUSED_ROOT_SEQ * sizeof(uint8_t));
241 if(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP)
243 DU_LOG("\nERROR --> DU_APP : Memory allocation failed at readMacCfg");
246 *(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ;
248 duCfgParam.macCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH;
249 duCfgParam.macCellCfg.prachCfg.prachMultCarrBand = PRACH_MULT_CARRIER_BAND;
250 duCfgParam.macCellCfg.prachCfg.raContResTmr = RA_CONT_RES_TIMER;
251 duCfgParam.macCellCfg.prachCfg.rsrpThreshSsb = RSRP_THRESHOLD_SSB;
252 duCfgParam.macCellCfg.prachCfg.raRspWindow = RA_RSP_WINDOW;
253 duCfgParam.macCellCfg.prachCfg.prachRestrictedSet = PRACH_RESTRICTED_SET;
255 /* TDD configuration */
256 duCfgParam.macCellCfg.tddCfg.pres = TRUE;
257 duCfgParam.macCellCfg.tddCfg.tddPeriod = TDD_PERIODICITY;
262 /* RSSI Measurement configuration */
263 duCfgParam.macCellCfg.rssiUnit = RSS_MEASUREMENT_UNIT;
265 /* fill SIB1 configuration */
266 duCfgParam.macCellCfg.sib1Cfg.sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len;
267 DU_ALLOC_SHRABL_BUF(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu,duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
268 memcpy(duCfgParam.macCellCfg.sib1Cfg.sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, \
269 duCfgParam.srvdCellLst[0].duSysInfo.sib1Len);
270 duCfgParam.macCellCfg.sib1Cfg.sib1RepetitionPeriod = SIB1_REPETITION_PERIOD;
271 duCfgParam.macCellCfg.sib1Cfg.coresetZeroIndex = CORESET_0_INDEX;
272 duCfgParam.macCellCfg.sib1Cfg.searchSpaceZeroIndex = SEARCHSPACE_0_INDEX;
273 duCfgParam.macCellCfg.sib1Cfg.sib1Mcs = SIB1_MCS;
276 /* fill Intial DL BWP */
277 duCfgParam.macCellCfg.initialDlBwp.bwp.firstPrb = 0;
278 duCfgParam.macCellCfg.initialDlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */
280 duCfgParam.macCellCfg.initialDlBwp.bwp.scs = SCS_30KHZ; /* numerology is 1, 30Khz */
282 duCfgParam.macCellCfg.initialDlBwp.bwp.scs = SCS_15KHZ; /* numerology is 0, 15Khz */
284 duCfgParam.macCellCfg.initialDlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
285 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId = SEARCHSPACE_1_INDEX;
286 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.coresetId = CORESET_0_INDEX;
287 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot =
288 SS_MONITORING_SLOT_SL1; /* sl1 - all slots */
289 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.duration = 0;
290 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol =
291 SS_MONITORING_SYMBOL;
292 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
293 candidate.aggLevel1 = 8;
294 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
295 candidate.aggLevel2 = 4;
296 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
297 candidate.aggLevel4 = 2;
298 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
299 candidate.aggLevel8 = 1;
300 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.
301 candidate.aggLevel16 = 0;
303 duCfgParam.macCellCfg.initialDlBwp.pdschCommon.numTimeDomAlloc = 2;
305 duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].k0 = PDSCH_K0_CFG1;
306 duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].mappingType =
307 PDSCH_MAPPING_TYPE_A;
308 duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].startSymbol =
310 duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].lengthSymbol =
314 duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].k0 = PDSCH_K0_CFG2;
315 duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].mappingType =
316 PDSCH_MAPPING_TYPE_A;
317 duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].startSymbol =
319 duCfgParam.macCellCfg.initialDlBwp.pdschCommon.timeDomRsrcAllocList[idx].lengthSymbol =
322 /* ra-searchSpace ID is set to 1 */
323 duCfgParam.macCellCfg.initialDlBwp.pdcchCommon.raSearchSpaceId = SEARCHSPACE_1_INDEX;
325 /* fill Intial UL BWP */
326 duCfgParam.macCellCfg.initialUlBwp.bwp.firstPrb = 0;
327 duCfgParam.macCellCfg.initialUlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */
329 duCfgParam.macCellCfg.initialUlBwp.bwp.scs = SCS_30KHZ; /* numerology is 1, 30Khz */
331 duCfgParam.macCellCfg.initialUlBwp.bwp.scs = SCS_15KHZ; /* numerology is 0, 15Khz */
333 duCfgParam.macCellCfg.initialUlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
334 duCfgParam.macCellCfg.initialUlBwp.puschCommon.numTimeDomRsrcAlloc = 2;
335 duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].k2 = PUSCH_K2_CFG1;
336 duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].mappingType =
337 PUSCH_MAPPING_TYPE_A;
338 duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].startSymbol =
340 duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].symbolLength =
343 duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].k2 = PUSCH_K2_CFG2;
344 duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].mappingType =
345 PUSCH_MAPPING_TYPE_A;
346 duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].startSymbol =
348 duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].symbolLength =
351 duCfgParam.macCellCfg.dmrsTypeAPos = DMRS_TYPE_A_POS;
353 /* fill PUCCH config common */
354 duCfgParam.macCellCfg.initialUlBwp.pucchCommon.pucchResourceCommon = PUCCH_RSRC_COMMON;
355 duCfgParam.macCellCfg.initialUlBwp.pucchCommon.pucchGroupHopping = PUCCH_GROUP_HOPPING;
360 /*******************************************************************
362 * @brief Configures the DU Parameters
366 * Function : fillDuPort
369 * - fills the DU Ports.
371 * @params[in] duPort array to be filled
372 * @return ROK - success
375 * ****************************************************************/
376 uint8_t fillDuPort(uint16_t *duPort)
380 duPort[F1_INTERFACE] = g_cfg.DU_Port;
381 duPort[E2_INTERFACE] = g_cfg.RIC_Port;
383 duPort[F1_INTERFACE] = DU_PORT; /* DU Port idx 0 38472 */
384 duPort[E2_INTERFACE] = RIC_PORT; /* RIC Port idx 1 38482 */
389 /*******************************************************************
391 * @brief Configures the DU Parameters
395 * Function : calcSliv
398 * - calculate SLIV value from start and length field
400 * @params[in] start symbol
401 * @params[in] length of symbols
404 * ****************************************************************/
405 uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol)
408 if((lengthSymbol-1) <= 7)
410 sliv = NUM_SYMBOLS_PER_SLOT * (lengthSymbol-1) + startSymbol;
414 sliv = NUM_SYMBOLS_PER_SLOT * (NUM_SYMBOLS_PER_SLOT - lengthSymbol + 1) \
415 + (NUM_SYMBOLS_PER_SLOT - 1 - startSymbol);
421 /*******************************************************************
423 * @brief Configures serving cell config common in sib1
427 * Function : fillServCellCfgCommSib
430 * - fills Serving cell config common for SIB1
432 * @params[in] SrvCellCfgCommSib pointer
433 * @return ROK - success
436 ** ****************************************************************/
437 uint8_t fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm)
439 PdcchCfgCommon pdcchCfg;
440 PdschCfgCommon pdschCfg;
442 RachCfgCommon rachCfg;
443 PuschCfgCommon puschCfg;
444 PucchCfgCommon pucchCfg;
445 TddUlDlCfgCommon tddCfg;
447 /* Configuring DL Config Common for SIB1*/
448 srvCellCfgComm->dlCfg.freqBandInd = NR_FREQ_BAND;
449 srvCellCfgComm->dlCfg.offsetToPointA = OFFSET_TO_POINT_A;
450 srvCellCfgComm->dlCfg.dlScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET;
452 srvCellCfgComm->dlCfg.dlScsCarrier.scs = SCS_30KHZ;
453 srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = BANDWIDTH_100MHZ;
455 srvCellCfgComm->dlCfg.dlScsCarrier.scs = SCS_15KHZ;
456 srvCellCfgComm->dlCfg.dlScsCarrier.scsBw = BANDWIDTH_20MHZ;
458 srvCellCfgComm->dlCfg.locAndBw = FREQ_LOC_BW;
460 /* Configuring PDCCH Config Common For SIB1 */
461 pdcchCfg.present = BWP_DownlinkCommon__pdcch_ConfigCommon_PR_setup;
462 pdcchCfg.ctrlRsrcSetZero = CORESET_0_INDEX;
463 pdcchCfg.searchSpcZero = SEARCHSPACE_0_INDEX;
464 pdcchCfg.searchSpcId = PDCCH_SEARCH_SPACE_ID;
465 pdcchCfg.ctrlRsrcSetId = PDCCH_CTRL_RSRC_SET_ID;
466 pdcchCfg.monitorSlotPrdAndOffPresent = \
468 SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
469 //pdcchCfg.monitorSlotPrdAndOff = \
470 SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
471 pdcchCfg.monitorSymbolsInSlot[0] = 128;
472 pdcchCfg.monitorSymbolsInSlot[1] = 0;
473 pdcchCfg.numCandAggLvl1 = SearchSpace__nrofCandidates__aggregationLevel1_n8;
474 pdcchCfg.numCandAggLvl2 = SearchSpace__nrofCandidates__aggregationLevel2_n4;
475 pdcchCfg.numCandAggLvl4 = SearchSpace__nrofCandidates__aggregationLevel4_n2;
476 pdcchCfg.numCandAggLvl8 = SearchSpace__nrofCandidates__aggregationLevel8_n1;
477 pdcchCfg.numCandAggLvl16 = SearchSpace__nrofCandidates__aggregationLevel16_n0;
478 pdcchCfg.searchSpcType = SearchSpace__searchSpaceType_PR_common;
479 pdcchCfg.commSrchSpcDciFrmt = PDCCH_SERACH_SPACE_DCI_FORMAT;
480 pdcchCfg.searchSpcSib1 = PDCCH_SEARCH_SPACE_ID_SIB1;
481 pdcchCfg.pagingSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING;
482 pdcchCfg.raSearchSpc = PDCCH_SEARCH_SPACE_ID_PAGING;
483 srvCellCfgComm->dlCfg.pdcchCfg = pdcchCfg;
485 /* Configuring PDSCH Config Common For SIB1 */
486 pdschCfg.present = BWP_DownlinkCommon__pdsch_ConfigCommon_PR_setup;
487 pdschCfg.numTimeDomRsrcAlloc = 2;
488 pdschCfg.timeDomAlloc[0].k0 = PDSCH_K0_CFG1;
489 pdschCfg.timeDomAlloc[0].mapType = \
490 PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
491 pdschCfg.timeDomAlloc[0].sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL);
493 pdschCfg.timeDomAlloc[1].k0 = PDSCH_K0_CFG2;
494 pdschCfg.timeDomAlloc[1].mapType = \
495 PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
496 pdschCfg.timeDomAlloc[1].sliv = calcSliv(PDSCH_START_SYMBOL,PDSCH_LENGTH_SYMBOL);
498 srvCellCfgComm->dlCfg.pdschCfg = pdschCfg;
500 /* Configuring BCCH Config for SIB1 */
501 srvCellCfgComm->dlCfg.bcchCfg.modPrdCoeff = \
502 BCCH_Config__modificationPeriodCoeff_n16;
504 /* Configuring PCCH Config for SIB1 */
505 pcchCfg.dfltPagingCycle = PagingCycle_rf256;
506 pcchCfg.nAndPagingFrmOffPresent = PCCH_Config__nAndPagingFrameOffset_PR_oneT;
507 pcchCfg.numPagingOcc = PCCH_Config__ns_four;
508 srvCellCfgComm->dlCfg.pcchCfg = pcchCfg;
511 /* Configuring UL Config Common */
512 srvCellCfgComm->ulCfg.ulScsCarrier.scsOffset = SSB_SUBCARRIER_OFFSET;
514 srvCellCfgComm->ulCfg.ulScsCarrier.scs = SCS_30KHZ;
515 srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = BANDWIDTH_100MHZ;
517 srvCellCfgComm->ulCfg.ulScsCarrier.scs = SCS_15KHZ;
518 srvCellCfgComm->ulCfg.ulScsCarrier.scsBw = BANDWIDTH_20MHZ;
520 srvCellCfgComm->ulCfg.pMax = UL_P_MAX;
521 srvCellCfgComm->ulCfg.locAndBw = FREQ_LOC_BW;
522 srvCellCfgComm->ulCfg.timeAlignTimerComm = TimeAlignmentTimer_infinity;
524 /* Configuring RACH Config Common for SIB1 */
525 rachCfg.present = BWP_UplinkCommon__rach_ConfigCommon_PR_setup;
526 rachCfg.prachCfgIdx = PRACH_CONFIG_IDX;
527 rachCfg.msg1Fdm = RACH_ConfigGeneric__msg1_FDM_one;
528 rachCfg.msg1FreqStart = PRACH_FREQ_START;
529 rachCfg.zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
530 rachCfg.preambleRcvdTgtPwr = PRACH_PREAMBLE_RCVD_TGT_PWR;
531 rachCfg.preambleTransMax = RACH_ConfigGeneric__preambleTransMax_n200;
532 rachCfg.pwrRampingStep = RACH_ConfigGeneric__powerRampingStep_dB2;
533 rachCfg.raRspWindow = RACH_ConfigGeneric__ra_ResponseWindow_sl10;
534 rachCfg.numRaPreamble = NUM_RA_PREAMBLE;
535 rachCfg.ssbPerRachOccPresent = \
536 RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one;
537 rachCfg.numSsbPerRachOcc = SSB_PER_RACH;
538 rachCfg.contResTimer = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64;
539 rachCfg.rsrpThreshSsb = RSRP_THRESHOLD_SSB;
540 rachCfg.rootSeqIdxPresent = RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139;
541 rachCfg.rootSeqIdx = ROOT_SEQ_IDX;
542 rachCfg.msg1Scs = PRACH_SUBCARRIER_SPACING ;
543 rachCfg.restrictedSetCfg = PRACH_RESTRICTED_SET_CFG;
544 srvCellCfgComm->ulCfg.rachCfg = rachCfg;
546 /* Configuring PUSCH Config Common for SIB1 */
547 puschCfg.puschCfgPresent = BWP_UplinkCommon__pusch_ConfigCommon_PR_setup;
548 puschCfg.numTimeDomRsrcAlloc = 2;
549 puschCfg.timeDomAllocList[0].k2 = PUSCH_K2_CFG1;
550 puschCfg.timeDomAllocList[0].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
551 puschCfg.timeDomAllocList[0].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
552 puschCfg.timeDomAllocList[1].k2 = PUSCH_K2_CFG2;
553 puschCfg.timeDomAllocList[1].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
554 puschCfg.timeDomAllocList[1].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
555 puschCfg.msg3DeltaPreamble = PUSCH_MSG3_DELTA_PREAMBLE;
556 puschCfg.p0NominalWithGrant = PUSCH_P0_NOMINAL_WITH_GRANT;
557 srvCellCfgComm->ulCfg.puschCfg = puschCfg;
559 /* Configuring PUCCH Config Common for SIB1 */
560 pucchCfg.present = BWP_UplinkCommon__pucch_ConfigCommon_PR_setup;
561 pucchCfg.rsrcComm = PUCCH_RSRC_COMMON;
562 pucchCfg.grpHop = PUCCH_ConfigCommon__pucch_GroupHopping_neither;
563 pucchCfg.p0Nominal = PUCCH_P0_NOMINAL;
564 srvCellCfgComm->ulCfg.pucchCfg = pucchCfg;
566 /* Configuring TDD UL DL config common */
567 tddCfg.refScs = SubcarrierSpacing_kHz30;
568 tddCfg.txPrd = TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5;
569 tddCfg.numDlSlots = NUM_DL_SLOTS;
570 tddCfg.numDlSymbols = NUM_DL_SYMBOLS;
571 tddCfg.numUlSlots = NUM_UL_SLOTS;
572 tddCfg.numUlSymbols = NUM_UL_SYMBOLS;
573 srvCellCfgComm->tddCfg = tddCfg;
575 srvCellCfgComm->ssbPosInBurst = 192;
576 srvCellCfgComm->ssbPrdServingCell = SSB_PERIODICITY_20MS;
577 srvCellCfgComm->ssPbchBlockPwr = SSB_PBCH_PWR;
582 /*******************************************************************
584 * @brief Configures the DU Parameters
591 * - Initializes the DuCfg members.
592 * - Calls readMacCfg()
594 * @params[in] system task ID
595 * @return ROK - success
598 * ****************************************************************/
602 uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx;
603 uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx;
604 uint32_t ipv4_du, ipv4_cu, ipv4_ric;
607 F1TaiSliceSuppLst *taiSliceSuppLst;
608 RrmPolicy *rrmPolicy;
610 /* TODO Added these below variable for local testing, once we will receive the
611 * configuration from O1 we can remove these variable */
612 F1Snsaai snsaai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}};
613 ResourceType rsrcType = PRB;
614 RrmPolicyRatio policyRatio= {10,20,30};
615 PolicyMemberList memberList;
617 memset(&memberList, 0, sizeof(PolicyMemberList));
618 memberList.snsaai = snsaai[DEDICATED_SLICE_INDEX];
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 = CU_PORT;
637 duCfgParam.sctpParams.ricPort = RIC_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 = DU_EGTP_PORT;
655 duCfgParam.egtpParams.destIp.ipV4Pres = TRUE;
656 duCfgParam.egtpParams.destIp.ipV4Addr = ipv4_cu;
657 duCfgParam.egtpParams.destPort = CU_EGTP_PORT;
658 duCfgParam.egtpParams.minTunnelId = MIN_TEID;
659 duCfgParam.egtpParams.maxTunnelId = MAX_TEID;
661 duCfgParam.maxUe = 32; //TODO: Check
663 duCfgParam.duId = DU_ID;
664 strcpy((char*)duCfgParam.duName,DU_NAME);
667 mib.sysFrmNum = SYS_FRAME_NUM;
669 mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs30or120;
671 mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs15or60;
673 mib.ssb_SubcarrierOffset = SSB_SC_OFFSET; //Kssb
674 mib.dmrs_TypeA_Position = MIB__dmrs_TypeA_Position_pos2;
675 mib.controlResourceSetZero = CORESET_0_INDEX;
676 mib.searchSpaceZero = SEARCHSPACE_0_INDEX;
677 mib.cellBarred = MIB__cellBarred_notBarred;
678 mib.intraFreqReselection =
679 MIB__intraFreqReselection_notAllowed;
680 duCfgParam.mibParams = mib;
683 memset(&sib1.plmn, 0, sizeof(Plmn));
684 sib1.plmn.mcc[0] = PLMN_MCC0;
685 sib1.plmn.mcc[1] = PLMN_MCC1;
686 sib1.plmn.mcc[2] = PLMN_MCC2;
687 sib1.plmn.mnc[0] = PLMN_MNC0;
688 sib1.plmn.mnc[1] = PLMN_MNC1;
690 sib1.ranac = DU_RANAC;
691 sib1.cellIdentity = CELL_IDENTITY;
692 sib1.cellResvdForOpUse = PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
693 sib1.connEstFailCnt = ConnEstFailureControl__connEstFailCount_n3;
694 sib1.connEstFailOffValidity = ConnEstFailureControl__connEstFailOffsetValidity_s120;
695 sib1.siSchedInfo.winLen = SI_SchedulingInfo__si_WindowLength_s5;
696 sib1.siSchedInfo.broadcastSta = SchedulingInfo__si_BroadcastStatus_broadcasting;
697 sib1.siSchedInfo.preiodicity = SchedulingInfo__si_Periodicity_rf8;
698 sib1.siSchedInfo.sibType = SIB_TypeInfo__type_sibType2;
699 sib1.siSchedInfo.sibValTag = SIB1_VALUE_TAG;
701 fillServCellCfgCommSib(&sib1.srvCellCfgCommSib);
703 duCfgParam.sib1Params = sib1;
705 for(srvdCellIdx=0; srvdCellIdx<DEFAULT_CELLS; srvdCellIdx++)
707 memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn, 0, sizeof(Plmn));
708 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
709 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
710 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
711 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
712 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
715 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.cellId = NR_CELL_ID;
716 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = NR_PCI;
718 /* List of Available PLMN */
719 for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
721 /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
722 * followed by either 2 digit or 3 digits of mnc */
724 memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn, 0,\
726 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = PLMN_MCC0;
727 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = PLMN_MCC1;
728 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = PLMN_MCC2;
729 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = PLMN_MNC0;
730 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = PLMN_MNC1;
732 /* List of Extended PLMN */
733 for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
735 /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
736 * followed by either 2 digit or 3 digits of mnc */
738 memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn, 0, sizeof(Plmn));
739 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[0] = PLMN_MCC0;
740 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[1] = PLMN_MCC1;
741 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[2] = PLMN_MCC2;
742 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[0] = PLMN_MNC0;
743 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[1] = PLMN_MNC1;
745 /* List of Supporting Slices */
746 for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
748 taiSliceSuppLst = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].taiSliceSuppLst;
750 taiSliceSuppLst->pres = true;
751 taiSliceSuppLst->numSupportedSlices = NUM_OF_SUPPORTED_SLICE;
753 memset(&taiSliceSuppLst->snssai, 0, sizeof(F1Snsaai));
754 for(sliceIdx=0; sliceIdx<NUM_OF_SUPPORTED_SLICE; sliceIdx++)
756 DU_ALLOC(taiSliceSuppLst->snssai[sliceIdx], sizeof(F1Snsaai));
757 if(taiSliceSuppLst->snssai[sliceIdx] == NULLP)
759 DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
762 memcpy(taiSliceSuppLst->snssai[sliceIdx], &snsaai[sliceIdx], sizeof(F1Snsaai));
764 /* Checking rrmPolicy Slice list available or not */
765 if(!memcmp(&snsaai[sliceIdx], &memberList.snsaai, sizeof(F1Snsaai)))
767 rrmPolicy = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].rrmPolicy;
768 rrmPolicy->present = true;
769 rrmPolicy->rsrcType = rsrcType;
770 rrmPolicy->memberList.snsaai = memberList.snsaai;
771 rrmPolicy->rrmPolicyRatio = policyRatio;
776 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = DU_TAC;
777 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = DU_TAC; //to check and fill
779 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_UL_ARFCN;
780 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
781 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
782 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
786 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_ARFCN;
787 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
788 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
789 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
791 for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
793 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].nrFreqBand =\
795 for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
797 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].sulBand[bandIdx]\
802 for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
804 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
805 nrFreqBand = NR_FREQ_BAND;
806 for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
808 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
809 sulBand[bandIdx] = SUL_BAND;
812 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_DL_ARFCN;
813 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
814 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
815 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
816 for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
818 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
819 nrFreqBand = NR_FREQ_BAND;
820 for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
822 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
823 sulBand[bandIdx] = SUL_BAND;
827 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = SCS_15;
828 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
830 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = SCS_15;
831 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
833 /*Measurement Config and Cell Config */
834 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.measTimeCfg = TIME_CFG;
836 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellDir = DL_UL;
838 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellType=CELL_TYPE;
840 /* Broadcast PLMN Identity */
841 for(brdcstPlmnIdx=0; brdcstPlmnIdx<MAX_BPLMN_NRCELL_MINUS_1; brdcstPlmnIdx++)
843 for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
845 memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx],\
847 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[0] =\
849 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[1] =\
851 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[2] =\
853 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[0] =\
855 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[1] =\
858 /* Extended PLMN List */
859 for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
861 memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
862 extPlmn[plmnIdx], 0, sizeof(Plmn));
863 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
864 extPlmn[plmnIdx].mcc[0] = PLMN_MCC0;
865 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
866 extPlmn[plmnIdx].mcc[1] = PLMN_MCC1;
867 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
868 extPlmn[plmnIdx].mcc[2] = PLMN_MCC2;
869 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
870 extPlmn[plmnIdx].mnc[0] = PLMN_MNC0;
871 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
872 extPlmn[plmnIdx].mnc[1] = PLMN_MNC1;
875 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = DU_TAC;
876 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = NR_CELL_ID;
877 duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].ranac = NR_RANAC;
880 /*gnb DU System Info mib msg*/
882 DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBufSize);
883 if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg))
885 DU_LOG("\nERROR --> DU APP : Memory allocation failure at readCfg");
888 memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBuf, encBufSize);
889 duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibLen = encBufSize;
891 /*gnb DU System Info mib msg*/
893 DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
895 if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg))
897 DU_LOG("\nERROR --> DU APP : Memory allocation failure at readCfg");
900 memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
902 duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Len = encBufSize;
906 if(readMacCfg() != ROK)
908 DU_LOG("\nERROR --> DU_APP : Failed while reading MAC config");
915 /*******************************************************************
917 * @brief Reads config and posts message to du_app on completion
925 * - Post to du_app for further processing
928 * @return ROK - success
931 * ****************************************************************/
937 memset(&duCfgParam, 0, sizeof(DuCfgParams));
939 //Read configs into duCfgParams
942 DU_LOG("\nERROR --> DU_APP : Reading configuration failed");
947 memset(&(pst), 0, sizeof(Pst));
948 pst.srcEnt = (Ent)ENTDUAPP;
949 pst.srcInst = (Inst)DU_INST;
950 pst.srcProcId = DU_PROC;
951 pst.dstEnt = pst.srcEnt;
952 pst.dstInst = pst.srcInst;
953 pst.dstProcId = pst.srcProcId;
955 pst.selector = ODU_SELECTOR_TC;
959 if(ODU_GET_MSG_BUF(DFLT_REGION, DU_POOL, &mBuf) != ROK)
961 DU_LOG("\nERROR --> DU_APP : Memory allocation failed in duReadCfg");
965 if (ODU_POST_TASK(&pst, mBuf) != ROK)
967 DU_LOG("\nERROR --> DU_APP : ODU_POST_TASK failed in duReadCfg");
974 /**********************************************************************
976 **********************************************************************/