#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
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);
}
dir++;
}
-
+
sendSlicePmToDu(sliceStats);
return ROK;
}
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 */
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
################################################################################
*******************************************************************************/
+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);
#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
#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
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 */
}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,
RlcUeReestablishRsp *ueDelRsp));
/* Pack/Unpack function declarations */
+uint8_t packRlcDuMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInd);
+uint8_t unpackRlcMaxRetransInd(RlcDuMaxRetransInd func, Pst *pst, Buffer *mBuf);
uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf);
uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfgRsp);
uint8_t unpackRlcUeReestablishRsp(RlcDuUeReestablishRsp func, Pst *pst, Buffer *mBuf);
/* Event Handler function declarations */
+uint8_t DuProcRlcMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInd);
uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp);
uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
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);
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