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 */
22 #include "PLMN-IdentityInfo.h"
23 #include "odu_common_codec.h"
25 extern DuCfgParams duCfgParam;
26 extern char encBuf[ENC_BUF_MAX_LEN];
29 /* Filling Slot configuration as :
30 * 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
31 * 0 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
32 * 1 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
33 * 2 DL DL DL DL DL DL DL DL DL DL DL DL DL DL
34 * 3 DL DL DL DL DL DL DL DL DL DL GD GD GD UL
35 * 4 UL UL UL UL UL UL UL UL UL UL UL UL UL UL
38 /*******************************************************************
40 * @brief Fills the Slot configuration
44 * Function : FillSlotConfig
46 * Functionality:Fill the Slot configuration values
49 * @return ROK - success
52 * ****************************************************************/
58 for(slot = 0; slot <= 3; slot++)
60 for(symbol = 0; symbol < MAX_SYMB_PER_SLOT; symbol++)
61 duCfgParam.macCellCfg.tddCfg.slotCfg[slot][symbol] = DL_SLOT;
64 duCfgParam.macCellCfg.tddCfg.slotCfg[3][10] = GUARD_SLOT;
65 duCfgParam.macCellCfg.tddCfg.slotCfg[3][11] = GUARD_SLOT;
66 duCfgParam.macCellCfg.tddCfg.slotCfg[3][12] = GUARD_SLOT;
67 duCfgParam.macCellCfg.tddCfg.slotCfg[3][13] = UL_SLOT;
69 for(symbol = 0; symbol < MAX_SYMB_PER_SLOT; symbol++)
70 duCfgParam.macCellCfg.tddCfg.slotCfg[4][symbol] = UL_SLOT;
74 /*******************************************************************
76 * @brief Reads the CL Configuration.
80 * Function : readMacCfg
83 * - Fills up the cell configuration for CL.
84 * - Calls FillSlotConfig()
87 * @return ROK - success
90 * ****************************************************************/
93 /* This function is used to fill up the cell configuration for CL */
96 duCfgParam.macCellCfg.carrierId = CARRIER_IDX;
98 /* Cell configuration */
99 duCfgParam.macCellCfg.cellId = NR_CELL_ID;
100 duCfgParam.macCellCfg.phyCellId = NR_PCI;
101 duCfgParam.macCellCfg.dupType = DUPLEX_MODE;
103 /* DL carrier configuration */
104 duCfgParam.macCellCfg.dlCarrCfg.pres = TRUE;
105 duCfgParam.macCellCfg.dlCarrCfg.bw = SUL_ARFCN;
106 duCfgParam.macCellCfg.dlCarrCfg.freq = NR_ARFCN;
107 duCfgParam.macCellCfg.dlCarrCfg.k0[0] = 1;
108 duCfgParam.macCellCfg.dlCarrCfg.k0[1] = 1;
109 duCfgParam.macCellCfg.dlCarrCfg.k0[2] = 1;
110 duCfgParam.macCellCfg.dlCarrCfg.k0[3] = 1;
111 duCfgParam.macCellCfg.dlCarrCfg.k0[4] = 1;
112 duCfgParam.macCellCfg.dlCarrCfg.gridSize[0] = 1;
113 duCfgParam.macCellCfg.dlCarrCfg.gridSize[1] = 1;
114 duCfgParam.macCellCfg.dlCarrCfg.gridSize[2] = 1;
115 duCfgParam.macCellCfg.dlCarrCfg.gridSize[3] = 1;
116 duCfgParam.macCellCfg.dlCarrCfg.gridSize[4] = 1;
117 duCfgParam.macCellCfg.dlCarrCfg.numAnt = NUM_TX_ANT;
119 /* UL Carrier configuration */
120 duCfgParam.macCellCfg.ulCarrCfg.pres = TRUE;
121 duCfgParam.macCellCfg.ulCarrCfg.bw = SUL_ARFCN;
122 duCfgParam.macCellCfg.ulCarrCfg.freq = NR_ARFCN;
123 duCfgParam.macCellCfg.ulCarrCfg.k0[0] = 1;
124 duCfgParam.macCellCfg.ulCarrCfg.k0[1] = 1;
125 duCfgParam.macCellCfg.ulCarrCfg.k0[2] = 1;
126 duCfgParam.macCellCfg.ulCarrCfg.k0[3] = 1;
127 duCfgParam.macCellCfg.ulCarrCfg.k0[4] = 1;
128 duCfgParam.macCellCfg.ulCarrCfg.gridSize[0] = 1;
129 duCfgParam.macCellCfg.ulCarrCfg.gridSize[1] = 1;
130 duCfgParam.macCellCfg.ulCarrCfg.gridSize[2] = 1;
131 duCfgParam.macCellCfg.ulCarrCfg.gridSize[3] = 1;
132 duCfgParam.macCellCfg.ulCarrCfg.gridSize[4] = 1;
133 duCfgParam.macCellCfg.ulCarrCfg.numAnt = NUM_RX_ANT;
135 duCfgParam.macCellCfg.freqShft = FREQ_SHIFT_7P5KHZ;
137 /* SSB configuration */
138 duCfgParam.macCellCfg.ssbCfg.ssbPbchPwr = SSB_PBCH_PWR;
139 duCfgParam.macCellCfg.ssbCfg.bchPayloadOption = BCH_PAYLOAD;
140 duCfgParam.macCellCfg.ssbCfg.scsCmn = SUBCARRIER_SPACING;
141 duCfgParam.macCellCfg.ssbCfg.ssbPrbOffset = PRB_OFFSET;
142 duCfgParam.macCellCfg.ssbCfg.betaPss = BETA_PSS;
143 duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PERIODICITTY;
144 duCfgParam.macCellCfg.ssbCfg.ssbSubcOffset = SSB_SUBCARRIER_OFFSET;
145 duCfgParam.macCellCfg.ssbCfg.mibPdu = 104;
146 duCfgParam.macCellCfg.ssbCfg.nSSBMask[0] = 2162721;
147 duCfgParam.macCellCfg.ssbCfg.nSSBMask[1] = 0;
148 duCfgParam.macCellCfg.ssbCfg.multCarrBand = SSB_MULT_CARRIER_BAND;
149 duCfgParam.macCellCfg.ssbCfg.multCellCarr = MULT_CELL_CARRIER;
151 /* PRACH configuration */
152 duCfgParam.macCellCfg.prachCfg.pres = TRUE;
153 duCfgParam.macCellCfg.prachCfg.prachSeqLen = PRACH_SEQ_LEN;
154 duCfgParam.macCellCfg.prachCfg.prachSubcSpacing = PRACH_SUBCARRIER_SPACING;
155 duCfgParam.macCellCfg.prachCfg.prachRstSetCfg = PRACH_RESTRICTED_SET_CFG;
156 duCfgParam.macCellCfg.prachCfg.prachFdm = NUM_PRACH_FDM;
157 duCfgParam.macCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX;
158 duCfgParam.macCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ;
159 duCfgParam.macCellCfg.prachCfg.fdm[0].k1 = 1;
160 duCfgParam.macCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
161 duCfgParam.macCellCfg.prachCfg.fdm[0].numUnusedRootSeq = NUM_UNUSED_ROOT_SEQ;
162 DU_ALLOC(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq, NUM_UNUSED_ROOT_SEQ * sizeof(U8));
163 if(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP)
165 DU_LOG("\nDU_APP : Memory allocation failed");
168 *(duCfgParam.macCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ;
169 duCfgParam.macCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH;
170 duCfgParam.macCellCfg.prachCfg.prachMultCarrBand = PRACH_MULT_CARRIER_BAND;
172 /* TDD configuration */
173 duCfgParam.macCellCfg.tddCfg.pres = TRUE;
174 duCfgParam.macCellCfg.tddCfg.tddPeriod = TDD_PERIODICITY;
178 /* RSSI Measurement configuration */
179 duCfgParam.macCellCfg.rssiUnit = RSS_MEASUREMENT_UNIT;
181 /* This should be calculated based on
182 (number of mandatory parameters) + (number of otional parameters being filled) */
183 duCfgParam.macCellCfg.numTlv = 39;
188 /*******************************************************************
190 * @brief Configures the DU Parameters
194 * Function : fillDuPort
197 * - fills the DU Ports.
199 * @params[in] duPort array to be filled
200 * @return ROK - success
203 * ****************************************************************/
205 S16 fillDuPort(U16 *duPort)
207 duPort[F1_INTERFACE] = DU_PORT; /* DU Port idx 0 38472 */
208 duPort[E2_INTERFACE] = RIC_PORT; /* RIC Port idx 1 38482 */
213 /*******************************************************************
215 * @brief Configures the DU Parameters
222 * - Initializes the DuCfg members.
223 * - Calls readMacCfg()
225 * @params[in] system task ID
226 * @return ROK - success
229 * ****************************************************************/
234 U32 ipv4_du, ipv4_cu, ipv4_ric;
238 cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du);
239 cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu);
240 cmInetAddr((S8*)RIC_IP_V4_ADDR, &ipv4_ric);
241 fillDuPort(duCfgParam.sctpParams.duPort);
243 /* F1 DU IP Address and Port*/
244 duCfgParam.sctpParams.duIpAddr.ipV4Addr = ipv4_du;
246 /* F1 CU IP Address and Port*/
247 duCfgParam.sctpParams.cuIpAddr.ipV4Addr = ipv4_cu;
248 duCfgParam.sctpParams.cuPort = CU_PORT;
250 /* Fill RIC Params */
251 duCfgParam.sctpParams.ricIpAddr.ipV4Addr = ipv4_ric;
252 duCfgParam.sctpParams.ricPort = RIC_PORT;
255 /* EGTP Parameters */
256 duCfgParam.egtpParams.localIp.ipV4Pres = TRUE;
257 duCfgParam.egtpParams.localIp.ipV4Addr = ipv4_du;
258 duCfgParam.egtpParams.localPort = DU_EGTP_PORT;
259 duCfgParam.egtpParams.destIp.ipV4Pres = TRUE;
260 duCfgParam.egtpParams.destIp.ipV4Addr = ipv4_cu;
261 duCfgParam.egtpParams.destPort = CU_EGTP_PORT;
262 duCfgParam.egtpParams.minTunnelId = 0;
263 duCfgParam.egtpParams.maxTunnelId = 10;
265 duCfgParam.maxUe = 32; //TODO: Check
267 duCfgParam.duId = DU_ID;
268 strcpy((char*)duCfgParam.duName,DU_NAME);
271 mib.sysFrmNum = SYS_FRAME_NUM;
272 mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs15or60;
273 mib.ssb_SubcarrierOffset = SSB_SC_OFFSET;
274 mib.dmrs_TypeA_Position = MIB__dmrs_TypeA_Position_pos2;
275 mib.controlResourceSetZero = CORESET_ZERO;
276 mib.searchSpaceZero = SEARCH_SPACE_ZERO;
277 mib.cellBarred = MIB__cellBarred_barred;
278 mib.intraFreqReselection =
279 MIB__intraFreqReselection_notAllowed;
280 duCfgParam.mibParams = mib;
283 sib1.plmn.mcc[0] = PLMN_MCC0;
284 sib1.plmn.mcc[1] = PLMN_MCC1;
285 sib1.plmn.mcc[2] = PLMN_MCC2;
286 sib1.plmn.mnc[0] = PLMN_MNC0;
287 sib1.plmn.mnc[1] = PLMN_MNC1;
288 sib1.plmn.mnc[2] = PLMN_MNC2;
290 sib1.ranac = DU_RANAC;
291 sib1.cellIdentity = CELL_IDENTITY;
292 sib1.cellResvdForOpUse =\
293 PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
294 duCfgParam.sib1Params = sib1;
296 for(i=0; i<DEFAULT_CELLS; i++)
298 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
299 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
300 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
301 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
302 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
303 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[2] = PLMN_MNC2;
306 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.cellId = NR_CELL_ID;
307 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrPci = NR_PCI;
309 /* List of Available PLMN */
310 for(j=0;j<MAX_PLMN;j++)
312 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[0] = PLMN_MCC0;
313 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[1] = PLMN_MCC1;
314 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[2] = PLMN_MCC2;
315 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[0] = PLMN_MNC0;
316 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[1] = PLMN_MNC1;
317 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[2] = PLMN_MNC2;
319 /* List of Extended PLMN */
320 for(j=0;j<MAX_PLMN;j++)
322 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[0] = PLMN_MCC0;
323 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[1] = PLMN_MCC1;
324 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[2] = PLMN_MCC2;
325 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[0] = PLMN_MNC0;
326 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[1] = PLMN_MNC1;
327 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[2] = PLMN_MNC2;
331 duCfgParam.srvdCellLst[i].duCellInfo.tac = DU_TAC;
332 duCfgParam.srvdCellLst[i].duCellInfo.epsTac = DU_TAC; //to check and fill
334 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_ARFCN;
335 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
336 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_120;
337 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_66;
341 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_ARFCN;
342 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
343 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
344 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_160;
346 for(j=0;j<MAXNRCELLBANDS;j++)
348 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
349 for(k=0;k<MAXNRCELLBANDS;k++)
351 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
355 for(j=0;j<MAXNRCELLBANDS;j++)
357 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
358 for(k=0;k<MAXNRCELLBANDS;k++)
360 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
363 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_ARFCN;
364 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
365 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_120;
366 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_66;
367 for(j=0;j<MAXNRCELLBANDS;j++)
369 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
370 for(k=0;k<MAXNRCELLBANDS;k++)
372 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
376 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = SCS_120;
377 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_66;
379 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = SCS_120;
380 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_66;
383 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrTxBw.nrScs = SCS_15;
384 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrTxBw.nrb = NRB_160;
386 /*Measurement Config and Cell Config */
387 duCfgParam.srvdCellLst[i].duCellInfo.measTimeCfg = TIME_CFG;
389 duCfgParam.srvdCellLst[i].duCellInfo.cellDir = DL_UL;
391 duCfgParam.srvdCellLst[i].duCellInfo.cellType=CELL_TYPE;
393 /* Broadcast PLMN Identity */
394 for(j=0;j<MAXBPLMNNRMINUS1;j++)
396 for(k=0;k<MAX_PLMN;k++)
398 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[0] = PLMN_MCC0;
399 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[1] = PLMN_MCC1;
400 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[2] = PLMN_MCC2;
401 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[0] = PLMN_MNC0;
402 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[1] = PLMN_MNC1;
403 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[2] = PLMN_MNC2;
405 /* Extended PLMN List */
406 for(k=0;k<MAX_PLMN;k++)
408 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[0] = PLMN_MCC0;
409 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[1] = PLMN_MCC1;
410 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[2] = PLMN_MCC2;
411 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[0] = PLMN_MNC0;
412 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[1] = PLMN_MNC1;
413 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[2] = PLMN_MNC2;
416 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].tac = DU_TAC;
417 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].nrCellId = NR_CELL_ID;
418 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].ranac = NR_RANAC;
421 /*gnb DU System Info mib msg*/
423 DU_ALLOC(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg,\
425 if(!(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg))
427 DU_LOG("\nDU_APP: Memory allocation failure");
430 strcpy(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg, encBuf);
432 /*gnb DU System Info mib msg*/
434 DU_ALLOC(duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg,\
436 if(!(duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg))
438 DU_LOG("\nDU_APP: Memory allocation failure");
441 for(int x=0; x<encBufSize; x++)
443 duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg[x]=\
449 if(readMacCfg() != ROK)
451 DU_LOG("\nDU_APP : Failed while reading MAC config");
458 /*******************************************************************
460 * @brief Reads config and posts message to du_app on completion
468 * - Post to du_app for further processing
471 * @return ROK - success
474 * ****************************************************************/
480 cmMemset((U8 *)&duCfgParam, 0, sizeof(DuCfgParams));
481 //Read configs into duCfgParams
484 DU_LOG("\nDU_APP : Reading configuration failed");
489 cmMemset((U8 *)&(pst), 0, sizeof(Pst));
490 pst.srcEnt = (Ent)ENTDUAPP;
491 pst.srcInst = (Inst)DU_INST;
492 pst.srcProcId = DU_PROC;
493 pst.dstEnt = pst.srcEnt;
494 pst.dstInst = pst.srcInst;
495 pst.dstProcId = pst.srcProcId;
497 pst.selector = DU_SELECTOR_TC;
501 if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
503 DU_LOG("\nDU_APP : Memory allocation failed in duReadCfg");
507 if (SPstTsk(&pst, mBuf) != ROK)
509 DU_LOG("\nDU_APP : SPstTsk failed in duReadCfg");
516 /*******************************************************************
518 * @brief Converts bit strings to integer
522 * Function : bitStringToInt
525 * - Converts ASN bit string format IEs to integer type
528 * @return ROK - success
531 * ****************************************************************/
532 S16 bitStringToInt(BIT_STRING_t *bitString, U16 *val)
535 if(bitString->buf == NULL || bitString->size <= 0)
537 DU_LOG("\nDU_APP : Bit string is empty");
541 for(idx=0; idx<bitString->size-1; idx++)
543 *val |= bitString->buf[idx];
547 *val |= bitString->buf[idx];
548 *val >>= bitString->bits_unused;
554 /**********************************************************************
556 **********************************************************************/