From dee0e42150c8768c2ded8ce8c9c19dd8ab59764f Mon Sep 17 00:00:00 2001 From: "lal.harshita" Date: Wed, 5 Apr 2023 10:29:58 +0530 Subject: [PATCH] [EPIC-ID: ODUHIGH-488][TASK-ID: ODUHIGH-494] Rebasing to master branch Change-Id: I98bf5aac7573d62d52203475ede3fca20a5c0b12 Signed-off-by: lal.harshita Change-Id: Idef044ca216ed7557ea5932f5e20a297c4fd13d7 --- src/5gnrmac/mac.h | 26 +-- src/5gnrmac/mac_cfg_hdl.c | 49 ++++++ src/5gnrmac/mac_msg_router.c | 7 + src/5gnrmac/mac_ue_mgr.c | 52 +++--- src/5gnrrlc/rlc_dl_ul_inf_ul.c | 14 +- src/5gnrrlc/rlc_mgr.c | 89 +++++++++-- src/5gnrrlc/rlc_mgr.h | 7 +- src/5gnrrlc/rlc_msg_hdl.c | 200 +++++++++++++++++++++-- src/5gnrrlc/rlc_ul_msg_router.c | 5 + src/5gnrrlc/rlc_upr_inf_api.c | 58 +++++++ src/5gnrrlc/rlc_upr_inf_api.h | 2 + src/cm/common_def.c | 14 +- src/cm/common_def.h | 3 +- src/cm/du_app_mac_inf.c | 108 +++++++++++-- src/cm/du_app_mac_inf.h | 181 +++++++++++++++++++-- src/cm/du_app_rlc_inf.c | 346 ++++++++++++++++++++++++++++++++++++++-- src/cm/du_app_rlc_inf.h | 154 +++++++++++++----- src/du_app/du_cell_mgr.c | 56 +++++++ src/du_app/du_f1ap_msg_hdl.c | 4 +- src/du_app/du_mgr_msg_router.c | 16 +- src/du_app/du_ue_mgr.c | 337 +++++++++++++++++++++++++++++++++----- 21 files changed, 1517 insertions(+), 211 deletions(-) diff --git a/src/5gnrmac/mac.h b/src/5gnrmac/mac.h index ea4bfa0cd..64ff813fb 100644 --- a/src/5gnrmac/mac.h +++ b/src/5gnrmac/mac.h @@ -229,19 +229,19 @@ typedef struct macUeCb struct macCellCb { - uint16_t cellId; - uint16_t numOfSlots; - MacCellStatus state; - uint16_t crntiMap; - MacRaCbInfo macRaCb[MAX_NUM_UE]; - MacDlSlot dlSlot[MAX_SLOTS]; - MacUlSlot ulSlot[MAX_SLOTS]; - uint16_t numActvUe; - MacUeCfg *ueCfgTmpData[MAX_NUM_UE]; - MacUeRecfg *ueRecfgTmpData[MAX_NUM_UE]; - MacUeCb ueCb[MAX_NUM_UE]; - MacCellCfg macCellCfg; - SlotTimingInfo currTime; + uint16_t cellId; + uint16_t numOfSlots; + MacCellStatus state; + uint16_t crntiMap; + MacRaCbInfo macRaCb[MAX_NUM_UE]; + MacDlSlot dlSlot[MAX_SLOTS]; + MacUlSlot ulSlot[MAX_SLOTS]; + uint16_t numActvUe; + MacUeCreateReq *ueCfgTmpData[MAX_NUM_UE]; + MacUeRecfg *ueRecfgTmpData[MAX_NUM_UE]; + MacUeCb ueCb[MAX_NUM_UE]; + MacCellCfg macCellCfg; + SlotTimingInfo currTime; }; typedef struct macCb diff --git a/src/5gnrmac/mac_cfg_hdl.c b/src/5gnrmac/mac_cfg_hdl.c index 1af9b0b0b..ac05143dc 100644 --- a/src/5gnrmac/mac_cfg_hdl.c +++ b/src/5gnrmac/mac_cfg_hdl.c @@ -961,6 +961,55 @@ uint8_t MacProcDlPcchInd(Pst *pst, DlPcchInd *pcchInd) } return ret; } + +/** + * @brief Mac process the downlink Broadcast Req received from DUAPP + * + * @details + * + * Function : MacProcDlBroadcastReq + * + * This function process the downlink Broadcast Req received from DUAPP + * + * @param[in] Pst *pst + * @param[in] DlBroadcastReq *dlBroadcastReq + * @return int + * -# ROK + **/ +uint8_t MacProcDlBroadcastReq(Pst *pst, MacDlBroadcastReq *dlBroadcastReq) +{ + uint8_t ret = ROK, idx=0; + uint16_t cellIdx = 0; + + if(dlBroadcastReq) + { + DU_LOG("\nINFO --> MAC : Received DL braodcast req from DU_APP for cellId[%d]", dlBroadcastReq->cellId); + + GET_CELL_IDX(dlBroadcastReq->cellId, cellIdx); + + if(macCb.macCell[cellIdx] == NULLP || macCb.macCell[cellIdx]->cellId != dlBroadcastReq->cellId) + { + ret = RFAILED; + DU_LOG("\nERROR --> MAC : MacProcDlBroadcastReq(): CellId[%d] does not exist", dlBroadcastReq->cellId); + } + else + { + /*TODO - Complete the processing of DL Broadcast Request*/ + } + for(idx = 0; idxnumSiBlock; idx++) + { + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlBroadcastReq->siSchedulingInfo[idx]->siAreaID, sizeof(uint8_t)); + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlBroadcastReq->siSchedulingInfo[idx], sizeof(SiSchedulingInfo)); + } + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, dlBroadcastReq, sizeof(MacDlBroadcastReq)); + } + else + { + ret = RFAILED; + DU_LOG("\nERROR --> MAC : MacProcDlBroadcastReq(): Received Null pointer"); + } + return ret; +} /********************************************************************** End of file **********************************************************************/ diff --git a/src/5gnrmac/mac_msg_router.c b/src/5gnrmac/mac_msg_router.c index 114e1d824..1ed8fb3b0 100755 --- a/src/5gnrmac/mac_msg_router.c +++ b/src/5gnrmac/mac_msg_router.c @@ -173,6 +173,13 @@ void MacHdlDuappEvents(Pst *pst, Buffer *mBuf) unpackMacDlPcchInd(MacProcDlPcchInd, pst, mBuf); break; } + case EVENT_MAC_DL_BROADCAST_REQ: + { + /* Process Dl Broadcast Request */ + unpackMacDlBroadcastReq(MacProcDlBroadcastReq, pst, mBuf); + break; + } + case EVENT_MAC_UE_RESET_REQ: { /* Process UE Reset Request */ diff --git a/src/5gnrmac/mac_ue_mgr.c b/src/5gnrmac/mac_ue_mgr.c index 99c4e8d71..cea930536 100644 --- a/src/5gnrmac/mac_ue_mgr.c +++ b/src/5gnrmac/mac_ue_mgr.c @@ -28,11 +28,11 @@ #include "mac.h" #include "mac_utils.h" -MacDuUeCfgRspFunc macDuUeCfgRspOpts[] = +MacDuUeCreateRspFunc macDuUeCreateRspOpts[] = { - packDuMacUeCfgRsp, /* packing for loosely coupled */ - DuProcMacUeCfgRsp, /* packing for tightly coupled */ - packDuMacUeCfgRsp /* packing for light weight loosly coupled */ + packDuMacUeCreateRsp, /* packing for loosely coupled */ + DuProcMacUeCreateRsp, /* packing for tightly coupled */ + packDuMacUeCreateRsp /* packing for light weight loosly coupled */ }; MacDuUeRecfgRspFunc macDuUeRecfgRspOpts[] = @@ -1756,7 +1756,7 @@ uint8_t fillLogicalChannelCfg(SchLcCfg *schLcCfg, LcCfg *macLcCfg) * * ****************************************************************/ -uint8_t fillSchLcCfgList(SchUeCfgReq *schUeCfg, MacUeCfg *ueCfg) +uint8_t fillSchLcCfgList(SchUeCfgReq *schUeCfg, MacUeCreateReq *ueCfg) { uint8_t lcIdx; @@ -1836,7 +1836,7 @@ uint8_t fillSchLcRecfgList(SchUeRecfgReq *schUeRecfg, MacUeRecfg *ueRecfg) * RFAILED - failure * * ****************************************************************/ -uint8_t fillSchUeCfg(SchUeCfgReq *schUeCfg, MacUeCfg *ueCfg) +uint8_t fillSchUeCfg(SchUeCfgReq *schUeCfg, MacUeCreateReq *ueCfg) { uint8_t ret = ROK; @@ -2225,7 +2225,7 @@ void updateMacDlLcCtxt(UeDlCb *dlInfo, LcCfg *ueLcCfg, uint8_t lcIdToDel) * * ****************************************************************/ -uint8_t fillMacLcCfgList(MacUeCb *ueCb, MacUeCfg *ueCfg) +uint8_t fillMacLcCfgList(MacUeCb *ueCb, MacUeCreateReq *ueCfg) { uint8_t lcIdx = 0; @@ -2378,7 +2378,7 @@ uint8_t updateMacLcCfgList(MacUeCb *ueCb, MacUeRecfg *ueRecfg) * * ****************************************************************/ -uint8_t fillMacUeCb(MacUeCb *ueCb, MacUeCfg *ueCfg, uint8_t cellIdx) +uint8_t fillMacUeCb(MacUeCb *ueCb, MacUeCreateReq *ueCfg, uint8_t cellIdx) { uint8_t ret = ROK; @@ -2531,7 +2531,7 @@ void deleteMacRaCb(uint16_t cellIdx, MacUeCb *ueCb) * RFAILED - failure * * ****************************************************************/ -uint8_t createUeCb(uint8_t cellIdx, MacUeCb *ueCb, MacUeCfg *ueCfg) +uint8_t createUeCb(uint8_t cellIdx, MacUeCb *ueCb, MacUeCreateReq *ueCfg) { uint8_t ret = ROK; uint8_t hqProcIdx = 0; @@ -2630,7 +2630,7 @@ uint8_t modifyUeCb(uint8_t cellIdx, MacUeCb *ueCb, MacUeRecfg *ueRecfg) * * ****************************************************************/ -uint8_t procMacUeCfgData(Pst *pst, MacUeCfg *ueCfg, MacUeRecfg *ueRecfg) +uint8_t procMacUeCfgData(Pst *pst, MacUeCreateReq *ueCfg, MacUeRecfg *ueRecfg) { uint8_t ret = ROK, ueId = 0; uint16_t cellIdx, cellId; @@ -2702,27 +2702,27 @@ uint8_t procMacUeCfgData(Pst *pst, MacUeCfg *ueCfg, MacUeRecfg *ueRecfg) * * Functionality: Function to store the UeCfg Data * - * @params[in] MacUeCfg pointer + * @params[in] MacUeCreateReq pointer * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t copyToTmpData(MacUeCfg *ueCfg, MacUeRecfg *ueRecfg) +uint8_t copyToTmpData(MacUeCreateReq *ueCfg, MacUeRecfg *ueRecfg) { uint8_t cellIdx; if(ueCfg != NULLP) { - MacUeCfg *tmpData = NULLP; + MacUeCreateReq *tmpData = NULLP; - MAC_ALLOC(tmpData, sizeof(MacUeCfg)); + MAC_ALLOC(tmpData, sizeof(MacUeCreateReq)); if(!tmpData) { DU_LOG("\nERROR --> MAC: Memory Alloc Failed at copyToTmpData()"); return RFAILED; } - memcpy(tmpData, ueCfg, sizeof(MacUeCfg)); + memcpy(tmpData, ueCfg, sizeof(MacUeCreateReq)); GET_CELL_IDX(ueCfg->cellId, cellIdx); macCb.macCell[cellIdx]->ueCfgTmpData[ueCfg->ueId-1] = tmpData; } @@ -2758,7 +2758,7 @@ uint8_t copyToTmpData(MacUeCfg *ueCfg, MacUeRecfg *ueRecfg) * RFAILED - failure * * ****************************************************************/ -uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg) +uint8_t MacProcUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg) { uint8_t ret = ROK; SchUeCfgReq schUeCfg; @@ -2802,7 +2802,7 @@ uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg) ret = RFAILED; } /* FREE shared memory */ - MAC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(MacUeCfg)); + MAC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(MacUeCreateReq)); return ret; } @@ -2825,10 +2825,10 @@ uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg) * ****************************************************************/ uint8_t MacSendUeCreateRsp(MacRsp result, SchUeCfgRsp *schCfgRsp) { - MacUeCfgRsp *cfgRsp; + MacUeCreateRsp *cfgRsp; Pst rspPst; - MAC_ALLOC_SHRABL_BUF(cfgRsp, sizeof(MacUeCfgRsp)); + MAC_ALLOC_SHRABL_BUF(cfgRsp, sizeof(MacUeCreateRsp)); if(!cfgRsp) { DU_LOG("\nERROR --> MAC: Memory allocation for UE config response failed"); @@ -2836,7 +2836,7 @@ uint8_t MacSendUeCreateRsp(MacRsp result, SchUeCfgRsp *schCfgRsp) } /* Filling UE Config response */ - memset(cfgRsp, 0, sizeof(MacUeCfgRsp)); + memset(cfgRsp, 0, sizeof(MacUeCreateRsp)); cfgRsp->cellId = schCfgRsp->cellId; cfgRsp->ueId = schCfgRsp->ueId; cfgRsp->result = result; @@ -2844,7 +2844,7 @@ uint8_t MacSendUeCreateRsp(MacRsp result, SchUeCfgRsp *schCfgRsp) /* Fill Post structure and send UE Create response*/ memset(&rspPst, 0, sizeof(Pst)); FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_CREATE_RSP); - return (*macDuUeCfgRspOpts[rspPst.selector])(&rspPst, cfgRsp); + return (*macDuUeCreateRspOpts[rspPst.selector])(&rspPst, cfgRsp); } /******************************************************************* @@ -2900,14 +2900,14 @@ uint8_t MacSendUeReconfigRsp(MacRsp result, SchUeRecfgRsp *schCfgRsp) * * @params[in] cellIdx, ueId * - * @return MacUeCfg pointer - success + * @return MacUeCreateReq pointer - success * NULLP - failure * * ****************************************************************/ -MacUeCfg *getMacUeCfg(uint16_t cellIdx, uint8_t ueId) +MacUeCreateReq *getMacUeCfg(uint16_t cellIdx, uint8_t ueId) { - MacUeCfg *ueCfg = NULLP; + MacUeCreateReq *ueCfg = NULLP; if(macCb.macCell[cellIdx]) { ueCfg = macCb.macCell[cellIdx]->ueCfgTmpData[ueId-1]; @@ -2974,7 +2974,7 @@ uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *schCfgRsp) uint8_t result = MAC_DU_APP_RSP_NOK; uint8_t ret = ROK; uint16_t cellIdx; - MacUeCfg *ueCfg = NULLP; + MacUeCreateReq *ueCfg = NULLP; #ifdef CALL_FLOW_DEBUG_LOG switch(pst->event) @@ -3016,7 +3016,7 @@ uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *schCfgRsp) DU_LOG("\nERROR --> MAC: SCH UeConfigRsp for CRNTI[%d] is failed in MacProcSchUeCfgRsp()", schCfgRsp->crnti); } ret = MacSendUeCreateRsp(result, schCfgRsp); - MAC_FREE(ueCfg, sizeof(MacUeCfg)); + MAC_FREE(ueCfg, sizeof(MacUeCreateReq)); ueCfg = NULLP; return ret; } diff --git a/src/5gnrrlc/rlc_dl_ul_inf_ul.c b/src/5gnrrlc/rlc_dl_ul_inf_ul.c index 09dad61ae..b6afa2021 100755 --- a/src/5gnrrlc/rlc_dl_ul_inf_ul.c +++ b/src/5gnrrlc/rlc_dl_ul_inf_ul.c @@ -262,12 +262,12 @@ RlcCfgCfmInfo *cfmInfo if(tRlcCb->u.ulCb->rlcUlUdxEventType == EVENT_RLC_UE_CREATE_REQ) { FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_CREATE_RSP); - SendRlcUeCfgRspToDu(&rspPst, cfgCfm); + SendRlcUeCreateRspToDu(&rspPst, cfgCfm); } else if(tRlcCb->u.ulCb->rlcUlUdxEventType == EVENT_RLC_UE_RECONFIG_REQ) { FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_RECONFIG_RSP); - SendRlcUeCfgRspToDu(&rspPst, cfgCfm); + SendRlcUeReconfigRspToDu(&rspPst, cfgCfm); } else if (tRlcCb->u.ulCb->rlcUlUdxEventType == EVENT_RLC_UE_DELETE_REQ) { @@ -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.c b/src/5gnrrlc/rlc_mgr.c index 60391efc0..dd6793464 100644 --- a/src/5gnrrlc/rlc_mgr.c +++ b/src/5gnrrlc/rlc_mgr.c @@ -35,13 +35,19 @@ #include "du_app_rlc_inf.h" #include "rlc_mgr.h" -RlcDuUeCfgRsp rlcUeCfgRspOpts[] = +RlcDuUeCreateRsp rlcUeCreateRspOpts[] = { - packRlcDuUeCfgRsp, /* 0 - loosely coupled */ - DuProcRlcUeCfgRsp, /* 1 - tightly coupled */ - packRlcDuUeCfgRsp /* 2 - LWLC loosely coupled */ + packRlcDuUeCreateRsp, /* 0 - loosely coupled */ + DuProcRlcUeCreateRsp, /* 1 - tightly coupled */ + packRlcDuUeCreateRsp /* 2 - LWLC loosely coupled */ }; +RlcDuUeReconfigRsp rlcUeReconfigRspOpts[] = +{ + packRlcDuUeReconfigRsp, /* 0 - loosely coupled */ + DuProcRlcUeReconfigRsp, /* 1 - tightly coupled */ + packRlcDuUeReconfigRsp /* 2 - LWLC loosely coupled */ +}; /*********************************************************** * @@ -61,15 +67,15 @@ RlcDuUeCfgRsp rlcUeCfgRspOpts[] = * -# RFAILED * *************************************************************/ -uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp) +uint8_t SendRlcUeCreateRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp) { /* jump to specific primitive depending on configured selector */ uint8_t ret = ROK; RlcCb *gCb; - RlcUeCfgRsp *ueRsp = NULLP; + RlcUeCreateRsp *ueRsp = NULLP; gCb = RLC_GET_RLCCB(pst->srcInst); - RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp)); + RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp)); if(!ueRsp) { DU_LOG("\nERROR --> RLC: Memory allocation failed for ueRsp at SendRlcUeCreateRspToDu()"); @@ -78,25 +84,80 @@ uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp) else { /* Mapping Old api to New Api */ - ret = fillRlcUeCfgRsp(ueRsp, cfgRsp); + ret = fillRlcUeCreateRsp(ueRsp, cfgRsp); + if(!ret) + { + ret = (*rlcUeCreateRspOpts[pst->selector])(pst, ueRsp); + if(ret) + { + DU_LOG("\nERROR --> RLC: Failed at SendRlcUeCreateRspToDu()"); + RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp)); + } + } + else + { + DU_LOG("\nERROR --> RLC: Failed at fillRlcUeCreateRsp() for event %d", pst->event); + RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp)); + } + } + RLC_FREE(gCb, cfgRsp, sizeof(RlcCfgCfmInfo)); + return ret; +} /* end of SendRlcUeCreateRspToDu */ + +/*********************************************************** + * + * @brief + * + * Handler for the ue Reconfig response to DUAPP + * + * @b Description: + * + * This function reports ue Reconfig response to DUAPP + * + * @param[in] post Post structure + * @param[in] cfgRsp ue reconfig Config Response + * + * @return uint16_t + * -# ROK + * -# RFAILED + * + *************************************************************/ +uint8_t SendRlcUeReconfigRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp) +{ + /* jump to specific primitive depending on configured selector */ + uint8_t ret = ROK; + RlcCb *gCb; + RlcUeReconfigRsp *ueRsp = NULLP; + + gCb = RLC_GET_RLCCB(pst->srcInst); + RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp)); + if(!ueRsp) + { + DU_LOG("\nERROR --> RLC: Memory allocation failed for ueRsp at SendRlcUeReconfigRspToDu()"); + ret = RFAILED; + } + else + { + /* Mapping Old api to New Api */ + ret = fillRlcUeCreateRsp(ueRsp, cfgRsp); if(!ret) { - ret = (*rlcUeCfgRspOpts[pst->selector])(pst, ueRsp); + ret = (*rlcUeReconfigRspOpts[pst->selector])(pst, ueRsp); if(ret) { - DU_LOG("\nERROR --> RLC: Failed at SendRlcUeCfgRspToDu()"); - RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp)); + DU_LOG("\nERROR --> RLC: Failed at SendRlcUeReconfigRspToDu()"); + RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp)); } } else { - DU_LOG("\nERROR --> RLC: Failed at fillRlcUeCfgRsp() for event %d", pst->event); - RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp)); + DU_LOG("\nERROR --> RLC: Failed at fillRlcUeCreateRsp() for event %d", pst->event); + RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp)); } } RLC_FREE(gCb, cfgRsp, sizeof(RlcCfgCfmInfo)); return ret; -} /* end of SendRlcUeCfgRspToDu */ +} /* end of SendRlcUeReconfigRspToDu */ /********************************************************************** End of file diff --git a/src/5gnrrlc/rlc_mgr.h b/src/5gnrrlc/rlc_mgr.h index c3b64893a..956b77282 100644 --- a/src/5gnrrlc/rlc_mgr.h +++ b/src/5gnrrlc/rlc_mgr.h @@ -17,10 +17,11 @@ *******************************************************************************/ /* This file stores defines used at RLC interface */ -uint8_t fillRlcUeCfgRsp(RlcUeCfgRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp); -uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp); +uint8_t fillRlcUeCreateRsp(RlcUeCreateRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp); +uint8_t SendRlcUeCreateRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp); +uint8_t SendRlcUeReconfigRspToDu(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..38f0456fa 100644 --- a/src/5gnrrlc/rlc_msg_hdl.c +++ b/src/5gnrrlc/rlc_msg_hdl.c @@ -40,25 +40,77 @@ #include "du_app_rlc_inf.h" #include "rlc_upr_inf_api.h" #include "rlc_mgr.h" + +/******************************************************************* + * + * @brief building and sending UE max retransmission info to DU + * + * @details + * + * Function : BuildAndSendRlcMaxRetransIndToDu + * + * Functionality: + * Building and sending UE max retransmission information to DU + * + * @params[in] uint8_t cellId, uint8_t ueId, CauseOfResult status + * + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t BuildAndSendRlcMaxRetransIndToDu(uint16_t cellId,uint8_t ueId, uint8_t lcId, uint8_t lcType) +{ + Pst pst; + RlcMaxRetransInfo *maxRetransInfo = NULLP; + + FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_RLC_MAX_RETRANSMISSION); + + RLC_ALLOC_SHRABL_BUF(pst.region, pst.pool, maxRetransInfo, sizeof(RlcMaxRetransInfo)); + if(!maxRetransInfo) + { + DU_LOG("\nERROR --> RLC: sendRlcMaxRetransIndToDu(): Memory allocation failed "); + return RFAILED; + } + else + { + maxRetransInfo->cellId = cellId; + maxRetransInfo->ueId = ueId; + maxRetransInfo->lcId = lcId; + maxRetransInfo->lcType = lcType; + + if(rlcSendMaxRetransIndToDu(&pst, maxRetransInfo) == ROK) + { + DU_LOG("\nDEBUG --> RLC: UE [ %d] max retransmission information sent successfully",ueId); + } + else + { + DU_LOG("\nERROR --> RLC: SendRlcMaxRetransIndToDu(): fail to send UeId's[%d] maximum retransmission information", ueId); + RLC_FREE_SHRABL_BUF(pst.region, pst.pool, maxRetransInfo, sizeof(RlcMaxRetransInfo)); + return RFAILED; + } + } + return ROK; +} + /******************************************************************* * * @brief Fills RLC UL UE Cfg Rsp from RlcCRsp * * @details * - * Function : fillRlcUeCfgRsp + * Function : fillRlcUeCreateRsp * * Functionality: * Fills RLC UL UE Cfg Rsp from RlcCRsp * * @params[in] Pointer to RlcCfgCfm - * Pointer to RlcUeCfgRsp + * Pointer to RlcUeCreateRsp * * @return ROK/RFAILED * *****************************************************************/ -uint8_t fillRlcUeCfgRsp(RlcUeCfgRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp) +uint8_t fillRlcUeCreateRsp(RlcUeCreateRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp) { uint8_t idx; uint8_t ret = ROK; @@ -222,7 +274,7 @@ uint8_t fillLcCfg(RlcCb *gCb, RlcEntCfgInfo *rlcUeCfg, RlcBearerCfg *duRlcUeCfg) * ******************************************************************/ -uint8_t fillRlcCfg(RlcCb *gCb, RlcCfgInfo *rlcUeCfg, RlcUeCfg *ueCfg) +uint8_t fillRlcCfg(RlcCb *gCb, RlcCfgInfo *rlcUeCfg, RlcUeCreate *ueCfg) { uint8_t lcIdx; @@ -314,12 +366,12 @@ uint8_t updateRlcCfg(RlcCb *gCb, RlcCfgInfo *rlcUeCfg, RlcUeRecfg *ueRecfg) * Functionality: * Fill RlcCfgCfmInfo structure for sending failure response to DU * - * @params[in] RlcCfgCfmInfo *cfgRsp, RlcUeCfg *ueCfg + * @params[in] RlcCfgCfmInfo *cfgRsp, RlcUeCreate *ueCfg * * @return void * * ****************************************************************/ -void fillRlcCfgFailureRsp(RlcCfgCfmInfo *cfgRsp, RlcUeCfg *ueCfg) +void fillRlcCfgFailureRsp(RlcCfgCfmInfo *cfgRsp, RlcUeCreate *ueCfg) { uint8_t cfgIdx =0; @@ -346,7 +398,7 @@ void fillRlcCfgFailureRsp(RlcCfgCfmInfo *cfgRsp, RlcUeCfg *ueCfg) * Functionality: * Fill RlcCfgCfmInfo structure for sending failure response to DU * - * @params[in] RlcCfgCfmInfo *cfgRsp, RlcUeCfg *ueCfg + * @params[in] RlcCfgCfmInfo *cfgRsp, RlcUeCreate *ueCfg * * @return void * @@ -396,12 +448,12 @@ void fillRlcRecfgFailureRsp(RlcCfgCfmInfo *cfgRsp, RlcUeRecfg *ueRecfg) * Handles Ue create Request from DU APP * * @params[in] Post structure pointer - * RlcUeCfg pointer + * RlcUeCreate pointer * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) +uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCreate *ueCfg) { uint8_t ret = ROK; RlcCb *gCb; @@ -425,7 +477,7 @@ uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) DU_LOG("\nERROR --> RLC: Failed to fill configuration at RlcProcUeCreateReq()"); FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_CREATE_RSP); fillRlcCfgFailureRsp(&cfgRsp, ueCfg); - SendRlcUeCfgRspToDu(&rspPst, &cfgRsp); + SendRlcUeCreateRspToDu(&rspPst, &cfgRsp); } else @@ -435,7 +487,7 @@ uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) DU_LOG("\nERROR --> RLC: Failed to configure Add/Mod/Del entities at RlcProcUeCreateReq()"); } } - RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(RlcUeCfg)); + RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(RlcUeCreate)); return ret; } @@ -756,7 +808,7 @@ uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeRecfg *ueRecfg) RlcCb *rlcUeCb = NULLP; RlcCfgCfmInfo cfgRsp; Pst rspPst; - + DU_LOG("\nDEBUG --> RLC: UE reconfig request received. CellID[%d] UEID[%d]",ueRecfg->cellId, ueRecfg->ueId); rlcUeCb = RLC_GET_RLCCB(pst->dstInst); @@ -775,7 +827,7 @@ uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeRecfg *ueRecfg) DU_LOG("\nERROR --> RLC: Failed to fill configuration at RlcProcUeReconfigReq()"); FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_RECONFIG_RSP); fillRlcRecfgFailureRsp(&cfgRsp, ueRecfg); - SendRlcUeCfgRspToDu(&rspPst, &cfgRsp); + SendRlcUeReconfigRspToDu(&rspPst, &cfgRsp); } else { @@ -1120,10 +1172,126 @@ uint8_t BuildSliceReportToDu(uint8_t snssaiCnt) } dir++; } - + 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..ae28ef62d 100644 --- a/src/5gnrrlc/rlc_upr_inf_api.c +++ b/src/5gnrrlc/rlc_upr_inf_api.c @@ -26,6 +26,13 @@ RlcUlRrcMsgToDuFunc rlcSendUlRrcMsgToDuOpts[] = packRlcUlRrcMsgToDu /* 2 - Light weight loosely coupled */ }; +RlcDuMaxRetransInd rlcMaxRetransIndOpts[] = +{ + packRlcDuMaxRetransInd, /* 0 - loosely coupled */ + DuProcRlcMaxRetransInd, /* 1 - tightly coupled */ + packRlcDuMaxRetransInd /* 2 - LWLC loosely coupled */ +}; + RlcRrcDeliveryReportToDuFunc rlcSendRrcDeliveryReportToDuOpts[]= { packRrcDeliveryReportToDu, /* 0 - Loosely coupled */ @@ -62,6 +69,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 @@ -83,6 +98,27 @@ uint8_t rlcSendUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo) return (*rlcSendUlRrcMsgToDuOpts[pst->selector])(pst, ulRrcMsgInfo); } +/******************************************************************* +* +* @brief Sends max retransmission reached Info to DU APP +* +* @details +* +* Function : rlcSendMaxRetransIndToDu +* +* Functionality: Sends max retransmission reached Info to DU APP +* +* @params[in] Pst structure +* max retransmission reached Info +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ +uint8_t rlcSendMaxRetransIndToDu(Pst *pst, RlcMaxRetransInfo *maxRetransInfo) +{ + return (*rlcMaxRetransIndOpts[pst->selector])(pst, maxRetransInfo); +} + /******************************************************************* * * @brief Sends RRC delivery Message Info to DU APP @@ -186,6 +222,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..9299942ca 100644 --- a/src/5gnrrlc/rlc_upr_inf_api.h +++ b/src/5gnrrlc/rlc_upr_inf_api.h @@ -16,12 +16,14 @@ ################################################################################ *******************************************************************************/ +uint8_t rlcSendMaxRetransIndToDu(Pst *pst, RlcMaxRetransInfo *maxRetransInfo); uint8_t rlcSendUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo); uint8_t rlcSendRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDelivery); 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.c b/src/cm/common_def.c index 444db96f8..5aa8705e5 100644 --- a/src/cm/common_def.c +++ b/src/cm/common_def.c @@ -447,16 +447,16 @@ uint32_t convertArfcnToFreqKhz(uint32_t arfcn) uint8_t indexTable = 0; uint32_t freq = 0; - for(indexTable = 0; indexTable < 4; indexTable++) + for(indexTable = 0; indexTable < 3; indexTable++) { if(arfcn <= arfcnFreqTable[indexTable][4]) { - freq = arfcnFreqTable[indexTable][2] + (arfcnFreqTable[indexTable][1] * (arfcn - arfcnFreqTable[indexTable][3])); - return (freq*1000); + freq = (arfcnFreqTable[indexTable][2] * 1000) + (arfcnFreqTable[indexTable][1] * (arfcn - arfcnFreqTable[indexTable][3])); + return (freq); } } DU_LOG("ERROR --> DUAPP: ARFCN vaid range is between 0 and 3279165"); - return (freq*1000); + return (freq); } @@ -472,7 +472,7 @@ uint32_t convertArfcnToFreqKhz(uint32_t arfcn) * 3GPP TS 38.104, Table 5.4.2.1-1 * Formula: NREF = NREF-Offs + (FREF – FREF-Offs) / ΔFGlobal * -* @params[in] uint32_t Freq(MHZ) +* @params[in] uint32_t Freq(kHZ) * * @return [out] uint32_t ARFCN(number) * @@ -482,11 +482,11 @@ uint32_t convertFreqToArfcn(uint32_t freq) uint8_t indexTable = 0; uint32_t arfcn = 0; - for(indexTable = 0; indexTable < 4; indexTable++) + for(indexTable = 0; indexTable < 3; indexTable++) { if(freq < arfcnFreqTable[indexTable][0]) { - arfcn = arfcnFreqTable[indexTable][3] + ((freq - arfcnFreqTable[indexTable][2]) / (arfcnFreqTable[indexTable][1])); + arfcn = arfcnFreqTable[indexTable][3] + ((freq - (arfcnFreqTable[indexTable][2] * 1000)) / (arfcnFreqTable[indexTable][1])); return (arfcn); } } 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_mac_inf.c b/src/cm/du_app_mac_inf.c index d5735c880..3ea1b0cce 100644 --- a/src/cm/du_app_mac_inf.c +++ b/src/cm/du_app_mac_inf.c @@ -687,12 +687,12 @@ uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf) * * * @params[in] Post structure pointer - * MacUeCfg pointer + * MacUeCreateReq pointer * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg) +uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg) { Buffer *mBuf = NULLP; @@ -737,7 +737,7 @@ uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf) { if(pst->selector == ODU_SELECTOR_LWLC) { - MacUeCfg *ueCfg; + MacUeCreateReq *ueCfg; /* unpack the address of the structure */ CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf); @@ -756,21 +756,21 @@ uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf) /******************************************************************* * - * @brief Pack and send UE config response from MAC to DU APP + * @brief Pack and send UE create response from MAC to DU APP * * @details * - * Function : packDuMacUeCfgRsp + * Function : packDuMacUeCreateRsp * * Functionality: - * Pack and send UE config response from MAC to DU APP + * Pack and send UE create response from MAC to DU APP * * @params[in] * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp) +uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp) { Buffer *mBuf = NULLP; @@ -778,7 +778,7 @@ uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp) { if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { - DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeCfgRsp"); + DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeCreateRsp"); return RFAILED; } /* pack the address of the structure */ @@ -786,7 +786,7 @@ uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp) } else { - DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeCfgRsp"); + DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeCreateRsp"); return RFAILED; } @@ -794,24 +794,24 @@ uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp) } /******************************************************************* * - * @brief Unpack UE Config Response from MAC to DU APP + * @brief Unpack UE Create Response from MAC to DU APP * * @details * - * Function :unpackDuMacUeCfgRsp + * Function :unpackDuMacUeCreateRsp * - * Functionality: Unpack UE Config Response from MAC to DU APP + * Functionality: Unpack UE Create Response from MAC to DU APP * * @params[in] * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf) +uint8_t unpackDuMacUeCreateRsp(MacDuUeCreateRspFunc func, Pst *pst, Buffer *mBuf) { if(pst->selector == ODU_SELECTOR_LWLC) { - MacUeCfgRsp *cfgRsp = NULLP; + MacUeCreateRsp *cfgRsp = NULLP; /* unpack the address of the structure */ CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf); @@ -836,7 +836,7 @@ uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf) * * * @params[in] Post structure pointer - * MacUeCfg pointer + * MacUeRecfg pointer * @return ROK - success * RFAILED - failure * @@ -2178,6 +2178,84 @@ uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buff return RFAILED; } +/******************************************************************* +* +* @brief Packs and Sends Dl Broadcast Request from DUAPP to MAC +* +* @details +* +* Function : packDuMacDlBroadcastReq +* +* Functionality: +* Packs and Sends Dl Broadcast Request from DUAPP to MAC +* +* +* @params[in] Post structure pointer +* MacDlBroadcastReq pointer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ +uint8_t packDuMacDlBroadcastReq(Pst *pst, MacDlBroadcastReq *ueDel) +{ + Buffer *mBuf = NULLP; + + if(pst->selector == ODU_SELECTOR_LWLC) + { + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) + { + DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacDlBroadcastReq"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf); + } + else + { + DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacDlBroadcastReq"); + return RFAILED; + } + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* +* +* @brief Unpacks Dl Broadcast Request received from DU APP +* +* @details +* +* Function : unpackMacDlBroadcastReq +* +* Functionality: +* Unpacks Dl Broadcast Request received from DU APP +* +* @params[in] Pointer to Handler +* Post structure pointer +* Message Buffer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ +uint8_t unpackMacDlBroadcastReq(DuMacDlBroadcastReq func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + MacDlBroadcastReq *dlBroadcast; + + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&dlBroadcast, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, dlBroadcast); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> DU APP : Only LWLC supported for Dl Broadcast Request "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} /******************************************************************* * * @brief Searches for first unset bit in ueBitMap diff --git a/src/cm/du_app_mac_inf.h b/src/cm/du_app_mac_inf.h index af3b6229d..56bb46108 100644 --- a/src/cm/du_app_mac_inf.h +++ b/src/cm/du_app_mac_inf.h @@ -21,7 +21,8 @@ #define __MACINT_H__ #define NUM_NUMEROLOGY 5 /* Number of numerology */ - +#define MAX_SI_MESSAGE 32 /* As per 138 331 V15.3, RRC Multiplicity and type constraint definitions maxSI-Message = 32 */ +#define NUM_SIB 32 /* As per 138 331 V15.3, RRC Multiplicity and type constraint definitions maxSIB = 32 */ #define NUM_SSB 1 /* max value is 64 */ #define SSB_MASK_SIZE 1 /* SSB mask size is 32bit for sub6 */ #define SIB1_REPETITION_PERIOD 20 @@ -87,6 +88,7 @@ #define EVENT_MAC_UE_RESET_REQ 225 #define EVENT_MAC_UE_RESET_RSP 226 #define EVENT_MAC_UE_SYNC_STATUS_IND 227 +#define EVENT_MAC_DL_BROADCAST_REQ 228 #define BSR_PERIODIC_TIMER_SF_10 10 #define BSR_RETX_TIMER_SF_320 320 @@ -95,6 +97,73 @@ #define PAGING_SCHED_DELTA 4 #define MAX_PLMN 2 +typedef enum +{ + SIB_TYPE2, + SIB_TYPE3, + SIB_TYPE4, + SIB_TYPE5, + SIB_TYPE6, + SIB_TYPE7, + SIB_TYPE8, + SIB_TYPE9, + SPARE +}SibType; + +typedef enum +{ + SSB_PER_RACH_OCCASION_ONE_EIGHTH, + SSB_PER_RACH_OCCASION_ONE_FOURTH, + SSB_PER_RACH_OCCASION_ONE_HALF, + SSB_PER_RACH_OCCASION_ONE, + SSB_PER_RACH_OCCASION_TWO, + SSB_PER_RACH_OCCASION_FOUR, + SSB_PER_RACH_OCCASION_EIGHT, + SSB_PER_RACH_OCCASION_SIXTEEN +}SsbPerRachOccasion; + +typedef enum +{ + BROADCASTING, + NOTBROADCASTING, +}SiBroadcastStatus; + +typedef enum +{ + RF8, + RF16, + RF32, + RF64, + RF128, + RF256, + RF512 +}SiPeriodicity; + +typedef enum +{ + S5, + S10, + S20, + S40, + S80, + S160, + S320, + S640, + S1280 +}SiWindowLength; + +typedef enum +{ + SI_REQ_PERIOD_1, + SI_REQ_PERIOD_2, + SI_REQ_PERIOD_4, + SI_REQ_PERIOD_6, + SI_REQ_PERIOD_8, + SI_REQ_PERIOD_10, + SI_REQ_PERIOD_12, + SI_REQ_PERIOD_16 +}SiRequestPeriod; + typedef enum { MAC_DU_APP_RSP_NOK, @@ -1458,7 +1527,7 @@ typedef struct modulationInfo McsTable mcsTable; /* MCS table */ }ModulationInfo; -typedef struct macUeCfg +typedef struct macUeCreateReq { uint16_t cellId; uint8_t ueId; @@ -1475,7 +1544,7 @@ typedef struct macUeCfg ModulationInfo ulModInfo; /* UL modulation info */ uint8_t numLcs; LcCfg lcCfgList[MAX_NUM_LC]; -}MacUeCfg; +}MacUeCreateReq; /* UE Re-configuration */ typedef struct macUeRecfg @@ -1529,7 +1598,7 @@ typedef struct sCellFailInfo FailureCause cause; }SCellFailInfo; -typedef struct ueCfgRsp +typedef struct macUeCreateRsp { uint16_t cellId; uint16_t ueId; @@ -1542,9 +1611,9 @@ typedef struct ueCfgRsp SCellFailInfo *failedSCellList; uint8_t numDRBModFailed; /* valid values : 0 to MAX_NUM_DRB */ DRBFailInfo *failedDRBModlist; -}MacUeCfgRsp; +}MacUeCreateRsp; -typedef struct ueCfgRsp MacUeRecfgRsp; +typedef struct macUeCreateRsp MacUeRecfgRsp; typedef struct rachRsrcReq { @@ -1645,6 +1714,7 @@ typedef struct macSliceCfgReq typedef struct macSliceCfgReq MacSliceRecfgReq; typedef struct macSliceCfgRsp MacSliceRecfgRsp; +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.17 DL PCCH Indication */ typedef struct dlPcchInd { uint16_t cellId; @@ -1654,6 +1724,8 @@ typedef struct dlPcchInd uint8_t *pcchPdu; }DlPcchInd; + +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.1 Cell Start */ typedef struct cellInfo { SlotTimingInfo slotInfo; @@ -1663,12 +1735,14 @@ typedef struct cellInfo typedef struct cellInfo CellStartInfo; typedef struct cellInfo CellStopInfo; +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.12 UE Reset Request */ typedef struct ueReset { uint16_t cellId; uint8_t ueId; }MacUeResetReq; +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.13 UE Reset Response */ typedef struct ueResetRsp { uint16_t cellId; @@ -1676,6 +1750,7 @@ typedef struct ueResetRsp CauseOfResult status; }MacUeResetRsp; +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.14 UE Sync Status Indication */ typedef struct ueSyncStatusInd { uint16_t cellId; @@ -1683,6 +1758,81 @@ typedef struct ueSyncStatusInd SyncStatus status; }MacUeSyncStatusInd; +/* The following list of structures is taken from the SI-SchedulingInfo section of specification 33.331. */ +typedef struct sibTypeInfo +{ + SibType sibType; + uint8_t valueTag; + bool areaScope; +}SibTypeInfo; + +typedef struct sibMappingInfo +{ + uint8_t numSibTypeInfo; + SibTypeInfo sibTypeInfo[NUM_SIB]; +}SibMappingInfo; + +typedef struct schedulingInfo +{ + SiBroadcastStatus siBroadcastStatus; + SiPeriodicity siPeriodicity; + SibMappingInfo sibMappingInfo; +}SchedulingInfo; + +typedef struct rachOccasionsSi +{ + RachCfgGeneric rachConfigSi; + SsbPerRachOccasion ssbPerRachOccasion; +}RachOccasionsSi; + +typedef struct siReqRsrc +{ + uint8_t raPreambleStartIndex; + uint8_t raAssociationPeriodIndex; + uint8_t raSsbOccasionMaskIndex; +}SiReqRsrc; + +typedef struct siRequestResource +{ + uint8_t numOfSiReqRsrc; + SiReqRsrc siReqRsrc[MAX_SI_MESSAGE]; +}SiRequestResource; + +typedef struct siRequestConfig +{ + RachOccasionsSi rachOccasionsSi; + SiRequestPeriod siRequestPeriod; + SiRequestResource siRequestResource; +}SiRequestConfig; + +typedef struct schedulingInfoList +{ + uint8_t numSchInfo; + SchedulingInfo schedulingInfo[MAX_SI_MESSAGE]; +}SchedulingInfoList; + +typedef struct siSchedulingInfo +{ + SchedulingInfoList schInfoList; + SiWindowLength siWindowLength; + SiRequestConfig siRequestConfig; + SiRequestConfig siRequestConfigSUL; + uint8_t *siAreaID; +}SiSchedulingInfo; + +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.18 DL Broadcast Request */ +typedef struct macDlBroadcastReq +{ + uint16_t cellId; + uint8_t numSiBlock; + SiSchedulingInfo **siSchedulingInfo; +}MacDlBroadcastReq; + +/* DL broadcast req from DU APP to MAC*/ +typedef uint8_t (*DuMacDlBroadcastReq) ARGS(( + Pst *pst, + MacDlBroadcastReq *dlBroadcast)); + /* Functions for CellUp Ind from MAC to DU APP*/ typedef uint8_t (*DuMacCellUpInd) ARGS(( Pst *pst, @@ -1738,12 +1888,12 @@ typedef uint8_t (*DuMacDlCcchInd) ARGS(( /* UE create Request from DU APP to MAC*/ typedef uint8_t (*DuMacUeCreateReq) ARGS(( Pst *pst, - MacUeCfg *ueCfg )); + MacUeCreateReq *ueCfg )); /* UE create Response from MAC to DU APP */ -typedef uint8_t (*MacDuUeCfgRspFunc) ARGS(( +typedef uint8_t (*MacDuUeCreateRspFunc) ARGS(( Pst *pst, - MacUeCfgRsp *cfgRsp)); + MacUeCreateRsp *cfgRsp)); /* UE Reconfig Request from DU APP to MAC */ typedef uint8_t (*DuMacUeReconfigReq) ARGS(( @@ -1856,13 +2006,13 @@ uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo); uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo); uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf); uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo); -uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg); +uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg); uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf); -uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg); +uint8_t MacProcUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg); uint8_t sendStopIndMacToDuApp(uint16_t cellId); -uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp); -uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf); -uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp); +uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp); +uint8_t unpackDuMacUeCreateRsp(MacDuUeCreateRspFunc func, Pst *pst, Buffer *mBuf); +uint8_t DuProcMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp); uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg); uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf); uint8_t MacProcUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg); @@ -1919,6 +2069,9 @@ uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf); uint8_t packDuMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd); uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd); uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buffer *mBuf); +uint8_t packDuMacDlBroadcastReq(Pst *pst, MacDlBroadcastReq *dlBroadcastReq); +uint8_t MacProcDlBroadcastReq(Pst *pst, MacDlBroadcastReq *dlBroadcastReq); +uint8_t unpackMacDlBroadcastReq(DuMacDlBroadcastReq func, Pst *pst, Buffer *mBuf); #endif diff --git a/src/cm/du_app_rlc_inf.c b/src/cm/du_app_rlc_inf.c index 2bdcf248a..ff556a56c 100644 --- a/src/cm/du_app_rlc_inf.c +++ b/src/cm/du_app_rlc_inf.c @@ -19,6 +19,88 @@ #include "common_def.h" #include "du_app_rlc_inf.h" +/******************************************************************* +* +* @brief Packs and Sends Max Retransmission Reached Info from RLC to DUAPP +* +* @details +* +* Function : packRlcDuMaxRetransInd +* +* Functionality: +* Packs and Sends Max Retransmission Reached Info from RLC to DUAPP +* +* +* @params[in] Post structure pointer +* RlcMaxRetransInfo *maxRetransInfo +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t packRlcDuMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInfo) +{ + 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 packRlcDuMaxRetransInd"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)maxRetransInfo, mBuf); + } + else + { + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuMaxRetransInd"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* +* +* @brief Unpacks Max Retransmission Reached Info received from DU APP +* +* @details +* +* Function : unpackRlcMaxRetransInd +* +* Functionality: +* Unpacks Max Retransmission Reached Info received from DU APP +* +* @params[in] Pointer to Handler +* Post structure pointer +* Message Buffer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t unpackRlcMaxRetransInd(RlcDuMaxRetransInd func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcMaxRetransInfo *maxRetransInfo = NULLP; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&maxRetransInfo, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, maxRetransInfo); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC: Only LWLC supported for Max Retransmission Reached Info "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} + /******************************************************************* * * @brief Packs and Sends UE create Request from DUAPP to RLC @@ -32,12 +114,12 @@ * * * @params[in] Post structure pointer - * RlcUeCfg pointer + * RlcUeCreate pointer * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) +uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCreate *ueCfg) { Buffer *mBuf = NULLP; @@ -82,7 +164,7 @@ uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf) { if(pst->selector == ODU_SELECTOR_LWLC) { - RlcUeCfg *ueCfg; + RlcUeCreate *ueCfg; /* unpack the address of the structure */ CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf); ODU_PUT_MSG_BUF(mBuf); @@ -100,11 +182,11 @@ uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf) /******************************************************************* * - * @brief Packs and Sends UE Cfg Response from RLC to DUAPP + * @brief Packs and Sends UE Create Response from RLC to DUAPP * * @details * - * Function : packRlcDuUeCfgRsp + * Function : packRlcDuUeCreateRsp * * Functionality: * Packs and Sends UE Cfg Rrsponse from RLC to DUAPP @@ -116,7 +198,7 @@ uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf) * RFAILED - failure * * ****************************************************************/ -uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfg) +uint8_t packRlcDuUeCreateRsp(Pst *pst, RlcUeCreateRsp *ueCfg) { Buffer *mBuf = NULLP; @@ -124,7 +206,7 @@ uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfg) { if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { - DU_LOG("\nERROR --> RLC : Memory allocation failed at packRlcDuUeCfgRsp"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at packRlcDuUeCreateRsp"); return RFAILED; } /* pack the address of the structure */ @@ -132,7 +214,7 @@ uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfg) } else { - DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuUeCfgRsp"); + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuUeCreateRsp"); return RFAILED; } @@ -141,11 +223,11 @@ uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfg) /******************************************************************* * - * @brief Unpacks UE Cfg Response received from DU APP + * @brief Unpacks UE Create Response received from DU APP * * @details * - * Function : unpackRlcUeCfgRsp + * Function : unpackRlcUeCreateRsp * * Functionality: * Unpacks UE Cfg Response received from DU APP @@ -157,11 +239,11 @@ uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfg) * RFAILED - failure * * ****************************************************************/ -uint8_t unpackRlcUeCfgRsp(RlcDuUeCfgRsp func, Pst *pst, Buffer *mBuf) +uint8_t unpackRlcUeCreateRsp(RlcDuUeCreateRsp func, Pst *pst, Buffer *mBuf) { if(pst->selector == ODU_SELECTOR_LWLC) { - RlcUeCfgRsp *cfgRsp = NULLP; + RlcUeCreateRsp *cfgRsp = NULLP; /* unpack the address of the structure */ CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf); ODU_PUT_MSG_BUF(mBuf); @@ -177,6 +259,85 @@ uint8_t unpackRlcUeCfgRsp(RlcDuUeCfgRsp func, Pst *pst, Buffer *mBuf) return RFAILED; } +/******************************************************************* + * + * @brief Packs and Sends UE Reconfig Response from RLC to DUAPP + * + * @details + * + * Function : packRlcDuUeReconfigRsp + * + * Functionality: + * Packs and Sends UE Reconfig Rrsponse from RLC to DUAPP + * + * + * @params[in] Post structure pointer + * RlcUeRecfgRsp pointer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packRlcDuUeReconfigRsp(Pst *pst, RlcUeReconfigRsp *ueCfg) +{ + 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 packRlcDuUeReconfigRsp"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf); + } + else + { + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuUeReconfigRsp"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* + * + * @brief Unpacks UE Reconfig Response received from DU APP + * + * @details + * + * Function : unpackRlcUeReconfigRsp + * + * Functionality: + * Unpacks UE Reconfig Response received from DU APP + * + * @params[in] Pointer to Handler + * Post structure pointer + * Message Buffer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t unpackRlcUeReconfigRsp(RlcDuUeReconfigRsp func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcUeReconfigRsp *cfgRsp = NULLP; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, cfgRsp); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC: Only LWLC supported for UE Re-Cfg Response "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} + /******************************************************************* * * @brief Pack and send UL RRC message transfer from RLC to DU APP @@ -940,6 +1101,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..ee536f64b 100644 --- a/src/cm/du_app_rlc_inf.h +++ b/src/cm/du_app_rlc_inf.h @@ -34,6 +34,9 @@ #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 EVENT_RLC_MAX_RETRANSMISSION 225 #define RB_ID_SRB 0 #define RB_ID_DRB 1 @@ -118,6 +121,16 @@ typedef enum RLC_DU_APP_RSP_NOK }RlcRsp; +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.10 RLC Max Retransmission Reached */ + +typedef struct rlcMaxRetransInd +{ + uint16_t cellId; + uint16_t ueId; + RlcRbType lcType; + uint8_t lcId; +}RlcMaxRetransInfo; + typedef struct ulAmCfg { SnLenAm snLenUl; /* Sequence Number length in bits. Allowed values are 12 and 18 */ @@ -190,6 +203,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,28 +216,35 @@ typedef struct rlcUeRecfg RlcBearerCfg rlcLcCfgRel[MAX_NUM_LC]; }RlcUeRecfg; -typedef struct rlcUeCfg +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.1 UE Create */ +typedef struct rlcUeCreate { uint16_t cellId; uint8_t ueId; uint8_t numLcsToAdd; RlcBearerCfg rlcLcCfgAdd[MAX_NUM_LC]; -}RlcUeCfg; +}RlcUeCreate; -typedef struct rlcUeCfgRsp +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.2 UE Create Response */ +typedef struct rlcUeCreateRsp { uint16_t cellId; uint16_t ueId; RlcRsp result; FailureReason reason; -}RlcUeCfgRsp; +}RlcUeCreateRsp; +/* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.4 UE Reconfig Response */ +typedef struct rlcUeCreateRsp RlcUeReconfigRsp; + +/* 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 +252,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 +262,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 +274,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 +292,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 +312,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,16 +322,55 @@ 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 */ + +/* Max Retransmission from RLC to DU APP*/ +typedef uint8_t (*RlcDuMaxRetransInd) ARGS(( + Pst *pst, + RlcMaxRetransInfo *maxRetransInfo)); + /* UE create Request from DU APP to RLC*/ typedef uint8_t (*DuRlcUeCreateReq) ARGS(( Pst *pst, - RlcUeCfg *ueCfg )); + RlcUeCreate *ueCfg )); -/* UE Cfg Response from RLC to DU APP*/ -typedef uint8_t (*RlcDuUeCfgRsp) ARGS(( +/* UE Create Response from RLC to DU APP*/ +typedef uint8_t (*RlcDuUeCreateRsp) ARGS(( Pst *pst, - RlcUeCfgRsp *ueCfgRsp)); + RlcUeCreateRsp *ueCreateRsp)); /* UE Delete Response from RLC to DU APP*/ typedef uint8_t (*RlcDuUeDeleteRsp) ARGS(( @@ -352,6 +397,11 @@ typedef uint8_t (*DuRlcUeReconfigReq) ARGS(( Pst *pst, RlcUeRecfg *ueRecfg )); +/* UE Reconfig Response from RLC to DU APP*/ +typedef uint8_t (*RlcDuUeReconfigRsp) ARGS(( + Pst *pst, + RlcUeReconfigRsp *ueReconfigRsp)); + /* UE Delete Request from DU APP to RLC */ typedef uint8_t (*DuRlcUeDeleteReq) ARGS(( Pst *pst, @@ -377,11 +427,25 @@ 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 packRlcDuMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInd); +uint8_t unpackRlcMaxRetransInd(RlcDuMaxRetransInd func, Pst *pst, Buffer *mBuf); +uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCreate *ueCfg); uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf); -uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfgRsp); -uint8_t unpackRlcUeCfgRsp(RlcDuUeCfgRsp func, Pst *pst, Buffer *mBuf); +uint8_t packRlcDuUeCreateRsp(Pst *pst, RlcUeCreateRsp *ueCfgRsp); +uint8_t unpackRlcUeCreateRsp(RlcDuUeCreateRsp func, Pst *pst, Buffer *mBuf); +uint8_t packRlcDuUeReconfigRsp(Pst *pst, RlcUeReconfigRsp *ueCfgRsp); +uint8_t unpackRlcUeReconfigRsp(RlcDuUeReconfigRsp func, Pst *pst, Buffer *mBuf); uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo); uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf); uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo); @@ -402,10 +466,16 @@ 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); -uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp); +uint8_t DuProcRlcMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInd); +uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCreate *ueCfg); +uint8_t DuProcRlcUeCreateRsp(Pst *pst, RlcUeCreateRsp *cfgRsp); +uint8_t DuProcRlcUeReconfigRsp(Pst *pst, RlcUeReconfigRsp *recfgRsp); uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo); uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo); uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport); @@ -416,6 +486,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_cell_mgr.c b/src/du_app/du_cell_mgr.c index 191240fe6..286d2db88 100644 --- a/src/du_app/du_cell_mgr.c +++ b/src/du_app/du_cell_mgr.c @@ -60,6 +60,12 @@ DuMacDlPcchInd packMacDlPcchIndOpts[] = packDuMacDlPcchInd /* Light weight-loose coupling */ }; +DuMacDlBroadcastReq packMacDlBroadcastReqOpts[] = +{ + packDuMacDlBroadcastReq, /* Loose coupling */ + MacProcDlBroadcastReq, /* TIght coupling */ + packDuMacDlBroadcastReq /* Light weight-loose coupling */ +}; /******************************************************************* * * @brief Processes cells to be activated @@ -1062,6 +1068,56 @@ uint8_t processPagingMsg(uint16_t cellId, DuPagingMsg *rcvdF1apPagingParam) return ROK; } + +/******************************************************************* + * + * @brief DU build and send dl broacast req and send it to MAC + * + * @details + * + * Function : duBuildAndSendDlBroadcastReq + * + * Functionality: DU build and send dl broacast req and send to MAC + * + * + * @params[in] cellId, crnti + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ + +uint8_t duBuildAndSendDlBroadcastReq() +{ + Pst pst; + uint8_t ret =ROK; + MacDlBroadcastReq *dlBroadcast=NULLP; + + DU_LOG("\nDEBUG --> DU_APP : Building Dl broadcast request"); + + DU_ALLOC_SHRABL_BUF(dlBroadcast, sizeof(MacDlBroadcastReq)); + if(dlBroadcast) + { + /*TODO - fill MAC DL Broadcast Request*/ + + FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_DL_BROADCAST_REQ); + + DU_LOG("\nDEBUG --> DU_APP: Sending Dl broadcast Request to MAC "); + ret = (*packMacDlBroadcastReqOpts[pst.selector])(&pst, dlBroadcast); + if(ret == RFAILED) + { + DU_LOG("\nERROR --> DU_APP: sendDlBroadcastReqToMac(): Failed to send Dl broadcast Req to MAC"); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlBroadcast, sizeof(MacDlBroadcastReq)); + } + } + else + { + DU_LOG("\nERROR --> DU_APP: sendDlBroadcastReqToMac(): Failed to allocate memory"); + ret = RFAILED; + } + + return ret; +} + /********************************************************************** End of file **********************************************************************/ diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 2719cdbdc..2df998e13 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -13081,7 +13081,7 @@ uint8_t extractSrbListToSetup(SRBs_ToBeSetup_List_t *srbCfg, DuUeCfg *ueCfgDb) * * @params[in] DRBs_ToBeSetup_Item_t , DRBs_ToBeSetupMod_Item_t, * DRBs_ToBeModified_Item_t , lcId, DuLcCfg pointer, - * RlcBearerCfg , UpTnlCfg, RlcUeCfg + * RlcBearerCfg , UpTnlCfg, DuRlcUeCfg * @return void * * ****************************************************************/ @@ -15291,9 +15291,9 @@ uint8_t procF1SetupRsp(F1AP_PDU_t *f1apMsg, MsgLen recvBufLen, char *recvBuf) DU_LOG("\nERROR --> DU_APP : Invalid IE received in F1SetupRsp:%ld", f1SetRspMsg->protocolIEs.list.array[idx]->id); } - duProcF1SetupRsp(); } + duProcF1SetupRsp(); freeAperDecodeF1SetupRsp(f1SetRspMsg); duCb.f1SetupReqAndRspMsg.f1MsgRspBufSize = recvBufLen; diff --git a/src/du_app/du_mgr_msg_router.c b/src/du_app/du_mgr_msg_router.c index 2d650e4b1..da12de625 100644 --- a/src/du_app/du_mgr_msg_router.c +++ b/src/du_app/du_mgr_msg_router.c @@ -432,12 +432,12 @@ uint8_t duActvTsk(Pst *pst, Buffer *mBuf) } case EVENT_RLC_UE_CREATE_RSP: { - ret = unpackRlcUeCfgRsp(DuProcRlcUeCfgRsp, pst, mBuf); + ret = unpackRlcUeCreateRsp(DuProcRlcUeCreateRsp, pst, mBuf); break; } case EVENT_RLC_UE_RECONFIG_RSP: { - ret = unpackRlcUeCfgRsp(DuProcRlcUeCfgRsp, pst, mBuf); + ret = unpackRlcUeReconfigRsp(DuProcRlcUeReconfigRsp, pst, mBuf); break; } case EVENT_RLC_UE_DELETE_RSP: @@ -460,6 +460,11 @@ uint8_t duActvTsk(Pst *pst, Buffer *mBuf) ret = unpackRlcDlRrcMsgRspToDu(DuProcRlcDlRrcMsgRsp, pst, mBuf); break; } + case EVENT_RLC_MAX_RETRANSMISSION: + { + ret = unpackRlcMaxRetransInd(DuProcRlcMaxRetransInd, pst, mBuf); + break; + } case EVENT_UL_USER_DATA_TRANS_TO_DU: { ret = unpackRlcUlUserDataToDu(DuProcRlcUlUserDataTrans, pst, mBuf); @@ -470,6 +475,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", \ @@ -527,7 +537,7 @@ uint8_t duActvTsk(Pst *pst, Buffer *mBuf) } case EVENT_MAC_UE_CREATE_RSP: { - ret = unpackDuMacUeCfgRsp(DuProcMacUeCfgRsp, pst, mBuf); + ret = unpackDuMacUeCreateRsp(DuProcMacUeCreateRsp, pst, mBuf); break; } case EVENT_MAC_UE_RECONFIG_RSP: diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index f5011270e..769f4e9a1 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 */ @@ -122,6 +129,55 @@ DuMacUeResetReq packMacUeResetReqOpts[] = 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 @@ -1608,7 +1664,7 @@ uint8_t fillRlcSrb1LcCfg(DuRlcBearerCfg *rlcLcCfg) * Functionality: * Processes UE Reconfig Req to RLC UL * - * @params[in] Pointer to RlcUeCfg + * @params[in] Pointer to RlcUeRecfg * @return ROK - success * RFAILED - failure * @@ -1633,7 +1689,7 @@ uint8_t sendUeRecfgReqToRlc(RlcUeRecfg *rlcUeRecfg) } 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; @@ -1828,7 +1884,7 @@ uint8_t duCreateUeCb(UeCcchCtxt *ueCcchCtxt, uint32_t gnbCuUeF1apId) /********************************************************************************** * - * @brief Fills Ue Cfg from DU DB to MacUeCfg + * @brief Fills Ue Cfg from DU DB to MacUeCreateReq * * @details * @@ -1837,12 +1893,12 @@ uint8_t duCreateUeCb(UeCcchCtxt *ueCcchCtxt, uint32_t gnbCuUeF1apId) * 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; @@ -1915,12 +1971,12 @@ void fillMacUeCfg(DuMacUeCfg *duMacUeCfg, MacUeCfg *macUeCfg) * 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; @@ -1962,7 +2018,7 @@ void fillRlcUeCfg(DuRlcUeCfg *duRlcUeCfg, RlcUeCfg *rlcUeCfg) 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)); @@ -1978,10 +2034,10 @@ uint8_t duBuildAndSendUeCreateReqToMac(uint16_t cellId, uint8_t gnbDuUeF1apId, u 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"); @@ -1990,7 +2046,7 @@ uint8_t duBuildAndSendUeCreateReqToMac(uint16_t cellId, uint8_t gnbDuUeF1apId, u 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 @@ -2680,20 +2736,20 @@ uint8_t duUpdateDuUeCbCfg(uint8_t ueId, uint8_t cellId) /******************************************************************* * - * @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; @@ -2722,14 +2778,14 @@ uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp) 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; } } @@ -2741,11 +2797,11 @@ uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp) 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; @@ -2837,7 +2893,7 @@ uint8_t DuProcMacUeRecfgRsp(Pst *pst, MacUeRecfgRsp *reCfgRsp) * * @params[in] cellId, * ueId, - * Pointer to RlcUeCfg + * Pointer to RlcUeCreate * @return ROK - success * RFAILED - failure * @@ -2846,7 +2902,7 @@ uint8_t DuProcMacUeRecfgRsp(Pst *pst, MacUeRecfgRsp *reCfgRsp) 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); @@ -2858,10 +2914,10 @@ uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t gnbDuUeF1apId, D 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 */ @@ -2870,7 +2926,7 @@ uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t gnbDuUeF1apId, D 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; } } @@ -2889,7 +2945,7 @@ uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t gnbDuUeF1apId, D * @details * - * Function : DuProcRlcUeCfgRsp + * Function : DuProcRlcUeCreateRsp * * Functionality: * Processes UE create Rsp received from RLC UL @@ -2900,7 +2956,7 @@ uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t gnbDuUeF1apId, D * RFAILED - failure * *****************************************************************/ -uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp) +uint8_t DuProcRlcUeCreateRsp(Pst *pst, RlcUeCreateRsp *cfgRsp) { uint8_t ret = ROK; @@ -2924,20 +2980,62 @@ uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp) 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); @@ -2950,14 +3048,14 @@ uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp) 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; } } @@ -2965,7 +3063,7 @@ uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp) } 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)) { @@ -2973,16 +3071,15 @@ uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp) } 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 @@ -3046,7 +3143,7 @@ void fillRlcUeRecfg(DuRlcUeCfg *duRlcUeCfg, RlcUeRecfg *rlcUeRecfg) * * @params[in] cellId, crnti * DuUeCfg *ueCfgDb - * RlcUeCfg *rlcUeCfg + * RlcUeCreate *rlcUeCfg * @return ROK - success * RFAILED - failure * @@ -3915,16 +4012,16 @@ uint8_t duBuildAndSendUeDeleteReq(uint16_t cellId, uint16_t crnti) /******************************************************************* * - * @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 @@ -3965,7 +4062,7 @@ void deleteRlcUeCfg(DuRlcUeCfg *ueCfg) } DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->snssai, sizeof(Snssai)); } - memset(ueCfg, 0, sizeof(RlcUeCfg)); + memset(ueCfg, 0, sizeof(DuRlcUeCfg)); } } @@ -4237,6 +4334,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