From 40d79285fedc8551f3f0e43ba01123d367c09248 Mon Sep 17 00:00:00 2001 From: "lal.harshita" Date: Fri, 17 Mar 2023 13:23:45 +0530 Subject: [PATCH] [Epic-ID: ODUHIGH-488][Task-ID: ODUHIGH-501] WG8 Alignment | UE RLC Re-establishment Req And Rsp Signed-off-by: lal.harshita Change-Id: Ic3b155b799ff330b9c9592571775980745545fe6 Signed-off-by: lal.harshita --- src/5gnrrlc/rlc_dl_ul_inf_ul.c | 10 +++ src/5gnrrlc/rlc_mgr.h | 2 +- src/5gnrrlc/rlc_msg_hdl.c | 120 ++++++++++++++++++++++++++++- src/5gnrrlc/rlc_ul_msg_router.c | 5 ++ src/5gnrrlc/rlc_upr_inf_api.c | 30 ++++++++ src/5gnrrlc/rlc_upr_inf_api.h | 1 + src/cm/common_def.h | 3 +- src/cm/du_app_rlc_inf.c | 161 +++++++++++++++++++++++++++++++++++++++ src/cm/du_app_rlc_inf.h | 97 +++++++++++++++++------- src/du_app/du_mgr_msg_router.c | 5 ++ src/du_app/du_ue_mgr.c | 163 ++++++++++++++++++++++++++++++++++++++++ 11 files changed, 565 insertions(+), 32 deletions(-) diff --git a/src/5gnrrlc/rlc_dl_ul_inf_ul.c b/src/5gnrrlc/rlc_dl_ul_inf_ul.c index 09dad61ae..b7eb803ad 100755 --- a/src/5gnrrlc/rlc_dl_ul_inf_ul.c +++ b/src/5gnrrlc/rlc_dl_ul_inf_ul.c @@ -280,6 +280,16 @@ RlcCfgCfmInfo *cfmInfo } RLC_FREE(tRlcCb, cfgCfm, sizeof(RlcCfgCfmInfo)); } + else if (tRlcCb->u.ulCb->rlcUlUdxEventType == EVENT_RLC_UE_REESTABLISH_REQ) + { + if(sendRlcUeReestablishRspToDu(cfgCfm->cellId, cfgCfm->ueId, SUCCESSFUL) != ROK) + { + DU_LOG("ERROR --> RLC_UL: rlcUlUdxCfgCfm(): Failed to send UE Reestablishment response to DU "); + RLC_FREE(tRlcCb, cfgCfm, sizeof(RlcCfgCfmInfo)); + return RFAILED; + } + RLC_FREE(tRlcCb, cfgCfm, sizeof(RlcCfgCfmInfo)); + } /* free the memory from DL */ RLC_FREE_SHRABL_BUF(pst->region, pst->pool, cfmInfo, sizeof(RlcCfgCfmInfo)); diff --git a/src/5gnrrlc/rlc_mgr.h b/src/5gnrrlc/rlc_mgr.h index c3b64893a..3c6a8a345 100644 --- a/src/5gnrrlc/rlc_mgr.h +++ b/src/5gnrrlc/rlc_mgr.h @@ -20,7 +20,7 @@ uint8_t fillRlcUeCfgRsp(RlcUeCfgRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp); uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp); uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId, uint8_t ueId, CauseOfResult status); - +uint8_t sendRlcUeReestablishRspToDu(uint16_t cellId,uint8_t ueId, CauseOfResult status); /********************************************************************** End of file **********************************************************************/ 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 + **********************************************************************/ diff --git a/src/5gnrrlc/rlc_ul_msg_router.c b/src/5gnrrlc/rlc_ul_msg_router.c index 5326573c1..ecf0bb46e 100755 --- a/src/5gnrrlc/rlc_ul_msg_router.c +++ b/src/5gnrrlc/rlc_ul_msg_router.c @@ -388,6 +388,11 @@ Buffer *mBuf /* message buffer */ ret = unpackRlcUeDeleteReq(RlcProcUeDeleteReq, pst, mBuf); break; } + case EVENT_RLC_UE_REESTABLISH_REQ: + { + ret = unpackRlcUeReestablishReq(RlcProcUeReestablishReq, pst, mBuf); + break; + } case LKW_EVT_STS_REQ: { diff --git a/src/5gnrrlc/rlc_upr_inf_api.c b/src/5gnrrlc/rlc_upr_inf_api.c index 547f741e5..bc00bf35e 100644 --- a/src/5gnrrlc/rlc_upr_inf_api.c +++ b/src/5gnrrlc/rlc_upr_inf_api.c @@ -62,6 +62,14 @@ RlcSlicePmToDuFunc rlcSlicePmOpts[] = DuProcRlcSliceMetrics, /* 1 - tightly coupled */ packRlcDuSlicePm /* 2 - LWLC loosely coupled */ }; + +RlcDuUeReestablishRsp rlcUeReestablishRspOpts[] = +{ + packRlcDuUeReestablishRsp, /* 0 - loosely coupled */ + DuProcRlcUeReestablishRsp, /* 1 - tightly coupled */ + packRlcDuUeReestablishRsp /* 2 - LWLC loosely coupled */ +}; + /******************************************************************* * * @brief Sends UL RRC Message Info to DU APP @@ -186,6 +194,28 @@ uint8_t rlcSendSlicePmToDu(Pst *pst, SlicePmList *sliceStats) { return (*rlcSlicePmOpts[pst->selector])(pst, sliceStats); } + +/******************************************************************* + * + * @brief Sends Ue Reestablishment Rsp to DU APP + * + * @details + * + * Function : rlcSendUeReestablishRspToDu + * + * Functionality: Sends Ue Reestablishment Rsp to DU APP + * + * @params[in] Pst *pst, RlcUeReestablishRsp *ueReestablishRsp + * + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t rlcSendUeReestablishRspToDu(Pst *pst, RlcUeReestablishRsp *ueReestablishRsp) +{ + return (*rlcUeReestablishRspOpts[pst->selector])(pst, ueReestablishRsp); +} + /********************************************************************** End of file **********************************************************************/ diff --git a/src/5gnrrlc/rlc_upr_inf_api.h b/src/5gnrrlc/rlc_upr_inf_api.h index 4647da385..70f30135e 100644 --- a/src/5gnrrlc/rlc_upr_inf_api.h +++ b/src/5gnrrlc/rlc_upr_inf_api.h @@ -22,6 +22,7 @@ uint8_t rlcSendDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp); uint8_t rlcSendUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData); uint8_t rlcSendUeDeleteRspToDu(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp); uint8_t rlcSendSlicePmToDu(Pst *pst, SlicePmList *sliceStats); +uint8_t rlcSendUeReestablishRspToDu(Pst *pst, RlcUeReestablishRsp *ueReestablishRsp); /********************************************************************** End of file **********************************************************************/ diff --git a/src/cm/common_def.h b/src/cm/common_def.h index 22b7ac95c..ae50d82b5 100644 --- a/src/cm/common_def.h +++ b/src/cm/common_def.h @@ -246,7 +246,8 @@ typedef enum CONFIG_UNKNOWN, CONFIG_ADD, CONFIG_MOD, - CONFIG_DEL + CONFIG_DEL, + CONFIG_REESTABLISH }ConfigType; #ifdef NR_TDD diff --git a/src/cm/du_app_rlc_inf.c b/src/cm/du_app_rlc_inf.c index 2bdcf248a..417df5b20 100644 --- a/src/cm/du_app_rlc_inf.c +++ b/src/cm/du_app_rlc_inf.c @@ -940,6 +940,167 @@ uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf) return RFAILED; } + +/******************************************************************* +* +* @brief Packs and Sends UE Reestablishment Req from DUAPP to RLC +* +* @details +* +* Function : packDuRlcUeReestablishReq +* +* Functionality: +* Packs and Sends UE Reestablishment Req from DUAPP to RLC +* +* +* @params[in] Post structure pointer +* RlcUeReestablishReq pointer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t packDuRlcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueDelete) +{ + Buffer *mBuf = NULLP; + + if(pst->selector == ODU_SELECTOR_LWLC) + { + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) + { + DU_LOG("\nERROR --> RLC : Memory allocation failed at packDuRlcUeReestablishReq"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)ueDelete, mBuf); + } + else + { + DU_LOG("\nERROR --> RLC: Only LWLC supported for packDuRlcUeReestablishReq"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* +* @brief Unpacks UE Reestablishment Req received from DU APP +* +* @details +* +* Function : unpackRlcUeReestablishReq +* +* Functionality: +* Unpacks UE Reestablishment Req received from DU APP +* +* @params[in] Pointer to Handler +* Post structure pointer +* Message Buffer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t unpackRlcUeReestablishReq(DuRlcUeReestablishReq func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcUeReestablishReq *ueDelete; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDelete, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, ueDelete); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC: Only LWLC supported for UE Reestablishment Req "); + ODU_PUT_MSG_BUF(mBuf); + } + return RFAILED; +} + +/******************************************************************* +* +* @brief Packs and Sends UE Reestablishment Response from RLC to DUAPP +* +* @details +* +* Function : packRlcDuUeReestablishRsp +* +* Functionality: +* Packs and Sends UE Reestablishment Response from RLC to DUAPP +* +* +* @params[in] Post structure pointer +* RlcUeReestablishRsp *ueReestablish +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t packRlcDuUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *ueReestablish) +{ + Buffer *mBuf = NULLP; + + if(pst->selector == ODU_SELECTOR_LWLC) + { + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) + { + DU_LOG("\nERROR --> RLC : Memory allocation failed at packRlcDuUeReestablishRsp"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)ueReestablish, mBuf); + } + else + { + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuUeReestablishRsp"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* +* +* @brief Unpacks UE Reestablishment Response received from DU APP +* +* @details +* +* Function : unpackRlcUeReestablishRsp +* +* Functionality: +* Unpacks UE Reestablishment Response received from DU APP +* +* @params[in] Pointer to Handler +* Post structure pointer +* Message Buffer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t unpackRlcUeReestablishRsp(RlcDuUeReestablishRsp func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcUeReestablishRsp *ueReestablishRsp = NULLP; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&ueReestablishRsp, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, ueReestablishRsp); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC: Only LWLC supported for UE Reestablishment Response "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} /********************************************************************** End of file ***********************************************************************/ diff --git a/src/cm/du_app_rlc_inf.h b/src/cm/du_app_rlc_inf.h index 44687a41f..ebf0cdde4 100644 --- a/src/cm/du_app_rlc_inf.h +++ b/src/cm/du_app_rlc_inf.h @@ -34,6 +34,8 @@ #define EVENT_RLC_UE_DELETE_REQ 220 #define EVENT_RLC_UE_DELETE_RSP 221 #define EVENT_RLC_SLICE_PM_TO_DU 222 +#define EVENT_RLC_UE_REESTABLISH_REQ 223 +#define EVENT_RLC_UE_REESTABLISH_RSP 224 #define RB_ID_SRB 0 #define RB_ID_DRB 1 @@ -190,6 +192,7 @@ typedef struct rlcBearerCfg bool isLcAddModRspSent; }RlcBearerCfg; +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.3 UE Reconfiguration */ typedef struct rlcUeRecfg { uint16_t cellId; @@ -202,6 +205,7 @@ typedef struct rlcUeRecfg RlcBearerCfg rlcLcCfgRel[MAX_NUM_LC]; }RlcUeRecfg; +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.1 UE Create */ typedef struct rlcUeCfg { uint16_t cellId; @@ -210,6 +214,7 @@ typedef struct rlcUeCfg RlcBearerCfg rlcLcCfgAdd[MAX_NUM_LC]; }RlcUeCfg; +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.2 UE Create Response */ typedef struct rlcUeCfgRsp { uint16_t cellId; @@ -218,12 +223,14 @@ typedef struct rlcUeCfgRsp FailureReason reason; }RlcUeCfgRsp; +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.5 UE Delete Response */ typedef struct rlcUeDelete { uint16_t cellId; uint8_t ueId; }RlcUeDelete; +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.6 UE Delete Response */ typedef struct rlcUeDeleteRsp { uint16_t cellId; @@ -231,7 +238,7 @@ typedef struct rlcUeDeleteRsp CauseOfResult status; }RlcUeDeleteRsp; -/* UL RRC Message from RLC to DU APP */ +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.8 UL RRC Message Transfer*/ typedef struct ulRrcMsgInfo { uint16_t cellId; /* Cell Id */ @@ -241,17 +248,7 @@ typedef struct ulRrcMsgInfo uint8_t *rrcMsg; /* RRC Message (UL-DCCH Message) */ }RlcUlRrcMsgInfo; -/* UL User Data from RLC to DU APP */ -typedef struct ulUserDatInfo -{ - uint16_t cellId; /* Cell Id */ - uint16_t ueId; /* UE Id */ - uint8_t rbId; - uint16_t msgLen; /* User data length (in bytes) */ - uint8_t *userData; /* User data (UL-DTCH Message) */ -}RlcUlUserDatInfo; - -/* DL RRC Message from DU APP to RLC */ +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.7 DL RRC Message Transfer */ typedef struct dlRrcMsgInfo { uint16_t cellId; /* Cell Id */ @@ -263,7 +260,17 @@ typedef struct dlRrcMsgInfo uint8_t *rrcMsg; /* RRC Message (DL-DCCH Message) */ }RlcDlRrcMsgInfo; -/* DL RRC Message Rsp From RLC to DU APP */ +/* UL User Data from RLC to DU APP */ +typedef struct ulUserDatInfo +{ + uint16_t cellId; /* Cell Id */ + uint16_t ueId; /* UE Id */ + uint8_t rbId; + uint16_t msgLen; /* User data length (in bytes) */ + uint8_t *userData; /* User data (UL-DTCH Message) */ +}RlcUlUserDatInfo; + +/* DL RRC Message Rsp From RLC to DU APP */ typedef struct dlRrcMsgRsp { uint16_t cellId; /* Cell Id */ @@ -271,13 +278,6 @@ typedef struct dlRrcMsgRsp DlMsgState state; /* Dl RRC Msg State */ }RlcDlRrcMsgRsp; -/* RRC delivery message from RLC to DU APP */ -typedef struct rrcDeliveryStatus -{ - uint16_t deliveryStatus; - uint16_t triggeringMessage; -}RrcDeliveryStatus; - typedef struct { uint32_t sd:24; @@ -298,14 +298,6 @@ typedef struct slicePmList SlicePm *sliceRecord; }SlicePmList; -typedef struct rrcDeliveryReportInfo -{ - uint16_t cellId; - uint16_t ueId; - uint8_t srbId; - RrcDeliveryStatus rrcDeliveryStatus; -}RrcDeliveryReport; - /* DL Data Message from DU APP to RLC */ typedef struct dlDataMsgInfo { @@ -316,6 +308,39 @@ typedef struct dlDataMsgInfo Buffer *dlMsg; /* DL Data */ }RlcDlUserDataInfo; +/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.9 UL RRC Message Delivery Report */ +typedef struct rrcDeliveryStatus +{ + uint16_t deliveryStatus; + uint16_t triggeringMessage; +}RrcDeliveryStatus; + +typedef struct rrcDeliveryReportInfo +{ + uint16_t cellId; + uint16_t ueId; + uint8_t srbId; + RrcDeliveryStatus rrcDeliveryStatus; +}RrcDeliveryReport; + +/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.11 UE RLC Re-establishment Req */ + +typedef struct rlcUeReestablishReq +{ + uint16_t cellId; + uint16_t ueId; + uint8_t numLcsToReestablish; + uint8_t lcToReestablish[MAX_NUM_LC]; +}RlcUeReestablishReq; + +/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.12 UE RLC Re-establishment Rsp */ +typedef struct rlcUeReestablishRsp +{ + uint16_t cellId; + uint16_t ueId; + CauseOfResult status; +}RlcUeReestablishRsp; + /* Function Pointers */ /* UE create Request from DU APP to RLC*/ typedef uint8_t (*DuRlcUeCreateReq) ARGS(( @@ -377,6 +402,16 @@ typedef uint8_t (*RlcSlicePmToDuFunc) ARGS(( Pst *pst, SlicePmList *sliceStats)); +/* UE Re-establishment Request from DU APP to RLC */ +typedef uint8_t (*DuRlcUeReestablishReq) ARGS(( + Pst *pst, + RlcUeReestablishReq *ueReestablishReq)); + +/* UE Re-establishment Response from RLC to DU APP*/ +typedef uint8_t (*RlcDuUeReestablishRsp) ARGS(( + Pst *pst, + RlcUeReestablishRsp *ueDelRsp)); + /* Pack/Unpack function declarations */ uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg); uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf); @@ -402,6 +437,10 @@ uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp); uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf); uint8_t packRlcDuSlicePm(Pst *pst, SlicePmList *sliceStats); uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf); +uint8_t packDuRlcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueReestablish); +uint8_t unpackRlcUeReestablishReq(DuRlcUeReestablishReq func, Pst *pst, Buffer *mBuf); +uint8_t packRlcDuUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *ueReestablishRsp); +uint8_t unpackRlcUeReestablishRsp(RlcDuUeReestablishRsp func, Pst *pst, Buffer *mBuf); /* Event Handler function declarations */ uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg); @@ -416,6 +455,8 @@ uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo); uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete); uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp); uint8_t DuProcRlcSliceMetrics(Pst *pst, SlicePmList *sliceStats); +uint8_t RlcProcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueReestablish); +uint8_t DuProcRlcUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *delRsp); #endif /* RLC_INF_H */ /********************************************************************** diff --git a/src/du_app/du_mgr_msg_router.c b/src/du_app/du_mgr_msg_router.c index 2d650e4b1..79f7cc7c2 100644 --- a/src/du_app/du_mgr_msg_router.c +++ b/src/du_app/du_mgr_msg_router.c @@ -470,6 +470,11 @@ uint8_t duActvTsk(Pst *pst, Buffer *mBuf) ret = unpackRlcSlicePm(DuProcRlcSliceMetrics, pst, mBuf); break; } + case EVENT_RLC_UE_REESTABLISH_RSP: + { + ret = unpackRlcUeReestablishRsp(DuProcRlcUeReestablishRsp, pst, mBuf); + break; + } default: { DU_LOG("\nERROR --> DU_APP : Invalid event %d received at duActvTsk from ENTRLC", \ 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 ***********************************************************************/ -- 2.16.6