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 "GlobalDefs.h"
46 #include "AlarmInterface.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("\nDU_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("\nDU_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("\nDU_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("\nDU_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("\nDU_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;
370 duCb.cfgCellLst[duCb.numCfgCells] = cell;
376 //Start layer configs
377 ret = duSendRlcUlCfg();
381 /**************************************************************************
382 * @brief Function to invoke DU Layer Configs
386 * Function : duSendRlcUlCfg
389 * Initiates Configs towards layers of DU
392 * @return ROK - success
395 ***************************************************************************/
396 uint8_t duSendRlcUlCfg()
400 duBuildRlcCfg((Inst)RLC_UL_INST);
401 for(cellIdx = 0; cellIdx < DEFAULT_CELLS; cellIdx++)
403 duBuildRlcLsapCfg(ENTMAC, (Inst)RLC_UL_INST, cellIdx);
405 duBuildRlcLsapCfg(ENTRLC, (Inst)RLC_UL_INST, 0);
410 /**************************************************************************
411 * @brief Function to invoke DU Layer Configs
415 * Function : duSendRlcDlCfg
418 * Initiates Configs towards layers of DU
421 * @return ROK - success
424 ***************************************************************************/
425 uint8_t duSendRlcDlCfg()
429 duBuildRlcCfg((Inst)RLC_DL_INST);
430 duBuildRlcUsapCfg(STUDXSAP, ENTRLC, (Inst)RLC_DL_INST);
431 for(cellIdx = 0; cellIdx < DEFAULT_CELLS; cellIdx++)
433 duBuildRlcLsapCfg(ENTMAC, (Inst)RLC_DL_INST, cellIdx);
438 /**************************************************************************
439 * @brief Function to handle Config Confirm from RLC
443 * Function : DuHdlRlcCfgComplete
446 * Handles Gen Config Confirm from RLC
448 * @param[in] Pst *pst, Post structure of the primitive.
449 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC
450 * @return ROK - success
453 ***************************************************************************/
454 uint8_t DuHdlRlcCfgComplete(Pst *pst, RlcMngmt *cfm)
457 if (pst->srcInst == RLC_UL_INST)
459 ret = duProcRlcUlCfgComplete(pst, cfm);
463 ret = duProcRlcDlCfgComplete(pst, cfm);
468 /**************************************************************************
469 * @brief Function to handle Control Config Confirm from RLC
473 * Function : duHdlRlcCntrlCfgComplete
476 * Handles Control Config Confirm from RLC
478 * @param[in] Pst *pst, Post structure of the primitive.
479 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC
480 * @return ROK - success
483 ***************************************************************************/
484 uint8_t duHdlRlcCntrlCfgComplete(Pst *pst, RlcMngmt *cntrl)
488 if (cntrl->cfm.status == LCM_PRIM_OK)
490 switch (cntrl->hdr.elmId.elmnt)
494 if (pst->srcInst == RLC_DL_INST)
496 DU_LOG("\nDU_APP : BIND OF RLC DL TO MAC (RGU) SAP SUCCESSFUL");
498 if(macCfgInst < DEFAULT_CELLS)
501 duBindUnbindRlcToMacSap((Inst) RLC_DL_INST, ABND);
505 duBindUnbindRlcToMacSap((Inst) RLC_UL_INST, ABND);
510 DU_LOG("\nDU_APP : BIND OF RLC UL TO MAC (RGU) SAP SUCCESSFUL");
512 if(macCfgInst < DEFAULT_CELLS)
514 duBindUnbindRlcToMacSap((Inst) RLC_UL_INST, ABND);
528 /**************************************************************************
529 * @brief Function to handle Config Confirm from RLC UL
533 * Function : duHdlRlcUlCfgComplete
536 * Handles Config Confirm from RLC UL
538 * @param[in] Pst *pst, Post structure of the primitive.
539 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC UL
540 * @return ROK - success
543 ***************************************************************************/
544 uint8_t duProcRlcUlCfgComplete(Pst *pst, RlcMngmt *cfm)
548 DU_LOG("\nDU_APP : RLC UL Cfg Status %d", cfm->cfm.status);
549 if (cfm->cfm.status == LCM_PRIM_OK)
551 switch(cfm->hdr.elmId.elmnt)
555 rlcUlCfg |= RLC_GEN_CFG;
561 if(numRlcMacSaps == DEFAULT_CELLS)
563 rlcUlCfg |= RLC_MAC_SAP_CFG;
570 rlcUlCfg |= RLC_UDX_SAP_CFG;
577 DU_LOG("\nDU_APP : RLC UL Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
578 if(rlcUlCfg == DU_RLC_UL_CONFIGURED)
582 //Start configuration of RLC DL
589 DU_LOG("\nDU_APP : Config confirm NOK from RLC UL");
595 /**************************************************************************
596 * @brief Function to handle Config Confirm from RLC DL
600 * Function : duHdlRlcDlCfgComplete
603 * Handles Config Confirm from RLC DL
605 * @param[in] Pst *pst, Post structure of the primitive.
606 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC DL
607 * @return ROK - success
610 ***************************************************************************/
611 uint8_t duProcRlcDlCfgComplete(Pst *pst, RlcMngmt *cfm)
613 DU_LOG("\nDU_APP : RLC DL Cfg Status %d", cfm->cfm.status);
614 if (cfm->cfm.status == LCM_PRIM_OK)
616 switch(cfm->hdr.elmId.elmnt)
620 rlcDlCfg |= RLC_GEN_CFG;
626 if(numRlcMacSaps == DEFAULT_CELLS)
628 rlcDlCfg |= RLC_MAC_SAP_CFG;
635 rlcDlCfg |= RLC_UDX_SAP_CFG;
643 DU_LOG("\nDU_APP : RLC DL Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
644 if(rlcDlCfg == DU_RLC_DL_CONFIGURED)
647 //Start configuration of MAC
654 DU_LOG("\nDU_APP : Config confirm NOK from RLC DL");
659 /**************************************************************************
660 * @brief Function to send configs to MAC
664 * Function : duSendMacCfg
667 * Initiates Configs towards MAC layer
670 * @return ROK - success
673 ***************************************************************************/
674 uint8_t duSendMacCfg()
677 duBuildMacUsapCfg(RLC_UL_INST);
678 duBuildMacUsapCfg(RLC_DL_INST);
683 /**************************************************************************
684 * @brief Function to fill gen config required by MAC
688 * Function : duBuildMacGenCfg
691 * Initiates general Configs towards MAC
694 * @return ROK - success
697 ***************************************************************************/
698 uint8_t duBuildMacGenCfg()
701 RgGenCfg *genCfg=NULLP;
704 DU_SET_ZERO(&pst, sizeof(Pst));
705 DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
707 genCfg = &(rgMngmt.t.cfg.s.genCfg);
709 /*----------- Fill General Configuration Parameters ---------*/
710 genCfg->mem.region = MAC_MEM_REGION;
711 genCfg->mem.pool = MAC_POOL;
713 genCfg->numRguSaps = 2;
715 genCfg->lmPst.dstProcId = DU_PROC;
716 genCfg->lmPst.srcProcId = DU_PROC;
717 genCfg->lmPst.dstEnt = ENTDUAPP;
718 genCfg->lmPst.dstInst = 0;
719 genCfg->lmPst.srcEnt = ENTMAC;
720 genCfg->lmPst.srcInst = macCfgInst;
721 genCfg->lmPst.prior = PRIOR0;
722 genCfg->lmPst.route = RTESPEC;
723 genCfg->lmPst.region = MAC_MEM_REGION;
724 genCfg->lmPst.pool = MAC_POOL;
725 genCfg->lmPst.selector = ODU_SELECTOR_LC;
728 rgMngmt.hdr.msgType = TCFG;
729 rgMngmt.hdr.msgLen = 0;
730 rgMngmt.hdr.entId.ent = ENTMAC;
731 rgMngmt.hdr.entId.inst = (Inst)0;
732 rgMngmt.hdr.elmId.elmnt = STGEN;
733 rgMngmt.hdr.seqNmb = 0;
734 rgMngmt.hdr.version = 0;
735 rgMngmt.hdr.transId = 0;
737 rgMngmt.hdr.response.prior = PRIOR0;
738 rgMngmt.hdr.response.route = RTESPEC;
739 rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
740 rgMngmt.hdr.response.mem.pool = MAC_POOL;
741 rgMngmt.hdr.response.selector = ODU_SELECTOR_LC;
744 pst.selector = ODU_SELECTOR_LC;
745 pst.srcEnt = ENTDUAPP;
747 pst.dstInst = macCfgInst;
748 pst.dstProcId = DU_PROC;
749 pst.srcProcId = DU_PROC;
750 pst.region = duCb.init.region;
752 DU_LOG("\nDU_APP : MAC Gen Cfg Req sent");
754 /* Send the request to MAC */
755 cmPkLrgCfgReq(&pst, &rgMngmt);
760 /**************************************************************************
761 * @brief Function to fill USAP config required by MAC
765 * Function : duBuildMacUsapCfg
768 * Initiates USAP Configs towards MAC
770 * @param[in] SpId Specifies if RLC UL or RLC DL instance
771 * @return ROK - success
774 ***************************************************************************/
775 uint8_t duBuildMacUsapCfg(SpId sapId)
778 RgUpSapCfg *uSap = NULLP;
781 DU_SET_ZERO(&pst, sizeof(Pst));
782 DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
784 uSap = &(rgMngmt.t.cfg.s.rguSap);
786 uSap->mem.region = MAC_MEM_REGION;
787 uSap->mem.pool = MAC_POOL;
790 uSap->procId = DU_PROC;
793 uSap->prior = PRIOR0;
794 uSap->route = RTESPEC;
795 uSap->selector = ODU_SELECTOR_LC ;
798 rgMngmt.hdr.msgType = TCFG;
799 rgMngmt.hdr.entId.ent = ENTMAC;
800 rgMngmt.hdr.entId.inst = (Inst)0;
801 rgMngmt.hdr.elmId.elmnt = STRGUSAP;
802 rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
803 rgMngmt.hdr.response.mem.pool = MAC_POOL;
806 pst.selector = ODU_SELECTOR_LC;
807 pst.srcEnt = ENTDUAPP;
809 pst.dstInst = macCfgInst;
810 pst.dstProcId = DU_PROC;
811 pst.srcProcId = DU_PROC;
812 pst.region = duCb.init.region;
814 DU_LOG("\nDU_APP : MAC Rgu USap Cfg Req sent");
816 /* Send the request to MAC */
817 cmPkLrgCfgReq(&pst, &rgMngmt);
822 /**************************************************************************
823 * @brief Function to handle Config Confirm from MAC
827 * Function : duHdlMacCfgComplete
830 * Handles Gen Config Confirm from MAC
832 * @param[in] Pst *pst, Post structure of the primitive.
833 * @param[in] RgMngmt *cfm, Unpacked primitive info received from MAC
834 * @return ROK - success
837 ***************************************************************************/
838 uint8_t duHdlMacCfgComplete(Pst *pst, RgMngmt *cfm)
842 if (cfm->cfm.status == LCM_PRIM_OK)
844 switch (cfm->hdr.elmId.elmnt)
848 macCfg |= MAC_GEN_CFG;
853 macCfg |= MAC_SAP_CFG;
860 DU_LOG("\nDU_APP : MAC Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
861 if(macCfg == MAC_CONFIGURED && numRlcMacSaps == MAX_MAC_SAP)
864 DU_LOG("\nDU_APP : Completed sending Configs");
866 duBindUnbindRlcToMacSap(RLC_DL_INST, ABND);
872 DU_LOG("\nDU_APP : Config confirm NOK from MAC");
878 /**************************************************************************
879 * @brief Function to bind/unbind RLC to MAC SAP
883 * Function : duBindUnbindRlcToMacSap
886 * Initiates Bind/Unbind from RLC to MAC
888 * @param[in] Inst Specifies if RLC UL or RLC DL instance
889 * @param[in] action Specifies if action is bind or unbind
890 * @return ROK - success
893 ***************************************************************************/
894 uint8_t duBindUnbindRlcToMacSap(uint8_t inst, uint8_t action)
896 RlcCntrl *cntrl = NULLP;
901 DU_SET_ZERO(&rlcMngmt, sizeof(RlcMngmt));
902 DU_SET_ZERO(&pst, sizeof(Pst));
906 DU_LOG("\nDU_APP : Cntrl Req to RLC inst %d to bind MAC sap", inst);
910 DU_LOG("\nDU_APP : Cntrl Req to RLC inst %d to unbind MAC sap", inst);
912 cntrl = &(rlcMngmt.t.cntrl);
914 cntrl->action = action;
915 cntrl->subAction = DU_ZERO_VAL;
916 cntrl->s.sapCntrl.suId = macCfgInst;
917 cntrl->s.sapCntrl.spId = inst;
920 rlcMngmt.hdr.msgType = TCNTRL;
921 rlcMngmt.hdr.entId.ent = ENTRLC;
922 rlcMngmt.hdr.entId.inst = inst;
923 rlcMngmt.hdr.elmId.elmnt = 186; /* ambiguous defines in lkw.h and lrg.h so direct hardcoded*/
924 rlcMngmt.hdr.response.mem.region = (inst == RLC_UL_INST) ?
925 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
926 rlcMngmt.hdr.response.mem.pool = RLC_POOL;
929 pst.selector = ODU_SELECTOR_LC;
930 pst.srcEnt = ENTDUAPP;
932 pst.dstProcId = DU_PROC;
934 pst.srcProcId = DU_PROC;
935 pst.region = duCb.init.region;
937 cmPkLkwCntrlReq(&pst, &rlcMngmt);
941 /*******************************************************************
943 * @brief Handles SCTP notifications
947 * Function : duSctpNtfyHdl
950 * Handles SCTP notification
952 * @params[in] Message Buffer
955 * @return ROK - success
958 * ****************************************************************/
960 uint8_t duSctpNtfyHdl(Buffer *mBuf, CmInetSctpNotification *ntfy)
962 if(f1Params.assocId == ntfy->u.assocChange.assocId)
964 if(BuildAndSendF1SetupReq() != ROK)
969 else if(ricParams.assocId == ntfy->u.assocChange.assocId)
971 if(BuildAndSendE2SetupReq() != ROK)
978 DU_LOG("\nDU_APP : Invalid assocId %d received", ntfy->u.assocChange.assocId);
984 /*******************************************************************
986 * @brief Fills Pst struct for ENTEGTP
990 * Function : duFillEgtpPst
993 * Fills Pst struct for ENTEGTP
996 * @return ROK - success
999 * ****************************************************************/
1000 uint8_t duFillEgtpPst(Pst *pst, Event event)
1002 memset(pst, 0, sizeof(Pst));
1003 pst->srcEnt = (Ent)ENTDUAPP;
1004 pst->srcInst = (Inst)DU_INST;
1005 pst->srcProcId = DU_PROC;
1006 pst->dstEnt = (Ent)ENTEGTP;
1007 pst->dstInst = (Inst)EGTP_INST;
1008 pst->dstProcId = pst->srcProcId;
1010 pst->selector = ODU_SELECTOR_LC;
1017 /*******************************************************************
1019 * @brief Function to configure EGTP
1023 * Function : duBuildEgtpCfgReq
1026 * Function to configure EGTP
1029 * @return ROK - success
1032 * ****************************************************************/
1034 uint8_t duBuildEgtpCfgReq()
1039 DU_LOG("\nDU_APP : Sending EGTP config request");
1041 memset(&egtpCfg, 0, sizeof(EgtpConfig));
1042 memcpy(&egtpCfg, &duCfgParam.egtpParams, sizeof(EgtpConfig));
1044 duFillEgtpPst(&pst, EVTCFGREQ);
1045 packEgtpCfgReq(&pst, egtpCfg);
1050 /*******************************************************************
1052 * @brief Function to configure EGTP
1056 * Function : duBuildEgtpCfgReq
1059 * Function to configure EGTP
1062 * @return ROK - success
1065 * ****************************************************************/
1066 uint8_t duHdlEgtpCfgComplete(CmStatus cfm)
1070 if(cfm.status == LCM_PRIM_OK)
1072 DU_LOG("\nDU_APP : EGTP configuraton complete");
1074 duSendEgtpSrvOpenReq();
1079 DU_LOG("\nDU_APP : EGTP configuraton failed");
1086 /*******************************************************************
1088 * @brief Sends server open request to EGTP
1092 * Function : duSendEgtpSrvOpenReq
1095 * Sends server open request to EGTP
1098 * @return ROK - success
1101 * ****************************************************************/
1103 uint8_t duSendEgtpSrvOpenReq()
1107 DU_LOG("\nDU_APP : Sending EGTP server open request");
1109 duFillEgtpPst(&pst, EVTSRVOPENREQ);
1110 packEgtpSrvOpenReq(&pst);
1115 /*******************************************************************
1117 * @brief Handles server open confirmation
1121 * Function : duHdlEgtpSrvOpenComplete
1124 * Handles server open confirmation
1127 * @return ROK - success
1130 *****************************************************************/
1132 uint8_t duHdlEgtpSrvOpenComplete(CmStatus cfm)
1136 if(cfm.status == LCM_PRIM_OK)
1138 DU_LOG("\nDU_APP : EGTP server opened successfully");
1140 duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_ADD, EGTP_LCL_TEID, EGTP_REM_TEID);
1145 DU_LOG("\nDU_APP : EGTP server opening failed");
1152 /*******************************************************************
1154 * @brief Sends tunnel management request
1158 * Function : duSendEgtpTnlMgmtReq
1161 * Builds and sends tunnel management request to EGTP
1163 * @params[in] Action
1164 * Local tunnel endpoint id
1165 * Remote tunnel endpoint id
1166 * @return ROK - success
1169 * ****************************************************************/
1171 uint8_t duSendEgtpTnlMgmtReq(uint8_t action, uint32_t lclTeid, uint32_t remTeid)
1176 tnlEvt.action = action;
1177 tnlEvt.lclTeid = lclTeid;
1178 tnlEvt.remTeid = remTeid;
1180 DU_LOG("\nDU_APP : Sending EGTP tunnel management request");
1181 duFillEgtpPst(&pst, EVTTNLMGMTREQ);
1182 egtpTnlMgmtReq(&pst, tnlEvt);
1186 /*******************************************************************
1188 * @brief Handles Tunnel management confirm
1192 * Function : duHdlEgtpTnlMgmtCfm
1195 * Handles tunnel management confirm received from Egtp
1197 * @params[in] Tunnel Event
1198 * @return ROK - success
1201 * ****************************************************************/
1202 uint8_t duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm)
1206 if(tnlEvtCfm.cfmStatus.status == LCM_PRIM_OK)
1208 DU_LOG("\nDU_APP : Tunnel management confirm OK");
1210 duSendEgtpTestData();
1215 DU_LOG("\nDU_APP : Tunnel management failed");
1222 /*******************************************************************
1224 * @brief Sends UL user data over to EGTP
1228 * Function : duSendEgtpDatInd
1230 * Functionality: Sends UL user data over to EGTP
1232 * @params[in] UL data buffer
1233 * @return ROK - success
1236 * ****************************************************************/
1237 uint8_t duSendEgtpDatInd(Buffer *mBuf)
1241 /* Fill EGTP header */
1242 egtpMsg.msgHdr.msgType = EGTPU_MSG_GPDU;
1243 egtpMsg.msgHdr.nPdu.pres = FALSE;
1244 egtpMsg.msgHdr.seqNum.pres = FALSE;
1245 egtpMsg.msgHdr.extHdr.udpPort.pres = FALSE;
1246 egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
1247 egtpMsg.msgHdr.teId = 1;
1250 egtpHdlDatInd(egtpMsg);
1257 /*******************************************************************
1259 * @brief Simulate UL Data for intial test
1263 * Function : duSendEgtpTestData
1266 * Simulate UL data for initial test
1269 * @return ROK - success
1272 * ****************************************************************/
1273 uint8_t duSendEgtpTestData()
1275 char data[30] = "This is EGTP data from DU";
1280 if(ODU_GET_MSG_BUF(DU_APP_MEM_REGION, DU_POOL, &mBuf) == ROK)
1282 if(ODU_ADD_POST_MSG_MULT((Data *)data, datSize, mBuf) != ROK)
1284 DU_LOG("\nDU_APP : ODU_ADD_POST_MSG_MULT failed");
1285 ODU_PUT_MSG_BUF(mBuf);
1291 DU_LOG("\nDU_APP : Failed to allocate memory");
1295 /* filling IPv4 header */
1300 ODU_GET_MSG_LEN(mBuf, &mLen);
1302 memset(&ipv4Hdr, 0, sizeof(CmIpv4Hdr));
1303 ipv4Hdr.length = CM_IPV4_HDRLEN + mLen;
1304 ipv4Hdr.hdrVer = 0x45;
1306 ipv4Hdr.srcAddr = CM_INET_NTOH_UINT32(duCfgParam.egtpParams.localIp.ipV4Addr);
1307 ipv4Hdr.destAddr = CM_INET_NTOH_UINT32(duCfgParam.egtpParams.destIp.ipV4Addr);
1309 /* Packing IPv4 header into buffer */
1310 uint8_t ret, cnt, idx;
1311 Data revPkArray[CM_IPV4_HDRLEN];
1312 Data pkArray[CM_IPV4_HDRLEN];
1314 /* initialize locals */
1316 memset(revPkArray, 0, CM_IPV4_HDRLEN);
1317 memset(pkArray, 0, CM_IPV4_HDRLEN);
1319 /* Pack Header Version */
1320 pkArray[cnt++] = ipv4Hdr.hdrVer;
1323 pkArray[cnt++] = ipv4Hdr.tos;
1325 pkArray[cnt++] = (Data)GetHiByte(ipv4Hdr.length);
1326 pkArray[cnt++] = (Data)GetLoByte(ipv4Hdr.length);
1329 pkArray[cnt++] = (Data) GetHiByte(ipv4Hdr.id);
1330 pkArray[cnt++] = (Data) GetLoByte(ipv4Hdr.id);
1333 pkArray[cnt++] = (Data)GetHiByte(ipv4Hdr.off);
1334 pkArray[cnt++] = (Data)GetLoByte(ipv4Hdr.off);
1337 pkArray[cnt++] = ipv4Hdr.ttl;
1340 pkArray[cnt++] = ipv4Hdr.proto;
1343 pkArray[cnt++] = (Data)GetHiByte(ipv4Hdr.chkSum);
1344 pkArray[cnt++] = (Data)GetLoByte(ipv4Hdr.chkSum);
1346 /* Pack Source Address */
1347 pkArray[cnt++] = (Data)GetHiByte(GetHiWord(ipv4Hdr.srcAddr));
1348 pkArray[cnt++] = (Data)GetLoByte(GetHiWord(ipv4Hdr.srcAddr));
1349 pkArray[cnt++] = (Data)GetHiByte(GetLoWord(ipv4Hdr.srcAddr));
1350 pkArray[cnt++] = (Data)GetLoByte(GetLoWord(ipv4Hdr.srcAddr));
1352 /* Pack Destination Address */
1353 pkArray[cnt++] = (Data)GetHiByte(GetHiWord(ipv4Hdr.destAddr));
1354 pkArray[cnt++] = (Data)GetLoByte(GetHiWord(ipv4Hdr.destAddr));
1355 pkArray[cnt++] = (Data)GetHiByte(GetLoWord(ipv4Hdr.destAddr));
1356 pkArray[cnt++] = (Data)GetLoByte(GetLoWord(ipv4Hdr.destAddr));
1358 for (idx = 0; idx < CM_IPV4_HDRLEN; idx++)
1359 revPkArray[idx] = pkArray[CM_IPV4_HDRLEN - idx -1];
1361 /* this function automatically reverses revPkArray */
1362 ret = ODU_ADD_PRE_MSG_MULT(revPkArray, (MsgLen)cnt, mBuf);
1364 duSendEgtpDatInd(mBuf);
1368 #endif /* EGTP_TEST */
1371 /**************************************************************************
1372 * @brief Function to send configs to SCH
1376 * Function : duSendSchCfg
1379 * Sends general config to Scheduler via MAC layer
1382 * @return ROK - success
1385 ***************************************************************************/
1386 uint8_t duSendSchCfg()
1389 RgSchInstCfg *cfg = NULLP;
1392 DU_SET_ZERO(&pst, sizeof(Pst));
1393 DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
1395 cfg = &(rgMngmt.t.cfg.s.schInstCfg);
1397 /* Filling of Instance Id */
1398 cfg->instId = DEFAULT_CELLS + 1;
1399 /* Filling of Gen config */
1400 cfg->genCfg.mem.region = MAC_MEM_REGION;
1401 cfg->genCfg.mem.pool = MAC_POOL;
1402 cfg->genCfg.tmrRes = 10;
1405 cfg->genCfg.forceCntrlSrbBoOnPCel = FALSE;
1406 cfg->genCfg.isSCellActDeactAlgoEnable = TRUE;
1408 cfg->genCfg.startCellId = 1;
1409 cfg->genCfg.lmPst.dstProcId = DU_PROC;
1410 cfg->genCfg.lmPst.srcProcId = DU_PROC;
1411 cfg->genCfg.lmPst.dstEnt = ENTDUAPP;
1412 cfg->genCfg.lmPst.dstInst = DU_INST;
1413 cfg->genCfg.lmPst.srcEnt = ENTMAC;
1414 cfg->genCfg.lmPst.srcInst = DEFAULT_CELLS + 1;
1415 cfg->genCfg.lmPst.prior = PRIOR0;
1416 cfg->genCfg.lmPst.route = RTESPEC;
1417 cfg->genCfg.lmPst.region = MAC_MEM_REGION;
1418 cfg->genCfg.lmPst.pool = MAC_POOL;
1419 cfg->genCfg.lmPst.selector = ODU_SELECTOR_LC;
1422 rgMngmt.hdr.msgType = TCFG;
1423 rgMngmt.hdr.entId.ent = ENTMAC;
1424 rgMngmt.hdr.entId.inst = DU_INST;
1425 rgMngmt.hdr.elmId.elmnt = STSCHINST;
1426 rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
1427 rgMngmt.hdr.response.mem.pool = MAC_POOL;
1430 pst.selector = ODU_SELECTOR_LC;
1431 pst.srcEnt = ENTDUAPP;
1432 pst.dstEnt = ENTMAC;
1433 pst.dstProcId = DU_PROC;
1434 pst.srcProcId = DU_PROC;
1435 pst.srcInst = DU_INST;
1437 pst.region = duCb.init.region;
1438 pst.event = (Event) EVTMACSCHGENCFGREQ;
1440 DU_LOG("\nDU_APP : MAC Sch Cfg sent");
1442 /* Send the request to MAC */
1443 cmPkLrgSchCfgReq(&pst, &rgMngmt);
1449 /**************************************************************************
1450 * @brief Function to configure SCTP params and
1451 * responsible for F1 and E2 interfaces
1455 * Function : duLayerConfigComplete
1458 * Configures SCTP Params and responsible for handling
1459 * F1 and E2 interface.
1462 * @return ROK - success
1465 ***************************************************************************/
1466 uint8_t duLayerConfigComplete()
1470 DU_LOG("\nDU_APP : Configuring all Layer is complete");
1472 if((ret = duSctpCfgReq(duCfgParam.sctpParams)) != ROK)
1474 DU_LOG("\nDU_APP : Failed configuring Sctp Params");
1477 if((ret = duSctpAssocReq(F1_INTERFACE)) != ROK)
1479 DU_LOG("\nDU_APP : Failed to send AssocReq F1");
1482 if((ret = duSctpAssocReq(E2_INTERFACE)) != ROK)
1484 DU_LOG("\nDU_APP : Failed to send AssocReq E2");
1491 /**************************************************************************
1492 * @brief Function to handle SCH Config Confirm from MAC
1496 * Function : duHdlSchCfgComplete
1499 * Handles Scheduler Gen Config Confirm from MAC
1501 * @param[in] Pst *pst, Post structure of the primitive.
1502 * @param[in] RgMngmt *cfm, Unpacked primitive info received from MAC
1503 * @return ROK - success
1506 ***************************************************************************/
1507 uint8_t duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm)
1509 if (cfm->cfm.status == LCM_PRIM_OK)
1511 switch (cfm->hdr.elmId.elmnt)
1515 DU_LOG("\nDU_APP : Received SCH CFG CFM at DU APP");
1522 duLayerConfigComplete();
1523 duBuildEgtpCfgReq();
1527 /**************************************************************************
1528 * @brief Function to fill and send MacCellconfig
1532 * Function : duBuildAndSendMacCellCfg
1535 * Initiates MAC Configs towards MAC
1538 * @return ROK - success
1541 ***************************************************************************/
1542 uint8_t duBuildAndSendMacCellCfg(uint16_t cellId)
1545 MacCellCfg *duMacCellCfg = NULLP;
1547 DU_ALLOC_SHRABL_BUF(duMacCellCfg, sizeof(MacCellCfg));
1548 if(duMacCellCfg == NULLP)
1553 /* store the address in the duCellCb so that we can free on confirm msg */
1554 duCb.actvCellLst[cellId-1]->duMacCellCfg = duMacCellCfg;
1556 /* copy the mac config structure from duCfgParams */
1557 memcpy(duMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
1560 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_CONFIG_REQ);
1562 /* Send MAC cell config to MAC */
1563 return (*packMacCellCfgOpts[pst.selector])(&pst, duMacCellCfg);
1566 /**************************************************************************
1567 * @brief Function to Handle MAC cell config confirm
1571 * Function : duHandleMacCellCfgCfm
1574 * Initiates general Configs towards MAC
1577 * @return ROK - success
1580 ***************************************************************************/
1581 uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
1583 uint8_t actvCellIdx = 0;
1586 for(actvCellIdx = 0; actvCellIdx < MAX_NUM_CELL; actvCellIdx++)
1588 if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
1590 duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP;
1593 if(macCellCfgCfm->rsp == ROK)
1595 /* Build and send GNB-DU config update */
1596 ret = BuildAndSendDUConfigUpdate();
1598 /* Build and Send Cell Start Req to MAC */
1599 ret = duBuildAndSendMacCellStart();
1603 /* TODO : Action to be taken if cell configuration fails.
1604 * Should CU be informed? */
1606 DU_LOG("\nMac cell cfg failed");
1612 /*******************************************************************
1614 * @brief Builds and sends cell start request to MAC
1618 * Function : duBuildAndSendMacCellStart
1621 * Builds and sends cell start request to MAC
1624 * @return ROK - success
1627 * ****************************************************************/
1628 uint8_t duBuildAndSendMacCellStart()
1631 OduCellId *cellId = NULL;
1633 DU_LOG("\nDU APP : Building and Sending cell start request to MAC");
1635 /* Send Cell Start Request to MAC */
1636 DU_ALLOC_SHRABL_BUF(cellId, sizeof(OduCellId));
1639 DU_LOG("\nDU APP : Memory alloc failed while building cell start request");
1643 for(uint8_t id = 0; id < duCb.numActvCells; id++)
1645 if(duCb.actvCellLst[id])
1647 cellId->cellId = duCb.actvCellLst[id]->cellId;
1650 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_START);
1652 return (*packMacCellStartOpts[pst.selector])(&pst, cellId);
1658 /*******************************************************************
1660 * @brief Builds and sends cell stop request to MAC
1664 * Function : duBuildAndSendMacCellStop
1667 * Builds and sends cell stop request to MAC
1670 * @return ROK - success
1673 * ****************************************************************/
1674 uint8_t duBuildAndSendMacCellStop()
1677 OduCellId *cellId = NULL;
1679 DU_LOG("\nDU APP : Building and Sending cell stop request to MAC");
1681 /* Send Cell Stop Request to MAC */
1682 DU_ALLOC_SHRABL_BUF(cellId, sizeof(OduCellId));
1685 DU_LOG("\nDU APP : Memory alloc failed while building cell stop request");
1688 cellId->cellId = duCb.actvCellLst[0]->cellId;
1691 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP);
1693 return (*packMacCellStopOpts[pst.selector])(&pst, cellId);
1696 /*******************************************************************
1698 * @brief Handles stop indication from MAC
1702 * Function : duHandleStopInd
1705 * Handles stop indication from MAC
1707 * @params[in] Post structure pointer
1708 * @return ROK - success
1711 * ****************************************************************/
1712 uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId)
1714 DuCellCb *cellCb = NULLP;
1716 if(cellId->cellId <=0 || cellId->cellId > MAX_NUM_CELL)
1718 DU_LOG("\nDU APP : Invalid Cell Id %d in duHandleStopInd()", cellId->cellId);
1721 if(duGetCellCb(cellId->cellId, &cellCb) != ROK)
1724 if((cellCb->cellStatus == ACTIVATED))
1726 DU_LOG("\nDU APP : 5G-NR Cell %d is DOWN", cellId->cellId);
1727 cellCb->cellStatus = DELETION_IN_PROGRESS;
1730 DU_LOG("\nDU APP : Raise cell down alarm for cell id=%d", cellId->cellId);
1731 raiseCellAlrm(CELL_DOWN_ALARM_ID, cellId->cellId);
1735 if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC))
1736 DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, cellId, sizeof(OduCellId));
1738 cellCb->cellStatus = CELL_OUT_OF_SERVICE; //TODO: cell status must be set to OOS after all UE and cell cleanup which is not
1744 /*******************************************************************
1746 * @brief Handles slot indication from MAC
1750 * Function : duHandleUlCcchInd
1753 * Handles UL CCCH indication from MAC
1755 * @params[in] Post structure pointer
1756 * UL CCCH Ind pointer
1757 * @return ROK - success
1760 * ****************************************************************/
1761 uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
1764 DU_LOG("\nDU APP : UL CCCH Indication received");
1766 return (duProcUlCcchInd(ulCcchIndInfo));
1769 /*******************************************************************
1771 * @brief Process UL RRC Message from RLC
1775 * Function : DuProcRlcUlRrcMsgTrans
1777 * Functionality: Process UL RRC Message from RLC
1779 * @params[in] Post structure
1780 * UL RRC Message Info
1781 * @return ROK - success
1784 * ****************************************************************/
1785 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
1787 DuCellCb *cellCb = NULLP;
1790 if(duGetCellCb(ulRrcMsgInfo->cellId, &cellCb) != ROK)
1792 if(ulRrcMsgInfo->ueIdx > 0)
1794 ueCb = cellCb->ueCb[ulRrcMsgInfo->ueIdx -1];
1797 BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, \
1798 ulRrcMsgInfo->rrcMsg);
1800 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo->rrcMsg, ulRrcMsgInfo->msgLen);
1801 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
1806 /*******************************************************************
1808 * @brief Process RRC delivery report from RLC
1812 * Function : DuProcRlcRrcDeliveryReport
1814 * Functionality: Process RRC delivery Message from RLC
1816 * @params[in] Post structure
1817 * UL RRC Message Info
1818 * @return ROK - success
1821 * ****************************************************************/
1822 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport)
1824 DuCellCb *cellCb = NULLP;
1826 uint8_t ret = RFAILED;
1828 if(duGetCellCb(rrcDeliveryReport->cellId, &cellCb) != ROK)
1831 ueCb = cellCb->ueCb[rrcDeliveryReport->ueIdx -1];
1832 ret = BuildAndSendRrcDeliveryReport(ueCb.gnbCuUeF1apId, ueCb.gnbDuUeF1apId,rrcDeliveryReport);
1834 DU_FREE_SHRABL_BUF(pst->region, pst->pool, rrcDeliveryReport, sizeof(RrcDeliveryReport));
1839 /**********************************************************************
1841 **********************************************************************/