X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_msg_hdl.c;fp=src%2Fdu_app%2Fdu_msg_hdl.c;h=c7c9bc3b5f595eedaafe149caff8c138188a7f89;hb=964fd8f1dc9c969e70caf8885332cc086ff22d74;hp=72e5949cc779d81fd2690a8ff961615b687dbcba;hpb=f76690adc96d589ab208fbcdef906be32a5abb7d;p=o-du%2Fl2.git diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index 72e5949cc..c7c9bc3b5 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -1707,22 +1707,63 @@ uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo) * ****************************************************************/ uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo) { + uint8_t ret = ROK; DuCellCb *cellCb = NULLP; - DuUeCb ueCb ={0}; + DuUeCb *ueCb = NULLP; - if(duGetCellCb(ulRrcMsgInfo->cellId, &cellCb) != ROK) - return RFAILED; - if(ulRrcMsgInfo->ueId > 0) + duGetCellCb(ulRrcMsgInfo->cellId, &cellCb); + if(cellCb) { - ueCb = cellCb->ueCb[ulRrcMsgInfo->ueId -1]; + if(ulRrcMsgInfo->ueId > 0) + { + if(cellCb->ueCb[ulRrcMsgInfo->ueId -1].gnbDuUeF1apId == ulRrcMsgInfo->ueId) + ueCb = &cellCb->ueCb[ulRrcMsgInfo->ueId -1]; + if(ueCb) + { + /* If UL message is received for a UE in handover, it signifies that UE is now + * attached to GNB. Hence marking this UE as active and requesting MAC to + * release the dedicated RACH resources */ + if(ueCb->ueState == UE_HANDIN_IN_PROGRESS) + { + ueCb->ueState = UE_ACTIVE; + cellCb->numActvUes++; + + /* Release RACH resources */ + memset(&ueCb->cfraResource, 0, sizeof(MacCfraResource)); + if(duBuildAndSendRachRsrcRelToMac(ulRrcMsgInfo->cellId, ueCb) != ROK) + { + DU_LOG("\nERROR --> DU_APP : DuProcRlcUlRrcMsgTrans() : Failed to send RACH resource release to MAC"); + } + } - BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, ulRrcMsgInfo->rrcMsg); + if(BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, ulRrcMsgInfo->rrcMsg) != ROK) + { + DU_LOG("\nERROR --> DU_APP : DuProcRlcUlRrcMsgTrans() : Failed to build and send UL RRC Message Transfer"); + ret = RFAILED; + } + } + else + { + DU_LOG("\nERROR --> DU_APP : DuProcRlcUlRrcMsgTrans() : UE ID [%d] not found", ulRrcMsgInfo->ueId); + ret = RFAILED; + } + } + else + { + DU_LOG("\nERROR --> DU_APP : DuProcRlcUlRrcMsgTrans() : Invalid UE ID [%d]", ulRrcMsgInfo->ueId); + ret = RFAILED; + } + } + else + { + DU_LOG("\nERROR --> DU_APP : DuProcRlcUlRrcMsgTrans() : Cell ID [%d] not found", ulRrcMsgInfo->cellId); + ret = RFAILED; + } DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo->rrcMsg, ulRrcMsgInfo->msgLen); DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo)); - } - return ROK; + return ret; } /*******************************************************************