X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_ue_mgr.c;fp=src%2Fdu_app%2Fdu_ue_mgr.c;h=98faa7114b8aab295b83b0fa5a14738de7589e1c;hb=40d79285fedc8551f3f0e43ba01123d367c09248;hp=f5011270e2963c81ea68c99496f56f766442e63e;hpb=8144a551b3efaa006e48c00e6a2838ff662e2650;p=o-du%2Fl2.git diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index f5011270e..98faa7114 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -39,6 +39,13 @@ #include "CmInterface.h" #endif +DuRlcUeReestablishReq packRlcUeReestablishReqOpts[] = +{ + packDuRlcUeReestablishReq, /* Loose coupling */ + RlcProcUeReestablishReq, /* TIght coupling */ + packDuRlcUeReestablishReq /* Light weight-loose coupling */ +}; + DuMacDlCcchInd packMacDlCcchIndOpts[] = { packMacDlCcchInd, /* Loose coupling */ @@ -4237,6 +4244,162 @@ uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd) } return ret; } + +/******************************************************************* + * + * @brief Sending UE Reestablishment Req To Rlc + * + * @details + * + * Function : sendUeReestablishReqToRlc + * + * Functionality: + * Sending UE Reestablishment Req To Rlc + * + * @params[in] cellId, ueId + * @return ROK - success + * RFAILED - failure + * + *****************************************************************/ + +uint8_t sendUeReestablishReqToRlc(uint16_t cellId, uint8_t ueId, uint8_t numLcToReestablish, uint8_t *lcId) +{ + uint8_t ret=ROK,idx=0; + Pst pst; + RlcUeReestablishReq *ueReestablish; + + DU_ALLOC_SHRABL_BUF(ueReestablish, sizeof(RlcUeReestablishReq)); + if(ueReestablish !=NULLP) + { + ueReestablish->cellId = cellId; + ueReestablish->ueId = ueId; + ueReestablish->numLcsToReestablish = numLcToReestablish; + + for(idx = 0;idxlcToReestablish[idx]= lcId[idx]; + } + FILL_PST_DUAPP_TO_RLC(pst, RLC_UL_INST, EVENT_RLC_UE_REESTABLISH_REQ); + + ret = (*packRlcUeReestablishReqOpts[pst.selector])(&pst, ueReestablish); + if(ret == RFAILED) + { + DU_LOG("\nERROR --> DU_APP : sendUeReestablishReqToRlc():Failed to send UE Reestablishment Req to RLC"); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueReestablish, sizeof(RlcUeReestablishReq)); + } + } + else + { + DU_LOG("\nERROR --> DU_APP: sendUeReestablishReqToRlc():Memory allocation failed"); + ret = RFAILED; + } + return ret; +} + +/******************************************************************* + * + * @brief DU processes UE reestablishment req and sends to MAC and RLC + * + * @details + * + * Function : duBuildAndSendUeReestablishReq + * + * Functionality: DU processes UE reestablishment req and sends to MAC + * and RLC + * + * @params[in] cellId, crnti, numLcToReestablish, ListOflcid + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ + +uint8_t duBuildAndSendUeReestablishReq(uint16_t cellId, uint16_t crnti, uint8_t numLcToReestablish, uint8_t *lcId) +{ + uint8_t ueId =0; + uint16_t cellIdx = 0; + + DU_LOG("\nDEBUG --> DU_APP: Building UE Reestablishment Request "); + GET_CELL_IDX(cellId, cellIdx); + GET_UE_ID(crnti, ueId); + + if(duCb.actvCellLst[cellIdx] != NULLP) + { + if(crnti != duCb.actvCellLst[cellIdx]->ueCb[ueId - 1].crnti) + { + DU_LOG("\nERROR --> DU APP : duBuildAndSendUeReestablishReq(): CRNTI [%d] not found", crnti); + return RFAILED; + } + + if(sendUeReestablishReqToRlc(cellId, ueId, numLcToReestablish, lcId) == RFAILED) + { + DU_LOG("\nERROR --> DU APP : duBuildAndSendUeReestablishReq(): Failed to send UE reestablishment req for RLC "); + return RFAILED; + } + } + else + { + DU_LOG("\nERROR --> DU APP : duBuildAndSendUeReestablishReq(): Cell Id %d is not found", cellId); + return RFAILED; + } + + return ROK; +} + +/******************************************************************* + * + * @brief Processes UE Reestablishment Rsp received from RLC + * + * @details + * + * Function : DuProcRlcUeReestablishRsp + * + * Functionality: + * Processes UE Reestablishment Rsp received from RLC + * + * @params[in] Post structure + * Pointer to RlcUeReestablishRsp + * @return ROK - success + * RFAILED - failure + * + * *****************************************************************/ + +uint8_t DuProcRlcUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *ueReestablishRsp) +{ + uint8_t ueId = 0, ret = RFAILED; + uint16_t cellIdx = 0,crnti=0; + + if(ueReestablishRsp) + { + ueId = ueReestablishRsp->ueId; + GET_CELL_IDX(ueReestablishRsp->cellId, cellIdx); + + if(ueReestablishRsp->status == SUCCESSFUL) + { + if(duCb.actvCellLst[cellIdx]!=NULLP) + { + GET_CRNTI(crnti, ueId); + if(duCb.actvCellLst[cellIdx]->ueCb[ueId-1].crnti == crnti) + { + /*TODO: complete the processing of UE Reestablishment Response */ + DU_LOG("\nINFO --> DU_APP: RLC UE Reestablishment Response : SUCCESS [UE IDX:%d]", ueId); + ret = ROK; + } + else + DU_LOG("\nERROR --> DU APP : duBuildAndSendUeReestablishRsp(): CRNTI [%d] not found", crnti); + } + else + DU_LOG("\nERROR --> DU APP : duBuildAndSendUeReestablishRsp(): Cell Id[%d] is not found", ueReestablishRsp->cellId); + + } + else + { + DU_LOG("\nERROR --> DU_APP: RLC UE Reestablishment Response : FAILED [UE IDX:%d]", ueId); + } + DU_FREE_SHRABL_BUF(pst->region, pst->pool, ueReestablishRsp, sizeof(RlcUeReestablishRsp)); + + } + return ret; +} /********************************************************************** End of file ***********************************************************************/