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"
44 uint8_t numRlcDlSaps = 0;
46 uint8_t numRlcMacSaps = 0;
48 uint8_t macCfgInst = 0;
50 DuCfgParams duCfgParam;
51 uint8_t packRlcConfigReq(Pst *pst, RlcMngmt *cfg);
52 uint8_t cmPkLkwCntrlReq(Pst *pst, RlcMngmt *cfg);
53 uint8_t cmPkLrgCfgReq(Pst *pst, RgMngmt *cfg);
54 uint8_t BuildAndSendE2SetupReq();
55 uint8_t egtpHdlDatInd(EgtpMsg egtpMsg);
56 uint8_t BuildAndSendDUConfigUpdate();
57 uint16_t getTransId();
58 uint8_t cmPkLrgSchCfgReq(Pst * pst,RgMngmt * cfg);
60 packMacCellCfgReq packMacCellCfgOpts[] =
62 packMacCellCfg, /* packing for loosely coupled */
63 MacProcCellCfgReq, /* packing for tightly coupled */
64 packMacCellCfg, /* packing for light weight loosly coupled */
67 DuMacCellStartReq packMacCellStartReqOpts[] =
69 packMacCellStartReq, /* Loose coupling */
70 MacProcCellStartReq, /* TIght coupling */
71 packMacCellStartReq /* Light weight-loose coupling */
74 DuMacCellStopReq packMacCellStopReqOpts[] =
76 packMacCellStopReq, /* Loose coupling */
77 MacProcCellStopReq, /* TIght coupling */
78 packMacCellStopReq /* Light weight-loose coupling */
81 /**************************************************************************
82 * @brief Function to fill configs required by RLC
86 * Function : duBuildRlcCfg
89 * Initiates general Configs towards RLC
91 * @param[in] Inst Specifies if RLC UL or RLC DL instance
92 * @return ROK - success
95 ***************************************************************************/
96 uint8_t duBuildRlcCfg(Inst inst)
99 RlcGenCfg *genCfg = NULLP;
102 DU_SET_ZERO(&rlcMngmt, sizeof(RlcMngmt));
103 DU_SET_ZERO(&pst, sizeof(Pst));
105 genCfg = &(rlcMngmt.t.cfg.s.gen);
107 /*----------- Fill General Configuration Parameters ---------*/
108 genCfg->maxUe = duCfgParam.maxUe;
109 genCfg->maxKwuSaps = 2;
110 genCfg->maxUdxSaps = 1;
111 genCfg->rlcMode = (inst == RLC_UL_INST) ?
112 LKW_RLC_MODE_UL : LKW_RLC_MODE_DL;
114 genCfg->maxRguSaps = DEFAULT_CELLS;
116 /*----------- Fill lmPst
117 * Parameters ---------*/
118 genCfg->lmPst.dstProcId = DU_PROC;
119 genCfg->lmPst.srcProcId = DU_PROC;
120 genCfg->lmPst.dstEnt = ENTDUAPP;
121 genCfg->lmPst.dstInst = DU_INST;
122 genCfg->lmPst.srcEnt = ENTRLC;
123 genCfg->lmPst.srcInst = inst;
124 genCfg->lmPst.prior = PRIOR0;
125 genCfg->lmPst.route = RTESPEC;
126 genCfg->lmPst.region = (inst == RLC_UL_INST) ?
127 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
128 genCfg->lmPst.pool = RLC_POOL;
129 genCfg->lmPst.selector = ODU_SELECTOR_LC;
132 rlcMngmt.hdr.msgType = TCFG;
133 rlcMngmt.hdr.msgLen = 0;
134 rlcMngmt.hdr.entId.ent = ENTRLC;
135 rlcMngmt.hdr.entId.inst = (Inst)0;
136 rlcMngmt.hdr.elmId.elmnt = STGEN;
137 rlcMngmt.hdr.seqNmb = 0;
138 rlcMngmt.hdr.version = 0;
139 rlcMngmt.hdr.transId = 0;
140 rlcMngmt.hdr.response.prior = PRIOR0;
141 rlcMngmt.hdr.response.route = RTESPEC;
142 rlcMngmt.hdr.response.mem.region = (inst == RLC_UL_INST) ?
143 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
144 rlcMngmt.hdr.response.mem.pool = DU_POOL;
145 rlcMngmt.hdr.response.selector = ODU_SELECTOR_LC;
148 pst.selector = ODU_SELECTOR_LC;
149 pst.srcEnt = ENTDUAPP;
152 pst.dstProcId = DU_PROC;
153 pst.srcProcId = DU_PROC;
154 pst.region = duCb.init.region;
156 DU_LOG("\nDU_APP : RLC Gen Cfg Req sent for inst %d", inst);
158 /* Send the request to RLC */
159 packRlcConfigReq(&pst, &rlcMngmt);
164 /**************************************************************************
165 * @brief Function to fill configs required by RLC
169 * Function : duBuildRlcLsapCfg
172 * Initiates general Configs towards RLC
174 * @param[in] Inst Specifies if RLC UL or RLC DL instance
175 * @return ROK - success
178 ***************************************************************************/
179 uint8_t duBuildRlcLsapCfg(Ent ent, Inst inst, uint8_t lsapInst)
183 RlcSapCfg *lSap = NULLP;
186 DU_SET_ZERO(&rlcMngmt, sizeof(RlcMngmt));
187 DU_SET_ZERO(&pst, sizeof(Pst));
190 rlcMngmt.hdr.msgType = TCFG;
191 rlcMngmt.hdr.entId.ent = ENTRLC;
192 rlcMngmt.hdr.response.mem.region = (inst == RLC_UL_INST) ?
193 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
195 rlcMngmt.hdr.response.mem.pool = RLC_POOL;
198 pst.selector = ODU_SELECTOR_LC;
199 pst.srcEnt = ENTDUAPP;
201 pst.dstProcId = DU_PROC;
203 pst.srcProcId = DU_PROC;
204 pst.region = duCb.init.region;
205 lSap = &(rlcMngmt.t.cfg.s.sap);
207 lSap->mem.region = (inst == RLC_UL_INST) ?
208 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
209 lSap->mem.pool = RLC_POOL;
211 lSap->bndTmrIntvl = 10;
212 lSap->priority = PRIOR0;
213 lSap->route = RTESPEC;
216 lSap->procId = DU_PROC;
218 lSap->inst = lsapInst;
219 lSap->sapId = lsapInst; /* SapId will be stored as suId in MAC */
220 lSap->selector = (inst == RLC_UL_INST) ? ODU_SELECTOR_LWLC : ODU_SELECTOR_TC;
221 rlcMngmt.hdr.elmId.elmnt = STRGUSAP;
222 DU_LOG("\nDU_APP : RLC MAC Lower Sap Cfg Req sent for inst %d", inst);
227 lSap->procId = DU_PROC;
229 lSap->inst = (inst == RLC_UL_INST) ?
230 RLC_DL_INST : RLC_UL_INST;
232 lSap->selector = ODU_SELECTOR_LC;
233 rlcMngmt.hdr.elmId.elmnt = STUDXSAP;
234 DU_LOG("\nDU_APP : RLC DL/UL Lower Sap Cfg Req sent for inst %d", inst);
237 packRlcConfigReq(&pst, &rlcMngmt);
241 /**************************************************************************
242 * @brief Function to fill configs required by RLC
246 * Function : duBuildRlcUsapCfg
249 * Initiates general Configs towards RLC
251 * @param[in] Inst Specifies if RLC UL or RLC DL instance
252 * @return ROK - success
255 ***************************************************************************/
256 uint8_t duBuildRlcUsapCfg(uint8_t elemId, Ent ent, Inst inst)
259 RlcSapCfg *uSap = NULLP;
262 DU_SET_ZERO(&rlcMngmt, sizeof(RlcMngmt));
263 DU_SET_ZERO(&pst, sizeof(Pst));
265 uSap = &(rlcMngmt.t.cfg.s.sap);
267 uSap->selector = ODU_SELECTOR_LC;
268 uSap->mem.region = (inst == RLC_UL_INST) ?
269 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
270 uSap->mem.pool = RLC_POOL;
273 uSap->procId = DU_PROC;
277 uSap->inst = (inst == RLC_UL_INST) ?
278 RLC_DL_INST : RLC_UL_INST;
279 uSap->bndTmrIntvl = 1000;
280 uSap->priority = PRIOR0;
281 uSap->route = RTESPEC;
284 rlcMngmt.hdr.msgType = TCFG;
285 rlcMngmt.hdr.entId.ent = ENTRLC;
286 rlcMngmt.hdr.elmId.elmnt = STUDXSAP;
287 rlcMngmt.hdr.response.mem.region = (inst == RLC_UL_INST) ?
288 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
290 rlcMngmt.hdr.response.mem.pool = RLC_POOL;
293 pst.selector = ODU_SELECTOR_LC;
294 pst.srcEnt = ENTDUAPP;
296 pst.dstProcId = DU_PROC;
298 pst.srcProcId = DU_PROC;
299 pst.region = duCb.init.region;
301 DU_LOG("\nDU_APP : RLC Kwu Upper Sap Cfg Req sent for inst %d", inst);
302 packRlcConfigReq(&pst, &rlcMngmt);
307 /**************************************************************************
308 * @brief Function to populate internal DS of DU APP
312 * Function : duProcCfgComplete
315 * Populates internal data structures of DU APP after
316 * receiving configurations.
319 * @return ROK - success
322 ***************************************************************************/
323 uint8_t duProcCfgComplete()
326 static uint16_t cellId = 0;
328 for(idx=0; idx< DEFAULT_CELLS; idx++)
330 DuCellCb *cell = NULLP;
331 DU_ALLOC(cell, sizeof(DuCellCb))
334 DU_LOG("\nDU_APP : Memory Allocation failed in duProcCfgComplete");
340 memset(cell, 0, sizeof(DuCellCb));
341 cell->cellId = ++cellId;
342 memset(&cell->cellInfo.nrEcgi.plmn, 0, sizeof(Plmn));
343 cell->cellInfo.nrEcgi.plmn.mcc[0] = PLMN_MCC0;
344 cell->cellInfo.nrEcgi.plmn.mcc[1] = PLMN_MCC1;
345 cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
346 cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0;
347 cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1;
348 cell->cellInfo.nrEcgi.cellId = NR_CELL_ID;
349 cell->cellInfo.nrPci = NR_PCI;
350 cell->cellInfo.fiveGsTac = DU_TAC;
351 memset(&cell->cellInfo.plmn[idx1], 0, sizeof(Plmn));
352 for(idx1=0; idx1<MAX_PLMN; idx1++)
354 cell->cellInfo.plmn[idx1].mcc[0] = PLMN_MCC0;
355 cell->cellInfo.plmn[idx1].mcc[1] = PLMN_MCC1;
356 cell->cellInfo.plmn[idx1].mcc[2] = PLMN_MCC2;
357 cell->cellInfo.plmn[idx1].mnc[0] = PLMN_MNC0;
358 cell->cellInfo.plmn[idx1].mnc[1] = PLMN_MNC1;
360 cell->cellInfo.maxUe = duCfgParam.maxUe;
361 cell->cellStatus = CELL_OUT_OF_SERVICE;
363 duCb.cfgCellLst[duCb.numCfgCells] = cell;
369 //Start layer configs
370 ret = duSendRlcUlCfg();
374 /**************************************************************************
375 * @brief Function to invoke DU Layer Configs
379 * Function : duSendRlcUlCfg
382 * Initiates Configs towards layers of DU
385 * @return ROK - success
388 ***************************************************************************/
389 uint8_t duSendRlcUlCfg()
393 duBuildRlcCfg((Inst)RLC_UL_INST);
394 for(cellIdx = 0; cellIdx < DEFAULT_CELLS; cellIdx++)
396 duBuildRlcLsapCfg(ENTMAC, (Inst)RLC_UL_INST, cellIdx);
398 duBuildRlcLsapCfg(ENTRLC, (Inst)RLC_UL_INST, 0);
403 /**************************************************************************
404 * @brief Function to invoke DU Layer Configs
408 * Function : duSendRlcDlCfg
411 * Initiates Configs towards layers of DU
414 * @return ROK - success
417 ***************************************************************************/
418 uint8_t duSendRlcDlCfg()
422 duBuildRlcCfg((Inst)RLC_DL_INST);
423 duBuildRlcUsapCfg(STUDXSAP, ENTRLC, (Inst)RLC_DL_INST);
424 for(cellIdx = 0; cellIdx < DEFAULT_CELLS; cellIdx++)
426 duBuildRlcLsapCfg(ENTMAC, (Inst)RLC_DL_INST, cellIdx);
431 /**************************************************************************
432 * @brief Function to handle Config Confirm from RLC
436 * Function : DuHdlRlcCfgComplete
439 * Handles Gen Config Confirm from RLC
441 * @param[in] Pst *pst, Post structure of the primitive.
442 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC
443 * @return ROK - success
446 ***************************************************************************/
447 uint8_t DuHdlRlcCfgComplete(Pst *pst, RlcMngmt *cfm)
450 if (pst->srcInst == RLC_UL_INST)
452 ret = duProcRlcUlCfgComplete(pst, cfm);
456 ret = duProcRlcDlCfgComplete(pst, cfm);
461 /**************************************************************************
462 * @brief Function to handle Control Config Confirm from RLC
466 * Function : duHdlRlcCntrlCfgComplete
469 * Handles Control Config Confirm from RLC
471 * @param[in] Pst *pst, Post structure of the primitive.
472 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC
473 * @return ROK - success
476 ***************************************************************************/
477 uint8_t duHdlRlcCntrlCfgComplete(Pst *pst, RlcMngmt *cntrl)
481 if (cntrl->cfm.status == LCM_PRIM_OK)
483 switch (cntrl->hdr.elmId.elmnt)
487 if (pst->srcInst == RLC_DL_INST)
489 DU_LOG("\nDU_APP : BIND OF RLC DL TO MAC (RGU) SAP SUCCESSFUL");
491 if(macCfgInst < DEFAULT_CELLS)
494 duBindUnbindRlcToMacSap((Inst) RLC_DL_INST, ABND);
498 duBindUnbindRlcToMacSap((Inst) RLC_UL_INST, ABND);
503 DU_LOG("\nDU_APP : BIND OF RLC UL TO MAC (RGU) SAP SUCCESSFUL");
505 if(macCfgInst < DEFAULT_CELLS)
507 duBindUnbindRlcToMacSap((Inst) RLC_UL_INST, ABND);
521 /**************************************************************************
522 * @brief Function to handle Config Confirm from RLC UL
526 * Function : duHdlRlcUlCfgComplete
529 * Handles Config Confirm from RLC UL
531 * @param[in] Pst *pst, Post structure of the primitive.
532 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC UL
533 * @return ROK - success
536 ***************************************************************************/
537 uint8_t duProcRlcUlCfgComplete(Pst *pst, RlcMngmt *cfm)
541 DU_LOG("\nDU_APP : RLC UL Cfg Status %d", cfm->cfm.status);
542 if (cfm->cfm.status == LCM_PRIM_OK)
544 switch(cfm->hdr.elmId.elmnt)
548 rlcUlCfg |= RLC_GEN_CFG;
554 if(numRlcMacSaps == DEFAULT_CELLS)
556 rlcUlCfg |= RLC_MAC_SAP_CFG;
563 rlcUlCfg |= RLC_UDX_SAP_CFG;
570 DU_LOG("\nDU_APP : RLC UL Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
571 if(rlcUlCfg == DU_RLC_UL_CONFIGURED)
575 //Start configuration of RLC DL
582 DU_LOG("\nDU_APP : Config confirm NOK from RLC UL");
588 /**************************************************************************
589 * @brief Function to handle Config Confirm from RLC DL
593 * Function : duHdlRlcDlCfgComplete
596 * Handles Config Confirm from RLC DL
598 * @param[in] Pst *pst, Post structure of the primitive.
599 * @param[in] RlcMngmt *cfm, Unpacked primitive info received from RLC DL
600 * @return ROK - success
603 ***************************************************************************/
604 uint8_t duProcRlcDlCfgComplete(Pst *pst, RlcMngmt *cfm)
606 DU_LOG("\nDU_APP : RLC DL Cfg Status %d", cfm->cfm.status);
607 if (cfm->cfm.status == LCM_PRIM_OK)
609 switch(cfm->hdr.elmId.elmnt)
613 rlcDlCfg |= RLC_GEN_CFG;
619 if(numRlcMacSaps == DEFAULT_CELLS)
621 rlcDlCfg |= RLC_MAC_SAP_CFG;
628 rlcDlCfg |= RLC_UDX_SAP_CFG;
636 DU_LOG("\nDU_APP : RLC DL Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
637 if(rlcDlCfg == DU_RLC_DL_CONFIGURED)
640 //Start configuration of MAC
647 DU_LOG("\nDU_APP : Config confirm NOK from RLC DL");
652 /**************************************************************************
653 * @brief Function to send configs to MAC
657 * Function : duSendMacCfg
660 * Initiates Configs towards MAC layer
663 * @return ROK - success
666 ***************************************************************************/
667 uint8_t duSendMacCfg()
670 duBuildMacUsapCfg(RLC_UL_INST);
671 duBuildMacUsapCfg(RLC_DL_INST);
676 /**************************************************************************
677 * @brief Function to fill gen config required by MAC
681 * Function : duBuildMacGenCfg
684 * Initiates general Configs towards MAC
687 * @return ROK - success
690 ***************************************************************************/
691 uint8_t duBuildMacGenCfg()
694 RgGenCfg *genCfg=NULLP;
697 DU_SET_ZERO(&pst, sizeof(Pst));
698 DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
700 genCfg = &(rgMngmt.t.cfg.s.genCfg);
702 /*----------- Fill General Configuration Parameters ---------*/
703 genCfg->mem.region = MAC_MEM_REGION;
704 genCfg->mem.pool = MAC_POOL;
706 genCfg->numRguSaps = 2;
708 genCfg->lmPst.dstProcId = DU_PROC;
709 genCfg->lmPst.srcProcId = DU_PROC;
710 genCfg->lmPst.dstEnt = ENTDUAPP;
711 genCfg->lmPst.dstInst = 0;
712 genCfg->lmPst.srcEnt = ENTMAC;
713 genCfg->lmPst.srcInst = macCfgInst;
714 genCfg->lmPst.prior = PRIOR0;
715 genCfg->lmPst.route = RTESPEC;
716 genCfg->lmPst.region = MAC_MEM_REGION;
717 genCfg->lmPst.pool = MAC_POOL;
718 genCfg->lmPst.selector = ODU_SELECTOR_LC;
721 rgMngmt.hdr.msgType = TCFG;
722 rgMngmt.hdr.msgLen = 0;
723 rgMngmt.hdr.entId.ent = ENTMAC;
724 rgMngmt.hdr.entId.inst = (Inst)0;
725 rgMngmt.hdr.elmId.elmnt = STGEN;
726 rgMngmt.hdr.seqNmb = 0;
727 rgMngmt.hdr.version = 0;
728 rgMngmt.hdr.transId = 0;
730 rgMngmt.hdr.response.prior = PRIOR0;
731 rgMngmt.hdr.response.route = RTESPEC;
732 rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
733 rgMngmt.hdr.response.mem.pool = MAC_POOL;
734 rgMngmt.hdr.response.selector = ODU_SELECTOR_LC;
737 pst.selector = ODU_SELECTOR_LC;
738 pst.srcEnt = ENTDUAPP;
740 pst.dstInst = macCfgInst;
741 pst.dstProcId = DU_PROC;
742 pst.srcProcId = DU_PROC;
743 pst.region = duCb.init.region;
745 DU_LOG("\nDU_APP : MAC Gen Cfg Req sent");
747 /* Send the request to MAC */
748 cmPkLrgCfgReq(&pst, &rgMngmt);
753 /**************************************************************************
754 * @brief Function to fill USAP config required by MAC
758 * Function : duBuildMacUsapCfg
761 * Initiates USAP Configs towards MAC
763 * @param[in] SpId Specifies if RLC UL or RLC DL instance
764 * @return ROK - success
767 ***************************************************************************/
768 uint8_t duBuildMacUsapCfg(SpId sapId)
771 RgUpSapCfg *uSap = NULLP;
774 DU_SET_ZERO(&pst, sizeof(Pst));
775 DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
777 uSap = &(rgMngmt.t.cfg.s.rguSap);
779 uSap->mem.region = MAC_MEM_REGION;
780 uSap->mem.pool = MAC_POOL;
783 uSap->procId = DU_PROC;
786 uSap->prior = PRIOR0;
787 uSap->route = RTESPEC;
788 uSap->selector = ODU_SELECTOR_LC ;
791 rgMngmt.hdr.msgType = TCFG;
792 rgMngmt.hdr.entId.ent = ENTMAC;
793 rgMngmt.hdr.entId.inst = (Inst)0;
794 rgMngmt.hdr.elmId.elmnt = STRGUSAP;
795 rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
796 rgMngmt.hdr.response.mem.pool = MAC_POOL;
799 pst.selector = ODU_SELECTOR_LC;
800 pst.srcEnt = ENTDUAPP;
802 pst.dstInst = macCfgInst;
803 pst.dstProcId = DU_PROC;
804 pst.srcProcId = DU_PROC;
805 pst.region = duCb.init.region;
807 DU_LOG("\nDU_APP : MAC Rgu USap Cfg Req sent");
809 /* Send the request to MAC */
810 cmPkLrgCfgReq(&pst, &rgMngmt);
815 /**************************************************************************
816 * @brief Function to handle Config Confirm from MAC
820 * Function : duHdlMacCfgComplete
823 * Handles Gen Config Confirm from MAC
825 * @param[in] Pst *pst, Post structure of the primitive.
826 * @param[in] RgMngmt *cfm, Unpacked primitive info received from MAC
827 * @return ROK - success
830 ***************************************************************************/
831 uint8_t duHdlMacCfgComplete(Pst *pst, RgMngmt *cfm)
835 if (cfm->cfm.status == LCM_PRIM_OK)
837 switch (cfm->hdr.elmId.elmnt)
841 macCfg |= MAC_GEN_CFG;
846 macCfg |= MAC_SAP_CFG;
853 DU_LOG("\nDU_APP : MAC Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
854 if(macCfg == MAC_CONFIGURED && numRlcMacSaps == MAX_MAC_SAP)
857 DU_LOG("\nDU_APP : Completed sending Configs");
859 duBindUnbindRlcToMacSap(RLC_DL_INST, ABND);
865 DU_LOG("\nDU_APP : Config confirm NOK from MAC");
871 /**************************************************************************
872 * @brief Function to bind/unbind RLC to MAC SAP
876 * Function : duBindUnbindRlcToMacSap
879 * Initiates Bind/Unbind from RLC to MAC
881 * @param[in] Inst Specifies if RLC UL or RLC DL instance
882 * @param[in] action Specifies if action is bind or unbind
883 * @return ROK - success
886 ***************************************************************************/
887 uint8_t duBindUnbindRlcToMacSap(uint8_t inst, uint8_t action)
889 RlcCntrl *cntrl = NULLP;
894 DU_SET_ZERO(&rlcMngmt, sizeof(RlcMngmt));
895 DU_SET_ZERO(&pst, sizeof(Pst));
899 DU_LOG("\nDU_APP : Cntrl Req to RLC inst %d to bind MAC sap", inst);
903 DU_LOG("\nDU_APP : Cntrl Req to RLC inst %d to unbind MAC sap", inst);
905 cntrl = &(rlcMngmt.t.cntrl);
907 cntrl->action = action;
908 cntrl->subAction = DU_ZERO_VAL;
909 cntrl->s.sapCntrl.suId = macCfgInst;
910 cntrl->s.sapCntrl.spId = inst;
913 rlcMngmt.hdr.msgType = TCNTRL;
914 rlcMngmt.hdr.entId.ent = ENTRLC;
915 rlcMngmt.hdr.entId.inst = inst;
916 rlcMngmt.hdr.elmId.elmnt = 186; /* ambiguous defines in lkw.h and lrg.h so direct hardcoded*/
917 rlcMngmt.hdr.response.mem.region = (inst == RLC_UL_INST) ?
918 RLC_UL_MEM_REGION:RLC_DL_MEM_REGION;
919 rlcMngmt.hdr.response.mem.pool = RLC_POOL;
922 pst.selector = ODU_SELECTOR_LC;
923 pst.srcEnt = ENTDUAPP;
925 pst.dstProcId = DU_PROC;
927 pst.srcProcId = DU_PROC;
928 pst.region = duCb.init.region;
930 cmPkLkwCntrlReq(&pst, &rlcMngmt);
934 /*******************************************************************
936 * @brief Handles SCTP notifications
940 * Function : duSctpNtfyHdl
943 * Handles SCTP notification
945 * @params[in] Message Buffer
948 * @return ROK - success
951 * ****************************************************************/
953 uint8_t duSctpNtfyHdl(Buffer *mBuf, CmInetSctpNotification *ntfy)
955 if(f1Params.assocId == ntfy->u.assocChange.assocId)
957 if(BuildAndSendF1SetupReq() != ROK)
962 else if(ricParams.assocId == ntfy->u.assocChange.assocId)
964 if(BuildAndSendE2SetupReq() != ROK)
971 DU_LOG("\nDU_APP : Invalid assocId %d received", ntfy->u.assocChange.assocId);
977 /*******************************************************************
979 * @brief Fills Pst struct for ENTEGTP
983 * Function : duFillEgtpPst
986 * Fills Pst struct for ENTEGTP
989 * @return ROK - success
992 * ****************************************************************/
993 uint8_t duFillEgtpPst(Pst *pst, Event event)
995 memset(pst, 0, sizeof(Pst));
996 pst->srcEnt = (Ent)ENTDUAPP;
997 pst->srcInst = (Inst)DU_INST;
998 pst->srcProcId = DU_PROC;
999 pst->dstEnt = (Ent)ENTEGTP;
1000 pst->dstInst = (Inst)EGTP_INST;
1001 pst->dstProcId = pst->srcProcId;
1003 pst->selector = ODU_SELECTOR_LC;
1010 /*******************************************************************
1012 * @brief Function to configure EGTP
1016 * Function : duBuildEgtpCfgReq
1019 * Function to configure EGTP
1022 * @return ROK - success
1025 * ****************************************************************/
1027 uint8_t duBuildEgtpCfgReq()
1032 DU_LOG("\nDU_APP : Sending EGTP config request");
1034 memset(&egtpCfg, 0, sizeof(EgtpConfig));
1035 memcpy(&egtpCfg, &duCfgParam.egtpParams, sizeof(EgtpConfig));
1037 duFillEgtpPst(&pst, EVTCFGREQ);
1038 packEgtpCfgReq(&pst, egtpCfg);
1043 /*******************************************************************
1045 * @brief Function to configure EGTP
1049 * Function : duBuildEgtpCfgReq
1052 * Function to configure EGTP
1055 * @return ROK - success
1058 * ****************************************************************/
1059 uint8_t duHdlEgtpCfgComplete(CmStatus cfm)
1063 if(cfm.status == LCM_PRIM_OK)
1065 DU_LOG("\nDU_APP : EGTP configuraton complete");
1067 duSendEgtpSrvOpenReq();
1072 DU_LOG("\nDU_APP : EGTP configuraton failed");
1079 /*******************************************************************
1081 * @brief Sends server open request to EGTP
1085 * Function : duSendEgtpSrvOpenReq
1088 * Sends server open request to EGTP
1091 * @return ROK - success
1094 * ****************************************************************/
1096 uint8_t duSendEgtpSrvOpenReq()
1100 DU_LOG("\nDU_APP : Sending EGTP server open request");
1102 duFillEgtpPst(&pst, EVTSRVOPENREQ);
1103 packEgtpSrvOpenReq(&pst);
1108 /*******************************************************************
1110 * @brief Handles server open confirmation
1114 * Function : duHdlEgtpSrvOpenComplete
1117 * Handles server open confirmation
1120 * @return ROK - success
1123 *****************************************************************/
1125 uint8_t duHdlEgtpSrvOpenComplete(CmStatus cfm)
1129 if(cfm.status == LCM_PRIM_OK)
1131 DU_LOG("\nDU_APP : EGTP server opened successfully");
1133 duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_ADD, EGTP_LCL_TEID, EGTP_REM_TEID);
1138 DU_LOG("\nDU_APP : EGTP server opening failed");
1145 /*******************************************************************
1147 * @brief Sends tunnel management request
1151 * Function : duSendEgtpTnlMgmtReq
1154 * Builds and sends tunnel management request to EGTP
1156 * @params[in] Action
1157 * Local tunnel endpoint id
1158 * Remote tunnel endpoint id
1159 * @return ROK - success
1162 * ****************************************************************/
1164 uint8_t duSendEgtpTnlMgmtReq(uint8_t action, uint32_t lclTeid, uint32_t remTeid)
1169 tnlEvt.action = action;
1170 tnlEvt.lclTeid = lclTeid;
1171 tnlEvt.remTeid = remTeid;
1173 DU_LOG("\nDU_APP : Sending EGTP tunnel management request");
1175 duFillEgtpPst(&pst, EVTTNLMGMTREQ);
1176 packEgtpTnlMgmtReq(&pst, tnlEvt);
1181 /*******************************************************************
1183 * @brief Handles Tunnel management confirm
1187 * Function : duHdlEgtpTnlMgmtCfm
1190 * Handles tunnel management confirm received from Egtp
1192 * @params[in] Tunnel Event
1193 * @return ROK - success
1196 * ****************************************************************/
1197 uint8_t duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm)
1201 if(tnlEvtCfm.cfmStatus.status == LCM_PRIM_OK)
1203 DU_LOG("\nDU_APP : Tunnel management confirm OK");
1207 DU_LOG("\nDU_APP : Tunnel management failed");
1214 uint8_t duSendEgtpDatInd(Buffer *mBuf)
1218 /* Fill EGTP header */
1219 egtpMsg.msgHdr.msgType = EGTPU_MSG_GPDU;
1220 egtpMsg.msgHdr.nPdu.pres = FALSE;
1221 egtpMsg.msgHdr.seqNum.pres = FALSE;
1222 egtpMsg.msgHdr.extHdr.udpPort.pres = FALSE;
1223 egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
1224 egtpMsg.msgHdr.teId = 1;
1227 egtpHdlDatInd(egtpMsg);
1234 /*******************************************************************
1236 * @brief Simulate UL Data for intial test
1240 * Function : duSendEgtpTestData
1243 * Simulate UL data for initial test
1246 * @return ROK - success
1249 * ****************************************************************/
1250 uint8_t duSendEgtpTestData()
1252 char data[30] = "This is EGTP data from DU";
1257 if(ODU_GET_MSG_BUF(DU_APP_MEM_REGION, DU_POOL, &mBuf) == ROK)
1259 if(ODU_ADD_POST_MSG_MULT((Data *)data, datSize, mBuf) != ROK)
1261 DU_LOG("\nDU_APP : ODU_ADD_POST_MSG_MULT failed");
1262 ODU_PUT_MSG_BUF(mBuf);
1268 DU_LOG("\nDU_APP : Failed to allocate memory");
1272 /* filling IPv4 header */
1277 ODU_GET_MSG_LEN(mBuf, &mLen);
1279 memset(&ipv4Hdr, 0, sizeof(CmIpv4Hdr));
1280 ipv4Hdr.length = CM_IPV4_HDRLEN + mLen;
1281 ipv4Hdr.hdrVer = 0x45;
1283 ipv4Hdr.srcAddr = CM_INET_NTOH_UINT32(duCfgParam.egtpParams.localIp.ipV4Addr);
1284 ipv4Hdr.destAddr = CM_INET_NTOH_UINT32(duCfgParam.egtpParams.destIp.ipV4Addr);
1286 /* Packing IPv4 header into buffer */
1287 uint8_t ret, cnt, idx;
1288 Data revPkArray[CM_IPV4_HDRLEN];
1289 Data pkArray[CM_IPV4_HDRLEN];
1291 /* initialize locals */
1293 memset(revPkArray, 0, CM_IPV4_HDRLEN);
1294 memset(pkArray, 0, CM_IPV4_HDRLEN);
1296 /* Pack Header Version */
1297 pkArray[cnt++] = ipv4Hdr.hdrVer;
1300 pkArray[cnt++] = ipv4Hdr.tos;
1302 pkArray[cnt++] = (Data)GetHiByte(ipv4Hdr.length);
1303 pkArray[cnt++] = (Data)GetLoByte(ipv4Hdr.length);
1306 pkArray[cnt++] = (Data) GetHiByte(ipv4Hdr.id);
1307 pkArray[cnt++] = (Data) GetLoByte(ipv4Hdr.id);
1310 pkArray[cnt++] = (Data)GetHiByte(ipv4Hdr.off);
1311 pkArray[cnt++] = (Data)GetLoByte(ipv4Hdr.off);
1314 pkArray[cnt++] = ipv4Hdr.ttl;
1317 pkArray[cnt++] = ipv4Hdr.proto;
1320 pkArray[cnt++] = (Data)GetHiByte(ipv4Hdr.chkSum);
1321 pkArray[cnt++] = (Data)GetLoByte(ipv4Hdr.chkSum);
1323 /* Pack Source Address */
1324 pkArray[cnt++] = (Data)GetHiByte(GetHiWord(ipv4Hdr.srcAddr));
1325 pkArray[cnt++] = (Data)GetLoByte(GetHiWord(ipv4Hdr.srcAddr));
1326 pkArray[cnt++] = (Data)GetHiByte(GetLoWord(ipv4Hdr.srcAddr));
1327 pkArray[cnt++] = (Data)GetLoByte(GetLoWord(ipv4Hdr.srcAddr));
1329 /* Pack Destination Address */
1330 pkArray[cnt++] = (Data)GetHiByte(GetHiWord(ipv4Hdr.destAddr));
1331 pkArray[cnt++] = (Data)GetLoByte(GetHiWord(ipv4Hdr.destAddr));
1332 pkArray[cnt++] = (Data)GetHiByte(GetLoWord(ipv4Hdr.destAddr));
1333 pkArray[cnt++] = (Data)GetLoByte(GetLoWord(ipv4Hdr.destAddr));
1335 for (idx = 0; idx < CM_IPV4_HDRLEN; idx++)
1336 revPkArray[idx] = pkArray[CM_IPV4_HDRLEN - idx -1];
1338 /* this function automatically reverses revPkArray */
1339 ret = ODU_ADD_PRE_MSG_MULT(revPkArray, (MsgLen)cnt, mBuf);
1341 duSendEgtpDatInd(mBuf);
1345 #endif /* EGTP_TEST */
1348 /**************************************************************************
1349 * @brief Function to send configs to SCH
1353 * Function : duSendSchCfg
1356 * Sends general config to Scheduler via MAC layer
1359 * @return ROK - success
1362 ***************************************************************************/
1363 uint8_t duSendSchCfg()
1366 RgSchInstCfg *cfg = NULLP;
1369 DU_SET_ZERO(&pst, sizeof(Pst));
1370 DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
1372 cfg = &(rgMngmt.t.cfg.s.schInstCfg);
1374 /* Filling of Instance Id */
1375 cfg->instId = DEFAULT_CELLS + 1;
1376 /* Filling of Gen config */
1377 cfg->genCfg.mem.region = MAC_MEM_REGION;
1378 cfg->genCfg.mem.pool = MAC_POOL;
1379 cfg->genCfg.tmrRes = 10;
1382 cfg->genCfg.forceCntrlSrbBoOnPCel = FALSE;
1383 cfg->genCfg.isSCellActDeactAlgoEnable = TRUE;
1385 cfg->genCfg.startCellId = 1;
1386 cfg->genCfg.lmPst.dstProcId = DU_PROC;
1387 cfg->genCfg.lmPst.srcProcId = DU_PROC;
1388 cfg->genCfg.lmPst.dstEnt = ENTDUAPP;
1389 cfg->genCfg.lmPst.dstInst = DU_INST;
1390 cfg->genCfg.lmPst.srcEnt = ENTMAC;
1391 cfg->genCfg.lmPst.srcInst = DEFAULT_CELLS + 1;
1392 cfg->genCfg.lmPst.prior = PRIOR0;
1393 cfg->genCfg.lmPst.route = RTESPEC;
1394 cfg->genCfg.lmPst.region = MAC_MEM_REGION;
1395 cfg->genCfg.lmPst.pool = MAC_POOL;
1396 cfg->genCfg.lmPst.selector = ODU_SELECTOR_LC;
1399 rgMngmt.hdr.msgType = TCFG;
1400 rgMngmt.hdr.entId.ent = ENTMAC;
1401 rgMngmt.hdr.entId.inst = DU_INST;
1402 rgMngmt.hdr.elmId.elmnt = STSCHINST;
1403 rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
1404 rgMngmt.hdr.response.mem.pool = MAC_POOL;
1407 pst.selector = ODU_SELECTOR_LC;
1408 pst.srcEnt = ENTDUAPP;
1409 pst.dstEnt = ENTMAC;
1410 pst.dstProcId = DU_PROC;
1411 pst.srcProcId = DU_PROC;
1412 pst.srcInst = DU_INST;
1414 pst.region = duCb.init.region;
1415 pst.event = (Event) EVTMACSCHGENCFGREQ;
1417 DU_LOG("\nDU_APP : MAC Sch Cfg sent");
1419 /* Send the request to MAC */
1420 cmPkLrgSchCfgReq(&pst, &rgMngmt);
1426 /**************************************************************************
1427 * @brief Function to configure SCTP params and
1428 * responsible for F1 and E2 interfaces
1432 * Function : duLayerConfigComplete
1435 * Configures SCTP Params and responsible for handling
1436 * F1 and E2 interface.
1439 * @return ROK - success
1442 ***************************************************************************/
1443 uint8_t duLayerConfigComplete()
1447 DU_LOG("\nDU_APP : Configuring all Layer is complete");
1449 if((ret = duSctpCfgReq(duCfgParam.sctpParams)) != ROK)
1451 DU_LOG("\nDU_APP : Failed configuring Sctp Params");
1454 if((ret = duSctpAssocReq(F1_INTERFACE)) != ROK)
1456 DU_LOG("\nDU_APP : Failed to send AssocReq F1");
1459 if((ret = duSctpAssocReq(E2_INTERFACE)) != ROK)
1461 DU_LOG("\nDU_APP : Failed to send AssocReq E2");
1468 /**************************************************************************
1469 * @brief Function to handle SCH Config Confirm from MAC
1473 * Function : duHdlSchCfgComplete
1476 * Handles Scheduler Gen Config Confirm from MAC
1478 * @param[in] Pst *pst, Post structure of the primitive.
1479 * @param[in] RgMngmt *cfm, Unpacked primitive info received from MAC
1480 * @return ROK - success
1483 ***************************************************************************/
1484 uint8_t duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm)
1486 if (cfm->cfm.status == LCM_PRIM_OK)
1488 switch (cfm->hdr.elmId.elmnt)
1492 DU_LOG("\nDU_APP : Received SCH CFG CFM at DU APP");
1499 duLayerConfigComplete();
1500 duBuildEgtpCfgReq();
1504 /*******************************************************************
1506 * @brief Sends Slot indication to EGTP
1510 * Function : duSendEgtpSlotInd
1513 * Sends Slot indication to EGTP
1516 * @return ROK - success
1519 * ****************************************************************/
1520 uint8_t duSendEgtpSlotInd()
1524 duFillEgtpPst(&pst, EVTSLOTIND);
1525 packEgtpSlotInd(&pst);
1531 /**************************************************************************
1532 * @brief Function to fill and send MacCellconfig
1536 * Function : duBuildAndSendMacCellCfg
1539 * Initiates MAC Configs towards MAC
1542 * @return ROK - success
1545 ***************************************************************************/
1546 uint8_t duBuildAndSendMacCellCfg(uint16_t cellId)
1549 MacCellCfg *duMacCellCfg = NULLP;
1551 DU_ALLOC_SHRABL_BUF(duMacCellCfg, sizeof(MacCellCfg));
1552 if(duMacCellCfg == NULLP)
1557 /* store the address in the duCellCb so that we can free on confirm msg */
1558 duCb.actvCellLst[cellId-1]->duMacCellCfg = duMacCellCfg;
1560 /* copy the mac config structure from duCfgParams */
1561 memcpy(duMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
1564 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_CONFIG_REQ);
1566 /* Send MAC cell config to MAC */
1567 return (*packMacCellCfgOpts[pst.selector])(&pst, duMacCellCfg);
1570 /**************************************************************************
1571 * @brief Function to Handle MAC cell config confirm
1575 * Function : duHandleMacCellCfgCfm
1578 * Initiates general Configs towards MAC
1581 * @return ROK - success
1584 ***************************************************************************/
1585 uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
1587 uint8_t actvCellIdx = 0;
1590 for(actvCellIdx = 0; actvCellIdx < MAX_NUM_CELL; actvCellIdx++)
1592 if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
1594 duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP;
1597 if(macCellCfgCfm->rsp == ROK)
1599 /* Build and send GNB-DU config update */
1600 ret = BuildAndSendDUConfigUpdate();
1602 /* Build and Send Cell Start Req to MAC */
1603 ret = duBuildAndSendMacCellStartReq();
1607 /* TODO : Action to be taken if cell configuration fails.
1608 * Should CU be informed? */
1610 DU_LOG("\nMac cell cfg failed");
1616 /*******************************************************************
1618 * @brief Handles slot indication from MAC
1622 * Function : duHandleSlotInd
1625 * Handles slot indication from MAC
1627 * @params[in] Post structure pointer
1629 * @return ROK - success
1632 * ****************************************************************/
1633 uint8_t duHandleSlotInd(Pst *pst, SlotIndInfo *slotInfo)
1635 DuCellCb *cellCb = NULLP;
1637 if(slotInfo->cellId <=0 || slotInfo->cellId > MAX_NUM_CELL)
1639 DU_LOG("\nDU APP : Invalid Cell Id %d", slotInfo->cellId);
1643 if(duGetCellCb(slotInfo->cellId, &cellCb) != ROK)
1646 if(!cellCb->firstSlotIndRcvd)
1648 DU_LOG("\nDU APP : Slot Indication received");
1649 cellCb->firstSlotIndRcvd = true;
1650 if((cellCb != NULL) && (cellCb->cellStatus == ACTIVATION_IN_PROGRESS))
1652 DU_LOG("\nDU APP : 5G-NR Cell %d is UP", slotInfo->cellId);
1653 cellCb->cellStatus = ACTIVATED;
1657 /* TODO : Slot Indication to be moved out of EGTP_TEST when
1658 * data path is established */
1660 duSendEgtpSlotInd();
1663 if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC))
1664 DU_FREE_SHRABL_BUF(pst->region, pst->pool, slotInfo, sizeof(SlotIndInfo));
1668 /*******************************************************************
1670 * @brief Builds and sends cell start request to MAC
1674 * Function : duBuildAndSendMacCellStartReq
1677 * Builds and sends cell start request to MAC
1680 * @return ROK - success
1683 * ****************************************************************/
1684 uint8_t duBuildAndSendMacCellStartReq()
1687 MacCellStartInfo *cellStartInfo = NULL;
1689 DU_LOG("\nDU APP : Building and Sending cell start request to MAC");
1691 /* Send Cell Start Request to MAC */
1692 DU_ALLOC_SHRABL_BUF(cellStartInfo, sizeof(MacCellStartInfo));
1695 DU_LOG("\nDU APP : Memory alloc failed while building cell start request");
1699 for(uint8_t id = 0; id < duCb.numActvCells; id++)
1701 if(duCb.actvCellLst[id])
1703 duCb.actvCellLst[id]->firstSlotIndRcvd = FALSE;
1704 cellStartInfo->cellId = duCb.actvCellLst[id]->cellId;
1707 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_START_REQ);
1709 return (*packMacCellStartReqOpts[pst.selector])(&pst, cellStartInfo);
1715 /*******************************************************************
1717 * @brief Builds and sends cell stop request to MAC
1721 * Function : duBuildAndSendMacCellStopReq
1724 * Builds and sends cell stop request to MAC
1727 * @return ROK - success
1730 * ****************************************************************/
1731 uint8_t duBuildAndSendMacCellStopReq()
1734 MacCellStopInfo *cellStopInfo = NULL;
1736 DU_LOG("\nDU APP : Building and Sending cell stop request to MAC");
1738 /* Send Cell Stop Request to MAC */
1739 DU_ALLOC_SHRABL_BUF(cellStopInfo, sizeof(MacCellStopInfo));
1742 DU_LOG("\nDU APP : Memory alloc failed while building cell stop request");
1745 cellStopInfo->cellId = duCb.actvCellLst[0]->cellId;
1748 FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP_REQ);
1750 return (*packMacCellStopReqOpts[pst.selector])(&pst, cellStopInfo);
1753 /*******************************************************************
1755 * @brief Handles stop indication from MAC
1759 * Function : duHandleStopInd
1762 * Handles stop indication from MAC
1764 * @params[in] Post structure pointer
1765 * @return ROK - success
1768 * ****************************************************************/
1769 uint8_t duHandleStopInd(Pst *pst, MacCellStopInfo *cellStopId)
1771 DuCellCb *cellCb = NULLP;
1773 if(cellStopId->cellId <=0 || cellStopId->cellId > MAX_NUM_CELL)
1775 DU_LOG("\nDU APP : Invalid Cell Id %d", cellStopId->cellId);
1778 if(duGetCellCb(cellStopId->cellId, &cellCb) != ROK)
1781 if(cellCb->firstSlotIndRcvd)
1783 cellCb->firstSlotIndRcvd = false;
1784 if((cellCb->cellStatus == ACTIVATED))
1786 DU_LOG("\nDU APP : 5G-NR Cell %d is DOWN", cellStopId->cellId);
1787 cellCb->cellStatus = DELETION_IN_PROGRESS;
1790 if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC))
1791 DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, cellStopId, sizeof(MacCellStopInfo));
1793 cellCb->cellStatus = CELL_OUT_OF_SERVICE; //TODO: cell status must be set to OOS after all UE and cell cleanup which is not
1800 /*******************************************************************
1802 * @brief Handles slot indication from MAC
1806 * Function : duHandleUlCcchInd
1809 * Handles UL CCCH indication from MAC
1811 * @params[in] Post structure pointer
1812 * UL CCCH Ind pointer
1813 * @return ROK - success
1816 * ****************************************************************/
1817 uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
1820 DU_LOG("\nDU APP : UL CCCH Indication received");
1822 return (duProcUlCcchInd(ulCcchIndInfo));
1825 /*******************************************************************
1827 * @brief Process UL RRC Message from RLC
1831 * Function : DuProcRlcUlRrcMsgTrans
1833 * Functionality: Process UL RRC Message from RLC
1835 * @params[in] Post structure
1836 * UL RRC Message Info
1837 * @return ROK - success
1840 * ****************************************************************/
1841 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
1843 DuCellCb *cellCb = NULLP;
1846 if(duGetCellCb(ulRrcMsgInfo->cellId, &cellCb) != ROK)
1849 ueCb = cellCb->ueCb[ulRrcMsgInfo->ueIdx -1];
1852 BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, \
1853 ulRrcMsgInfo->rrcMsg);
1855 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo->rrcMsg, ulRrcMsgInfo->msgLen);
1856 DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo));
1860 /*******************************************************************
1862 * @brief Process RRC delivery report from RLC
1866 * Function : DuProcRlcRrcDeliveryReport
1868 * Functionality: Process RRC delivery Message from RLC
1870 * @params[in] Post structure
1871 * UL RRC Message Info
1872 * @return ROK - success
1875 * ****************************************************************/
1876 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport)
1878 DuCellCb *cellCb = NULLP;
1880 uint8_t ret = RFAILED;
1882 if(duGetCellCb(rrcDeliveryReport->cellId, &cellCb) != ROK)
1885 ueCb = cellCb->ueCb[rrcDeliveryReport->ueIdx -1];
1886 ret = BuildAndSendRrcDeliveryReport(ueCb.gnbCuUeF1apId, ueCb.gnbDuUeF1apId,rrcDeliveryReport);
1888 DU_FREE_SHRABL_BUF(pst->region, pst->pool, rrcDeliveryReport, sizeof(RrcDeliveryReport));
1893 /**********************************************************************
1895 **********************************************************************/