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"
39 #include "lphy_stub.h"
41 #include "du_cell_mgr.h"
45 #include "AlarmInterface.h"
46 #include "ConfigInterface.h"
51 uint8_t numRlcDlSaps = 0;
53 uint8_t numRlcMacSaps = 0;
55 uint8_t macCfgInst = 0;
57 DuCfgParams duCfgParam;
58 uint8_t packRlcConfigReq(Pst *pst, RlcMngmt *cfg);
59 uint8_t cmPkLkwCntrlReq(Pst *pst, RlcMngmt *cfg);
60 uint8_t cmPkLrgCfgReq(Pst *pst, RgMngmt *cfg);
61 uint8_t BuildAndSendE2SetupReq();
62 uint8_t egtpHdlDatInd(EgtpMsg egtpMsg);
63 uint8_t BuildAndSendDUConfigUpdate();
64 uint16_t getTransId();
65 uint8_t cmPkLrgSchCfgReq(Pst * pst,RgMngmt * cfg);
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()
333 static uint16_t cellId = 0;
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 = NR_CELL_ID;
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;
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");
1075 duSendEgtpSrvOpenReq();
1080 DU_LOG("\nERROR --> DU_APP : EGTP configuraton failed");
1087 /*******************************************************************
1089 * @brief Sends server open request to EGTP
1093 * Function : duSendEgtpSrvOpenReq
1096 * Sends server open request to EGTP
1099 * @return ROK - success
1102 * ****************************************************************/
1104 uint8_t duSendEgtpSrvOpenReq()
1108 DU_LOG("\nDEBUG --> DU_APP : Sending EGTP server open request");
1110 duFillEgtpPst(&pst, EVTSRVOPENREQ);
1111 packEgtpSrvOpenReq(&pst);
1116 /*******************************************************************
1118 * @brief Handles server open confirmation
1122 * Function : duHdlEgtpSrvOpenComplete
1125 * Handles server open confirmation
1128 * @return ROK - success
1131 *****************************************************************/
1133 uint8_t duHdlEgtpSrvOpenComplete(CmStatus cfm)
1137 if(cfm.status == LCM_PRIM_OK)
1139 DU_LOG("\nDEBUG --> DU_APP : EGTP server opened successfully");
1143 DU_LOG("\nERROR --> DU_APP : EGTP server opening failed");
1150 /*******************************************************************
1152 * @brief Sends tunnel management request
1156 * Function : duSendEgtpTnlMgmtReq
1159 * Builds and sends tunnel management request to EGTP
1161 * @params[in] Action
1162 * Local tunnel endpoint id
1163 * Remote tunnel endpoint id
1164 * @return ROK - success
1167 * ****************************************************************/
1169 uint8_t duSendEgtpTnlMgmtReq(uint8_t action, uint32_t teIdTobeMod, GtpTnlCfg *ueCbTnlCfg)
1175 DU_LOG("\nDEBUG --> DU_APP : Sending EGTP tunnel management request for teId [%d]", ueCbTnlCfg->teId);
1177 /* ADD/MOD/DEL per tunnel */
1178 tnlEvt.action = action;
1179 tnlEvt.remTeid = ueCbTnlCfg->teId;
1180 if(action != EGTP_TNL_MGMT_ADD)
1182 tnlEvt.lclTeid = teIdTobeMod;
1186 tnlEvt.lclTeid = ueCbTnlCfg->teId;
1188 duFillEgtpPst(&pst, EVTTNLMGMTREQ);
1189 ret = egtpTnlMgmtReq(&pst, tnlEvt);
1193 /*******************************************************************
1195 * @brief Handles Tunnel management confirm
1199 * Function : duHdlEgtpTnlMgmtCfm
1202 * Handles tunnel management confirm received from Egtp
1204 * @params[in] Tunnel Event
1205 * @return ROK - success
1208 * ****************************************************************/
1209 uint8_t duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm)
1213 if(tnlEvtCfm.cfmStatus.status == LCM_PRIM_OK)
1215 DU_LOG("\nDEBUG --> DU_APP: Tunnel management confirm OK");
1219 DU_LOG("\nERROR --> DU_APP: Tunnel management failed");
1226 /*******************************************************************
1228 * @brief Sends UL user data over to EGTP
1232 * Function : duSendEgtpDatInd
1234 * Functionality: Sends UL user data over to EGTP
1236 * @params[in] UL data buffer
1237 * @return ROK - success
1240 * ****************************************************************/
1241 uint8_t duSendEgtpDatInd(Buffer *mBuf)
1245 /* Fill EGTP header */
1246 egtpMsg.msgHdr.msgType = EGTPU_MSG_GPDU;
1247 egtpMsg.msgHdr.nPdu.pres = FALSE;
1248 egtpMsg.msgHdr.seqNum.pres = FALSE;
1249 egtpMsg.msgHdr.extHdr.udpPort.pres = FALSE;
1250 egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
1251 egtpMsg.msgHdr.teId = 1;
1254 egtpHdlDatInd(egtpMsg);
1260 /**************************************************************************
1261 * @brief Function to send configs to SCH
1265 * Function : duSendSchCfg
1268 * Sends general config to Scheduler via MAC layer
1271 * @return ROK - success
1274 ***************************************************************************/
1275 uint8_t duSendSchCfg()
1278 RgSchInstCfg *cfg = NULLP;
1281 DU_SET_ZERO(&pst, sizeof(Pst));
1282 DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
1284 cfg = &(rgMngmt.t.cfg.s.schInstCfg);
1286 /* Filling of Instance Id */
1287 cfg->instId = DEFAULT_CELLS + 1;
1288 /* Filling of Gen config */
1289 cfg->genCfg.mem.region = MAC_MEM_REGION;
1290 cfg->genCfg.mem.pool = MAC_POOL;
1291 cfg->genCfg.tmrRes = 10;
1294 cfg->genCfg.forceCntrlSrbBoOnPCel = FALSE;
1295 cfg->genCfg.isSCellActDeactAlgoEnable = TRUE;
1297 cfg->genCfg.startCellId = 1;
1298 cfg->genCfg.lmPst.dstProcId = DU_PROC;
1299 cfg->genCfg.lmPst.srcProcId = DU_PROC;
1300 cfg->genCfg.lmPst.dstEnt = ENTDUAPP;
1301 cfg->genCfg.lmPst.dstInst = DU_INST;
1302 cfg->genCfg.lmPst.srcEnt = ENTMAC;
1303 cfg->genCfg.lmPst.srcInst = DEFAULT_CELLS + 1;
1304 cfg->genCfg.lmPst.prior = PRIOR0;
1305 cfg->genCfg.lmPst.route = RTESPEC;
1306 cfg->genCfg.lmPst.region = MAC_MEM_REGION;
1307 cfg->genCfg.lmPst.pool = MAC_POOL;
1308 cfg->genCfg.lmPst.selector = ODU_SELECTOR_LC;
1311 rgMngmt.hdr.msgType = TCFG;
1312 rgMngmt.hdr.entId.ent = ENTMAC;
1313 rgMngmt.hdr.entId.inst = DU_INST;
1314 rgMngmt.hdr.elmId.elmnt = STSCHINST;
1315 rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
1316 rgMngmt.hdr.response.mem.pool = MAC_POOL;
1319 pst.selector = ODU_SELECTOR_LC;
1320 pst.srcEnt = ENTDUAPP;
1321 pst.dstEnt = ENTMAC;
1322 pst.dstProcId = DU_PROC;
1323 pst.srcProcId = DU_PROC;
1324 pst.srcInst = DU_INST;
1326 pst.region = duCb.init.region;
1327 pst.event = (Event) EVTMACSCHGENCFGREQ;
1329 DU_LOG("\nDEBUG --> DU_APP : MAC Sch Cfg sent");
1331 /* Send the request to MAC */
1332 cmPkLrgSchCfgReq(&pst, &rgMngmt);
1338 /**************************************************************************
1339 * @brief Function to configure SCTP params and
1340 * responsible for F1 and E2 interfaces
1344 * Function : duLayerConfigComplete
1347 * Configures SCTP Params and responsible for handling
1348 * F1 and E2 interface.
1351 * @return ROK - success
1354 ***************************************************************************/
1355 uint8_t duLayerConfigComplete()
1359 DU_LOG("\nINFO --> DU_APP : Configuring all Layer is complete");
1361 if((ret = duSctpCfgReq(duCfgParam.sctpParams)) != ROK)
1363 DU_LOG("\nERROR --> DU_APP : Failed configuring Sctp Params");
1366 if((ret = duSctpAssocReq(F1_INTERFACE)) != ROK)
1368 DU_LOG("\nERROR --> DU_APP : Failed to send AssocReq F1");
1371 if((ret = duSctpAssocReq(E2_INTERFACE)) != ROK)
1373 DU_LOG("\nERROR --> DU_APP : Failed to send AssocReq E2");
1380 /**************************************************************************
1381 * @brief Function to handle SCH Config Confirm from MAC
1385 * Function : duHdlSchCfgComplete
1388 * Handles Scheduler Gen Config Confirm from MAC
1390 * @param[in] Pst *pst, Post structure of the primitive.
1391 * @param[in] RgMngmt *cfm, Unpacked primitive info received from MAC
1392 * @return ROK - success
1395 ***************************************************************************/
1396 uint8_t duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm)
1398 if (cfm->cfm.status == LCM_PRIM_OK)
1400 switch (cfm->hdr.elmId.elmnt)
1404 DU_LOG("\nDEBUG --> DU_APP : Received SCH CFG CFM at DU APP");
1411 duLayerConfigComplete();
1412 duBuildEgtpCfgReq();
1416 /**************************************************************************
1417 * @brief Function to fill and send MacCellconfig
1421 * Function : duBuildAndSendMacCellCfg
1424 * Initiates MAC Configs towards MAC
1427 * @return ROK - success
1430 ***************************************************************************/
1431 uint8_t duBuildAndSendMacCellCfg(uint16_t cellId)
1434 MacCellCfg *duMacCellCfg = NULLP;
1436 DU_ALLOC_SHRABL_BUF(duMacCellCfg, sizeof(MacCellCfg));
1437 if(duMacCellCfg == NULLP)
1442 /* store the address in the duCellCb so that we can free on confirm msg */
1443 duCb.actvCellLst[cellId-1]->duMacCellCfg = duMacCellCfg;
1445 /* copy the mac config structure from duCfgParams */
1446 memcpy(duMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
1449 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_CONFIG_REQ);
1451 /* Send MAC cell config to MAC */
1452 return (*packMacCellCfgOpts[pst.selector])(&pst, duMacCellCfg);
1455 /**************************************************************************
1456 * @brief Function to Handle MAC cell config confirm
1460 * Function : duHandleMacCellCfgCfm
1463 * Initiates general Configs towards MAC
1466 * @return ROK - success
1469 ***************************************************************************/
1470 uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
1472 uint8_t actvCellIdx = 0;
1475 for(actvCellIdx = 0; actvCellIdx < MAX_NUM_CELL; actvCellIdx++)
1477 if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
1479 duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP;
1482 if(macCellCfgCfm->rsp == ROK)
1484 /* Build and send GNB-DU config update */
1485 ret = BuildAndSendDUConfigUpdate();
1487 /* Build and Send Cell Start Req to MAC */
1488 ret = duBuildAndSendMacCellStart();
1492 /* TODO : Action to be taken if cell configuration fails.
1493 * Should CU be informed? */
1495 DU_LOG("\nERROR --> DU_APP : Mac cell cfg failed");
1501 /*******************************************************************
1503 * @brief Builds and sends cell start request to MAC
1507 * Function : duBuildAndSendMacCellStart
1510 * Builds and sends cell start request to MAC
1513 * @return ROK - success
1516 * ****************************************************************/
1517 uint8_t duBuildAndSendMacCellStart()
1520 OduCellId *cellId = NULL;
1522 DU_LOG("\nINFO --> DU APP : Building and Sending cell start request to MAC");
1524 /* Send Cell Start Request to MAC */
1525 DU_ALLOC_SHRABL_BUF(cellId, sizeof(OduCellId));
1528 DU_LOG("\nERROR --> DU APP : Memory alloc failed while building cell start request");
1532 for(uint8_t id = 0; id < duCb.numActvCells; id++)
1534 if(duCb.actvCellLst[id])
1536 cellId->cellId = duCb.actvCellLst[id]->cellId;
1539 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_START);
1541 return (*packMacCellStartOpts[pst.selector])(&pst, cellId);
1547 /*******************************************************************
1549 * @brief Builds and sends cell stop request to MAC
1553 * Function : duBuildAndSendMacCellStop
1556 * Builds and sends cell stop request to MAC
1559 * @return ROK - success
1562 * ****************************************************************/
1563 uint8_t duBuildAndSendMacCellStop(uint16_t cellId)
1567 OduCellId *oduCellId = NULL;
1569 DU_LOG("\nINFO --> DU APP : Building and Sending cell stop request to MAC");
1571 GET_CELL_IDX(cellId, cellIdx);
1572 if(duCb.actvCellLst[cellIdx] != NULLP)
1574 /* Send Cell Stop Request to MAC */
1575 DU_ALLOC_SHRABL_BUF(oduCellId, sizeof(OduCellId));
1578 DU_LOG("\nERROR --> DU APP : duBuildAndSendMacCellStop(): Memory allocation failed ");
1582 oduCellId->cellId = duCb.actvCellLst[cellIdx]->cellId;
1585 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP);
1587 return (*packMacCellStopOpts[pst.selector])(&pst, oduCellId);
1591 DU_LOG("\nERROR --> DU APP : duBuildAndSendMacCellStop(): cellId[%d] doesnot exists", cellId);
1597 /*******************************************************************
1599 * @brief Handles stop indication from MAC
1603 * Function : duHandleStopInd
1606 * Handles stop indication from MAC
1608 * @params[in] Post structure pointer
1609 * @return ROK - success
1612 * ****************************************************************/
1613 uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId)
1615 DuCellCb *cellCb = NULLP;
1617 if(cellId->cellId <=0 || cellId->cellId > MAX_NUM_CELL)
1619 DU_LOG("\nERROR --> DU APP : Invalid Cell Id %d in duHandleStopInd()", cellId->cellId);
1622 if(duGetCellCb(cellId->cellId, &cellCb) != ROK)
1625 if((cellCb->cellStatus == ACTIVATED))
1627 DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is DOWN", cellId->cellId);
1628 cellCb->cellStatus = DELETION_IN_PROGRESS;
1631 DU_LOG("\nINFO --> DU APP : Raise cell down alarm for cell id=%d", cellId->cellId);
1632 raiseCellAlrm(CELL_DOWN_ALARM_ID, cellId->cellId);
1633 setCellOpState(cellId->cellId, DISABLED, INACTIVE);
1637 if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC))
1638 DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, cellId, sizeof(OduCellId));
1640 cellCb->cellStatus = CELL_OUT_OF_SERVICE; //TODO: cell status must be set to OOS after all UE and cell cleanup which is not
1646 /*******************************************************************
1648 * @brief Handles slot indication from MAC
1652 * Function : duHandleUlCcchInd
1655 * Handles UL CCCH indication from MAC
1657 * @params[in] Post structure pointer
1658 * UL CCCH Ind pointer
1659 * @return ROK - success
1662 * ****************************************************************/
1663 uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
1666 DU_LOG("\nINFO --> DU APP : UL CCCH Indication received");
1668 return (duProcUlCcchInd(ulCcchIndInfo));
1671 /*******************************************************************
1673 * @brief Process UL RRC Message from RLC
1677 * Function : DuProcRlcUlRrcMsgTrans
1679 * Functionality: Process UL RRC Message from RLC
1681 * @params[in] Post structure
1682 * UL RRC Message Info
1683 * @return ROK - success
1686 * ****************************************************************/
1687 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
1689 DuCellCb *cellCb = NULLP;
1692 if(duGetCellCb(ulRrcMsgInfo->cellId, &cellCb) != ROK)
1694 if(ulRrcMsgInfo->ueIdx > 0)
1696 ueCb = cellCb->ueCb[ulRrcMsgInfo->ueIdx -1];
1699 BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, \
1700 ulRrcMsgInfo->rrcMsg);
1702 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo->rrcMsg, ulRrcMsgInfo->msgLen);
1703 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
1708 /*******************************************************************
1710 * @brief Process RRC delivery report from RLC
1714 * Function : DuProcRlcRrcDeliveryReport
1716 * Functionality: Process RRC delivery Message from RLC
1718 * @params[in] Post structure
1719 * UL RRC Message Info
1720 * @return ROK - success
1723 * ****************************************************************/
1724 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport)
1726 DuCellCb *cellCb = NULLP;
1728 uint8_t ret = RFAILED;
1730 if(duGetCellCb(rrcDeliveryReport->cellId, &cellCb) != ROK)
1733 ueCb = cellCb->ueCb[rrcDeliveryReport->ueIdx -1];
1734 ret = BuildAndSendRrcDeliveryReport(ueCb.gnbCuUeF1apId, ueCb.gnbDuUeF1apId,rrcDeliveryReport);
1736 DU_FREE_SHRABL_BUF(pst->region, pst->pool, rrcDeliveryReport, sizeof(RrcDeliveryReport));
1740 /*******************************************************************
1742 * @brief Process UL user data from RLC
1746 * Function : DuProcRlcUlUserDataTrans
1748 * Functionality: Process UL user data from RLC
1750 * @params[in] Post structure
1752 * @return ROK - success
1755 * ****************************************************************/
1756 uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData)
1762 DU_LOG("\nDEBUG --> DU APP : Received UL user data");
1764 /* Fill EGTP header */
1765 egtpMsg.msgHdr.msgType = EGTPU_MSG_GPDU;
1766 egtpMsg.msgHdr.nPdu.pres = FALSE;
1767 egtpMsg.msgHdr.seqNum.pres = FALSE;
1768 egtpMsg.msgHdr.extHdr.udpPort.pres = FALSE;
1769 egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
1771 /* Fetch EGTP tunnel info */
1772 for(rbIdx = 0; rbIdx < duCb.numDrb; rbIdx++)
1774 if((duCb.upTnlCfg[rbIdx] != NULLP) && (duCb.upTnlCfg[rbIdx]->drbId == ulUserData->rbId))
1776 if(duCb.upTnlCfg[rbIdx]->tnlCfg1)
1778 egtpMsg.msgHdr.teId = duCb.upTnlCfg[rbIdx]->tnlCfg1->teId; /*As we are supporting only 1 tunnel per DRB*/
1784 if (ODU_GET_MSG_BUF(DU_APP_MEM_REGION, DU_POOL, &mBuf) != ROK)
1786 DU_LOG("\nERROR --> DU APP : Failed to allocated buffer memory in DuProcRlcUlUserDataTrans");
1787 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulUserData->userData, ulUserData->msgLen);
1788 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulUserData, sizeof(RlcUlUserDatInfo));
1791 oduCpyFixBufToMsg(ulUserData->userData, mBuf, ulUserData->msgLen);
1792 ODU_PRINT_MSG(mBuf, 0, 0);
1794 egtpHdlDatInd(egtpMsg);
1796 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulUserData->userData, ulUserData->msgLen);
1797 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulUserData, sizeof(RlcUlUserDatInfo));
1801 /**********************************************************************
1803 **********************************************************************/