From: lal.harshita Date: Tue, 29 Dec 2020 14:18:23 +0000 (+0530) Subject: JIRA ID:[ODUHIGH-296]-Dl Data Changes from DUAPP to RLC X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=7d9367ae84317dce9bbe8cca3c0ae805ddaeee63;p=o-du%2Fl2.git JIRA ID:[ODUHIGH-296]-Dl Data Changes from DUAPP to RLC Change-Id: I6349b8b31ba778b44e4658ac02f239f8c880da98 Signed-off-by: sphoorthi --- diff --git a/src/5gnrmac/mac_msg_hdl.c b/src/5gnrmac/mac_msg_hdl.c index e227e8df7..bb8773092 100644 --- a/src/5gnrmac/mac_msg_hdl.c +++ b/src/5gnrmac/mac_msg_hdl.c @@ -271,9 +271,8 @@ uint8_t MacProcRlcDlData(Pst* pstInfo, RlcData *dlData) } if(pstInfo->selector == ODU_SELECTOR_LWLC) { - MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData, sizeof(RlcData)); + MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData, sizeof(RlcData)); } - return ROK; } diff --git a/src/5gnrrlc/kw_amm_dl.c b/src/5gnrrlc/kw_amm_dl.c index fd745946d..609434df3 100755 --- a/src/5gnrrlc/kw_amm_dl.c +++ b/src/5gnrrlc/kw_amm_dl.c @@ -961,7 +961,7 @@ uint32_t kwRxSdu; * @return Void * -# void */ -void rlcAmmQSdu(RlcCb *gCb, RlcDlRbCb *rbCb, Buffer *mBuf, KwuDatReqInfo *datReq) +void rlcAmmQSdu(RlcCb *gCb, RlcDlRbCb *rbCb, Buffer *mBuf, RlcDatReqInfo *datReq) { RlcSdu *sdu; #ifdef LTE_L2_MEAS diff --git a/src/5gnrrlc/kw_dl.x b/src/5gnrrlc/kw_dl.x index e4d1bc594..239f76884 100755 --- a/src/5gnrrlc/kw_dl.x +++ b/src/5gnrrlc/kw_dl.x @@ -635,7 +635,7 @@ Void rlcDbmDelAllDlL2MeasTbFrmUe ARGS ((RlcCb *gCb, RlcDlUeCb *ueCb)); ***************************************************************************/ Void rlcTmmQSdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - KwuDatReqInfo *datReqInfo, + RlcDatReqInfo *datReqInfo, Buffer *mBuf)); Void rlcTmmSendToMac ARGS ((RlcCb *gCb, SuId suId, @@ -649,7 +649,7 @@ Void rlcDlTmmReEstablish ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb)); ***************************************************************************/ Void rlcUmmQSdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - KwuDatReqInfo *datReq, + RlcDatReqInfo *datReq, Buffer *mBuf)); Void rlcUmmDiscSdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, uint32_t sduId)); @@ -674,7 +674,7 @@ Void rlcAmmSendDedLcBoStatus ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, RlcAmDl *amDl)) Void rlcAmmQSdu ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, Buffer *mBuf, - KwuDatReqInfo *datReq)); + RlcDatReqInfo *datReq)); void rlcAmmProcessSdus ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, @@ -831,7 +831,7 @@ S16 rlcUtlNotifyMacUlIp ARGS ((RlcL2MeasCb *measCb,uint16_t ueIdx, Bool enable, CmLteLcId *lChId, uint8_t *numLCh)); #endif -uint8_t rlcProcDlData(Pst *pst, KwuDatReqInfo* datReq, Buffer *buf); +uint8_t rlcProcDlData(Pst *pst, RlcDatReqInfo* datReq, Buffer *buf); uint8_t rlcProcCommLcSchedRpt(Pst *pst, SuId suId, RguCStaIndInfo *staInd); uint8_t rlcProcDedLcSchedRpt(Pst *pst, SuId suId, RguDStaIndInfo *staInd); diff --git a/src/5gnrrlc/kw_dl_ex_ms.c b/src/5gnrrlc/kw_dl_ex_ms.c index 77d3a52ca..dadd9de29 100755 --- a/src/5gnrrlc/kw_dl_ex_ms.c +++ b/src/5gnrrlc/kw_dl_ex_ms.c @@ -271,6 +271,11 @@ Buffer *mBuf /* message buffer */ ret = unpackDlRrcMsgToRlc(RlcProcDlRrcMsgTransfer, pst, mBuf); break; } + case EVENT_DL_USER_DATA_TRANS_TO_RLC: + { + ret = unpackRlcDlUserDataToRlc(RlcProcDlUserDataTransfer, pst, mBuf); + break; + } default: ODU_PUT_MSG_BUF(mBuf); if (pst->dstInst < MAX_RLC_INSTANCES) diff --git a/src/5gnrrlc/kw_ptli.c b/src/5gnrrlc/kw_ptli.c index 1b3a1b19e..6ef1197c5 100755 --- a/src/5gnrrlc/kw_ptli.c +++ b/src/5gnrrlc/kw_ptli.c @@ -371,7 +371,7 @@ S16 rlcLiRguStaRspRbuf(Pst *post,SpId spId,Void *staRsp) ret1 = RFAILED; } return (ret1); -} /* cmPkKwuDatReq */ +} /* cmPkRlcDatReq */ #endif #ifdef RLC_MAC_DAT_REQ_RBUF @@ -398,7 +398,7 @@ S16 rlcLiRguDatReqRbuf(Pst *post,SpId spId,Void *datReq) ret1 = RFAILED; } return (ret1); -} /* cmPkKwuDatReq */ +} /* cmPkRlcDatReq */ #endif diff --git a/src/5gnrrlc/kw_ptui.c b/src/5gnrrlc/kw_ptui.c index 874b02edc..2ddd20291 100755 --- a/src/5gnrrlc/kw_ptui.c +++ b/src/5gnrrlc/kw_ptui.c @@ -763,7 +763,7 @@ S16 rlcDlBatchProc(Void) #endif Void *elmIndx = NULLP; KwuDatReqDetl *kwuDatReqDetl = NULLP; - KwuDatReqInfo datReq; + RlcDatReqInfo datReq; rngBufDeqMaxCnt = SS_RNG_MAX_DLPDCP_TO_DLRLC_DQ_CNT; #ifdef TENB_T2K3K_SPECIFIC_CHANGES diff --git a/src/5gnrrlc/kw_tmm_dl.c b/src/5gnrrlc/kw_tmm_dl.c index f772c1768..1b7aae7a0 100755 --- a/src/5gnrrlc/kw_tmm_dl.c +++ b/src/5gnrrlc/kw_tmm_dl.c @@ -67,7 +67,7 @@ #define RLC_MODULE (RLC_DBGMASK_TM | RLC_DBGMASK_DL) static Void rlcTmmSendBoSta ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, - MsgLen bo, KwuDatReqInfo *datReqInfo)); + MsgLen bo, RlcDatReqInfo *datReqInfo)); uint32_t rgMacGT ; /** @addtogroup tmmode */ /*@{*/ @@ -94,7 +94,7 @@ Void rlcTmmQSdu ( RlcCb *gCb, RlcDlRbCb *rbCb, -KwuDatReqInfo *datReqInfo, +RlcDatReqInfo *datReqInfo, Buffer *mBuf ) { @@ -401,7 +401,7 @@ RlcDlRbCb *rbCb * -# RFAILED */ -static void rlcTmmSendBoSta(RlcCb *gCb, RlcDlRbCb *rbCb, MsgLen bo, KwuDatReqInfo *datReqInfo) +static void rlcTmmSendBoSta(RlcCb *gCb, RlcDlRbCb *rbCb, MsgLen bo, RlcDatReqInfo *datReqInfo) { Pst pst; /* Post structure */ RlcBoStatus *boStatus; /* Buffer occupancy status information */ diff --git a/src/5gnrrlc/kw_uim.c b/src/5gnrrlc/kw_uim.c index 222e58ba0..5eb9e2b72 100755 --- a/src/5gnrrlc/kw_uim.c +++ b/src/5gnrrlc/kw_uim.c @@ -709,7 +709,7 @@ Reason reason * -# ROK * -# RFAILED */ -uint8_t rlcProcDlData(Pst *pst, KwuDatReqInfo *datReq, Buffer *mBuf) +uint8_t rlcProcDlData(Pst *pst, RlcDatReqInfo *datReq, Buffer *mBuf) { uint8_t ret = ROK; /* Return Value */ RlcDlRbCb *rbCb; /* RB Control Block */ @@ -748,7 +748,7 @@ uint8_t rlcProcDlData(Pst *pst, KwuDatReqInfo *datReq, Buffer *mBuf) { /* kw002.201 Freeing from proper region */ RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, datReq, - sizeof(KwuDatReqInfo)); + sizeof(RlcDatReqInfo)); ODU_PUT_MSG_BUF(mBuf); return RFAILED; diff --git a/src/5gnrrlc/kw_umm_dl.c b/src/5gnrrlc/kw_umm_dl.c index dad725dd4..557b0baa0 100755 --- a/src/5gnrrlc/kw_umm_dl.c +++ b/src/5gnrrlc/kw_umm_dl.c @@ -101,7 +101,7 @@ static Void rlcUmmCreatePdu ARGS ((RlcCb *gCb, * * @return Void */ -void rlcUmmQSdu(RlcCb *gCb, RlcDlRbCb *rbCb, KwuDatReqInfo *datReq, Buffer *mBuf) +void rlcUmmQSdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReqInfo *datReq, Buffer *mBuf) { MsgLen len; /* SDU buffer length */ RlcSdu *sdu; /* SDU */ diff --git a/src/5gnrrlc/kw_utl_dl.c b/src/5gnrrlc/kw_utl_dl.c index 609be1fba..7a21f277e 100755 --- a/src/5gnrrlc/kw_utl_dl.c +++ b/src/5gnrrlc/kw_utl_dl.c @@ -221,40 +221,37 @@ Void PrintRLCStats(Void) * ****************************************************************/ uint8_t rlcSendDedLcDlData(Pst *post, SpId spId, RguDDatReqInfo *datReqInfo) { - uint8_t ueIdx; /* UE info list iterator */ - uint8_t tbIdx; /* TB info list iterator */ - uint8_t lchIdx; /* Lch info list iterator */ - uint8_t pduIdx; /* RLC PDU list iterator */ - RguDDatReqPerUe datPerUe; /* DL data info per UE */ - RguDatReqTb datPerTb; /* DL data info per TB */ - RguLchDatReq datPerLch; /* DL data info per Lch */ - RlcData *dlData; /* DL data to be sent to MAC */ - RlcDlRrcMsgRsp *dlRrcMsgRsp;/* DL Data Msg Rsp sent to DU */ - Pst pst; /* Post structure */ - uint16_t pduLen; /* PDU length */ - uint16_t copyLen; /* Number of bytes copied */ - - dlData = NULLP; - dlRrcMsgRsp = NULLP; + uint8_t ueIdx; /* UE info list iterator */ + uint8_t tbIdx; /* TB info list iterator */ + uint8_t lchIdx; /* Lch info list iterator */ + uint8_t pduIdx; /* RLC PDU list iterator */ + RguDDatReqPerUe datPerUe; /* DL data info per UE */ + RguDatReqTb datPerTb; /* DL data info per TB */ + RguLchDatReq datPerLch; /* DL data info per Lch */ + RlcData *dlData = NULLP; /* DL data to be sent to MAC */ + RlcDlRrcMsgRsp *dlRrcMsgRsp = NULLP; /*DL RRC Rsp to be sent to DU*/ + Pst pst; /* Post structure */ + uint16_t pduLen; /* PDU length */ + uint16_t copyLen; /* Number of bytes copied */ + uint8_t lcId = 0; + RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, dlData, sizeof(RlcData)); - if ( dlData == NULLP ) + if(dlData == NULLP) { DU_LOG("\nERROR --> RLC_DL : rlcSendDedLcDlData: Memory allocation failed for dl data"); RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RguDDatReqInfo)); return RFAILED; } + memset(dlData, 0, sizeof(RlcData)); for(ueIdx = 0; ueIdx < datReqInfo->nmbOfUeGrantPerTti; ueIdx++) { datPerUe = datReqInfo->datReq[ueIdx]; - memset(dlData, 0, sizeof(RlcData)); - dlData->cellId = datReqInfo->cellId; dlData->rnti = datPerUe.rnti; - /* Retrieving sfn/slot from transId. It was filled in RlcProcSchedResultRpt */ dlData->slotInfo.sfn = datPerUe.transId >> 16; dlData->slotInfo.slot = datPerUe.transId & 0xffff; @@ -267,6 +264,7 @@ uint8_t rlcSendDedLcDlData(Pst *post, SpId spId, RguDDatReqInfo *datReqInfo) for(lchIdx = 0; lchIdx < datPerTb.nmbLch; lchIdx++) { datPerLch = datPerTb.lchData[lchIdx]; + lcId = datPerLch.lcId; for(pduIdx = 0; pduIdx < datPerLch.pdu.numPdu; pduIdx++) { dlData->pduInfo[dlData->numPdu].commCh = FALSE; @@ -310,9 +308,8 @@ uint8_t rlcSendDedLcDlData(Pst *post, SpId spId, RguDDatReqInfo *datReqInfo) }/* For Data per Lch */ }/* For Data per Tb */ - RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, - dlRrcMsgRsp, sizeof(RlcDlRrcMsgRsp)); - if( dlRrcMsgRsp == NULLP ) + RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, dlRrcMsgRsp, sizeof(RlcDlRrcMsgRsp)); + if(dlRrcMsgRsp == NULLP) { DU_LOG("\nERROR --> RLC_DL : rlcSendDedLcDlData: Memory allocation failed for dlRrcMsgRsp"); for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++) @@ -325,37 +322,41 @@ uint8_t rlcSendDedLcDlData(Pst *post, SpId spId, RguDDatReqInfo *datReqInfo) datReqInfo, sizeof(RguDDatReqInfo)); return RFAILED; } - dlRrcMsgRsp->cellId = dlData->cellId; dlRrcMsgRsp->crnti = dlData->rnti; /* Sending DL Data per UE to MAC */ - memset(&pst, 0, sizeof(Pst)); FILL_PST_RLC_TO_MAC(pst, RLC_DL_INST, EVENT_DL_DATA_TO_MAC); if(RlcSendDlDataToMac(&pst, dlData) != ROK) { + DU_LOG("\nERROR --> RLC_DL : rlcSendDedLcDlData: Failed to send Dl RRC Msg To Mac"); + dlRrcMsgRsp->state = TRANSMISSION_FAILED; for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++) - { - RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlData->pduInfo[pduIdx].pduBuf,\ - dlData->pduInfo[pduIdx].pduLen); - } + { + RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlData->pduInfo[pduIdx].pduBuf,\ + dlData->pduInfo[pduIdx].pduLen); + } RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlData, sizeof(RlcData)); - /* Update DL RRC MSG Rsp State */ - dlRrcMsgRsp->state = TRANSMISSION_FAILED; + RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RguDDatReqInfo)); + RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlRrcMsgRsp, sizeof(RlcDlRrcMsgRsp)); + return RFAILED; } else dlRrcMsgRsp->state = TRANSMISSION_COMPLETE; - /* Send Dl RRC Msg Rsp to DU APP */ FILL_PST_RLC_TO_DUAPP(pst, RLC_DL_INST, EVENT_DL_RRC_MSG_RSP_TO_DU); - if(rlcSendDlRrcMsgRspToDu(&pst, dlRrcMsgRsp) != ROK) + if(lcId >= SRB1_LCID && lcId <= SRB3_LCID) /* Valid for all RRC messages i.e. SRB1, SRB2, SRB3 */ { - RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlRrcMsgRsp, sizeof(RlcDlRrcMsgRsp)); + if(rlcSendDlRrcMsgRspToDu(&pst, dlRrcMsgRsp) != ROK) + { + DU_LOG("\nERROR --> RLC_DL : rlcSendDedLcDlData: Failed to send Dl RRC Msg Rsp To Du"); + RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlRrcMsgRsp, sizeof(RlcDlRrcMsgRsp)); + RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RguDDatReqInfo)); + return RFAILED; + } } } /* For Data per UE */ - - RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, - datReqInfo, sizeof(RguDDatReqInfo)); + RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RguDDatReqInfo)); return ROK; }/* End of rlcSendDedLcDlData */ diff --git a/src/5gnrrlc/rlc_msg_hdl.c b/src/5gnrrlc/rlc_msg_hdl.c index b68e53c74..3f2badda3 100644 --- a/src/5gnrrlc/rlc_msg_hdl.c +++ b/src/5gnrrlc/rlc_msg_hdl.c @@ -331,9 +331,9 @@ uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo ) uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo) { Buffer *mBuf; - KwuDatReqInfo *datReqInfo; + RlcDatReqInfo *datReqInfo; - RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo)); + RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RlcDatReqInfo)); if(!datReqInfo) { DU_LOG("\nERROR --> RLC : Memory allocation failed in RlcProcDlRrcMsgTransfer"); @@ -353,7 +353,7 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo) if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, &mBuf) != ROK) { DU_LOG("\nERROR --> RLC : Memory allocation failed at RlcMacProcUlData"); - RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo)); + RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RlcDatReqInfo)); RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen); RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo)); return RFAILED; @@ -372,7 +372,7 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo) } /* Free memory allocated by du app */ - RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo)); + RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RlcDatReqInfo)); RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen); RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo)); return ROK; @@ -669,6 +669,58 @@ uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg) return ret; } +/* **************************************************************** + * + * @brief Process the DL Data transfer from DU APP + * + * @details + * + * Function : RlcProcDlUserDataTransfer + * + * Functionality: Process the DL transfer from DU APP + * + * @params[in] Post structure + * DL RRC Message info + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo) +{ + Buffer *mBuf = NULLP; + RlcDatReqInfo *datReqInfo = NULLP; + + if(dlDataMsgInfo->dlMsg == NULLP) + { + DU_LOG("\nERROR --> RLC_DL : Received DL message is NULLP in RlcProcDlUserDataTransfer()"); + return RFAILED; + } + RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RlcDatReqInfo)); + if(!datReqInfo) + { + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed for DatReq in RlcProcDlUserDataTransfer()"); + RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlDataMsgInfo->dlMsg, dlDataMsgInfo->msgLen); + RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlDataMsgInfo, sizeof(RlcDlUserDataInfo)); + return RFAILED; + } + + datReqInfo->rlcId.rbType = RB_TYPE_DRB; + datReqInfo->rlcId.rbId = dlDataMsgInfo->rbId; + datReqInfo->rlcId.ueId = dlDataMsgInfo->ueIdx; + datReqInfo->rlcId.cellId = dlDataMsgInfo->cellId; + datReqInfo->lcType = LCH_DTCH; + datReqInfo->sduId = ++(rlcCb[pst->dstInst]->dlSduId); + mBuf = dlDataMsgInfo->dlMsg; + if(rlcProcDlData(pst, datReqInfo, mBuf) != ROK) + { + return RFAILED; + } + + /* Free memory allocated by du app */ + RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RlcDatReqInfo)); + RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlDataMsgInfo, sizeof(RlcDlUserDataInfo)); + return ROK; +} /********************************************************************** End of file **********************************************************************/ diff --git a/src/cm/common_def.h b/src/cm/common_def.h index 07067a9d3..c06e12b7e 100644 --- a/src/cm/common_def.h +++ b/src/cm/common_def.h @@ -58,7 +58,8 @@ #define MAX_NUM_CELL 1 #define MAX_NUM_UE 1 #define MAX_NUM_LC 11 -#define MAX_NUM_TUNNEL 2 /* Max. no of Tunnels */ +#define MAX_NUM_SRB 3 /* Max. no of Srbs */ +#define MAX_NUM_DRB 29 /* spec 38.331, maxDRB */ /* 5G ORAN phy delay */ #define PHY_DELTA 2 diff --git a/src/cm/du_app_mac_inf.h b/src/cm/du_app_mac_inf.h index f91af256e..e622de808 100644 --- a/src/cm/du_app_mac_inf.h +++ b/src/cm/du_app_mac_inf.h @@ -51,8 +51,6 @@ #define MAX_NUM_UL_ALLOC 16 /* Max number of pusch time domain uplink allocation */ #define SD_SIZE 3 /* Max size of Slice Differentiator in S-NSSAI */ -#define MAX_NUM_SRB 8 -#define MAX_NUM_DRB 64 #define MAX_NUM_SCELL 32 /* PUCCH Configuration Macro */ diff --git a/src/cm/du_app_rlc_inf.c b/src/cm/du_app_rlc_inf.c index d85e02f55..5878defbc 100644 --- a/src/cm/du_app_rlc_inf.c +++ b/src/cm/du_app_rlc_inf.c @@ -624,13 +624,87 @@ uint8_t unpackRlcUlUserDataToDu(RlcUlUserDataToDuFunc func, Pst *pst, Buffer *mB else { /* Nothing to do for other selectors */ - DU_LOG("\nERROR --> DU APP: Only LWLC supported for UL User data transfer "); + DU_LOG("\nERROR --> RLC UL: Only LWLC supported for UL User data transfer "); ODU_PUT_MSG_BUF(mBuf); } return RFAILED; } +/******************************************************************* + * + * @brief Pack and send DL user data from DUAPP to RLC + * + * @details + * + * Function : packRlcDlUserDataToRlc + * + * Functionality: + * Pack and send DL User Data from DUAPP to RLC + * + * @params[in] Post structure + * DL user data + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlUserData) +{ + Buffer *mBuf = NULLP; + + if(pst->selector == ODU_SELECTOR_LWLC) + { + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) + { + DU_LOG("\nERROR --> RLC DL: Memory allocation failed at packRlcDlUserDataToRlc"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)dlUserData, mBuf); + return ODU_POST_TASK(pst,mBuf); + } + else + { + DU_LOG("\nERROR --> RLC DL: Only LWLC supported for packRlcUlUserDataToDu"); + } + return RFAILED; +} + +/******************************************************************* + * + * @brief Unpack DL user data received at RLC from DUAPP + * + * @details + * + * Function : unpackRlcDlUserDataToRlc + * + * Functionality: + * Unpack DL user data received at RLC from DUAPP + * + * @params[in] + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcDlUserDataInfo *dlUserData; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&dlUserData, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, dlUserData); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC DL: Only LWLC supported for UL User data transfer "); + 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 f168522ef..837afc3b2 100644 --- a/src/cm/du_app_rlc_inf.h +++ b/src/cm/du_app_rlc_inf.h @@ -29,9 +29,10 @@ #define EVENT_RLC_UE_RECONFIG_REQ 215 #define EVENT_RLC_UE_RECONFIG_RSP 216 #define EVENT_DL_RRC_MSG_RSP_TO_DU 217 -#define EVENT_DL_USER_DATA_TRANS_TO_DU 218 +#define EVENT_DL_USER_DATA_TRANS_TO_RLC 218 #define EVENT_UL_USER_DATA_TRANS_TO_DU 219 + #define RB_ID_SRB 0 #define RB_ID_DRB 1 @@ -258,6 +259,16 @@ typedef struct rrcDeliveryReportInfo RrcDeliveryStatus rrcDeliveryStatus; }RrcDeliveryReport; +/* DL Data Message from DU APP to RLC */ +typedef struct dlDataMsgInfo +{ + uint16_t cellId; /* Cell Id */ + uint16_t ueIdx; /* UE index */ + uint8_t rbId; /* Radio Bearer Id */ + uint16_t msgLen; /* Message length */ + Buffer *dlMsg; /* DL Data */ +}RlcDlUserDataInfo; + /* Function Pointers */ /* UE create Request from DU APP to RLC*/ typedef uint8_t (*DuRlcUeCreateReq) ARGS(( @@ -298,6 +309,11 @@ typedef uint8_t (*RlcUlUserDataToDuFunc) ARGS(( Pst *pst, RlcUlUserDatInfo *ulUserData)); +/* DL User Data from DU APP to RLC */ +typedef uint8_t (*DuRlcDlUserDataToRlcFunc) ARGS(( + Pst *pst, + RlcDlUserDataInfo *dlDataMsg)); + /* Pack/Unpack function declarations */ uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg); uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf); @@ -315,6 +331,8 @@ uint8_t packRlcDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp); uint8_t unpackRlcDlRrcMsgRspToDu(RlcDlRrcMsgRspToDuFunc func, Pst *pst, Buffer *mBuf); uint8_t packRlcUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData); uint8_t unpackRlcUlUserDataToDu(RlcUlUserDataToDuFunc func, Pst *pst, Buffer *mBuf); +uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlDataMsg); +uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf); /* Event Handler function declarations */ uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg); @@ -325,6 +343,7 @@ uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryRepor uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg); uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg); uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData); +uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo); #endif /* RLC_INF_H */ diff --git a/src/cm/kwu.c b/src/cm/kwu.c index 81e317694..1784166cf 100755 --- a/src/cm/kwu.c +++ b/src/cm/kwu.c @@ -136,7 +136,7 @@ S16 cmPkKwuUbndReq(Pst * pst,SuId suId,Reason reason) return (SPstTsk(pst,mBuf)); } /* cmPkKwuUbndReq */ -uint8_t cmPkKwuDatReqInfo(KwuDatReqInfo *param,Buffer *mBuf) +uint8_t cmPkRlcDatReqInfo(RlcDatReqInfo *param,Buffer *mBuf) { #ifdef CCPU_OPT switch(param->lcType) { @@ -163,10 +163,10 @@ uint8_t cmPkKwuDatReqInfo(KwuDatReqInfo *param,Buffer *mBuf) CMCHKPK(oduUnpackUInt32, param->sduId, mBuf); CMCHKPK(cmPkLteRlcId, ¶m->rlcId, mBuf); return ROK; -} /* cmPkKwuDatReqInfo */ +} /* cmPkRlcDatReqInfo */ -uint8_t cmPkKwuDatReq(Pst * pst,KwuDatReqInfo* datReq,Buffer * mBuf) +uint8_t cmPkRlcDatReq(Pst * pst,RlcDatReqInfo* datReq,Buffer * mBuf) { #ifdef LCKWU #if (ERRCLASS & ERRCLS_ADD_RES) @@ -174,7 +174,7 @@ uint8_t cmPkKwuDatReq(Pst * pst,KwuDatReqInfo* datReq,Buffer * mBuf) #endif /* LCKWU */ S16 ret1 = ROK; #ifndef SS_RBUF - KwuDatReqInfo* datReqInfo; + RlcDatReqInfo* datReqInfo; #endif #ifndef SS_RBUF switch(pst->selector) @@ -188,7 +188,7 @@ uint8_t cmPkKwuDatReq(Pst * pst,KwuDatReqInfo* datReq,Buffer * mBuf) * subsequent free would be done during the Unpack function of the * primitive. */ if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datReqInfo, - sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY)) != ROK) + sizeof(RlcDatReqInfo),SS_SHARABLE_MEMORY)) != ROK) { #if (ERRCLASS & ERRCLS_ADD_RES) if(ret1 != ROK) @@ -200,7 +200,7 @@ uint8_t cmPkKwuDatReq(Pst * pst,KwuDatReqInfo* datReq,Buffer * mBuf) #endif /* ERRCLASS & ERRCLS_ADD_RES */ return (ret1); } - memcpy(datReqInfo,datReq,sizeof(KwuDatReqInfo)); + memcpy(datReqInfo,datReq,sizeof(RlcDatReqInfo)); CMCHKPK(oduPackPointer,(PTR)datReqInfo, mBuf); } else @@ -212,7 +212,7 @@ uint8_t cmPkKwuDatReq(Pst * pst,KwuDatReqInfo* datReq,Buffer * mBuf) case ODU_SELECTOR_LC: { #if (ERRCLASS & ERRCLS_ADD_RES) - ret1 = cmPkKwuDatReqInfo( (datReq), mBuf); + ret1 = cmPkRlcDatReqInfo( (datReq), mBuf); if(ret1 != ROK) { SPutMsg(mBuf); @@ -222,12 +222,12 @@ uint8_t cmPkKwuDatReq(Pst * pst,KwuDatReqInfo* datReq,Buffer * mBuf) return ( ret1 ); } #else - cmPkKwuDatReqInfo( (datReq), mBuf); + cmPkRlcDatReqInfo( (datReq), mBuf); #endif /* ERRCLASS & ERRCLS_ADD_RES */ if(pst->srcEnt == ENTNH) { if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq, - sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY) != ROK) + sizeof(RlcDatReqInfo),SS_SHARABLE_MEMORY) != ROK) { SPutMsg(mBuf); return RFAILED; @@ -290,7 +290,7 @@ uint8_t cmPkKwuDatReq(Pst * pst,KwuDatReqInfo* datReq,Buffer * mBuf) #ifdef LCKWU case ODU_SELECTOR_LC: { - ret1 = cmPkKwuDatReqInfo( (datReq), mBuf); + ret1 = cmPkRlcDatReqInfo( (datReq), mBuf); #if (ERRCLASS & ERRCLS_ADD_RES) if(ret1 != ROK) { @@ -317,7 +317,7 @@ uint8_t cmPkKwuDatReq(Pst * pst,KwuDatReqInfo* datReq,Buffer * mBuf) if(pst->selector == ODU_SELECTOR_LC) { if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq, - sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY) != ROK) + sizeof(RlcDatReqInfo),SS_SHARABLE_MEMORY) != ROK) { SPutMsg(mBuf); return RFAILED; @@ -326,7 +326,7 @@ uint8_t cmPkKwuDatReq(Pst * pst,KwuDatReqInfo* datReq,Buffer * mBuf) } return (ret1); #endif -} /* cmPkKwuDatReq */ +} /* cmPkRlcDatReq */ uint8_t cmPkKwuDatIndInfo(KwuDatIndInfo *param,Buffer *mBuf) @@ -900,7 +900,7 @@ S16 cmUnpkKwuUbndReq(KwuUbndReq func,Pst *pst,Buffer *mBuf) } /* cmUnpkKwuUbndReq */ -S16 cmUnpkKwuDatReqInfo(KwuDatReqInfo *param,Buffer *mBuf) +S16 cmUnpkRlcDatReqInfo(RlcDatReqInfo *param,Buffer *mBuf) { @@ -939,8 +939,8 @@ S16 cmUnpkKwuDatReq(KwuDatReq func,Pst *pst,Buffer *mBuf) S16 ret1 = ROK; #endif S16 retVal; - KwuDatReqInfo *datReq = NULLP; - KwuDatReqInfo datReqTmp; + RlcDatReqInfo *datReq = NULLP; + RlcDatReqInfo datReqTmp; switch(pst->selector) @@ -955,9 +955,9 @@ S16 cmUnpkKwuDatReq(KwuDatReq func,Pst *pst,Buffer *mBuf) /* Allocate the memory statically as there is no free * in RLC */ datReq = &datReqTmp; - memset(datReq, 0, sizeof(KwuDatReqInfo)); + memset(datReq, 0, sizeof(RlcDatReqInfo)); #if(ERRCLASS & ERRCLS_DEBUG) - ret1 = cmUnpkKwuDatReqInfo( (datReq), mBuf); + ret1 = cmUnpkRlcDatReqInfo( (datReq), mBuf); if(ret1 != ROK) { SPutMsg(mBuf); @@ -967,7 +967,7 @@ S16 cmUnpkKwuDatReq(KwuDatReq func,Pst *pst,Buffer *mBuf) return ( ret1 ); } #else - cmUnpkKwuDatReqInfo( (datReq), mBuf); + cmUnpkRlcDatReqInfo( (datReq), mBuf); #endif /* ERRCLASS & ERRCLS_DEBUG */ } break; @@ -987,7 +987,7 @@ S16 cmUnpkKwuDatReq(KwuDatReq func,Pst *pst,Buffer *mBuf) if(pst->selector == ODU_SELECTOR_LWLC) { retVal = SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq, - sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY); + sizeof(RlcDatReqInfo),SS_SHARABLE_MEMORY); } return (retVal); } /* cmUnpkKwuDatReq */ diff --git a/src/cm/kwu.x b/src/cm/kwu.x index 32be9db13..53b447b07 100755 --- a/src/cm/kwu.x +++ b/src/cm/kwu.x @@ -61,7 +61,7 @@ typedef struct kwuDatReqInfo CmLteRnti rnti; /*!< Temporary CRNTI:Applicable for CCCH. */ }tm; /*!< TM mode data */ #endif /* CCPU_OPT */ -}KwuDatReqInfo; +}RlcDatReqInfo; /** @brief Data Indication Information from RLC to RRC or PDCP */ typedef struct kwuDatIndInfo @@ -125,7 +125,7 @@ typedef S16 (*KwuBndReq) ARGS((Pst *pst, SuId suId, SpId spId)); typedef S16 (*KwuBndCfm) ARGS((Pst *pst, SuId suId, uint8_t status)); typedef S16 (*KwuUbndReq) ARGS((Pst *pst, SuId suId, Reason reason)); -typedef S16 (*KwuDatReq) ARGS((Pst *pst, KwuDatReqInfo* datReq, Buffer *mBuf)); +typedef S16 (*KwuDatReq) ARGS((Pst *pst, RlcDatReqInfo* datReq, Buffer *mBuf)); typedef uint8_t (*KwuDatInd) ARGS((Pst *pst, KwuDatIndInfo* datInd, Buffer *mBuf)); typedef S16 (*KwuDatCfm) ARGS((Pst *pst, SuId suId, KwuDatCfmInfo* datCfm)); @@ -334,7 +334,7 @@ S16 NhLiKwuUbndReq ARGS((Pst *pst, S16 NhLiKwuDatReq ARGS((Pst *pst, SpId spId, - KwuDatReqInfo* datReq, + RlcDatReqInfo* datReq, Buffer *buf)); S16 NhLiKwuDatInd ARGS((Pst *pst, @@ -358,7 +358,7 @@ S16 DmUiKwuUbndReq ARGS((Pst *pst, S16 DmUiKwuDatReq ARGS((Pst *pst, SpId spId, - KwuDatReqInfo* datReq, + RlcDatReqInfo* datReq, Buffer *buf)); S16 DmUiKwuDatInd ARGS((Pst *pst, @@ -387,7 +387,7 @@ S16 PjLiKwuUbndReq ARGS((Pst *pst, S16 PjLiKwuDatReq ARGS((Pst *pst, SpId spId, - KwuDatReqInfo* datReq, + RlcDatReqInfo* datReq, Buffer *buf)); S16 PjLiKwuDatInd ARGS((Pst *pst, @@ -432,8 +432,8 @@ S16 rlcUlBatchProc ARGS((Void)); ****************************************************************************/ #ifdef LCKWU /* Packing Functions */ -uint8_t cmPkKwuDatReqInfo ARGS (( -KwuDatReqInfo *param, +uint8_t cmPkRlcDatReqInfo ARGS (( +RlcDatReqInfo *param, Buffer *mBuf )); @@ -470,9 +470,9 @@ SuId suId, uint8_t status )); -uint8_t cmPkKwuDatReq ARGS (( +uint8_t cmPkRlcDatReq ARGS (( Pst * pst, -KwuDatReqInfo* datReq, +RlcDatReqInfo* datReq, Buffer * mBuf )); @@ -533,8 +533,8 @@ KwuFlowCntrlIndInfo *flowCntrlIndInfo )); /* Unpacking Functions */ -S16 cmUnpkKwuDatReqInfo ARGS (( -KwuDatReqInfo *param, +S16 cmUnpkRlcDatReqInfo ARGS (( +RlcDatReqInfo *param, Buffer *mBuf )); diff --git a/src/cm/legtp.h b/src/cm/legtp.h index 844587ed0..dee4ab86b 100644 --- a/src/cm/legtp.h +++ b/src/cm/legtp.h @@ -49,18 +49,18 @@ typedef struct egtpIpAddr typedef struct egtpConfig { EgtpIpAddr localIp; - uint16_t localPort; + uint16_t localPort; EgtpIpAddr destIp; - uint16_t destPort; - uint32_t minTunnelId; - uint32_t maxTunnelId; + uint16_t destPort; + uint32_t minTunnelId; + uint32_t maxTunnelId; }EgtpConfig; typedef struct egtpTnlEvt { - uint8_t action; - uint32_t lclTeid; - uint32_t remTeid; + uint8_t action; + uint32_t lclTeid; + uint32_t remTeid; CmStatus cfmStatus; }EgtpTnlEvt; @@ -74,11 +74,11 @@ typedef struct egtpExtHdr /*Structure for MsgHdr */ typedef struct egtpMsgHdr { - TknUInt8 nPdu; /**< N-PDU Number */ - TknUInt32 seqNum; /**< Sequence Number */ - EgtpExtHdr extHdr; /**< Extension headers present flag */ - uint32_t teId; /**< Tunnel Endpoint Id */ - uint8_t msgType; /**< eGTP-U Message Type */ + TknUInt8 nPdu; /**< N-PDU Number */ + TknUInt32 seqNum; /**< Sequence Number */ + EgtpExtHdr extHdr; /**< Extension headers present flag */ + uint32_t teId; /**< Tunnel Endpoint Id */ + uint8_t msgType; /**< eGTP-U Message Type */ }EgtpMsgHdr; typedef struct egtpMsg diff --git a/src/cm/rlc_mac_inf.h b/src/cm/rlc_mac_inf.h index b8faa21c4..97f3fc75b 100644 --- a/src/cm/rlc_mac_inf.h +++ b/src/cm/rlc_mac_inf.h @@ -70,7 +70,6 @@ typedef struct rlcPduInfo typedef struct rlcData { - // add slot info uint16_t cellId; /*!< CELL ID */ uint16_t rnti; /*!< Temporary CRNTI */ SlotIndInfo slotInfo; /*!< Timing info */ diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 42134711b..e860d4153 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -7261,21 +7261,30 @@ uint8_t extractDrbCfg(DRBs_ToBeSetup_Item_t *drbItem, LcCfg *macLcToAdd, UpTnlCf return ROK; } -uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg,\ - UpTnlCfg *upTnlInfo) -{ - uint8_t ret = ROK; +/******************************************************************* + * + * @brief Function to extract RB info received from CU + * + * @details + * + * Function : extractMacRbCfg + * + * Functionality: Function to extract RB info received from CU + * + * @params[in] F1AP message + * @return ROK/RFAILED + * + * ****************************************************************/ - if(drbCfg) +uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg,\ + LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg, UpTnlCfg *upTnlInfo) +{ + if(drbCfg != NULLP) { - if(drbCfg != NULLP) + if(extractDrbCfg(drbCfg, lcCfg, upTnlInfo) != ROK) { - ret = extractDrbCfg(drbCfg, lcCfg, upTnlInfo); - if(ret == RFAILED) - { - DU_LOG("ERROR --> F1AP : Failed to build Drb Qos at extractMacRbCfg()"); - return ret; - } + DU_LOG("ERROR --> F1AP : Failed to build Drb Qos at extractMacRbCfg()"); + return RFAILED; } } else @@ -7294,9 +7303,24 @@ uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg, LogicalChan } else lcCfg->ulLcCfgPres = false; - return ret; + return ROK; } +/******************************************************************* + * + * @brief Function processing LC config info received from CU + * + * @details + * + * Function : procMacLcCfg + * + * Functionality: Function processing LC config info received from CU + * + * @params[in] F1AP message + * @return ROK/RFAILED + * + * ****************************************************************/ + uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType,\ DRBs_ToBeSetup_Item_t *drbItem, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg, UpTnlCfg *upTnlInfo) { @@ -9500,7 +9524,7 @@ uint8_t extractDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_List_t *drbCfg, DuUeC { uint8_t ret, drbIdx; DRBs_ToBeSetup_Item_t *drbItem = NULLP; - + ret = ROK; if(drbCfg) { @@ -9521,6 +9545,7 @@ uint8_t extractDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_List_t *drbCfg, DuUeC } memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg)); memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg)); + ret = procDrbListToSetup(lcId, drbItem, &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs],\ &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], &ueCfgDb->upTnlInfo[ueCfgDb->numDrb]); @@ -9529,7 +9554,7 @@ uint8_t extractDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_List_t *drbCfg, DuUeC ueCfgDb->numDrb++; if(ret == RFAILED) { - DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetup()"); + DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetup()"); break; } } @@ -10433,6 +10458,7 @@ uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId) freeF1UeDb(ueCb->f1UeDb); ueCb->f1UeDb = NULLP; + /* TODO: To send Drb list */ xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg); /* Encode the UE context setup response type as APER */ diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index 153ebf0b7..d2fc5c7ae 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -36,49 +36,151 @@ DuMacDlCcchInd packMacDlCcchIndOpts[] = { - packMacDlCcchInd, /* Loose coupling */ - MacProcDlCcchInd, /* TIght coupling */ - packMacDlCcchInd /* Light weight-loose coupling */ + packMacDlCcchInd, /* Loose coupling */ + MacProcDlCcchInd, /* TIght coupling */ + packMacDlCcchInd /* Light weight-loose coupling */ }; DuMacUeCreateReq packMacUeCreateReqOpts[] = { packDuMacUeCreateReq, /* Loose coupling */ - MacProcUeCreateReq, /* TIght coupling */ - packDuMacUeCreateReq /* Light weight-loose coupling */ + MacProcUeCreateReq, /* TIght coupling */ + packDuMacUeCreateReq /* Light weight-loose coupling */ }; DuRlcUeCreateReq packRlcUeCreateReqOpts[] = { packDuRlcUeCreateReq, /* Loose coupling */ - RlcProcUeCreateReq, /* TIght coupling */ - packDuRlcUeCreateReq /* Light weight-loose coupling */ + RlcProcUeCreateReq, /* TIght coupling */ + packDuRlcUeCreateReq /* Light weight-loose coupling */ }; DuDlRrcMsgToRlcFunc duSendDlRrcMsgToRlcOpts[] = { packDlRrcMsgToRlc, /* Loose coupling */ - RlcProcDlRrcMsgTransfer, /* Tight coupling */ + RlcProcDlRrcMsgTransfer, /* Tight coupling */ packDlRrcMsgToRlc /* Light weight-loose coupling */ }; DuRlcUeReconfigReq packRlcUeReconfigReqOpts[] = { - packDuRlcUeReconfigReq, /* Loose coupling */ + packDuRlcUeReconfigReq, /* Loose coupling */ RlcProcUeReconfigReq, /* TIght coupling */ - packDuRlcUeReconfigReq /* Light weight-loose coupling */ + packDuRlcUeReconfigReq /* Light weight-loose coupling */ }; DuMacUeReconfigReq packMacUeReconfigReqOpts[] = { - packDuMacUeReconfigReq, /* Loose coupling */ + packDuMacUeReconfigReq, /* Loose coupling */ MacProcUeReconfigReq, /* TIght coupling */ - packDuMacUeReconfigReq /* Light weight-loose coupling */ + packDuMacUeReconfigReq /* Light weight-loose coupling */ }; -#ifdef EGTP_TEST -uint32_t sduId = 0; -#endif +DuRlcDlUserDataToRlcFunc duSendRlcDlUserDataToRlcOpts[] = +{ + packRlcDlUserDataToRlc, /* Loose coupling */ + RlcProcDlUserDataTransfer, /* Tight coupling */ + packRlcDlUserDataToRlc /* Light weight-loose coupling */ +}; + +/******************************************************************* + * + * @brief Function to fillDlUserDataInfo + * + * @details + * + * Function : fillDlUserDataInfo + * + * Functionality: + * Function to fillDlUserDataInfo + * + * @params[in] teId, + * dlDataMsgInfo + * + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ + +uint8_t fillDlUserDataInfo(uint32_t teId, RlcDlUserDataInfo *dlDataMsgInfo) +{ + uint8_t drbIdx; + + for(drbIdx = 0; drbIdx < duCb.numDrb; drbIdx++) + { + if(duCb.upTnlCfg[drbIdx] && (duCb.upTnlCfg[drbIdx]->tnlCfg1 != NULLP)) + { + if(duCb.upTnlCfg[drbIdx]->tnlCfg1->teId == teId) + { + dlDataMsgInfo->cellId = duCb.upTnlCfg[drbIdx]->cellId; + dlDataMsgInfo->ueIdx = duCb.upTnlCfg[drbIdx]->ueIdx; + dlDataMsgInfo->rbId = duCb.upTnlCfg[drbIdx]->drbId; + return ROK; + } + } + } + return RFAILED; +} + + /******************************************************************* + * + * @brief Build and Send DL Data Message transfer to RLC + * + * @details + * + * Function : duBuildAndSendDlUserDataToRlc + * + * Functionality: + * Build and Send DL Data Message transfer to RLC + * + * @params[in] Cell ID + * UE Index + * Logical Channgel ID + * RRC Message + * RRC Message Length + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ + +uint8_t duBuildAndSendDlUserDataToRlc(uint16_t msgLen, EgtpMsg *egtpMsg) +{ + uint8_t ret = RFAILED; + Pst pst; + RlcDlUserDataInfo *dlDataMsgInfo = NULLP; + + DU_ALLOC_SHRABL_BUF(dlDataMsgInfo, sizeof(RlcDlUserDataInfo)); + if(!dlDataMsgInfo) + { + DU_LOG("\nERROR --> DU_APP : Memory allocation failed for dlDataMsgInfo in duHdlEgtpDlData()"); + return RFAILED; + } + memset(dlDataMsgInfo, 0, sizeof(RlcDlUserDataInfo)); + if(ODU_GET_MSG_BUF(DU_APP_MEM_REGION, DU_POOL, &dlDataMsgInfo->dlMsg) != ROK) + { + DU_LOG("\nERROR --> DU_APP : Memory allocation failed for dlMsg in duHdlEgtpDlData()"); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlDataMsgInfo, sizeof(RlcDlUserDataInfo)); + return RFAILED; + } + dlDataMsgInfo->dlMsg = egtpMsg->msg; + dlDataMsgInfo->msgLen = msgLen; + + /* Filling DL DATA Msg Info */ + if(fillDlUserDataInfo(egtpMsg->msgHdr.teId, dlDataMsgInfo) == ROK) + { + /* Filling post structure and sending msg */ + FILL_PST_DUAPP_TO_RLC(pst, RLC_DL_INST, EVENT_DL_USER_DATA_TRANS_TO_RLC); + DU_LOG("\nDEBUG --> DU_APP : Sending User Data Msg to RLC \n"); + ret = (*duSendRlcDlUserDataToRlcOpts[pst.selector])(&pst, dlDataMsgInfo); + } + if(ret != ROK) + { + DU_LOG("\nERROR --> DU_APP : Failed to send User Data to RLC in duHdlEgtpDlData()"); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlDataMsgInfo->dlMsg, msgLen); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlDataMsgInfo, sizeof(RlcDlUserDataInfo)); + } + return ret; +} /******************************************************************* * @@ -98,50 +200,21 @@ uint32_t sduId = 0; * ****************************************************************/ uint8_t duHdlEgtpDlData(EgtpMsg *egtpMsg) { - - /* TODO : Extract RbId/UeID/CellID/SduId from database - using tunnel id in egtp header */ - - DU_LOG("\nDEBUG --> DU_APP : Processing DL data"); -#ifdef EGTP_TEST - Pst pst; - uint8_t ret; - MsgLen copyLen; - RlcDlRrcMsgInfo *dlRrcMsgInfo = NULLP; - - DU_ALLOC_SHRABL_BUF(dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo)); - if(!dlRrcMsgInfo) + uint16_t msgLen = 0; + DU_LOG("\nDEBUG --> DU_APP : Processing DL data in duHdlEgtpDlData()"); + + if(!egtpMsg->msg) { - DU_LOG("\nDU APP : Memory allocation failed for dlRrcMsgInfo in \ - duBuildAndSendDlRrcMsgToRlc"); - ODU_PUT_MSG_BUF(egtpMsg->msg); + DU_LOG("\nERROR --> DU_APP : Recevied Dl Data is NULLP in duHdlEgtpDlData()"); return RFAILED; } - - /* Filling up the RRC msg info */ - dlRrcMsgInfo->cellId = NR_CELL_ID; - dlRrcMsgInfo->ueIdx = UE_ID; - dlRrcMsgInfo->rbType = CM_LTE_DRB; - dlRrcMsgInfo->rbId = RB_ID; - dlRrcMsgInfo->lcType = CM_LTE_LCH_DTCH; - dlRrcMsgInfo->lcId = 4; - dlRrcMsgInfo->execDup = false; - dlRrcMsgInfo->deliveryStaRpt = false; - ODU_GET_MSG_LEN(egtpMsg->msg, &dlRrcMsgInfo->msgLen); - DU_ALLOC_SHRABL_BUF(dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen); - ODU_COPY_MSG_TO_FIX_BUF(egtpMsg->msg, 0, dlRrcMsgInfo->msgLen, dlRrcMsgInfo->rrcMsg, (MsgLen *)©Len); - ODU_PUT_MSG_BUF(egtpMsg->msg); - - /* Filling post structure and sending msg */ - FILL_PST_DUAPP_TO_RLC(pst, RLC_DL_INST, EVENT_DL_RRC_MSG_TRANS_TO_RLC); - DU_LOG("\nDU_APP: Sending Dl User Msg to RLC \n"); - ret = (*duSendDlRrcMsgToRlcOpts[pst.selector])(&pst, dlRrcMsgInfo); - if(ret != ROK) + ODU_GET_MSG_LEN(egtpMsg->msg, (MsgLen *)&msgLen); + if(duBuildAndSendDlUserDataToRlc(msgLen, egtpMsg) != ROK) { - DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo)); + DU_LOG("\nERROR --> DU_APP : Failed to build DL USer Data in duHdlEgtpDlData()"); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, egtpMsg->msg, msgLen); return RFAILED; } -#endif return ROK; } diff --git a/src/du_app/du_ue_mgr.h b/src/du_app/du_ue_mgr.h index 4117e8175..7406ce2a9 100644 --- a/src/du_app/du_ue_mgr.h +++ b/src/du_app/du_ue_mgr.h @@ -22,7 +22,7 @@ #define __DU_UE_MGR_H__ uint8_t duHdlRlcUlData(Pst *pst, KwuDatIndInfo* datInd, Buffer *mBuf); -uint8_t cmPkKwuDatReq(Pst * pst,KwuDatReqInfo* datReq,Buffer * mBuf); +uint8_t cmPkRlcDatReq(Pst * pst,RlcDatReqInfo* datReq,Buffer * mBuf); uint8_t duBuildAndSendUeCreateReqToMac(uint16_t cellId, uint8_t ueIdx,\ uint16_t crnti, MacUeCfg *duMacUeCfg); uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t ueIdx, RlcUeCfg *duRlcUeCfg);