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.clCellCfg.tddCfg.slotCfg[slot][symbol] = DL_SLOT;
64 duCfgParam.clCellCfg.tddCfg.slotCfg[3][10] = GUARD_SLOT;
65 duCfgParam.clCellCfg.tddCfg.slotCfg[3][11] = GUARD_SLOT;
66 duCfgParam.clCellCfg.tddCfg.slotCfg[3][12] = GUARD_SLOT;
67 duCfgParam.clCellCfg.tddCfg.slotCfg[3][13] = UL_SLOT;
69 for(symbol = 0; symbol < MAX_SYMB_PER_SLOT; symbol++)
70 duCfgParam.clCellCfg.tddCfg.slotCfg[4][symbol] = UL_SLOT;
74 /*******************************************************************
76 * @brief Reads the CL Configuration.
80 * Function : readClCfg
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.clCellCfg.carrierId = CARRIER_IDX;
98 /* Cell configuration */
99 duCfgParam.clCellCfg.cellId = NR_CELL_ID;
100 duCfgParam.clCellCfg.phyCellId = NR_PCI;
101 duCfgParam.clCellCfg.dupType = DUPLEX_MODE;
103 /* DL carrier configuration */
104 duCfgParam.clCellCfg.dlCarrCfg.pres = TRUE;
105 duCfgParam.clCellCfg.dlCarrCfg.bw = SUL_ARFCN;
106 duCfgParam.clCellCfg.dlCarrCfg.freq = NR_ARFCN;
107 duCfgParam.clCellCfg.dlCarrCfg.k0[0] = 1;
108 duCfgParam.clCellCfg.dlCarrCfg.k0[1] = 1;
109 duCfgParam.clCellCfg.dlCarrCfg.k0[2] = 1;
110 duCfgParam.clCellCfg.dlCarrCfg.k0[3] = 1;
111 duCfgParam.clCellCfg.dlCarrCfg.k0[4] = 1;
112 duCfgParam.clCellCfg.dlCarrCfg.gridSize[0] = 1;
113 duCfgParam.clCellCfg.dlCarrCfg.gridSize[1] = 1;
114 duCfgParam.clCellCfg.dlCarrCfg.gridSize[2] = 1;
115 duCfgParam.clCellCfg.dlCarrCfg.gridSize[3] = 1;
116 duCfgParam.clCellCfg.dlCarrCfg.gridSize[4] = 1;
117 duCfgParam.clCellCfg.dlCarrCfg.numAnt = NUM_TX_ANT;
119 /* UL Carrier configuration */
120 duCfgParam.clCellCfg.ulCarrCfg.pres = TRUE;
121 duCfgParam.clCellCfg.ulCarrCfg.bw = SUL_ARFCN;
122 duCfgParam.clCellCfg.ulCarrCfg.freq = NR_ARFCN;
123 duCfgParam.clCellCfg.ulCarrCfg.k0[0] = 1;
124 duCfgParam.clCellCfg.ulCarrCfg.k0[1] = 1;
125 duCfgParam.clCellCfg.ulCarrCfg.k0[2] = 1;
126 duCfgParam.clCellCfg.ulCarrCfg.k0[3] = 1;
127 duCfgParam.clCellCfg.ulCarrCfg.k0[4] = 1;
128 duCfgParam.clCellCfg.ulCarrCfg.gridSize[0] = 1;
129 duCfgParam.clCellCfg.ulCarrCfg.gridSize[1] = 1;
130 duCfgParam.clCellCfg.ulCarrCfg.gridSize[2] = 1;
131 duCfgParam.clCellCfg.ulCarrCfg.gridSize[3] = 1;
132 duCfgParam.clCellCfg.ulCarrCfg.gridSize[4] = 1;
133 duCfgParam.clCellCfg.ulCarrCfg.numAnt = NUM_RX_ANT;
135 duCfgParam.clCellCfg.freqShft = FREQ_SHIFT_7P5KHZ;
137 /* SSB configuration */
138 duCfgParam.clCellCfg.ssbCfg.ssbPbchPwr = SSB_PBCH_PWR;
139 duCfgParam.clCellCfg.ssbCfg.bchPayload = BCH_PAYLOAD;
140 duCfgParam.clCellCfg.ssbCfg.scsCmn = SUBCARRIER_SPACING;
141 duCfgParam.clCellCfg.ssbCfg.ssbPrbOffset = PRB_OFFSET;
142 duCfgParam.clCellCfg.ssbCfg.betaPss = BETA_PSS;
143 duCfgParam.clCellCfg.ssbCfg.ssbPeriod = SSB_PERIODICITTY;
144 duCfgParam.clCellCfg.ssbCfg.ssbSubcOffset = SSB_SUBCARRIER_OFFSET;
145 duCfgParam.clCellCfg.ssbCfg.mibPdu = 104;
146 duCfgParam.clCellCfg.ssbCfg.nSSBMask[0] = 2162721;
147 duCfgParam.clCellCfg.ssbCfg.nSSBMask[1] = 0;
148 duCfgParam.clCellCfg.ssbCfg.multCarrBand = SSB_MULT_CARRIER_BAND;
149 duCfgParam.clCellCfg.ssbCfg.multCellCarr = MULT_CELL_CARRIER;
151 /* PRACH configuration */
152 duCfgParam.clCellCfg.prachCfg.pres = TRUE;
153 duCfgParam.clCellCfg.prachCfg.prachSeqLen = PRACH_SEQ_LEN;
154 duCfgParam.clCellCfg.prachCfg.prachSubcSpacing = PRACH_SUBCARRIER_SPACING;
155 duCfgParam.clCellCfg.prachCfg.prachRstSetCfg = PRACH_RESTRICTED_SET_CFG;
156 duCfgParam.clCellCfg.prachCfg.prachFdm = NUM_PRACH_FDM;
157 duCfgParam.clCellCfg.prachCfg.fdm[0].rootSeqIdx = ROOT_SEQ_IDX;
158 duCfgParam.clCellCfg.prachCfg.fdm[0].numRootSeq = NUM_ROOT_SEQ;
159 duCfgParam.clCellCfg.prachCfg.fdm[0].k1 = 1;
160 duCfgParam.clCellCfg.prachCfg.fdm[0].zeroCorrZoneCfg = ZERO_CORRELATION_ZONE_CFG;
161 duCfgParam.clCellCfg.prachCfg.fdm[0].numUnusedRootSeq = NUM_UNUSED_ROOT_SEQ;
162 DU_ALLOC(duCfgParam.clCellCfg.prachCfg.fdm[0].unsuedRootSeq, NUM_UNUSED_ROOT_SEQ * sizeof(U8));
163 if(duCfgParam.clCellCfg.prachCfg.fdm[0].unsuedRootSeq == NULLP)
165 DU_LOG("\nDU_APP : Memory allocation failed");
168 *(duCfgParam.clCellCfg.prachCfg.fdm[0].unsuedRootSeq) = UNUSED_ROOT_SEQ;
169 duCfgParam.clCellCfg.prachCfg.ssbPerRach = SSB_PER_RACH;
170 duCfgParam.clCellCfg.prachCfg.prachMultCarrBand = PRACH_MULT_CARRIER_BAND;
172 /* TDD configuration */
173 duCfgParam.clCellCfg.tddCfg.pres = TRUE;
174 duCfgParam.clCellCfg.tddCfg.tddPeriod = TDD_PERIODICITY;
178 /* RSSI Measurement configuration */
179 duCfgParam.clCellCfg.rssiUnit = RSS_MEASUREMENT_UNIT;
181 /* This should be calculated based on
182 (number of mandatory parameters) + (number of otional parameters being filled) */
183 duCfgParam.clCellCfg.numTlv = 39;
187 /*******************************************************************
189 * @brief Configures the DU Parameters
196 * - Initializes the DuCfg members.
197 * - Calls readClCfg()
199 * @params[in] system task ID
200 * @return ROK - success
203 * ****************************************************************/
208 U32 ipv4_du, ipv4_cu;
212 cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du);
213 cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu);
215 /* F1 DU IP Address and Port*/
216 duCfgParam.sctpParams.duIpAddr.ipV4Pres = TRUE;
217 duCfgParam.sctpParams.duIpAddr.ipV4Addr = ipv4_du;
218 duCfgParam.sctpParams.duPort = DU_PORT;
220 /* F1 CU IP Address and Port*/
221 duCfgParam.sctpParams.cuIpAddr.ipV4Pres = TRUE;
222 duCfgParam.sctpParams.cuIpAddr.ipV4Addr = ipv4_cu;
223 duCfgParam.sctpParams.cuPort = CU_PORT;
226 /* EGTP Parameters */
227 duCfgParam.egtpParams.localIp.ipV4Pres = TRUE;
228 duCfgParam.egtpParams.localIp.ipV4Addr = ipv4_du;
229 duCfgParam.egtpParams.localPort = DU_EGTP_PORT;
230 duCfgParam.egtpParams.destIp.ipV4Pres = TRUE;
231 duCfgParam.egtpParams.destIp.ipV4Addr = ipv4_cu;
232 duCfgParam.egtpParams.destPort = CU_EGTP_PORT;
233 duCfgParam.egtpParams.minTunnelId = 0;
234 duCfgParam.egtpParams.maxTunnelId = 10;
236 duCfgParam.maxUe = 32; //TODO: Check
238 duCfgParam.duId = DU_ID;
239 strcpy((char*)duCfgParam.duName,DU_NAME);
242 mib.sysFrmNum = SYS_FRAME_NUM;
243 mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs15or60;
244 mib.ssb_SubcarrierOffset = SSB_SC_OFFSET;
245 mib.dmrs_TypeA_Position = MIB__dmrs_TypeA_Position_pos2;
246 mib.controlResourceSetZero = CORESET_ZERO;
247 mib.searchSpaceZero = SEARCH_SPACE_ZERO;
248 mib.cellBarred = MIB__cellBarred_barred;
249 mib.intraFreqReselection =
250 MIB__intraFreqReselection_notAllowed;
251 duCfgParam.mibParams = mib;
254 sib1.plmn.mcc[0] = PLMN_MCC0;
255 sib1.plmn.mcc[1] = PLMN_MCC1;
256 sib1.plmn.mcc[2] = PLMN_MCC2;
257 sib1.plmn.mnc[0] = PLMN_MNC0;
258 sib1.plmn.mnc[1] = PLMN_MNC1;
259 sib1.plmn.mnc[2] = PLMN_MNC2;
261 sib1.ranac = DU_RANAC;
262 sib1.cellIdentity = CELL_IDENTITY;
263 sib1.cellResvdForOpUse =\
264 PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
265 duCfgParam.sib1Params = sib1;
267 for(i=0; i<DEFAULT_CELLS; i++)
269 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
270 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
271 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
272 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
273 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
274 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[2] = PLMN_MNC2;
277 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.cellId = NR_CELL_ID;
278 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrPci = NR_PCI;
280 /* List of Available PLMN */
281 for(j=0;j<MAX_PLMN;j++)
283 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[0] = PLMN_MCC0;
284 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[1] = PLMN_MCC1;
285 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[2] = PLMN_MCC2;
286 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[0] = PLMN_MNC0;
287 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[1] = PLMN_MNC1;
288 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[2] = PLMN_MNC2;
290 /* List of Extended PLMN */
291 for(j=0;j<MAX_PLMN;j++)
293 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[0] = PLMN_MCC0;
294 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[1] = PLMN_MCC1;
295 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[2] = PLMN_MCC2;
296 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[0] = PLMN_MNC0;
297 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[1] = PLMN_MNC1;
298 duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[2] = PLMN_MNC2;
302 duCfgParam.srvdCellLst[i].duCellInfo.tac = DU_TAC;
303 duCfgParam.srvdCellLst[i].duCellInfo.epsTac = DU_TAC; //to check and fill
305 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_ARFCN;
306 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
307 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_120;
308 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_66;
312 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_ARFCN;
313 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
314 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
315 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_160;
317 for(j=0;j<MAXNRCELLBANDS;j++)
319 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
320 for(k=0;k<MAXNRCELLBANDS;k++)
322 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
326 for(j=0;j<MAXNRCELLBANDS;j++)
328 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
329 for(k=0;k<MAXNRCELLBANDS;k++)
331 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
334 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_ARFCN;
335 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
336 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_120;
337 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_66;
338 for(j=0;j<MAXNRCELLBANDS;j++)
340 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
341 for(k=0;k<MAXNRCELLBANDS;k++)
343 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
347 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = SCS_120;
348 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_66;
350 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = SCS_120;
351 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_66;
354 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrTxBw.nrScs = SCS_15;
355 duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrTxBw.nrb = NRB_160;
357 /*Measurement Config and Cell Config */
358 duCfgParam.srvdCellLst[i].duCellInfo.measTimeCfg = TIME_CFG;
360 duCfgParam.srvdCellLst[i].duCellInfo.cellDir = DL_UL;
362 duCfgParam.srvdCellLst[i].duCellInfo.cellType=CELL_TYPE;
364 /* Broadcast PLMN Identity */
365 for(j=0;j<MAXBPLMNNRMINUS1;j++)
367 for(k=0;k<MAX_PLMN;k++)
369 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[0] = PLMN_MCC0;
370 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[1] = PLMN_MCC1;
371 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[2] = PLMN_MCC2;
372 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[0] = PLMN_MNC0;
373 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[1] = PLMN_MNC1;
374 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[2] = PLMN_MNC2;
376 /* Extended PLMN List */
377 for(k=0;k<MAX_PLMN;k++)
379 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[0] = PLMN_MCC0;
380 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[1] = PLMN_MCC1;
381 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[2] = PLMN_MCC2;
382 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[0] = PLMN_MNC0;
383 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[1] = PLMN_MNC1;
384 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[2] = PLMN_MNC2;
387 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].tac = DU_TAC;
388 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].nrCellId = NR_CELL_ID;
389 duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].ranac = NR_RANAC;
392 /*gnb DU System Info mib msg*/
394 DU_ALLOC(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg,\
396 if(!(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg))
398 DU_LOG("\nDU_APP: Memory allocation failure");
401 strcpy(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg, encBuf);
403 /*gnb DU System Info mib msg*/
405 DU_ALLOC(duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg,\
407 if(!(duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg))
409 DU_LOG("\nDU_APP: Memory allocation failure");
412 for(int x=0; x<encBufSize; x++)
414 duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg[x]=\
420 if(readClCfg() != ROK)
422 DU_LOG("\nDU_APP : Failed while reading CL config");
429 /*******************************************************************
431 * @brief Reads config and posts message to du_app on completion
439 * - Post to du_app for further processing
442 * @return ROK - success
445 * ****************************************************************/
451 cmMemset((U8 *)&duCfgParam, 0, sizeof(DuCfgParams));
452 //Read configs into duCfgParams
455 DU_LOG("\nDU_APP : Reading configuration failed");
460 cmMemset((U8 *)&(pst), 0, sizeof(Pst));
461 pst.srcEnt = (Ent)ENTDUAPP;
462 pst.srcInst = (Inst)DU_INST;
463 pst.srcProcId = DU_PROC;
464 pst.dstEnt = pst.srcEnt;
465 pst.dstInst = pst.srcInst;
466 pst.dstProcId = pst.srcProcId;
468 pst.selector = DU_SELECTOR_TC;
472 if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
474 DU_LOG("\nDU_APP : Memory allocation failed in duReadCfg");
478 if (SPstTsk(&pst, mBuf) != ROK)
480 DU_LOG("\nDU_APP : SPstTsk failed in duReadCfg");
487 /*******************************************************************
489 * @brief Converts bit strings to integer
493 * Function : bitStringToInt
496 * - Converts ASN bit string format IEs to integer type
499 * @return ROK - success
502 * ****************************************************************/
503 S16 bitStringToInt(BIT_STRING_t *bitString, U16 *val)
506 if(bitString->buf == NULL || bitString->size <= 0)
508 DU_LOG("\nDU_APP : Bit string is empty");
512 numOctets = (bitString->size + 7 )/8;
513 for(idx=0; idx< numOctets; idx++)
515 *val |= bitString->buf[idx];
519 *val |= bitString->buf[numOctets -1];
520 *val >>= ((numOctets * 8) - bitString->size);
526 /**********************************************************************
528 **********************************************************************/