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 message handling functionality for DU APP */
20 #include "common_def.h"
28 #include "du_app_mac_inf.h"
29 #include "du_app_rlc_inf.h"
31 #include "du_app_rlc_inf.h"
35 #include "du_f1ap_msg_hdl.h"
36 #include "du_ue_mgr.h"
40 #include "du_cell_mgr.h"
44 #include "AlarmInterface.h"
45 #include "ConfigInterface.h"
50 uint8_t numRlcDlSaps = 0;
52 uint8_t numRlcMacSaps = 0;
54 uint8_t macCfgInst = 0;
56 DuCfgParams duCfgParam;
57 uint8_t packRlcConfigReq(Pst *pst, RlcMngmt *cfg);
58 uint8_t cmPkLkwCntrlReq(Pst *pst, RlcMngmt *cfg);
59 uint8_t cmPkLrgCfgReq(Pst *pst, RgMngmt *cfg);
60 uint8_t BuildAndSendE2SetupReq();
61 uint8_t egtpHdlDatInd(EgtpMsg egtpMsg);
62 uint8_t BuildAndSendDUConfigUpdate();
63 uint16_t getTransId();
64 uint8_t cmPkLrgSchCfgReq(Pst * pst,RgMngmt * cfg);
65 uint8_t sendCellDeleteReqToMac(uint16_t cellId);
67 packMacCellCfgReq packMacCellCfgOpts[] =
69 packMacCellCfg, /* packing for loosely coupled */
70 MacProcCellCfgReq, /* packing for tightly coupled */
71 packMacCellCfg, /* packing for light weight loosly coupled */
74 DuMacCellStart packMacCellStartOpts[] =
76 packMacCellStart, /* Loose coupling */
77 MacProcCellStart, /* TIght coupling */
78 packMacCellStart /* Light weight-loose coupling */
81 DuMacCellStop packMacCellStopOpts[] =
83 packMacCellStop, /* Loose coupling */
84 MacProcCellStop, /* TIght coupling */
85 packMacCellStop /* Light weight-loose coupling */
88 /**************************************************************************
89 * @brief Function to fill configs required by RLC
93 * Function : duBuildRlcCfg
96 * Initiates general Configs towards RLC
98 * @param[in] Inst Specifies if RLC UL or RLC DL instance
99 * @return ROK - success
102 ***************************************************************************/
103 uint8_t duBuildRlcCfg(Inst inst)
106 RlcGenCfg *genCfg = NULLP;
109 DU_SET_ZERO(&rlcMngmt, sizeof(RlcMngmt));
110 DU_SET_ZERO(&pst, sizeof(Pst));
112 genCfg = &(rlcMngmt.t.cfg.s.gen);
114 /*----------- Fill General Configuration Parameters ---------*/
115 genCfg->maxUe = duCfgParam.maxUe;
116 genCfg->maxKwuSaps = 2;
117 genCfg->maxUdxSaps = 1;
118 genCfg->rlcMode = (inst == RLC_UL_INST) ?
119 LKW_RLC_MODE_UL : LKW_RLC_MODE_DL;
121 genCfg->maxRguSaps = DEFAULT_CELLS;
123 /*----------- Fill lmPst
124 * Parameters ---------*/
125 genCfg->lmPst.dstProcId = DU_PROC;
126 genCfg->lmPst.srcProcId = DU_PROC;
127 genCfg->lmPst.dstEnt = ENTDUAPP;
128 genCfg->lmPst.dstInst = DU_INST;
129 genCfg->lmPst.srcEnt = ENTRLC;
130 genCfg->lmPst.srcInst = inst;
131 genCfg->lmPst.prior = PRIOR0;
132 genCfg->lmPst.route = RTESPEC;
133 genCfg->lmPst.region = (inst == RLC_UL_INST) ?
134 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
135 genCfg->lmPst.pool = RLC_POOL;
136 genCfg->lmPst.selector = ODU_SELECTOR_LC;
139 rlcMngmt.hdr.msgType = TCFG;
140 rlcMngmt.hdr.msgLen = 0;
141 rlcMngmt.hdr.entId.ent = ENTRLC;
142 rlcMngmt.hdr.entId.inst = (Inst)0;
143 rlcMngmt.hdr.elmId.elmnt = STGEN;
144 rlcMngmt.hdr.seqNmb = 0;
145 rlcMngmt.hdr.version = 0;
146 rlcMngmt.hdr.transId = 0;
147 rlcMngmt.hdr.response.prior = PRIOR0;
148 rlcMngmt.hdr.response.route = RTESPEC;
149 rlcMngmt.hdr.response.mem.region = (inst == RLC_UL_INST) ?
150 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
151 rlcMngmt.hdr.response.mem.pool = DU_POOL;
152 rlcMngmt.hdr.response.selector = ODU_SELECTOR_LC;
155 pst.selector = ODU_SELECTOR_LC;
156 pst.srcEnt = ENTDUAPP;
159 pst.dstProcId = DU_PROC;
160 pst.srcProcId = DU_PROC;
161 pst.region = duCb.init.region;
163 DU_LOG("\nDEBUG --> DU_APP : RLC Gen Cfg Req sent for inst %d", inst);
165 /* Send the request to RLC */
166 packRlcConfigReq(&pst, &rlcMngmt);
171 /**************************************************************************
172 * @brief Function to fill configs required by RLC
176 * Function : duBuildRlcLsapCfg
179 * Initiates general Configs towards RLC
181 * @param[in] Inst Specifies if RLC UL or RLC DL instance
182 * @return ROK - success
185 ***************************************************************************/
186 uint8_t duBuildRlcLsapCfg(Ent ent, Inst inst, uint8_t lsapInst)
190 RlcSapCfg *lSap = NULLP;
193 DU_SET_ZERO(&rlcMngmt, sizeof(RlcMngmt));
194 DU_SET_ZERO(&pst, sizeof(Pst));
197 rlcMngmt.hdr.msgType = TCFG;
198 rlcMngmt.hdr.entId.ent = ENTRLC;
199 rlcMngmt.hdr.response.mem.region = (inst == RLC_UL_INST) ?
200 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
202 rlcMngmt.hdr.response.mem.pool = RLC_POOL;
205 pst.selector = ODU_SELECTOR_LC;
206 pst.srcEnt = ENTDUAPP;
208 pst.dstProcId = DU_PROC;
210 pst.srcProcId = DU_PROC;
211 pst.region = duCb.init.region;
212 lSap = &(rlcMngmt.t.cfg.s.sap);
214 lSap->mem.region = (inst == RLC_UL_INST) ?
215 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
216 lSap->mem.pool = RLC_POOL;
218 lSap->bndTmrIntvl = 10;
219 lSap->priority = PRIOR0;
220 lSap->route = RTESPEC;
223 lSap->procId = DU_PROC;
225 lSap->inst = lsapInst;
226 lSap->sapId = lsapInst; /* SapId will be stored as suId in MAC */
227 lSap->selector = (inst == RLC_UL_INST) ? ODU_SELECTOR_LWLC : ODU_SELECTOR_TC;
228 rlcMngmt.hdr.elmId.elmnt = STRGUSAP;
229 DU_LOG("\nDEBUG --> DU_APP : RLC MAC Lower Sap Cfg Req sent for inst %d", inst);
234 lSap->procId = DU_PROC;
236 lSap->inst = (inst == RLC_UL_INST) ?
237 RLC_DL_INST : RLC_UL_INST;
239 lSap->selector = ODU_SELECTOR_LC;
240 rlcMngmt.hdr.elmId.elmnt = STUDXSAP;
241 DU_LOG("\nDEBUG --> DU_APP : RLC DL/UL Lower Sap Cfg Req sent for inst %d", inst);
244 packRlcConfigReq(&pst, &rlcMngmt);
248 /**************************************************************************
249 * @brief Function to fill configs required by RLC
253 * Function : duBuildRlcUsapCfg
256 * Initiates general Configs towards RLC
258 * @param[in] Inst Specifies if RLC UL or RLC DL instance
259 * @return ROK - success
262 ***************************************************************************/
263 uint8_t duBuildRlcUsapCfg(uint8_t elemId, Ent ent, Inst inst)
266 RlcSapCfg *uSap = NULLP;
269 DU_SET_ZERO(&rlcMngmt, sizeof(RlcMngmt));
270 DU_SET_ZERO(&pst, sizeof(Pst));
272 uSap = &(rlcMngmt.t.cfg.s.sap);
274 uSap->selector = ODU_SELECTOR_LC;
275 uSap->mem.region = (inst == RLC_UL_INST) ?
276 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
277 uSap->mem.pool = RLC_POOL;
280 uSap->procId = DU_PROC;
284 uSap->inst = (inst == RLC_UL_INST) ?
285 RLC_DL_INST : RLC_UL_INST;
286 uSap->bndTmrIntvl = 1000;
287 uSap->priority = PRIOR0;
288 uSap->route = RTESPEC;
291 rlcMngmt.hdr.msgType = TCFG;
292 rlcMngmt.hdr.entId.ent = ENTRLC;
293 rlcMngmt.hdr.elmId.elmnt = STUDXSAP;
294 rlcMngmt.hdr.response.mem.region = (inst == RLC_UL_INST) ?
295 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
297 rlcMngmt.hdr.response.mem.pool = RLC_POOL;
300 pst.selector = ODU_SELECTOR_LC;
301 pst.srcEnt = ENTDUAPP;
303 pst.dstProcId = DU_PROC;
305 pst.srcProcId = DU_PROC;
306 pst.region = duCb.init.region;
308 DU_LOG("\nDEBUG --> DU_APP : RLC Kwu Upper Sap Cfg Req sent for inst %d", inst);
309 packRlcConfigReq(&pst, &rlcMngmt);
314 /**************************************************************************
315 * @brief Function to populate internal DS of DU APP
319 * Function : duProcCfgComplete
322 * Populates internal data structures of DU APP after
323 * receiving configurations.
326 * @return ROK - success
329 ***************************************************************************/
330 uint8_t duProcCfgComplete()
335 for(idx=0; idx< DEFAULT_CELLS; idx++)
337 DuCellCb *cell = NULLP;
338 DU_ALLOC(cell, sizeof(DuCellCb));
341 DU_LOG("\nERROR --> DU_APP : Memory Allocation failed in duProcCfgComplete");
347 memset(cell, 0, sizeof(DuCellCb));
348 cell->cellId = ++cellId;
349 memset(&cell->cellInfo.nrEcgi.plmn, 0, sizeof(Plmn));
350 cell->cellInfo.nrEcgi.plmn.mcc[0] = PLMN_MCC0;
351 cell->cellInfo.nrEcgi.plmn.mcc[1] = PLMN_MCC1;
352 cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
353 cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0;
354 cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1;
355 cell->cellInfo.nrEcgi.cellId = cell->cellId;
356 cell->cellInfo.nrPci = NR_PCI;
357 cell->cellInfo.fiveGsTac = DU_TAC;
358 memset(&cell->cellInfo.plmn[idx1], 0, sizeof(Plmn));
359 for(idx1=0; idx1<MAX_PLMN; idx1++)
361 cell->cellInfo.plmn[idx1].mcc[0] = PLMN_MCC0;
362 cell->cellInfo.plmn[idx1].mcc[1] = PLMN_MCC1;
363 cell->cellInfo.plmn[idx1].mcc[2] = PLMN_MCC2;
364 cell->cellInfo.plmn[idx1].mnc[0] = PLMN_MNC0;
365 cell->cellInfo.plmn[idx1].mnc[1] = PLMN_MNC1;
367 cell->cellInfo.maxUe = duCfgParam.maxUe;
368 cell->cellStatus = CELL_OUT_OF_SERVICE;
369 gCellStatus = CELL_DOWN;
370 cell->gnbDuUeF1apIdGenerator = 0;
371 duCb.cfgCellLst[duCb.numCfgCells] = cell;
377 //Start layer configs
378 ret = duSendRlcUlCfg();
382 /**************************************************************************
383 * @brief Function to invoke DU Layer Configs
387 * Function : duSendRlcUlCfg
390 * Initiates Configs towards layers of DU
393 * @return ROK - success
396 ***************************************************************************/
397 uint8_t duSendRlcUlCfg()
401 duBuildRlcCfg((Inst)RLC_UL_INST);
402 for(cellIdx = 0; cellIdx < DEFAULT_CELLS; cellIdx++)
404 duBuildRlcLsapCfg(ENTMAC, (Inst)RLC_UL_INST, cellIdx);
406 duBuildRlcLsapCfg(ENTRLC, (Inst)RLC_UL_INST, 0);
411 /**************************************************************************
412 * @brief Function to invoke DU Layer Configs
416 * Function : duSendRlcDlCfg
419 * Initiates Configs towards layers of DU
422 * @return ROK - success
425 ***************************************************************************/
426 uint8_t duSendRlcDlCfg()
430 duBuildRlcCfg((Inst)RLC_DL_INST);
431 duBuildRlcUsapCfg(STUDXSAP, ENTRLC, (Inst)RLC_DL_INST);
432 for(cellIdx = 0; cellIdx < DEFAULT_CELLS; cellIdx++)
434 duBuildRlcLsapCfg(ENTMAC, (Inst)RLC_DL_INST, cellIdx);
439 /**************************************************************************
440 * @brief Function to handle Config Confirm from RLC
444 * Function : DuHdlRlcCfgComplete
447 * Handles Gen Config Confirm from RLC
449 * @param[in] Pst *pst, Post structure of the primitive.
450 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC
451 * @return ROK - success
454 ***************************************************************************/
455 uint8_t DuHdlRlcCfgComplete(Pst *pst, RlcMngmt *cfm)
458 if (pst->srcInst == RLC_UL_INST)
460 ret = duProcRlcUlCfgComplete(pst, cfm);
464 ret = duProcRlcDlCfgComplete(pst, cfm);
469 /**************************************************************************
470 * @brief Function to handle Control Config Confirm from RLC
474 * Function : duHdlRlcCntrlCfgComplete
477 * Handles Control Config Confirm from RLC
479 * @param[in] Pst *pst, Post structure of the primitive.
480 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC
481 * @return ROK - success
484 ***************************************************************************/
485 uint8_t duHdlRlcCntrlCfgComplete(Pst *pst, RlcMngmt *cntrl)
489 if (cntrl->cfm.status == LCM_PRIM_OK)
491 switch (cntrl->hdr.elmId.elmnt)
495 if (pst->srcInst == RLC_DL_INST)
497 DU_LOG("\nDEBUG --> DU_APP : BIND OF RLC DL TO MAC (RGU) SAP SUCCESSFUL");
499 if(macCfgInst < DEFAULT_CELLS)
502 duBindUnbindRlcToMacSap((Inst) RLC_DL_INST, ABND);
506 duBindUnbindRlcToMacSap((Inst) RLC_UL_INST, ABND);
511 DU_LOG("\nDEBUG --> DU_APP : BIND OF RLC UL TO MAC (RGU) SAP SUCCESSFUL");
513 if(macCfgInst < DEFAULT_CELLS)
515 duBindUnbindRlcToMacSap((Inst) RLC_UL_INST, ABND);
529 /**************************************************************************
530 * @brief Function to handle Config Confirm from RLC UL
534 * Function : duHdlRlcUlCfgComplete
537 * Handles Config Confirm from RLC UL
539 * @param[in] Pst *pst, Post structure of the primitive.
540 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC UL
541 * @return ROK - success
544 ***************************************************************************/
545 uint8_t duProcRlcUlCfgComplete(Pst *pst, RlcMngmt *cfm)
549 DU_LOG("\nDEBUG --> DU_APP : RLC UL Cfg Status %d", cfm->cfm.status);
550 if (cfm->cfm.status == LCM_PRIM_OK)
552 switch(cfm->hdr.elmId.elmnt)
556 rlcUlCfg |= RLC_GEN_CFG;
562 if(numRlcMacSaps == DEFAULT_CELLS)
564 rlcUlCfg |= RLC_MAC_SAP_CFG;
571 rlcUlCfg |= RLC_UDX_SAP_CFG;
578 DU_LOG("\nDEBUG --> DU_APP : RLC UL Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
579 if(rlcUlCfg == DU_RLC_UL_CONFIGURED)
583 //Start configuration of RLC DL
590 DU_LOG("\nERROR --> DU_APP : Config confirm NOK from RLC UL");
596 /**************************************************************************
597 * @brief Function to handle Config Confirm from RLC DL
601 * Function : duHdlRlcDlCfgComplete
604 * Handles Config Confirm from RLC DL
606 * @param[in] Pst *pst, Post structure of the primitive.
607 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC DL
608 * @return ROK - success
611 ***************************************************************************/
612 uint8_t duProcRlcDlCfgComplete(Pst *pst, RlcMngmt *cfm)
614 DU_LOG("\nDEBUG --> DU_APP : RLC DL Cfg Status %d", cfm->cfm.status);
615 if (cfm->cfm.status == LCM_PRIM_OK)
617 switch(cfm->hdr.elmId.elmnt)
621 rlcDlCfg |= RLC_GEN_CFG;
627 if(numRlcMacSaps == DEFAULT_CELLS)
629 rlcDlCfg |= RLC_MAC_SAP_CFG;
636 rlcDlCfg |= RLC_UDX_SAP_CFG;
644 DU_LOG("\nDEBUG --> DU_APP : RLC DL Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
645 if(rlcDlCfg == DU_RLC_DL_CONFIGURED)
648 //Start configuration of MAC
655 DU_LOG("\nERROR --> DU_APP : Config confirm NOK from RLC DL");
660 /**************************************************************************
661 * @brief Function to send configs to MAC
665 * Function : duSendMacCfg
668 * Initiates Configs towards MAC layer
671 * @return ROK - success
674 ***************************************************************************/
675 uint8_t duSendMacCfg()
678 duBuildMacUsapCfg(RLC_UL_INST);
679 duBuildMacUsapCfg(RLC_DL_INST);
684 /**************************************************************************
685 * @brief Function to fill gen config required by MAC
689 * Function : duBuildMacGenCfg
692 * Initiates general Configs towards MAC
695 * @return ROK - success
698 ***************************************************************************/
699 uint8_t duBuildMacGenCfg()
702 RgGenCfg *genCfg=NULLP;
705 DU_SET_ZERO(&pst, sizeof(Pst));
706 DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
708 genCfg = &(rgMngmt.t.cfg.s.genCfg);
710 /*----------- Fill General Configuration Parameters ---------*/
711 genCfg->mem.region = MAC_MEM_REGION;
712 genCfg->mem.pool = MAC_POOL;
714 genCfg->numRguSaps = 2;
716 genCfg->lmPst.dstProcId = DU_PROC;
717 genCfg->lmPst.srcProcId = DU_PROC;
718 genCfg->lmPst.dstEnt = ENTDUAPP;
719 genCfg->lmPst.dstInst = 0;
720 genCfg->lmPst.srcEnt = ENTMAC;
721 genCfg->lmPst.srcInst = macCfgInst;
722 genCfg->lmPst.prior = PRIOR0;
723 genCfg->lmPst.route = RTESPEC;
724 genCfg->lmPst.region = MAC_MEM_REGION;
725 genCfg->lmPst.pool = MAC_POOL;
726 genCfg->lmPst.selector = ODU_SELECTOR_LC;
729 rgMngmt.hdr.msgType = TCFG;
730 rgMngmt.hdr.msgLen = 0;
731 rgMngmt.hdr.entId.ent = ENTMAC;
732 rgMngmt.hdr.entId.inst = (Inst)0;
733 rgMngmt.hdr.elmId.elmnt = STGEN;
734 rgMngmt.hdr.seqNmb = 0;
735 rgMngmt.hdr.version = 0;
736 rgMngmt.hdr.transId = 0;
738 rgMngmt.hdr.response.prior = PRIOR0;
739 rgMngmt.hdr.response.route = RTESPEC;
740 rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
741 rgMngmt.hdr.response.mem.pool = MAC_POOL;
742 rgMngmt.hdr.response.selector = ODU_SELECTOR_LC;
745 pst.selector = ODU_SELECTOR_LC;
746 pst.srcEnt = ENTDUAPP;
748 pst.dstInst = macCfgInst;
749 pst.dstProcId = DU_PROC;
750 pst.srcProcId = DU_PROC;
751 pst.region = duCb.init.region;
753 DU_LOG("\nDEBUG --> DU_APP : MAC Gen Cfg Req sent");
755 /* Send the request to MAC */
756 cmPkLrgCfgReq(&pst, &rgMngmt);
761 /**************************************************************************
762 * @brief Function to fill USAP config required by MAC
766 * Function : duBuildMacUsapCfg
769 * Initiates USAP Configs towards MAC
771 * @param[in] SpId Specifies if RLC UL or RLC DL instance
772 * @return ROK - success
775 ***************************************************************************/
776 uint8_t duBuildMacUsapCfg(SpId sapId)
779 RgUpSapCfg *uSap = NULLP;
782 DU_SET_ZERO(&pst, sizeof(Pst));
783 DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
785 uSap = &(rgMngmt.t.cfg.s.rguSap);
787 uSap->mem.region = MAC_MEM_REGION;
788 uSap->mem.pool = MAC_POOL;
791 uSap->procId = DU_PROC;
794 uSap->prior = PRIOR0;
795 uSap->route = RTESPEC;
796 uSap->selector = ODU_SELECTOR_LC ;
799 rgMngmt.hdr.msgType = TCFG;
800 rgMngmt.hdr.entId.ent = ENTMAC;
801 rgMngmt.hdr.entId.inst = (Inst)0;
802 rgMngmt.hdr.elmId.elmnt = STRGUSAP;
803 rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
804 rgMngmt.hdr.response.mem.pool = MAC_POOL;
807 pst.selector = ODU_SELECTOR_LC;
808 pst.srcEnt = ENTDUAPP;
810 pst.dstInst = macCfgInst;
811 pst.dstProcId = DU_PROC;
812 pst.srcProcId = DU_PROC;
813 pst.region = duCb.init.region;
815 DU_LOG("\nDEBUG --> DU_APP : MAC Rgu USap Cfg Req sent");
817 /* Send the request to MAC */
818 cmPkLrgCfgReq(&pst, &rgMngmt);
823 /**************************************************************************
824 * @brief Function to handle Config Confirm from MAC
828 * Function : duHdlMacCfgComplete
831 * Handles Gen Config Confirm from MAC
833 * @param[in] Pst *pst, Post structure of the primitive.
834 * @param[in] RgMngmt *cfm, Unpacked primitive info received from MAC
835 * @return ROK - success
838 ***************************************************************************/
839 uint8_t duHdlMacCfgComplete(Pst *pst, RgMngmt *cfm)
843 if (cfm->cfm.status == LCM_PRIM_OK)
845 switch (cfm->hdr.elmId.elmnt)
849 macCfg |= MAC_GEN_CFG;
854 macCfg |= MAC_SAP_CFG;
861 DU_LOG("\nDEBUG --> DU_APP : MAC Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
862 if(macCfg == MAC_CONFIGURED && numRlcMacSaps == MAX_MAC_SAP)
865 DU_LOG("\nDEBUG --> DU_APP : Completed sending Configs");
867 duBindUnbindRlcToMacSap(RLC_DL_INST, ABND);
873 DU_LOG("\nERROR --> DU_APP : Config confirm NOK from MAC");
879 /**************************************************************************
880 * @brief Function to bind/unbind RLC to MAC SAP
884 * Function : duBindUnbindRlcToMacSap
887 * Initiates Bind/Unbind from RLC to MAC
889 * @param[in] Inst Specifies if RLC UL or RLC DL instance
890 * @param[in] action Specifies if action is bind or unbind
891 * @return ROK - success
894 ***************************************************************************/
895 uint8_t duBindUnbindRlcToMacSap(uint8_t inst, uint8_t action)
897 RlcCntrl *cntrl = NULLP;
902 DU_SET_ZERO(&rlcMngmt, sizeof(RlcMngmt));
903 DU_SET_ZERO(&pst, sizeof(Pst));
907 DU_LOG("\nDEBUG --> DU_APP : Cntrl Req to RLC inst %d to bind MAC sap", inst);
911 DU_LOG("\nDEBUG --> DU_APP : Cntrl Req to RLC inst %d to unbind MAC sap", inst);
913 cntrl = &(rlcMngmt.t.cntrl);
915 cntrl->action = action;
916 cntrl->subAction = DU_ZERO_VAL;
917 cntrl->s.sapCntrl.suId = macCfgInst;
918 cntrl->s.sapCntrl.spId = inst;
921 rlcMngmt.hdr.msgType = TCNTRL;
922 rlcMngmt.hdr.entId.ent = ENTRLC;
923 rlcMngmt.hdr.entId.inst = inst;
924 rlcMngmt.hdr.elmId.elmnt = 186; /* ambiguous defines in lkw.h and lrg.h so direct hardcoded*/
925 rlcMngmt.hdr.response.mem.region = (inst == RLC_UL_INST) ?
926 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
927 rlcMngmt.hdr.response.mem.pool = RLC_POOL;
930 pst.selector = ODU_SELECTOR_LC;
931 pst.srcEnt = ENTDUAPP;
933 pst.dstProcId = DU_PROC;
935 pst.srcProcId = DU_PROC;
936 pst.region = duCb.init.region;
938 cmPkLkwCntrlReq(&pst, &rlcMngmt);
942 /*******************************************************************
944 * @brief Handles SCTP notifications
948 * Function : duSctpNtfyHdl
951 * Handles SCTP notification
953 * @params[in] Message Buffer
956 * @return ROK - success
959 * ****************************************************************/
961 uint8_t duSctpNtfyHdl(Buffer *mBuf, CmInetSctpNotification *ntfy)
963 if(f1Params.assocId == ntfy->u.assocChange.assocId)
965 if(BuildAndSendF1SetupReq() != ROK)
970 else if(ricParams.assocId == ntfy->u.assocChange.assocId)
972 if(BuildAndSendE2SetupReq() != ROK)
979 DU_LOG("\nERROR --> DU_APP : Invalid assocId %d received", ntfy->u.assocChange.assocId);
985 /*******************************************************************
987 * @brief Fills Pst struct for ENTEGTP
991 * Function : duFillEgtpPst
994 * Fills Pst struct for ENTEGTP
997 * @return ROK - success
1000 * ****************************************************************/
1001 uint8_t duFillEgtpPst(Pst *pst, Event event)
1003 memset(pst, 0, sizeof(Pst));
1004 pst->srcEnt = (Ent)ENTDUAPP;
1005 pst->srcInst = (Inst)DU_INST;
1006 pst->srcProcId = DU_PROC;
1007 pst->dstEnt = (Ent)ENTEGTP;
1008 pst->dstInst = (Inst)EGTP_INST;
1009 pst->dstProcId = pst->srcProcId;
1011 pst->selector = ODU_SELECTOR_LC;
1018 /*******************************************************************
1020 * @brief Function to configure EGTP
1024 * Function : duBuildEgtpCfgReq
1027 * Function to configure EGTP
1030 * @return ROK - success
1033 * ****************************************************************/
1035 uint8_t duBuildEgtpCfgReq()
1040 DU_LOG("\nDEBUG --> DU_APP : Sending EGTP config request");
1042 memset(&egtpCfg, 0, sizeof(EgtpConfig));
1043 memcpy(&egtpCfg, &duCfgParam.egtpParams, sizeof(EgtpConfig));
1045 duFillEgtpPst(&pst, EVTCFGREQ);
1046 packEgtpCfgReq(&pst, egtpCfg);
1051 /*******************************************************************
1053 * @brief Function to configure EGTP
1057 * Function : duBuildEgtpCfgReq
1060 * Function to configure EGTP
1063 * @return ROK - success
1066 * ****************************************************************/
1067 uint8_t duHdlEgtpCfgComplete(CmStatus cfm)
1071 if(cfm.status == LCM_PRIM_OK)
1073 DU_LOG("\nDEBUG --> DU_APP : EGTP configuraton complete");
1074 duSendEgtpSrvOpenReq();
1078 DU_LOG("\nERROR --> DU_APP : EGTP configuraton failed");
1085 /*******************************************************************
1087 * @brief Sends server open request to EGTP
1091 * Function : duSendEgtpSrvOpenReq
1094 * Sends server open request to EGTP
1097 * @return ROK - success
1100 * ****************************************************************/
1102 uint8_t duSendEgtpSrvOpenReq()
1106 DU_LOG("\nDEBUG --> DU_APP : Sending EGTP server open request");
1108 duFillEgtpPst(&pst, EVTSRVOPENREQ);
1109 packEgtpSrvOpenReq(&pst);
1114 /*******************************************************************
1116 * @brief Handles server open confirmation
1120 * Function : duHdlEgtpSrvOpenComplete
1123 * Handles server open confirmation
1126 * @return ROK - success
1129 *****************************************************************/
1131 uint8_t duHdlEgtpSrvOpenComplete(CmStatus cfm)
1135 if(cfm.status == LCM_PRIM_OK)
1137 DU_LOG("\nDEBUG --> DU_APP : EGTP server opened successfully");
1141 DU_LOG("\nERROR --> DU_APP : EGTP server opening failed");
1148 /*******************************************************************
1150 * @brief Sends tunnel management request
1154 * Function : duSendEgtpTnlMgmtReq
1157 * Builds and sends tunnel management request to EGTP
1159 * @params[in] Action
1160 * Local tunnel endpoint id
1161 * Remote tunnel endpoint id
1162 * @return ROK - success
1165 * ****************************************************************/
1167 uint8_t duSendEgtpTnlMgmtReq(uint8_t action, uint32_t teIdTobeMod, GtpTnlCfg *ueCbTnlCfg)
1173 DU_LOG("\nDEBUG --> DU_APP : Sending EGTP tunnel management request for teId [%d]", ueCbTnlCfg->teId);
1175 /* ADD/MOD/DEL per tunnel */
1176 tnlEvt.action = action;
1177 tnlEvt.remTeid = ueCbTnlCfg->teId;
1178 if(action != EGTP_TNL_MGMT_ADD)
1180 tnlEvt.lclTeid = teIdTobeMod;
1184 tnlEvt.lclTeid = ueCbTnlCfg->teId;
1186 duFillEgtpPst(&pst, EVTTNLMGMTREQ);
1187 ret = egtpTnlMgmtReq(&pst, tnlEvt);
1191 /*******************************************************************
1193 * @brief Handles Tunnel management confirm
1197 * Function : duHdlEgtpTnlMgmtCfm
1200 * Handles tunnel management confirm received from Egtp
1202 * @params[in] Tunnel Event
1203 * @return ROK - success
1206 * ****************************************************************/
1207 uint8_t duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm)
1211 if(tnlEvtCfm.cfmStatus.status == LCM_PRIM_OK)
1213 DU_LOG("\nDEBUG --> DU_APP: Tunnel management confirm OK");
1217 DU_LOG("\nERROR --> DU_APP: Tunnel management failed");
1224 /*******************************************************************
1226 * @brief Sends UL user data over to EGTP
1230 * Function : duSendEgtpDatInd
1232 * Functionality: Sends UL user data over to EGTP
1234 * @params[in] UL data buffer
1235 * @return ROK - success
1238 * ****************************************************************/
1239 uint8_t duSendEgtpDatInd(Buffer *mBuf)
1243 /* Fill EGTP header */
1244 egtpMsg.msgHdr.msgType = EGTPU_MSG_GPDU;
1245 egtpMsg.msgHdr.nPdu.pres = FALSE;
1246 egtpMsg.msgHdr.seqNum.pres = FALSE;
1247 egtpMsg.msgHdr.extHdr.udpPort.pres = FALSE;
1248 egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
1249 egtpMsg.msgHdr.teId = 1;
1252 egtpHdlDatInd(egtpMsg);
1258 /**************************************************************************
1259 * @brief Function to send configs to SCH
1263 * Function : duSendSchCfg
1266 * Sends general config to Scheduler via MAC layer
1269 * @return ROK - success
1272 ***************************************************************************/
1273 uint8_t duSendSchCfg()
1276 RgSchInstCfg *cfg = NULLP;
1279 DU_SET_ZERO(&pst, sizeof(Pst));
1280 DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
1282 cfg = &(rgMngmt.t.cfg.s.schInstCfg);
1284 /* Filling of Instance Id */
1285 cfg->instId = DEFAULT_CELLS + 1;
1286 /* Filling of Gen config */
1287 cfg->genCfg.mem.region = MAC_MEM_REGION;
1288 cfg->genCfg.mem.pool = MAC_POOL;
1289 cfg->genCfg.tmrRes = 10;
1292 cfg->genCfg.forceCntrlSrbBoOnPCel = FALSE;
1293 cfg->genCfg.isSCellActDeactAlgoEnable = TRUE;
1295 cfg->genCfg.startCellId = 1;
1296 cfg->genCfg.lmPst.dstProcId = DU_PROC;
1297 cfg->genCfg.lmPst.srcProcId = DU_PROC;
1298 cfg->genCfg.lmPst.dstEnt = ENTDUAPP;
1299 cfg->genCfg.lmPst.dstInst = DU_INST;
1300 cfg->genCfg.lmPst.srcEnt = ENTMAC;
1301 cfg->genCfg.lmPst.srcInst = DEFAULT_CELLS + 1;
1302 cfg->genCfg.lmPst.prior = PRIOR0;
1303 cfg->genCfg.lmPst.route = RTESPEC;
1304 cfg->genCfg.lmPst.region = MAC_MEM_REGION;
1305 cfg->genCfg.lmPst.pool = MAC_POOL;
1306 cfg->genCfg.lmPst.selector = ODU_SELECTOR_LC;
1309 rgMngmt.hdr.msgType = TCFG;
1310 rgMngmt.hdr.entId.ent = ENTMAC;
1311 rgMngmt.hdr.entId.inst = DU_INST;
1312 rgMngmt.hdr.elmId.elmnt = STSCHINST;
1313 rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
1314 rgMngmt.hdr.response.mem.pool = MAC_POOL;
1317 pst.selector = ODU_SELECTOR_LC;
1318 pst.srcEnt = ENTDUAPP;
1319 pst.dstEnt = ENTMAC;
1320 pst.dstProcId = DU_PROC;
1321 pst.srcProcId = DU_PROC;
1322 pst.srcInst = DU_INST;
1324 pst.region = duCb.init.region;
1325 pst.event = (Event) EVTMACSCHGENCFGREQ;
1327 DU_LOG("\nDEBUG --> DU_APP : MAC Sch Cfg sent");
1329 /* Send the request to MAC */
1330 cmPkLrgSchCfgReq(&pst, &rgMngmt);
1336 /**************************************************************************
1337 * @brief Function to configure SCTP params and
1338 * responsible for F1 and E2 interfaces
1342 * Function : duLayerConfigComplete
1345 * Configures SCTP Params and responsible for handling
1346 * F1 and E2 interface.
1349 * @return ROK - success
1352 ***************************************************************************/
1353 uint8_t duLayerConfigComplete()
1357 DU_LOG("\nINFO --> DU_APP : Configuring all Layer is complete");
1359 if((ret = duSctpCfgReq(duCfgParam.sctpParams)) != ROK)
1361 DU_LOG("\nERROR --> DU_APP : Failed configuring Sctp Params");
1364 if((ret = duSctpAssocReq(F1_INTERFACE)) != ROK)
1366 DU_LOG("\nERROR --> DU_APP : Failed to send AssocReq F1");
1369 if((ret = duSctpAssocReq(E2_INTERFACE)) != ROK)
1371 DU_LOG("\nERROR --> DU_APP : Failed to send AssocReq E2");
1378 /**************************************************************************
1379 * @brief Function to handle SCH Config Confirm from MAC
1383 * Function : duHdlSchCfgComplete
1386 * Handles Scheduler Gen Config Confirm from MAC
1388 * @param[in] Pst *pst, Post structure of the primitive.
1389 * @param[in] RgMngmt *cfm, Unpacked primitive info received from MAC
1390 * @return ROK - success
1393 ***************************************************************************/
1394 uint8_t duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm)
1396 if (cfm->cfm.status == LCM_PRIM_OK)
1398 switch (cfm->hdr.elmId.elmnt)
1402 DU_LOG("\nDEBUG --> DU_APP : Received SCH CFG CFM at DU APP");
1409 duLayerConfigComplete();
1410 duBuildEgtpCfgReq();
1414 /**************************************************************************
1415 * @brief Function to fill and send MacCellconfig
1419 * Function : duBuildAndSendMacCellCfg
1422 * Initiates MAC Configs towards MAC
1425 * @return ROK - success
1428 ***************************************************************************/
1429 uint8_t duBuildAndSendMacCellCfg(uint16_t cellId)
1432 MacCellCfg *duMacCellCfg = NULLP;
1434 DU_ALLOC_SHRABL_BUF(duMacCellCfg, sizeof(MacCellCfg));
1435 if(duMacCellCfg == NULLP)
1440 /* store the address in the duCellCb so that we can free on confirm msg */
1441 duCb.actvCellLst[cellId-1]->duMacCellCfg = duMacCellCfg;
1443 /* copy the mac config structure from duCfgParams */
1444 memcpy(duMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
1447 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_CONFIG_REQ);
1449 /* Send MAC cell config to MAC */
1450 return (*packMacCellCfgOpts[pst.selector])(&pst, duMacCellCfg);
1453 /**************************************************************************
1454 * @brief Function to Handle MAC cell config confirm
1458 * Function : duHandleMacCellCfgCfm
1461 * Initiates general Configs towards MAC
1464 * @return ROK - success
1467 ***************************************************************************/
1468 uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
1470 uint8_t actvCellIdx = 0;
1473 for(actvCellIdx = 0; actvCellIdx < MAX_NUM_CELL; actvCellIdx++)
1475 if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
1477 duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP;
1480 if(macCellCfgCfm->rsp == ROK)
1482 /* Build and send GNB-DU config update */
1483 ret = BuildAndSendDUConfigUpdate(SERV_CELL_TO_MODIFY);
1485 /* Build and Send Cell Start Req to MAC */
1486 ret = duBuildAndSendMacCellStart();
1490 /* TODO : Action to be taken if cell configuration fails.
1491 * Should CU be informed? */
1493 DU_LOG("\nERROR --> DU_APP : Mac cell cfg failed");
1499 /*******************************************************************
1501 * @brief Builds and sends cell start request to MAC
1505 * Function : duBuildAndSendMacCellStart
1508 * Builds and sends cell start request to MAC
1511 * @return ROK - success
1514 * ****************************************************************/
1515 uint8_t duBuildAndSendMacCellStart()
1518 OduCellId *cellId = NULL;
1520 DU_LOG("\nINFO --> DU APP : Building and Sending cell start request to MAC");
1522 /* Send Cell Start Request to MAC */
1523 DU_ALLOC_SHRABL_BUF(cellId, sizeof(OduCellId));
1526 DU_LOG("\nERROR --> DU APP : Memory alloc failed while building cell start request");
1530 for(uint8_t id = 0; id < duCb.numActvCells; id++)
1532 if(duCb.actvCellLst[id])
1534 cellId->cellId = duCb.actvCellLst[id]->cellId;
1537 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_START);
1539 return (*packMacCellStartOpts[pst.selector])(&pst, cellId);
1545 /*******************************************************************
1547 * @brief Builds and sends cell stop request to MAC
1551 * Function : duBuildAndSendMacCellStop
1554 * Builds and sends cell stop request to MAC
1557 * @return ROK - success
1560 * ****************************************************************/
1561 uint8_t duBuildAndSendMacCellStop(uint16_t cellId)
1565 OduCellId *oduCellId = NULL;
1567 DU_LOG("\nINFO --> DU APP : Building and Sending cell stop request to MAC");
1569 GET_CELL_IDX(cellId, cellIdx);
1570 if(duCb.actvCellLst[cellIdx] != NULLP)
1572 /* Send Cell Stop Request to MAC */
1573 DU_ALLOC_SHRABL_BUF(oduCellId, sizeof(OduCellId));
1576 DU_LOG("\nERROR --> DU APP : duBuildAndSendMacCellStop(): Memory allocation failed ");
1579 memset(oduCellId, 0, sizeof(OduCellId));
1580 oduCellId->cellId = duCb.actvCellLst[cellIdx]->cellId;
1583 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP);
1585 return (*packMacCellStopOpts[pst.selector])(&pst, oduCellId);
1589 DU_LOG("\nERROR --> DU APP : duBuildAndSendMacCellStop(): cellId[%d] doesnot exists", cellId);
1595 /*******************************************************************
1597 * @brief Handles stop indication from MAC
1601 * Function : duHandleStopInd
1604 * Handles stop indication from MAC
1606 * @params[in] Post structure pointer
1607 * @return ROK - success
1610 * ****************************************************************/
1611 uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId)
1613 DuCellCb *cellCb = NULLP;
1615 if(cellId->cellId <=0 || cellId->cellId > MAX_NUM_CELL)
1617 DU_LOG("\nERROR --> DU APP : Invalid Cell Id %d in duHandleStopInd()", cellId->cellId);
1620 if(duGetCellCb(cellId->cellId, &cellCb) != ROK)
1623 if((cellCb->cellStatus == ACTIVATED) || (cellCb->cellStatus == DELETION_IN_PROGRESS))
1625 DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is DOWN", cellId->cellId);
1626 if(sendCellDeleteReqToMac(cellId->cellId) == RFAILED)
1628 DU_LOG("\nERROR --> DU APP : duHandleStopInd(): Failed to send Cell delete req to MAC for\
1629 cellId[%d]", cellId->cellId);
1635 DU_LOG("\nINFO --> DU APP : Raise cell down alarm for cell id=%d", cellId->cellId);
1636 raiseCellAlrm(CELL_DOWN_ALARM_ID, cellId->cellId);
1637 setCellOpState(cellId->cellId, DISABLED, INACTIVE);
1641 if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC))
1642 DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, cellId, sizeof(OduCellId));
1644 cellCb->cellStatus = CELL_OUT_OF_SERVICE; //TODO: cell status must be set to OOS after all UE and cell cleanup which is not
1650 /*******************************************************************
1652 * @brief Handles slot indication from MAC
1656 * Function : duHandleUlCcchInd
1659 * Handles UL CCCH indication from MAC
1661 * @params[in] Post structure pointer
1662 * UL CCCH Ind pointer
1663 * @return ROK - success
1666 * ****************************************************************/
1667 uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
1670 DU_LOG("\nINFO --> DU APP : UL CCCH Indication received");
1672 return (duProcUlCcchInd(ulCcchIndInfo));
1675 /*******************************************************************
1677 * @brief Process UL RRC Message from RLC
1681 * Function : DuProcRlcUlRrcMsgTrans
1683 * Functionality: Process UL RRC Message from RLC
1685 * @params[in] Post structure
1686 * UL RRC Message Info
1687 * @return ROK - success
1690 * ****************************************************************/
1691 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
1693 DuCellCb *cellCb = NULLP;
1696 if(duGetCellCb(ulRrcMsgInfo->cellId, &cellCb) != ROK)
1698 if(ulRrcMsgInfo->ueIdx > 0)
1700 ueCb = cellCb->ueCb[ulRrcMsgInfo->ueIdx -1];
1703 BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, \
1704 ulRrcMsgInfo->rrcMsg);
1706 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo->rrcMsg, ulRrcMsgInfo->msgLen);
1707 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
1712 /*******************************************************************
1714 * @brief Process RRC delivery report from RLC
1718 * Function : DuProcRlcRrcDeliveryReport
1720 * Functionality: Process RRC delivery Message from RLC
1722 * @params[in] Post structure
1723 * UL RRC Message Info
1724 * @return ROK - success
1727 * ****************************************************************/
1728 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport)
1730 DuCellCb *cellCb = NULLP;
1732 uint8_t ret = RFAILED;
1734 if(duGetCellCb(rrcDeliveryReport->cellId, &cellCb) != ROK)
1737 ueCb = cellCb->ueCb[rrcDeliveryReport->ueIdx -1];
1738 ret = BuildAndSendRrcDeliveryReport(ueCb.gnbCuUeF1apId, ueCb.gnbDuUeF1apId,rrcDeliveryReport);
1740 DU_FREE_SHRABL_BUF(pst->region, pst->pool, rrcDeliveryReport, sizeof(RrcDeliveryReport));
1744 /*******************************************************************
1746 * @brief Process UL user data from RLC
1750 * Function : DuProcRlcUlUserDataTrans
1752 * Functionality: Process UL user data from RLC
1754 * @params[in] Post structure
1756 * @return ROK - success
1759 * ****************************************************************/
1760 uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData)
1766 DU_LOG("\nDEBUG --> DU APP : Received UL user data");
1768 /* Fill EGTP header */
1769 egtpMsg.msgHdr.msgType = EGTPU_MSG_GPDU;
1770 egtpMsg.msgHdr.nPdu.pres = FALSE;
1771 egtpMsg.msgHdr.seqNum.pres = FALSE;
1772 egtpMsg.msgHdr.extHdr.udpPort.pres = FALSE;
1773 egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
1775 /* Fetch EGTP tunnel info */
1776 for(rbIdx = 0; rbIdx < duCb.numDrb; rbIdx++)
1778 if((duCb.upTnlCfg[rbIdx] != NULLP) && (duCb.upTnlCfg[rbIdx]->ueIdx == ulUserData->ueIdx) && \
1779 (duCb.upTnlCfg[rbIdx]->drbId == ulUserData->rbId))
1781 if(duCb.upTnlCfg[rbIdx]->tnlCfg1)
1783 egtpMsg.msgHdr.teId = duCb.upTnlCfg[rbIdx]->tnlCfg1->teId; /*As we are supporting only 1 tunnel per DRB*/
1789 if (ODU_GET_MSG_BUF(DU_APP_MEM_REGION, DU_POOL, &mBuf) != ROK)
1791 DU_LOG("\nERROR --> DU APP : Failed to allocated buffer memory in DuProcRlcUlUserDataTrans");
1792 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulUserData->userData, ulUserData->msgLen);
1793 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulUserData, sizeof(RlcUlUserDatInfo));
1796 oduCpyFixBufToMsg(ulUserData->userData, mBuf, ulUserData->msgLen);
1797 ODU_PRINT_MSG(mBuf, 0, 0);
1799 egtpHdlDatInd(egtpMsg);
1801 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulUserData->userData, ulUserData->msgLen);
1802 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulUserData, sizeof(RlcUlUserDatInfo));
1806 /**********************************************************************
1808 **********************************************************************/