X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Frlc_msg_hdl.c;fp=src%2F5gnrrlc%2Frlc_msg_hdl.c;h=54c3b5c56be7cce35acfe3ea26a9f301f30feff6;hb=40d79285fedc8551f3f0e43ba01123d367c09248;hp=649a18eb2b693ad290c1ef6f8a3f11e28083e1e7;hpb=8144a551b3efaa006e48c00e6a2838ff662e2650;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/rlc_msg_hdl.c b/src/5gnrrlc/rlc_msg_hdl.c index 649a18eb2..54c3b5c56 100644 --- a/src/5gnrrlc/rlc_msg_hdl.c +++ b/src/5gnrrlc/rlc_msg_hdl.c @@ -1124,6 +1124,122 @@ uint8_t BuildSliceReportToDu(uint8_t snssaiCnt) sendSlicePmToDu(sliceStats); return ROK; } + +/******************************************************************* + * + * @brief sending UE reestablishment response to DU + * + * @details + * + * Function : sendRlcUeReestablishRspToDu + * + * Functionality: + * sending UE reestablishment response to DU + * + * @params[in] uint8_t cellId, uint8_t ueId, CauseOfResult status + * + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t sendRlcUeReestablishRspToDu(uint16_t cellId,uint8_t ueId, CauseOfResult status) +{ + Pst pst; + RlcUeReestablishRsp *ueReestablishRsp = NULLP; + + FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_RLC_UE_REESTABLISH_RSP); + + RLC_ALLOC_SHRABL_BUF(pst.region, pst.pool, ueReestablishRsp, sizeof(RlcUeReestablishRsp)); + if(!ueReestablishRsp) + { + DU_LOG("\nERROR --> RLC: sendRlcUeReestablishRspToDu(): Memory allocation failed "); + return RFAILED; + } + else + { + ueReestablishRsp->cellId = cellId; + ueReestablishRsp->ueId = ueId; + ueReestablishRsp->status = status; + + if(rlcSendUeReestablishRspToDu(&pst, ueReestablishRsp) == ROK) + { + DU_LOG("\nDEBUG --> RLC: UE Reestablishment response send successfully"); + } + else + { + DU_LOG("\nERROR --> RLC: SendRlcUeReestablishRspToDu():Failed to send UE Reestablishment response to DU"); + RLC_FREE_SHRABL_BUF(pst.region, pst.pool, ueReestablishRsp, sizeof(RlcUeReestablishRsp)); + return RFAILED; + } + } + return ROK; +} + +/******************************************************************* +* +* @brief Handles Ue reestablishment Request from DU APP +* +* @details +* +* Function : RlcProcUeReestablishReq +* +* Functionality: +* Handles Ue reestablishment Request from DU APP +* +* @params[in] Post structure pointer +* RlcUeReestablishReq pointer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t RlcProcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueReestablishReq) +{ + uint8_t ret = RFAILED; + RlcCb *gRlcCb = NULLP; + RlcUlUeCb *ueCb = NULLP; + CauseOfResult status =SUCCESSFUL; + + if(ueReestablishReq != NULLP) + { + gRlcCb = RLC_GET_RLCCB(pst->dstInst); + rlcDbmFetchUlUeCb(gRlcCb,ueReestablishReq->ueId, ueReestablishReq->cellId, &ueCb); + if(ueCb != NULLP) + { + if(ueReestablishReq->cellId == ueCb->cellId) + { + /* TODO : + * Step 1: Fill the RlcCfgInfo structure with data from the ueReestablishReq, just as we did in fillRlcCfg function and set + * ConfigType = CONFIG_REESTABLISH + * Step 2: To finish processing of Ue Reestablishment, call the RlcProcCfgReq function */ + } + else + { + status = CELLID_INVALID; + DU_LOG("\nERROR --> SCH : RlcProcUeReestablishReq(): cell Id[%d] not found", ueReestablishReq->cellId); + } + } + else + { + status = UEID_INVALID; + DU_LOG("\nERROR --> SCH : RlcProcUeReestablishReq(): ue Id[%d] not found", ueReestablishReq->cellId); + } + + if(status != SUCCESSFUL) + { + if(sendRlcUeReestablishRspToDu(ueReestablishReq->cellId, ueReestablishReq->ueId, status) != ROK) + { + DU_LOG("\nERROR --> RLC: RlcProcUeReestablishReq():Failed to send UE Reestablishment response to DU"); + } + } + RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueReestablishReq, sizeof(RlcUeDelete)); + } + else + { + DU_LOG("\nERROR --> RLC: RlcProcUeReestablishReq(): Recieved NULL pointer UE Reestablishment "); + } + return ret; +} /********************************************************************** - End of file -**********************************************************************/ + End of file + **********************************************************************/