/* This file contains UE management handling functionality for DU APP */
#include "common_def.h"
#include "lrg.h"
+#include "du_tmr.h"
#include "lrg.x"
#include "ckw.h"
#include "ckw.x"
#include "legtp.h"
#include "du_app_mac_inf.h"
#include "du_app_rlc_inf.h"
+#include "du_e2ap_mgr.h"
#include "du_cfg.h"
#include "du_mgr.h"
#include "du_utils.h"
#include "CmInterface.h"
#endif
+DuRlcUeReestablishReq packRlcUeReestablishReqOpts[] =
+{
+ packDuRlcUeReestablishReq, /* Loose coupling */
+ RlcProcUeReestablishReq, /* TIght coupling */
+ packDuRlcUeReestablishReq /* Light weight-loose coupling */
+};
+
DuMacDlCcchInd packMacDlCcchIndOpts[] =
{
packMacDlCcchInd, /* Loose coupling */
MacProcUeResetReq, /* TIght coupling */
packDuMacUeResetReq /* Light weight-loose coupling */
};
+
+/*******************************************************************
+ *
+ * @brief Processes UE's max retransmission information received from RLC
+ *
+ * @details
+ *
+ * Function : DuProcRlcMaxRetransInd
+ *
+ * Functionality:
+ * Processes max retransmission reached information received from RLC
+ *
+ * @params[in] Post structure
+ * Pointer to RlcMaxRetransInfo
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * *****************************************************************/
+
+uint8_t DuProcRlcMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInfo)
+{
+ uint8_t ueId = 0, ret = RFAILED;
+ uint16_t cellIdx = 0,crnti=0;
+
+ if(maxRetransInfo)
+ {
+ GET_CELL_IDX(maxRetransInfo->cellId, cellIdx);
+
+ if(duCb.actvCellLst[cellIdx]!=NULLP)
+ {
+ ueId = maxRetransInfo->ueId;
+ GET_CRNTI(crnti, ueId);
+ if(duCb.actvCellLst[cellIdx]->ueCb[ueId-1].crnti == crnti)
+ {
+ /*TODO: complete the processing of max retransmission */
+ ret = ROK;
+ }
+ else
+ DU_LOG("\nERROR --> DU APP : DuProcRlcMaxRetransInd(): CRNTI [%d] not found", crnti);
+ }
+ else
+ DU_LOG("\nERROR --> DU APP : DuProcRlcMaxRetransInd(): Cell Id[%d] is not found", maxRetransInfo->cellId);
+
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, maxRetransInfo, sizeof(RlcMaxRetransInfo));
+
+ }
+ return ret;
+}
+
/******************************************************************
*
* @brief Function to return Drb LcId
{
initDlBwp->pdcchCfg.searchSpcToAddModList[idx].searchSpaceId = PDCCH_SRCH_SPC_TWO_ID;
initDlBwp->pdcchCfg.searchSpcToAddModList[idx].cRSetId = PDCCH_CTRL_RSRC_SET_ONE_ID;
- initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSlotPeriodicityAndOffset = SLOTPERIODICITYANDOFFSET_PR_SL1;
+ initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSlotPeriodicityAndOffset.mSlotPeriodicity\
+ = SLOTPERIODICITY_PR_SL1;
+ initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSlotPeriodicityAndOffset.mSlotOffset = 0;
memset(initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSymbolsWithinSlot, 0, MONITORING_SYMB_WITHIN_SLOT_SIZE);
initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSymbolsWithinSlot[idx] = PDCCH_SYMBOL_WITHIN_SLOT;
initDlBwp->pdcchCfg.searchSpcToAddModList[idx].numCandidatesAggLevel1 = AGGREGATIONLEVEL_N8;
* Functionality:
* Processes UE Reconfig Req to RLC UL
*
- * @params[in] Pointer to RlcUeCfg
+ * @params[in] Pointer to RlcUeRecfg
* @return ROK - success
* RFAILED - failure
*
}
else
{
- DU_LOG("\nERROR --> DU_APP: Received RlcUeCfg is NULL at sendUeRecfgReqToRlc()");
+ DU_LOG("\nERROR --> DU_APP: Received RlcUeRecfg is NULL at sendUeRecfgReqToRlc()");
ret = RFAILED;
}
return ret;
/**********************************************************************************
*
- * @brief Fills Ue Cfg from DU DB to MacUeCfg
+ * @brief Fills Ue Cfg from DU DB to MacUeCreateReq
*
* @details
*
* Functionality: fills ue Cfg to be sent to MAC
*
* @params[in] DuMacUeCfg Pointer
- * MacUeCfg Pointer
+ * MacUeCreateReq Pointer
*
* @return ROK - success
* RFAILED - failure
* *******************************************************************************/
-void fillMacUeCfg(DuMacUeCfg *duMacUeCfg, MacUeCfg *macUeCfg)
+void fillMacUeCfg(DuMacUeCfg *duMacUeCfg, MacUeCreateReq *macUeCfg)
{
uint8_t lcIdx = 0;
* Functionality: fills ue Cfg to be sent to RLC
*
* @params[in] DuRlcUeCfg Pointer
- * RlcUeCfg Pointer
+ * RlcUeCreate Pointer
*
* @return ROK - success
* RFAILED - failure
* *******************************************************************************/
-void fillRlcUeCfg(DuRlcUeCfg *duRlcUeCfg, RlcUeCfg *rlcUeCfg)
+void fillRlcUeCfg(DuRlcUeCfg *duRlcUeCfg, RlcUeCreate *rlcUeCfg)
{
uint8_t lcIdx = 0;
uint8_t duBuildAndSendUeCreateReqToMac(uint16_t cellId, uint8_t gnbDuUeF1apId, uint16_t crnti, DuUeCfg *ueCfgDb, DuMacUeCfg *duMacUeCfg)
{
uint8_t ret = ROK;
- MacUeCfg *macUeCfg = NULLP;
+ MacUeCreateReq *macUeCfg = NULLP;
Pst pst;
memset(&pst, 0, sizeof(Pst));
FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_CREATE_REQ);
/* Copying ueCb to a sharable buffer */
- DU_ALLOC_SHRABL_BUF(macUeCfg, sizeof(MacUeCfg));
+ DU_ALLOC_SHRABL_BUF(macUeCfg, sizeof(MacUeCreateReq));
if(macUeCfg)
{
- memset(macUeCfg, 0, sizeof(MacUeCfg));
+ memset(macUeCfg, 0, sizeof(MacUeCreateReq));
fillMacUeCfg(duMacUeCfg, macUeCfg);
DU_LOG("\nDEBUG --> DU_APP: Sending UE create request to MAC");
if(ret == RFAILED)
{
DU_LOG("\nERROR --> DU_APP : Failure in sending Ue Create Req to MAC at duBuildAndSendUeCreateReqToMac()");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, macUeCfg, sizeof(MacUeCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, macUeCfg, sizeof(MacUeCreateReq));
}
}
else
uint8_t duUpdateDuUeCbCfg(uint8_t ueId, uint8_t cellId)
{
- uint8_t ret = ROK, cellIdx = 0, crnti=0;
+ uint8_t ret = ROK;
+ uint16_t cellIdx = 0, crnti=0;
DuUeCb *ueCb = NULLP;
GET_CELL_IDX(cellId, cellIdx);
/*******************************************************************
*
- * @brief Handle UE config response from MAC
+ * @brief Handle UE create response from MAC
*
* @details
*
- * Function : DuProcMacUeCfgRsp
+ * Function : DuProcMacUeCreateRsp
*
- * Functionality: Handle UE Config response from MAC
+ * Functionality: Handle UE Create response from MAC
*
- * @params[in] Pointer to MacUeCfgRsp and Pst
+ * @params[in] Pointer to MacUeCreateRsp and Pst
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
+uint8_t DuProcMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp)
{
uint8_t ret = ROK;
uint16_t cellIdx;
if((duBuildAndSendRachRsrcReqToMac(cfgRsp->cellId, cfgRsp->ueId)) != ROK)
{
DU_LOG("\nERROR --> DU APP : Failed to send RACH Resource Request to MAC");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacUeCfgRsp));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacUeCreateRsp));
return RFAILED;
}
}
else
{
DU_LOG("\nERROR -> DU APP : Failure in updating DU UE CB");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacUeCfgRsp));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacUeCreateRsp));
return RFAILED;
}
}
DU_LOG("\nERROR --> DU APP : MAC UE CFG Response for EVENT[%d]: FAILURE [DU UE F1AP ID : %d]", pst->event, cfgRsp->ueId);
ret = RFAILED;
}
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacUeCfgRsp));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacUeCreateRsp));
}
else
{
- DU_LOG("\nERROR --> DU APP : Received MAC Ue Config Response is NULL at DuProcMacUeCfgRsp()");
+ DU_LOG("\nERROR --> DU APP : Received MAC Ue Config Response is NULL at DuProcMacUeCreateRsp()");
ret = RFAILED;
}
return ret;
*
* @params[in] cellId,
* ueId,
- * Pointer to RlcUeCfg
+ * Pointer to RlcUeCreate
* @return ROK - success
* RFAILED - failure
*
uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t gnbDuUeF1apId, DuUeCfg *ueCfgDb, DuRlcUeCfg *duRlcUeCfg)
{
uint8_t ret = ROK;
- RlcUeCfg *rlcUeCfg = NULLP;
+ RlcUeCreate *rlcUeCfg = NULLP;
Pst pst;
ret = updateRlcUeCfg(cellId, gnbDuUeF1apId, ueCfgDb, duRlcUeCfg);
FILL_PST_DUAPP_TO_RLC(pst, RLC_UL_INST, EVENT_RLC_UE_CREATE_REQ);
/* Copying ueCfg to a sharable buffer */
- DU_ALLOC_SHRABL_BUF(rlcUeCfg, sizeof(RlcUeCfg));
+ DU_ALLOC_SHRABL_BUF(rlcUeCfg, sizeof(RlcUeCreate));
if(rlcUeCfg)
{
- memset(rlcUeCfg, 0, sizeof(RlcUeCfg));
+ memset(rlcUeCfg, 0, sizeof(RlcUeCreate));
fillRlcUeCfg(duRlcUeCfg, rlcUeCfg);
/* Processing one Ue at a time to RLC */
if(ret == RFAILED)
{
DU_LOG("\nERROR --> DU_APP : Failure in sending Ue Create Req to RLC");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, rlcUeCfg, sizeof(RlcUeCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, rlcUeCfg, sizeof(RlcUeCreate));
ret = RFAILED;
}
}
* @details
*
- * Function : DuProcRlcUeCfgRsp
+ * Function : DuProcRlcUeCreateRsp
*
* Functionality:
* Processes UE create Rsp received from RLC UL
* RFAILED - failure
*
*****************************************************************/
-uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp)
+uint8_t DuProcRlcUeCreateRsp(Pst *pst, RlcUeCreateRsp *cfgRsp)
{
uint8_t ret = ROK;
if((duBuildAndSendRachRsrcReqToMac(cfgRsp->cellId, cfgRsp->ueId)) != ROK)
{
DU_LOG("\nERROR --> DU APP : Failed to send RACH Resource Request to MAC");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacUeCfgRsp));
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeCfgRsp));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeCreateRsp));
return RFAILED;
}
}
else
{
DU_LOG("\nERROR --> DU APP : Failure in updating DU UE CB");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeCfgRsp));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeCreateRsp));
return RFAILED;
}
}
}
- else if(pst->event == EVENT_RLC_UE_RECONFIG_RSP)
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP: RLC UE CREATE Response for EVENT[%d] : FAILED [UE IDX : %d, REASON :%d]",\
+ pst->event, cfgRsp->ueId, cfgRsp->reason);
+ ret = RFAILED;
+ }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeCreateRsp));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP: Received RLC Ue Create Response is NULL at DuProcRlcUeCreateRsp()");
+ ret = RFAILED;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Processes UE reconfig Rsp received from RLC UL
+ *
+ * @details
+ *
+
+ * Function : DuProcRlcUeReconfigRsp
+ *
+ * Functionality:
+ * Processes UE reconfig Rsp received from RLC UL
+ *
+ * @params[in] Post structure
+ * Pointer to RlcCfgCfm
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *****************************************************************/
+uint8_t DuProcRlcUeReconfigRsp(Pst *pst, RlcUeReconfigRsp *cfgRsp)
+{
+ uint8_t ret = ROK;
+
+ if(cfgRsp)
+ {
+ if(cfgRsp->result == RLC_DU_APP_RSP_OK)
+ {
+ if(pst->event == EVENT_RLC_UE_RECONFIG_RSP)
{
DU_LOG("\nINFO --> DU_APP: RLC UE Reconfig Response : SUCCESS [UE IDX:%d]", cfgRsp->ueId);
if((BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueId)) != ROK)
{
DU_LOG("\nERROR --> DU APP : Failure in BuildAndSendUeCtxtRsp");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeCfgRsp));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeReconfigRsp));
return RFAILED;
}
}
else
{
DU_LOG("\nERROR --> DU APP : Failure in updating DU UE CB");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeCfgRsp));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeReconfigRsp));
return RFAILED;
}
}
}
else
{
- DU_LOG("\nERROR --> DU_APP: RLC UE CFG Response for EVENT[%d] : FAILED [UE IDX : %d, REASON :%d]",\
+ DU_LOG("\nERROR --> DU_APP: RLC UE RE-CFG Response for EVENT[%d] : FAILED [UE IDX : %d, REASON :%d]",\
pst->event, cfgRsp->ueId, cfgRsp->reason);
if((pst->event == EVENT_RLC_UE_RECONFIG_RSP))
{
}
ret = RFAILED;
}
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeCfgRsp));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeReconfigRsp));
}
else
{
- DU_LOG("\nERROR --> DU_APP: Received RLC Ue Config Response is NULL at DuProcRlcUeCfgRsp()");
+ DU_LOG("\nERROR --> DU_APP: Received RLC Ue ReConfig Response is NULL at DuProcRlcUeReconfigRsp()");
ret = RFAILED;
}
return ret;
}
-
/**********************************************************************************
*
* @brief Fills Ue ReCfg from DU DB to RlcUeRecfg
*
* Functionality: Builds and Send Ue Reconfig Req to RLC
*
- * @params[in] cellId, crnti
+ * @params[in] uint16_t cellId,
+ * uint6_t crnti #AS per 38.473 V15.3.0, Section 9.3.1.32 crnti
+ * value range is b/w 0..65535#
* DuUeCfg *ueCfgDb
- * RlcUeCfg *rlcUeCfg
+ * RlcUeCreate *rlcUeCfg
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t duBuildAndSendUeRecfgReqToRlc(uint8_t cellId, uint8_t gnbDuUeF1apId, uint8_t crnti, DuUeCfg *ueCfgDb)
+uint8_t duBuildAndSendUeRecfgReqToRlc(uint16_t cellId, uint8_t gnbDuUeF1apId, uint16_t crnti, DuUeCfg *ueCfgDb)
{
uint8_t ret = ROK;
DuRlcUeCfg *duRlcUeCfg = NULLP;
*
* Functionality: Builds and Send Ue Reconfig Req to MAC
*
- * @params[in] CellGroupConfigRrc_t *macCellGrpCfg
+ * @params[in] uint16_t cellId,
+ * uint6_t crnti #AS per 38.473 V15.3.0, Section 9.3.1.32 crnti
+ * value range is b/w 0..65535#
+ * CellGroupConfigRrc_t *macCellGrpCfg
* DuUeCfg *ueCfgDb
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t duBuildAndSendUeRecfgReqToMac(uint8_t cellId, uint8_t duUeF1apId, uint8_t crnti, DuUeCfg *ueCfgDb)
+uint8_t duBuildAndSendUeRecfgReqToMac(uint16_t cellId, uint8_t duUeF1apId, uint16_t crnti, DuUeCfg *ueCfgDb)
{
uint8_t ret = ROK;
DuMacUeCfg *duMacUeCfg = NULLP;
/*******************************************************************
*
- * @brief delete RlcUeCfg from duCb
+ * @brief delete RlcUeCreate from duCb
*
* @details
*
* Function : deleteRlcUeCfg
*
* Functionality:
- * delete RlcUeCfg from duCb
+ * delete RlcUeCreate from duCb
*
- * @params[in] RlcUeCfg *ueCfg
+ * @params[in] RlcUeCreate *ueCfg
*
* @return ROK - success
* RFAILED - failure
}
DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->snssai, sizeof(Snssai));
}
- memset(ueCfg, 0, sizeof(RlcUeCfg));
+ memset(ueCfg, 0, sizeof(DuRlcUeCfg));
}
}
return ret;
}
+/*******************************************************************
+*
+* @brief Handle UE sync status indication from MAC
+*
+* @details
+*
+* Function : DuProcMacUeSyncStatusInd
+*
+* Functionality: Handle UE sync status indication from MAC
+*
+* @params[in] Pointer to MacUeSyncStatusInd and Pst
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd)
+{
+ uint8_t ret =RFAILED;
+ uint16_t cellIdx=0, crnti = 0;
+ char *status;
+
+ if(ueSyncStatusInd)
+ {
+ GET_CELL_IDX(ueSyncStatusInd->cellId, cellIdx);
+ if(duCb.actvCellLst[cellIdx])
+ {
+ GET_CRNTI(crnti, ueSyncStatusInd->ueId);
+ if(duCb.actvCellLst[cellIdx]->ueCb[ueSyncStatusInd->ueId-1].crnti == crnti)
+ {
+ switch(ueSyncStatusInd->status)
+ {
+ case IN_SYNC:
+ status = "IN_SYNC";
+ break;
+
+ case OUT_OF_SYNC:
+ status = "OUT_OF_SYNC";
+ break;
+
+ case OUT_OF_SUNC_MAX_RETRIES:
+ status = "OUT_OF_SUNC_MAX_RETRIES";
+ break;
+
+ default:
+ status = "INVALID";
+ break;
+
+ }
+ DU_LOG("\nINFO --> DU APP : MAC UE sync status for received UeId %d is %s", ueSyncStatusInd->ueId,status);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeSyncStatusInd(): MAC UE sync status indication : Ue Id [%d] not found",ueSyncStatusInd->cellId);
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeSyncStatusInd(): MAC UE sync status indication : Cell Id [%d] not found",ueSyncStatusInd->cellId);
+ }
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, ueSyncStatusInd, sizeof(MacUeSyncStatusInd));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeSyncStatusInd(): MAC UE sync status indication is null");
+ }
+ 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;idx<numLcToReestablish; idx++)
+ {
+ ueReestablish->lcToReestablish[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
***********************************************************************/