X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Fkw_amm_dl.c;h=609434df3926dad83a50ee6eb8343867f560658f;hb=de455b62ebaa9e36fe74dc36d342d7f6a22314e1;hp=54b4b6d801495937dd9003d4d2f9bd3cbe4c9f2a;hpb=4d45b914f9e94203603d3b9fdbcb1aad361301dd;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/kw_amm_dl.c b/src/5gnrrlc/kw_amm_dl.c index 54b4b6d80..609434df3 100755 --- a/src/5gnrrlc/kw_amm_dl.c +++ b/src/5gnrrlc/kw_amm_dl.c @@ -35,9 +35,6 @@ File: kw_amm_dl.c *********************************************************************21*/ -static const char* RLOG_MODULE_NAME="AMM"; -static int RLOG_MODULE_ID=2048; -static int RLOG_FILE_ID=189; /* header include files (.h) */ #include "common_def.h" #include "lkw.h" /* LKW defines */ @@ -64,26 +61,26 @@ static int RLOG_FILE_ID=189; //UDAY #ifdef L2_OPTMZ -extern U32 kwAmmStaPduList[512]; - U32 kwAmmStaPduListCnt = 0; +uint32_t rlcAmmStaPduList[512]; +uint32_t rlcAmmStaPduListCnt = 0; #endif /** @file gp_amm_dl.c @brief RLC Acknowledged Mode Downlink Module **/ -#define KW_MODULE (KW_DBGMASK_AM | KW_DBGMASK_DL) +#define RLC_MODULE (RLC_DBGMASK_AM | RLC_DBGMASK_DL) -U32 kwStatusPduCnt, kwStatusAckCnt, kwStatusNcnt, kwSduSndCnt; +uint32_t rlcStatusPduCnt, rlcStatusAckCnt, rlcStatusNcnt, rlcSduSndCnt; /* local defines */ /* local externs */ /* forward references */ -EXTERN Void kwAmmDlHndlStatusPdu ARGS ((RlcCb *gCb, +Void rlcAmmDlHndlStatusPdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - KwUdxStaPdu *pStaPdu)); + RlcUdxStaPdu *pStaPdu)); /* public variable declarations */ @@ -91,12 +88,12 @@ EXTERN Void kwAmmDlHndlStatusPdu ARGS ((RlcCb *gCb, /* private variable declarations */ -#define KW_AM_RMV_HDR(_gCb, _rbCb, _retx) do { \ +#define RLC_AM_RMV_HDR(_gCb, _rbCb, _retx) do { \ if ((_retx)->yetToConst == FALSE) \ {\ Buffer *_pduInfo; \ SSegMsg((_retx)->seg, (_retx)->hdrSz, &_pduInfo); \ - RLC_FREE_BUF((_retx)->seg); \ + ODU_PUT_MSG_BUF((_retx)->seg); \ (_retx)->seg = _pduInfo; \ }\ (_rbCb)->m.amDl.estHdrSz -= retx->hdrSz;\ @@ -104,117 +101,117 @@ EXTERN Void kwAmmDlHndlStatusPdu ARGS ((RlcCb *gCb, /* private function declarations */ -PRIVATE Void kwResegRetxPdus ARGS ((RlcCb *gCb, +static Void rlcResegRetxPdus ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - KwDatReq *kwDatReq)); + RlcDatReq *rlcDatReq)); -PRIVATE Void kwRemRetxPdu ARGS ((RlcCb *gCb, +static Void rlcRemRetxPdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - KwRetx *retx)); + RlcRetx *retx)); -PRIVATE Void kwAmmCreateStatusPdu ARGS ((RlcCb *gCb, +static Void rlcAmmCreateStatusPdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - KwDatReq *kwDatReq)); + RlcDatReq *rlcDatReq)); -PRIVATE Void kwAmmDlMarkPduForReTx ARGS ((RlcCb *gCb, +static Void rlcAmmDlMarkPduForReTx ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - KwRetx *retx)); + RlcRetx *retx)); -PRIVATE Void kwAmmDlProcessSuccessfulTxPdu ARGS((RlcCb *gCb, +static Void rlcAmmDlProcessSuccessfulTxPdu ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, - KwSn sn, + RlcSn sn, KwuDatCfmInfo **datCfm)); -PRIVATE Void kwAmmDlSetTxNextAck ARGS((KwAmDl *amDl, KwSn sn)); +static Void rlcAmmDlSetTxNextAck ARGS((RlcAmDl *amDl, RlcSn sn)); -PRIVATE Void kwAmmDlCheckAndStopPollTmr ARGS((RlcCb *gCb, +static Void rlcAmmDlCheckAndStopPollTmr ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, - KwSn mAckSn)); + RlcSn mAckSn)); -PRIVATE Void kwAssembleSdus ARGS ((RlcCb *gCb, +static Void rlcAssembleSdus ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - KwDatReq *kwDatReq)); + RlcDatReq *rlcDatReq)); -PRIVATE Bool kwAmmDlCheckAndSetPoll ARGS ((RlcCb *gCb, +static bool rlcAmmDlCheckAndSetPoll ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - Bool newPdu, + bool newPdu, MsgLen bufSz)); -PRIVATE Void kwAmmCreatePdu ARGS ((RlcCb *gCb, +static Void rlcAmmCreatePdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - KwAmHdr *amHdr, + RlcAmHdr *amHdr, RlcDlPduInfo *pduInfo, Buffer *pdu)); -PRIVATE Void kwAmmSndStaInd ARGS ((RlcCb *gCb,RlcDlRbCb *rbCb, KwRetx *retx)); +static Void rlcAmmSndStaInd ARGS ((RlcCb *gCb,RlcDlRbCb *rbCb, RlcRetx *retx)); -PRIVATE Void kwGetNxtRetx ARGS ((RlcCb *gCb, KwRetx **retx)); +static Void rlcGetNxtRetx ARGS ((RlcCb *gCb, RlcRetx **retx)); -PRIVATE Void kwConstructAmHdr ARGS ((KwAmHdr *amHdr, - U8 *hdr, - U8 snLen, - U16 *idx)); +static Void rlcConstructAmHdr ARGS ((RlcAmHdr *amHdr, + uint8_t *hdr, + uint8_t snLen, + uint16_t *idx)); -PRIVATE Void kwAmmDlUpdateTxAndReTxBufForAckSn ARGS ((RlcCb *gCb, +static Void rlcAmmDlUpdateTxAndReTxBufForAckSn ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, - KwSn mAckSn, + RlcSn mAckSn, CmLList *retx, KwuDatCfmInfo **datCfm)); -PRIVATE Void kwAmmDlMoveFrmTxtoRetxBuffer ARGS ((RlcCb *gCb, - KwAmDl *amDl, - KwRetx **retx, - KwSn sn)); +static Void rlcAmmDlMoveFrmTxtoRetxBuffer ARGS ((RlcCb *gCb, + RlcAmDl *amDl, + RlcRetx **retx, + RlcSn sn)); -PRIVATE Void kwAmmDlCheckIsSDUDelivered ARGS((RlcCb *gCb, +static Void rlcAmmDlCheckIsSDUDelivered ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, - KwSduMap *sduMap, + RlcSduMap *sduMap, KwuDatCfmInfo **datCfm)); -PRIVATE Void kwAmmAddPduToRetxLst ARGS((KwAmDl *amDl, - KwRetx *retx)); +static Void rlcAmmAddPduToRetxLst ARGS((RlcAmDl *amDl, + RlcRetx *retx)); -PRIVATE Void kwAmmDlMoveSduByteSegFrmTxtoRetxBuffer ARGS( +static Void rlcAmmDlMoveSduByteSegFrmTxtoRetxBuffer ARGS( ( RlcCb *gCb, -KwAmDl *amDl, -KwRetx **retx, +RlcAmDl *amDl, +RlcRetx **retx, RlcDlPduInfo *pduInfo )); -PRIVATE Void kwAmmDlHndlStatus4SduByteSegInTxBuf ARGS( +static Void rlcAmmDlHndlStatus4SduByteSegInTxBuf ARGS( ( RlcCb *gCb, RlcDlRbCb *rbCb, -KwNackInfo *nackSnInfo, -KwRetx **retx, +RlcNackInfo *nackSnInfo, +RlcRetx **retx, KwuDatCfmInfo **datCfm )); -PRIVATE Void kwAmmDlUpdateTxAndReTxBufForNackSn ARGS( +static Void rlcAmmDlUpdateTxAndReTxBufForNackSn ARGS( ( RlcCb *gCb, RlcDlRbCb *rbCb, - KwNackInfo *nackSnInfo, + RlcNackInfo *nackSnInfo, CmLList **retxNode, KwuDatCfmInfo **datCfm )); -PRIVATE Void RlcDlAmmGetNackSnInfoFrmNackRangeIdx ARGS( +static Void RlcDlAmmGetNackSnInfoFrmNackRangeIdx ARGS( ( -KwAmDl *amDl, -KwNackInfo *nackInfo, +RlcAmDl *amDl, +RlcNackInfo *nackInfo, CmLList *retxNode, -KwNackInfo *nackSnInfo, -U8 idx +RlcNackInfo *nackSnInfo, +uint8_t idx )); -PRIVATE Void kwAmmDlUpdTxAndReTxBufForLessThanNackSn ARGS( +static Void rlcAmmDlUpdTxAndReTxBufForLessThanNackSn ARGS( ( RlcCb *gCb, RlcDlRbCb *rbCb, -KwSn sn, -KwSn mNackSn, +RlcSn sn, +RlcSn mNackSn, CmLList **retxNode, KwuDatCfmInfo **datCfm )); @@ -222,13 +219,13 @@ KwuDatCfmInfo **datCfm AM Module contains the following funcitons: - - kwAmmQSdu - - kwAmmProcessSdus - - kwAmmDlAssembleCntrlInfo - - kwResegRetxPdus - - kwAssembleSdus - - kwAmmDlCheckAndSetPoll - - kwAmmProcessPdus + - rlcAmmQSdu + - rlcAmmProcessSdus + - rlcAmmDlAssembleCntrlInfo + - rlcResegRetxPdus + - rlcAssembleSdus + - rlcAmmDlCheckAndSetPoll + - rlcAmmProcessPdus - rlcDlmHndlStaRsp - kwTriggerStatus - kwReassembleSdus @@ -251,28 +248,17 @@ KwuDatCfmInfo **datCfm * * @return Void */ -#ifdef ANSI -PUBLIC Void kwAmmSendDStaRsp -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwAmDl *amDl -) -#else -PUBLIC Void kwAmmSendDStaRsp(gCb, rbCb, amDl) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwAmDl *amDl; -#endif +void rlcAmmSendDedLcBoStatus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcAmDl *amDl) { - S32 bo = kwAmmCalculateBo(amDl); + int32_t bo = rlcAmmCalculateBo(amDl); if(bo) { - kwUtlSndDStaRsp(gCb, rbCb, bo, amDl->estHdrSz, amDl->cntrlBo ?TRUE:FALSE,amDl->cntrlBo); + rlcUtlSendDedLcBoStatus(gCb, rbCb, bo, amDl->estHdrSz, \ + amDl->cntrlBo ?TRUE:FALSE,amDl->cntrlBo); } - RETVOID; + return; } /** @@ -285,33 +271,21 @@ KwAmDl *amDl; * * @return Void */ -#ifdef ANSI -PRIVATE Void kwAmmDlCheckAndStopPollTmr -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwSn mAckSn -) -#else -PRIVATE Void kwAmmDlCheckAndStopPollTmr(gCb, rbCb, mAckSn) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwSn mAckSn; -#endif +static Void rlcAmmDlCheckAndStopPollTmr(RlcCb *gCb,RlcDlRbCb *rbCb,RlcSn mAckSn) { - KwSn mPollSn; + RlcSn mPollSn; MODAMT(rbCb->m.amDl.pollSn, mPollSn, rbCb->m.amDl.txNextAck,rbCb->m.amDl.snModMask); if (mPollSn <= mAckSn) { - if (kwChkTmr(gCb, (PTR)rbCb, KW_EVT_AMDL_POLL_RETX_TMR)) + if (rlcChkTmr(gCb, (PTR)rbCb, EVENT_RLC_AMDL_POLL_RETX_TMR)) { - kwStopTmr(gCb, (PTR)rbCb, KW_EVT_AMDL_POLL_RETX_TMR); + rlcStopTmr(gCb, (PTR)rbCb, EVENT_RLC_AMDL_POLL_RETX_TMR); } } - RETVOID; + return; } /** @@ -322,21 +296,11 @@ KwSn mAckSn; * * @return Void */ -#ifdef ANSI -PRIVATE Void kwAmmDlSetTxNextAck -( -KwAmDl *amDl, -KwSn sn -) -#else -PRIVATE Void kwAmmDlSetTxNextAck(amDl, sn) -KwAmDl *amDl; -KwSn sn -#endif +static Void rlcAmmDlSetTxNextAck(RlcAmDl *amDl,RlcSn sn) { amDl->txNextAck = sn; - RETVOID; + return; } /** @@ -352,27 +316,19 @@ KwSn sn * * @return Void */ -#ifdef ANSI -PRIVATE Void kwAmmDlProcessSuccessfulReTx +static Void rlcAmmDlProcessSuccessfulReTx ( RlcCb *gCb, RlcDlRbCb *rbCb, -KwRetx *retx, -KwuDatCfmInfo **datCfm +RlcRetx *retx, +KwuDatCfmInfo **datCfm ) -#else -PRIVATE Void kwAmmDlProcessSuccessfulReTx(gCb, rbCb, retx, datCfm) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwRetx *retx; -KwuDatCfmInfo **datCfm; -#endif { - kwAmmDlCheckIsSDUDelivered(gCb, rbCb, &(retx->sduMap), datCfm); + rlcAmmDlCheckIsSDUDelivered(gCb, rbCb, &(retx->sduMap), datCfm); - kwRemRetxPdu(gCb, rbCb, retx); + rlcRemRetxPdu(gCb, rbCb, retx); - RETVOID; + return; } /** @@ -382,8 +338,8 @@ KwuDatCfmInfo **datCfm; * This function is used to move the PDU from the txBuf to re-transmit buffer * * @param[in]RlcCb *gCb RLC instance control block - * @param[in]KwAmDl *amDl AM Downlink Control Block - * @param[in]KwRetx **retx node in the reTx buffer to be moved to, allocated by + * @param[in]RlcAmDl *amDl AM Downlink Control Block + * @param[in]RlcRetx **retx node in the reTx buffer to be moved to, allocated by * this function * @param[in]RlcDlPduInfo *pduInfo TX PDU which needs to be moved * @@ -391,32 +347,22 @@ KwuDatCfmInfo **datCfm; * */ -#ifdef ANSI -PRIVATE Void kwAmmDlMoveSduByteSegFrmTxtoRetxBuffer +static Void rlcAmmDlMoveSduByteSegFrmTxtoRetxBuffer ( RlcCb *gCb, -KwAmDl *amDl, -KwRetx **retx, +RlcAmDl *amDl, +RlcRetx **retx, RlcDlPduInfo *pduInfo ) -#else -PRIVATE Void kwAmmDlMoveSduByteSegFrmTxtoRetxBuffer(gCb, amDl, retx, pduInfo) -RlcCb *gCb; -KwAmDl *amDl; -KwRetx **retx; -RlcDlPduInfo *pduInfo; -#endif { - TRC2(kwAmmDlMoveSduByteSegFrmTxtoRetxBuffer); - - RLC_ALLOC_WC(gCb,*retx, sizeof(KwRetx)); + RLC_ALLOC_WC(gCb,*retx, sizeof(RlcRetx)); #if (ERRCLASS & ERRCLS_ADD_RES) if (*retx == NULLP) { - RLOG0(L_FATAL, "Memory allocation failed"); - RETVOID; + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed"); + return; } #endif /* ERRCLASS & ERRCLS_RES */ @@ -434,12 +380,12 @@ RlcDlPduInfo *pduInfo; (*retx)->lstEnt.next = 0; (*retx)->lstEnt.prev = 0; /* copy the sdu maps */ - KW_MEM_CPY(&((*retx)->sduMap), + RLC_MEM_CPY(&((*retx)->sduMap), &pduInfo->sduMap, - sizeof(KwSduMap)); + sizeof(RlcSduMap)); - KW_MEM_CPY(&((*retx)->amHdr), &pduInfo->amHdr, sizeof(KwAmHdr)); - kwAmmAddPduToRetxLst(amDl, (*retx)); + RLC_MEM_CPY(&((*retx)->amHdr), &pduInfo->amHdr, sizeof(RlcAmHdr)); + rlcAmmAddPduToRetxLst(amDl, (*retx)); /* Update the BO appropriately */ amDl->retxBo += (*retx)->segSz; @@ -447,8 +393,8 @@ RlcDlPduInfo *pduInfo; gRlcStats.amRlcStats.numDLRetransPdus++; - RETVOID; -} /*kwAmmDlMoveSduByteSegFrmTxtoRetxBuffer */ + return; +} /*rlcAmmDlMoveSduByteSegFrmTxtoRetxBuffer */ /** * @brief Function to handle Status of Sdu byte segment for a nackSn @@ -458,8 +404,8 @@ RlcDlPduInfo *pduInfo; * * @param[in]RlcCb *gCb RLC instance control block * @param[in]RlcDlRbCb *rbCb AM Downlink Control Block - * @param[in]KwNackInfo *nackSnInfo Nack Information of a NACK_SN - * @param[in]KwRetx **retx node in the reTx buffer to be moved to, allocated by + * @param[in]RlcNackInfo *nackSnInfo Nack Information of a NACK_SN + * @param[in]RlcRetx **retx node in the reTx buffer to be moved to, allocated by * this function * @param[in]KwuDatCfmInfo **datCfm Ptr to datCfm * @@ -467,48 +413,35 @@ RlcDlPduInfo *pduInfo; * */ -#ifdef ANSI -PRIVATE Void kwAmmDlHndlStatus4SduByteSegInTxBuf +static Void rlcAmmDlHndlStatus4SduByteSegInTxBuf ( RlcCb *gCb, RlcDlRbCb *rbCb, -KwNackInfo *nackSnInfo, -KwRetx **retx, +RlcNackInfo *nackSnInfo, +RlcRetx **retx, KwuDatCfmInfo ** datCfm ) -#else -PRIVATE Void kwAmmDlHndlStatus4SduByteSegInTxBuf(gCb, rbCb, nackSnInfo, retx, datCfm) -( -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwNackInfo *nackSnInfo; -KwRetx **retx; -KwuDatCfmInfo **datCfm; -) -#endif { - KwTx *txBuf=NULLP; + RlcTx *txBuf=NULLP; CmLList *lnk; CmLList *nextLnk; - TRC2(kwAmmDlHndlStatus4SduByteSegInTxBuf) - - txBuf = kwUtlGetTxBuf(AMDL.txBufLst, nackSnInfo->sn); + txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, nackSnInfo->sn); if (txBuf == NULLP) { - RETVOID; + return; } lnk = txBuf->pduLst.first; while(lnk) { RlcDlPduInfo *pduInfo = (RlcDlPduInfo *)(lnk->node); - KwSn pduSoEnd = (pduInfo->amHdr.so + pduInfo->sduMap.sduSz - 1); + RlcSn pduSoEnd = (pduInfo->amHdr.so + pduInfo->sduMap.sduSz - 1); /* If So of Sdu byte segment(pduInfo/seg) is < status pdu soStart that means it's ACKED*/ if(pduSoEnd < nackSnInfo->soStart) { - kwAmmDlCheckIsSDUDelivered(gCb, + rlcAmmDlCheckIsSDUDelivered(gCb, rbCb, &(pduInfo->sduMap), datCfm); @@ -517,7 +450,7 @@ KwuDatCfmInfo **datCfm; else if (pduSoEnd <= nackSnInfo->soEnd) { /* Move Sdu byte segment from TX buf to retx buf*/ - kwAmmDlMoveSduByteSegFrmTxtoRetxBuffer(gCb, + rlcAmmDlMoveSduByteSegFrmTxtoRetxBuffer(gCb, &rbCb->m.amDl, retx, pduInfo); @@ -530,16 +463,16 @@ KwuDatCfmInfo **datCfm; nextLnk = lnk->next; /* Delete node from the txBuf Pdu lst */ cmLListDelFrm(&txBuf->pduLst, lnk); - RLC_FREE_WC(gCb, pduInfo, sizeof(RlcDlPduInfo)); + RLC_FREE(gCb, pduInfo, sizeof(RlcDlPduInfo)); lnk = nextLnk; } if(!txBuf->pduLst.count) { /*No more Sdu byte segment are left. Hence delete txBuf*/ - kwUtlDelTxBuf(AMDL.txBufLst, txBuf,gCb); + rlcUtlDelTxBuf(RLC_AMDL.txBufLst, txBuf,gCb); } - RETVOID; + return; } /** @@ -550,38 +483,25 @@ KwuDatCfmInfo **datCfm; * * @param[in]RlcCb *gCb RLC instance control block * @param[in]RlcDlRbCb *rbCb AM Downlink Control Block - * @param[in]KwNackInfo *nackSnInfo Nack Information of a NACK_SN - * @param[in]KwRetx **retx node in the reTx buffer to be moved to, allocated by + * @param[in]RlcNackInfo *nackSnInfo Nack Information of a NACK_SN + * @param[in]RlcRetx **retx node in the reTx buffer to be moved to, allocated by * this function * @param[in]KwuDatCfmInfo **datCfm Ptr to datCfm * * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAmmDlUpdateTxAndReTxBufForNackSn -( - RlcCb *gCb, - RlcDlRbCb *rbCb, - KwNackInfo *nackSnInfo, - CmLList **retxNode, - KwuDatCfmInfo **datCfm - ) -#else -PRIVATE Void kwAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, nackSnInfo, retxNode, datCfm) +static Void rlcAmmDlUpdateTxAndReTxBufForNackSn ( - RlcCb *gCb; - RlcDlRbCb *rbCb; - KwNackInfo *nackSnInfo; - CmLList **retxNode; - KwuDatCfmInfo **datCfm; - ) -#endif +RlcCb *gCb, +RlcDlRbCb *rbCb, +RlcNackInfo *nackSnInfo, +CmLList **retxNode, +KwuDatCfmInfo **datCfm +) { - KwTx *txBuf; - KwRetx *retx; - - TRC2(kwAmmDlUpdateTxAndReTxBufForNackSn) + RlcTx *txBuf; + RlcRetx *retx; /* Now process the NACK_SN received. Now the NACK_SN is */ /* either the first element of RETX or is in TX array */ @@ -589,7 +509,7 @@ PRIVATE Void kwAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, nackSnInfo, retxNode, /* if the NACK_SN is in the transmit buffer, move it to the re- transmit buffer */ - txBuf = kwUtlGetTxBuf(AMDL.txBufLst, nackSnInfo->sn); + txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, nackSnInfo->sn); if (txBuf != NULLP) { if(nackSnInfo->isSegment) @@ -597,12 +517,12 @@ PRIVATE Void kwAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, nackSnInfo, retxNode, /* Go through all the AMD PDUs of a particular SN and check if segment is ACKED if yes then mark succesfully sent, if segment is NACKed then move it to to retx lst */ - kwAmmDlHndlStatus4SduByteSegInTxBuf(gCb, rbCb, nackSnInfo, &retx, datCfm); + rlcAmmDlHndlStatus4SduByteSegInTxBuf(gCb, rbCb, nackSnInfo, &retx, datCfm); } else { /*e2= 0 and e3= 0: Move complete PDU from TX buf to retx buf*/ - kwAmmDlMoveFrmTxtoRetxBuffer(gCb, + rlcAmmDlMoveFrmTxtoRetxBuffer(gCb, &rbCb->m.amDl, &retx, nackSnInfo->sn); @@ -615,14 +535,14 @@ PRIVATE Void kwAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, nackSnInfo, retxNode, (*retxNode) = retx->lstEnt.next; } - RETVOID; + return; } /* process the pdus/segments in the re-transmit buffer with this NACK_SN */ while (*retxNode) { - retx = (KwRetx *)((*retxNode)->node); + retx = (RlcRetx *)((*retxNode)->node); if (retx->amHdr.sn != nackSnInfo->sn) { break; @@ -630,20 +550,18 @@ PRIVATE Void kwAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, nackSnInfo, retxNode, if ((nackSnInfo->isSegment) && ((retx->soEnd < nackSnInfo->soStart) /*|| (retx->amHdr.so > soEnd)*/)) { - RLOG_ARG3(L_DEBUG, DBG_RBID, rbCb->rlcId.rbId, - "kwHndlStaRsp: Handle ACK for byte segment, Its " + DU_LOG( "\nDEBUG --> RLC_DL : rlcHndlStaRsp: Handle ACK for byte segment, Its " "sn = %d UEID:%d CELLID:%d", nackSnInfo->sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RLOG_ARG4(L_DEBUG, DBG_RBID, rbCb->rlcId.rbId, - "soStart and soEnd = %d, %d, UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_DL : soStart and soEnd = %d, %d, UEID:%d CELLID:%d", retx->amHdr.so, retx->soEnd, rbCb->rlcId.ueId, rbCb->rlcId.cellId); (*retxNode) = (*retxNode)->next; - kwAmmDlProcessSuccessfulReTx(gCb,rbCb, retx, datCfm); + rlcAmmDlProcessSuccessfulReTx(gCb,rbCb, retx, datCfm); } else if((!nackSnInfo->isSegment) || (retx->soEnd <= nackSnInfo->soEnd)) { @@ -653,7 +571,7 @@ PRIVATE Void kwAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, nackSnInfo, retxNode, (*retxNode) = (*retxNode)->next; /* Mark the retx PDU we found for further retransmission */ - kwAmmDlMarkPduForReTx(gCb, rbCb, retx); + rlcAmmDlMarkPduForReTx(gCb, rbCb, retx); } else { @@ -661,7 +579,7 @@ PRIVATE Void kwAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, nackSnInfo, retxNode, break; } } /* end of retxNode while loop*/ - RETVOID; + return; } /** @@ -670,58 +588,45 @@ PRIVATE Void kwAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, nackSnInfo, retxNode, * @details * This function is used to get nack Sn information from nackRange index * -* @param[in]KwAmDl *amDl, -* @param[in]KwUdxStaPdu *StaPdu, -* @param[in]KwNackInfo *nackSnInfo, -* @param[in]KwRetx *retx; -* @param[in]KwSn sn, -* @param[in]U8 idx +* @param[in]RlcAmDl *amDl, +* @param[in]RlcUdxStaPdu *StaPdu, +* @param[in]RlcNackInfo *nackSnInfo, +* @param[in]RlcRetx *retx; +* @param[in]RlcSn sn, +* @param[in]uint8_t idx * * @return Void * */ -#ifdef ANSI -PRIVATE Void RlcDlAmmGetNackSnInfoFrmNackRangeIdx +static Void RlcDlAmmGetNackSnInfoFrmNackRangeIdx ( -KwAmDl *amDl, -KwNackInfo *nackInfo, +RlcAmDl *amDl, +RlcNackInfo *nackInfo, CmLList *retxNode, -KwNackInfo *nackSnInfo, -U8 idx -) -#else -PRIVATE Void RlcDlAmmGetNackSnInfoFrmNackRangeIdx(amDl, nackInfo, retxNode, nackSnInfo, idx) -( -KwAmDl *amDl; -KwNackInfo *nackInfo; -CmLList *retxNode; -KwNackInfo *nackSnInfo; -U8 idx; +RlcNackInfo *nackSnInfo, +uint8_t idx ) -#endif { - KwTx *txBuf; - KwRetx *retx; + RlcTx *txBuf; + RlcRetx *retx; CmLList *node; - TRC2(RlcDlAmmGetNackSnInfoFrmNackRangeIdx) - nackSnInfo->isSegment = FALSE; if((!nackInfo->isSegment) || (!idx && nackSnInfo->nackRange && (!nackInfo->soStart))) { nackSnInfo->soStart = 0; nackSnInfo->soEnd = 0; - RETVOID; + return; } - txBuf = kwUtlGetTxBuf(amDl->txBufLst, nackSnInfo->sn); + txBuf = rlcUtlGetTxBuf(amDl->txBufLst, nackSnInfo->sn); if(txBuf != NULLP) { node = txBuf->pduLst.first; while(node) { RlcDlPduInfo *pduInfo = (RlcDlPduInfo *)(node->node); - U16 pduSoEnd = pduInfo->amHdr.so + pduInfo->sduMap.sduSz - 1; + uint16_t pduSoEnd = pduInfo->amHdr.so + pduInfo->sduMap.sduSz - 1; if((!idx) && (pduInfo->amHdr.so == nackInfo->soStart)) { nackSnInfo->isSegment = TRUE; @@ -744,7 +649,7 @@ U8 idx; { while (retxNode) { - retx = (KwRetx *)(retxNode->node); + retx = (RlcRetx *)(retxNode->node); if(retx->amHdr.sn != nackSnInfo->sn) { break; @@ -793,93 +698,78 @@ U8 idx; * * @return Void */ -#ifdef ANSI -PUBLIC Void kwAmmDlHndlStatusPdu -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwUdxStaPdu *pStaPdu -) -#else -PUBLIC Void kwAmmDlHndlStatusPdu(gCb, rbCb, pStaPdu) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwUdxStaPdu *pStaPdu; -#endif +Void rlcAmmDlHndlStatusPdu(RlcCb *gCb,RlcDlRbCb *rbCb,RlcUdxStaPdu *pStaPdu) { - KwSn mAckSn; + RlcSn mAckSn; S32 oldRetxBo; CmLList *retxNode; KwuDatCfmInfo* datCfm; - KwKwuSapCb *kwuSap; - KwSn mTxNext; + RlcKwuSapCb *rlckwuSap; + RlcSn mTxNext; - TRC2(kwAmmDlHndlStatusPdu) - kwStatusPduCnt++; + rlcStatusPduCnt++; - kwuSap = gCb->u.dlCb->kwuDlSap + KW_UI_PDCP; + rlckwuSap = gCb->u.dlCb->rlcKwuDlSap + RLC_UI_PDCP; /* store the re-transmission bo, to check if it changes due to the processing of the status pdu */ - oldRetxBo = AMDL.retxBo; + oldRetxBo = RLC_AMDL.retxBo; /* Allocate memory for datCfm Info */ - RLC_SHRABL_STATIC_BUF_ALLOC(kwuSap->pst.region, kwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); + RLC_SHRABL_STATIC_BUF_ALLOC(rlckwuSap->pst.region, rlckwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); #if (ERRCLASS & ERRCLS_ADD_RES) if (datCfm == NULLP) { - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RLC_SHRABL_STATIC_BUF_FREE(kwuSap->pst.region, kwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); - RETVOID; + RLC_SHRABL_STATIC_BUF_FREE(rlckwuSap->pst.region, rlckwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); + return; } #endif /* ERRCLASS & ERRCLS_RES */ datCfm->numSduIds = 0; datCfm->rlcId = rbCb->rlcId; - MODAMT(pStaPdu->ackSn, mAckSn, AMDL.txNextAck,AMDL.snModMask); - MODAMT(AMDL.txNext,mTxNext, AMDL.txNextAck,AMDL.snModMask); + MODAMT(pStaPdu->ackSn, mAckSn, RLC_AMDL.txNextAck,RLC_AMDL.snModMask); + MODAMT(RLC_AMDL.txNext,mTxNext, RLC_AMDL.txNextAck,RLC_AMDL.snModMask); if(mAckSn > mTxNext) { - RLOG_ARG4(L_WARNING,DBG_RBID, rbCb->rlcId.rbId, - "Invalid ACK SN = %d received. Current Vta =%d" + DU_LOG("\nERROR --> RLC_DL : Invalid ACK SN = %d received. Current Vta =%d" "UEID:%d CELLID:%d", pStaPdu->ackSn, - AMDL.txNextAck, + RLC_AMDL.txNextAck, rbCb->rlcId.ueId, rbCb->rlcId.cellId); -/* RLC_SHRABL_STATIC_BUF_ALLOC(kwuSap->pst.region, kwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); */ - RLC_SHRABL_STATIC_BUF_FREE(kwuSap->pst.region, kwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); - RETVOID; +/* RLC_SHRABL_STATIC_BUF_ALLOC(rlckwuSap->pst.region, rlckwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); */ + RLC_SHRABL_STATIC_BUF_FREE(rlckwuSap->pst.region, rlckwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); + return; } /* Venki - stopping the poll retx timer */ /*Stop PollRetx Tmr */ - kwAmmDlCheckAndStopPollTmr(gCb, rbCb, mAckSn); + rlcAmmDlCheckAndStopPollTmr(gCb, rbCb, mAckSn); /* Set the first node in retx list to retxNode */ - retxNode = AMDL.retxLst.first; + retxNode = RLC_AMDL.retxLst.first; /* If NACK exists in control PDU */ if (pStaPdu->nackCnt) { - KwSn sn; - KwNackInfo nackSnInfo; - KwSn mNackSn; - KwSn txNextAck; - KwSn transWinStartSn = AMDL.txNextAck; /*used to track the SN from which + RlcSn sn; + RlcNackInfo nackSnInfo; + RlcSn mNackSn; + RlcSn txNextAck; + RlcSn transWinStartSn = RLC_AMDL.txNextAck; /*used to track the SN from which to start processing the transmission buffer */ - U32 idx = 0; + uint32_t idx = 0; /* if any NACKs then txNextAck should be equal to the first NACK_SN*/ txNextAck = pStaPdu->nackInfo[0].sn; - kwStatusNcnt += pStaPdu->nackCnt; + rlcStatusNcnt += pStaPdu->nackCnt; /* For NACKs */ while (idx < pStaPdu->nackCnt) @@ -888,8 +778,7 @@ KwUdxStaPdu *pStaPdu; nackSnInfo.nackRange = pStaPdu->nackInfo[idx].nackRange; nackSnInfo.sn = pStaPdu->nackInfo[idx].sn; - RLOG_ARG3(L_DEBUG,DBG_RBID, rbCb->rlcId.rbId, - "kwHndlStaRsp: NACK SN = %d UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_DL : rlcHndlStaRsp: NACK SN = %d UEID:%d CELLID:%d", nackSnInfo.sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); @@ -904,44 +793,43 @@ KwUdxStaPdu *pStaPdu; /* move transWinStartSn to nackSnInfo.sn + 1, as the pdu's before that will be removed from the buffer */ transWinStartSn = (nackSnInfo.sn + (nackSnInfo.nackRange ?\ - (nackSnInfo.nackRange - 1) : 0) + 1) & AMDL.snModMask; + (nackSnInfo.nackRange - 1) : 0) + 1) & RLC_AMDL.snModMask; /* Clear the acked SNs from the retx list */ - MODAMT(nackSnInfo.sn, mNackSn, AMDL.txNextAck,AMDL.snModMask); + MODAMT(nackSnInfo.sn, mNackSn, RLC_AMDL.txNextAck,RLC_AMDL.snModMask); if ((mNackSn > mAckSn) || (mNackSn >= mTxNext)) { /* Erroneous NACK_SN, we should raise an error towards L3 */ - RLOG_ARG2(L_ERROR,DBG_RBID, rbCb->rlcId.rbId, - "Status Pdu is not correct UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : Status Pdu is not correct UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RLC_SHRABL_STATIC_BUF_FREE(kwuSap->pst.region, kwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); - RETVOID; + RLC_SHRABL_STATIC_BUF_FREE(rlckwuSap->pst.region, rlckwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); + return; } /* clear all the SNs < NACK_SN from re-transmission list */ - kwAmmDlUpdTxAndReTxBufForLessThanNackSn(gCb, rbCb, sn, mNackSn, + rlcAmmDlUpdTxAndReTxBufForLessThanNackSn(gCb, rbCb, sn, mNackSn, &retxNode, &datCfm); if(!nackSnInfo.nackRange) { - kwAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, &nackSnInfo, &retxNode, &datCfm); + rlcAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, &nackSnInfo, &retxNode, &datCfm); gRlcStats.amRlcStats.numRlcAmCellNackRx++; } else { - U8 idx1 = 0; + uint8_t idx1 = 0; /* Update issegment, soStart, soEnd ,sn in nackSnInfo and handle * nack sn*/ do { - RlcDlAmmGetNackSnInfoFrmNackRangeIdx(&AMDL, &pStaPdu->nackInfo[idx], + RlcDlAmmGetNackSnInfoFrmNackRangeIdx(&RLC_AMDL, &pStaPdu->nackInfo[idx], retxNode, &nackSnInfo, idx1); - kwAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, &nackSnInfo, + rlcAmmDlUpdateTxAndReTxBufForNackSn(gCb, rbCb, &nackSnInfo, &retxNode, &datCfm); - nackSnInfo.sn = ((nackSnInfo.sn + 1) & (AMDL.snModMask)); + nackSnInfo.sn = ((nackSnInfo.sn + 1) & (RLC_AMDL.snModMask)); gRlcStats.amRlcStats.numRlcAmCellNackRx++; }while((++idx1) < (nackSnInfo.nackRange)); @@ -952,33 +840,31 @@ KwUdxStaPdu *pStaPdu; /* Remove the PDUs with are further acked by the ACK_SN after taking care of all the NACK_SN related acknowledgments*/ - kwAmmDlUpdateTxAndReTxBufForAckSn(gCb,rbCb, mAckSn, retxNode, &datCfm); + rlcAmmDlUpdateTxAndReTxBufForAckSn(gCb,rbCb, mAckSn, retxNode, &datCfm); /* Update txNextAck */ - kwAmmDlSetTxNextAck(&AMDL,txNextAck); + rlcAmmDlSetTxNextAck(&RLC_AMDL,txNextAck); } else { - kwStatusAckCnt++; + rlcStatusAckCnt++; /* For All ACKs */ - RLOG_ARG2(L_UNUSED,DBG_RBID, rbCb->rlcId.rbId, - "kwHndlStaRsp: Received All ACKS UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_DL : rlcHndlStaRsp: Received All ACKS UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); /* For the remaining ACKs after last nackSn */ - kwAmmDlUpdateTxAndReTxBufForAckSn(gCb,rbCb, mAckSn, retxNode, &datCfm); + rlcAmmDlUpdateTxAndReTxBufForAckSn(gCb,rbCb, mAckSn, retxNode, &datCfm); /* update txNextAck */ - kwAmmDlSetTxNextAck(&AMDL, pStaPdu->ackSn); + rlcAmmDlSetTxNextAck(&RLC_AMDL, pStaPdu->ackSn); } if(datCfm->numSduIds != 0) { if(datCfm->numSduIds > 1024) { - RLOG_ARG4(L_DEBUG,DBG_RBID,datCfm->rlcId.rbId, - "Sending [%lu] SDU Cfms to PDCP & [%lu] lost for" + DU_LOG("\nDEBUG --> RLC_DL : Sending [%u] SDU Cfms to PDCP & [%u] lost for" "UEID:%d CELLID:%d", datCfm->numSduIds, datCfm->numSduIds-1024, @@ -986,25 +872,25 @@ KwUdxStaPdu *pStaPdu; rbCb->rlcId.cellId); datCfm->numSduIds = 1024; } - kwSduSndCnt += datCfm->numSduIds; + rlcSduSndCnt += datCfm->numSduIds; /* Sap control block */ - KwUiKwuDatCfm(&kwuSap->pst, kwuSap->suId, datCfm); + RlcUiKwuDatCfm(&rlckwuSap->pst, rlckwuSap->suId, datCfm); } else { - RLC_SHRABL_STATIC_BUF_FREE(kwuSap->pst.region, kwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); + RLC_SHRABL_STATIC_BUF_FREE(rlckwuSap->pst.region, rlckwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); } /* Fix for memory corruption */ - KW_LLIST_FIRST_RETX(AMDL.retxLst, AMDL.nxtRetx); - /* BO update, if retransmission BO has changed. AMDL.retxBo would have + RLC_LLIST_FIRST_RETX(RLC_AMDL.retxLst, RLC_AMDL.nxtRetx); + /* BO update, if retransmission BO has changed. RLC_AMDL.retxBo would have canged inside the above called functions */ - if (oldRetxBo != AMDL.retxBo) + if (oldRetxBo != RLC_AMDL.retxBo) { - kwAmmSendDStaRsp(gCb, rbCb, &AMDL); + rlcAmmSendDedLcBoStatus(gCb, rbCb, &RLC_AMDL); } - RETVOID; + return; } /** @@ -1021,15 +907,7 @@ KwUdxStaPdu *pStaPdu; * @return S16 * Calculated bo */ -#ifdef ANSI -PUBLIC S32 kwAmmCalculateBo -( -KwAmDl *amDl -) -#else -PUBLIC S32 kwAmmCalculateBo(amDl) -KwAmDl *amDl; -#endif +S32 rlcAmmCalculateBo(RlcAmDl *amDl) { S32 bo; @@ -1052,14 +930,14 @@ KwAmDl *amDl; bo = amDl->cntrlBo + amDl->retxBo; /* if window is not stalled then add the transmit bo also */ - if (! KW_AM_IS_TRANS_WIN_STALLED(amDl)) + if (! RLC_AM_IS_TRANS_WIN_STALLED(amDl)) { bo += amDl->bo; } return bo; } -U32 kwRxSdu; +uint32_t kwRxSdu; /** * @brief Handler to queue the SDUs received from PDCP @@ -1069,7 +947,7 @@ U32 kwRxSdu; * SDU queue of the corresponding RbCb. It also updates the BO and report the * same to MAC. * - Allocate memory for and assign received buffer to the SDU - * - Add SDU in the sduQ of KwAmDl + * - Add SDU in the sduQ of RlcAmDl * - Calculate bo with the buffer received * - Accumulate bo with retransmission bo and control pdu's bo if available * - Estimate the header size for the bo; Fill in StaRspInfo and send it @@ -1081,54 +959,37 @@ U32 kwRxSdu; * @param[in] datReq Ptr to the datReq sent from PDCP * * @return Void - * -# RETVOID + * -# void */ -#ifdef ANSI -PUBLIC Void kwAmmQSdu -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -Buffer *mBuf, -KwuDatReqInfo *datReq -) -#else -PUBLIC Void kwAmmQSdu(gCb, rbCb, mBuf, datReq) -RlcCb *gCb; -RlcDlRbCb *rbCb; -Buffer *mBuf; -KwuDatReqInfo *datReq; -#endif +void rlcAmmQSdu(RlcCb *gCb, RlcDlRbCb *rbCb, Buffer *mBuf, RlcDatReqInfo *datReq) { - KwSdu *sdu; + RlcSdu *sdu; #ifdef LTE_L2_MEAS #ifndef L2_L3_SPLIT #ifdef TENB_STATS - U32 kwWinSz; + uint32_t rlcWinSz; #endif #endif #endif - TRC2(kwAmmQSdu) /* Allocate sdu */ - RLC_ALLOC_WC(gCb,sdu, sizeof(KwSdu)); + RLC_ALLOC_WC(gCb,sdu, sizeof(RlcSdu)); #if (ERRCLASS & ERRCLS_ADD_RES) if (sdu == NULLP) { - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); - RETVOID; + DU_LOG("\nERROR --> RLC_DL : rlcAmmQSdu : Memory allocation failed UEID:%d CELLID:%d",\ + rbCb->rlcId.ueId, rbCb->rlcId.cellId); + return; } #endif /* ERRCLASS & ERRCLS_RES */ - KW_UPD_L2_DL_TOT_SDU_STS(gCb,rbCb); + RLC_UPD_L2_DL_TOT_SDU_STS(gCb,rbCb); /* Discard new changes starts */ - kwUtlGetCurrTime(&sdu->arrTime); + rlcUtlGetCurrTime(&sdu->arrTime); /* Discard new changes ends */ /* Assign values to sdu */ - SFndLenMsg(mBuf, &sdu->sduSz); + ODU_GET_MSG_LEN(mBuf, &sdu->sduSz); sdu->mBuf = mBuf; sdu->actSz = sdu->sduSz; @@ -1139,53 +1000,50 @@ KwuDatReqInfo *datReq; #ifndef RGL_SPECIFIC_CHANGES #ifdef MSPD { -extern U32 dlrate_kwu; +uint32_t dlrate_kwu; dlrate_kwu += sdu->sduSz; } #endif #endif /* Update nxtTx to point to the added sdu if this is the first SDU in the * queue */ - if (AMDL.nxtTx == NULLP) + if (RLC_AMDL.nxtTx == NULLP) { - RLOG_ARG2(L_UNUSED,DBG_RBID, rbCb->rlcId.rbId, - "kwAmmQSdu: Received SDU will be transmitted next" - "UEID:%d CELLID:%d", - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); - AMDL.nxtTx = sdu; + DU_LOG("\nDEBUG --> RLC_DL : rlcAmmQSdu: Received SDU will be transmitted next \ + UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); + RLC_AMDL.nxtTx = sdu; } /* Add sdu to the sdu list */ - cmLListAdd2Tail(&AMDL.sduQ, &sdu->lstEnt); + cmLListAdd2Tail(&RLC_AMDL.sduQ, &sdu->lstEnt); sdu->lstEnt.node = (PTR)sdu; #ifdef LTE_L2_MEAS #ifndef L2_L3_SPLIT #ifdef TENB_STATS if (rbCb->ueCb->tenbStats) { - if (AMDL.sduQ.count > rbCb->ueCb->tenbStats->stats.nonPersistent.rlc.dlMaxPktsInSduQ) + if (RLC_AMDL.sduQ.count > rbCb->ueCb->tenbStats->stats.nonPersistent.rlc.dlMaxPktsInSduQ) { - rbCb->ueCb->tenbStats->stats.nonPersistent.rlc.dlMaxPktsInSduQ = AMDL.sduQ.count; + rbCb->ueCb->tenbStats->stats.nonPersistent.rlc.dlMaxPktsInSduQ = RLC_AMDL.sduQ.count; } - kwWinSz = KW_AM_TRANS_WIN_SIZE(&AMDL); - if (kwWinSz > rbCb->ueCb->tenbStats->stats.nonPersistent.rlc.dlMaxWindowSz) + rlcWinSz = RLC_AM_TRANS_WIN_SIZE(&RLC_AMDL); + if (rlcWinSz > rbCb->ueCb->tenbStats->stats.nonPersistent.rlc.dlMaxWindowSz) { - rbCb->ueCb->tenbStats->stats.nonPersistent.rlc.dlMaxWindowSz = kwWinSz; + rbCb->ueCb->tenbStats->stats.nonPersistent.rlc.dlMaxWindowSz = rlcWinSz; } } #endif #endif #endif /* Update BO and estimate header size for the current BO */ - AMDL.bo = AMDL.bo + sdu->sduSz; - if(AMDL.snLen == KW_AM_CFG_12BIT_SN_LEN) + RLC_AMDL.bo = RLC_AMDL.bo + sdu->sduSz; + if(RLC_AMDL.snLen == RLC_AM_CFG_12BIT_SN_LEN) { - AMDL.estHdrSz += 2; + RLC_AMDL.estHdrSz += 2; } else { - AMDL.estHdrSz += 3; + RLC_AMDL.estHdrSz += 3; } #ifdef LTE_L2_MEAS_RLC /* Update numActUe if it is not active */ @@ -1193,16 +1051,16 @@ dlrate_kwu += sdu->sduSz; (rbCb->ueCb->numActRb[rbCb->qci] == 0)) { rbCb->ueCb->numActRb[rbCb->qci]++; - gCb.kwL2Cb.numActUe[rbCb->qci]++; + gCb.rlcL2Cb.numActUe[rbCb->qci]++; } #endif if(!rlcDlUtlIsReestInProgress(rbCb)) { - kwAmmSendDStaRsp(gCb, rbCb, &AMDL); + rlcAmmSendDedLcBoStatus(gCb, rbCb, &RLC_AMDL); } - RETVOID; + return; } /** @@ -1221,59 +1079,45 @@ dlrate_kwu += sdu->sduSz; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAmmDlAssembleCntrlInfo -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwDatReq *kwDatReq -) -#else -PRIVATE Void kwAmmDlAssembleCntrlInfo(gCb, rbCb, kwDatReq) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwDatReq *kwDatReq; -#endif +static void rlcAmmDlAssembleCntrlInfo(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) { - KwUdxDlSapCb *sapCb; + RlcUdxDlSapCb *sapCb; MsgLen macHdrEstmt; - TRC2(kwAmmDlAssembleCntrlInfo) - macHdrEstmt = (rbCb->m.amDl.cntrlBo < 256) ? - KW_MAC_HDR_SZ2 : KW_MAC_HDR_SZ3; + RLC_MAC_HDR_SZ2 : RLC_MAC_HDR_SZ3; /* Eliminate fixed hdr size (14bits including ACK_SN) */ - if (kwDatReq->pduSz >= (KW_CNTRL_PDU_FIXED_HDRSZ + macHdrEstmt)) + if (rlcDatReq->pduSz >= (RLC_CNTRL_PDU_FIXED_HDRSZ + macHdrEstmt)) { /* Check the TB size whether it is sufficcient enough to fit the status Pdu into it otherwise make arrangement such that it can fit into in a way of possible NACks*/ /* ccpu00135743 : fix for MAC Hdr size calc */ - kwDatReq->pduSz -= macHdrEstmt; + rlcDatReq->pduSz -= macHdrEstmt; /* Create the status Pdu with the required NACKs */ - kwAmmCreateStatusPdu(gCb,rbCb,kwDatReq); + rlcAmmCreateStatusPdu(gCb,rbCb,rlcDatReq); - sapCb = KW_GET_DL_SAPCB(gCb, rbCb); - rlcDlUdxStaProhTmrStart(&(gCb->u.dlCb->udxDlSap->pst), + sapCb = RLC_GET_DL_SAPCB(gCb, rbCb); + rlcDlUdxStaProhTmrStart(&(gCb->u.dlCb->udxDlSap->pst), sapCb->suId, &(rbCb->rlcId)); /* Update number of pdus in pduInfo */ - kwDatReq->pduInfo.mBuf[kwDatReq->pduInfo.numPdu] = AMDL.mBuf; - kwDatReq->pduInfo.numPdu++; + rlcDatReq->pduInfo.mBuf[rlcDatReq->pduInfo.numPdu] = RLC_AMDL.mBuf; + rlcDatReq->pduInfo.numPdu++; gRlcStats.amRlcStats.numDLStaPduSent++; RLC_FREE_SHRABL_BUF(gCb->u.dlCb->udxDlSap->pst.region, gCb->u.dlCb->udxDlSap->pst.pool, - AMDL.pStaPdu, - sizeof(KwUdxDlStaPdu)); + RLC_AMDL.pStaPdu, + sizeof(RlcUdxDlStaPdu)); - AMDL.pStaPdu = NULLP; - AMDL.mBuf = NULLP; + RLC_AMDL.pStaPdu = NULLP; + RLC_AMDL.mBuf = NULLP; gRlcStats.amRlcStats.numDLStaPduSent++; } - RETVOID; + return; } /** @@ -1286,12 +1130,12 @@ KwDatReq *kwDatReq; * set for the data PDU and returns PDU(s) and updated BO with * estimated header size to be sent to MAC. * - * - Check if the control BO is available and call kwAssembleCntrlInfo + * - Check if the control BO is available and call rlcAssembleCntrlInfo * to assemble control Information * - Check if the pdu size is available to form PDUs from retransmission - * buffer and call kwResegRetxPdus + * buffer and call rlcResegRetxPdus * - Check if the pdu size is available and assemble SDUs from sduQ - * if exist, using kwAssembleSdus + * if exist, using rlcAssembleSdus * - PDU Info and bo are filled in and then sent to MAC from the * utility function * @@ -1303,85 +1147,66 @@ KwDatReq *kwDatReq; * @return Void * */ -#ifdef ANSI -PUBLIC Void kwAmmProcessSdus -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwDatReq *kwDatReq, -Bool fillCtrlPdu -) -#else -PUBLIC Void kwAmmProcessSdus(gCb, rbCb, kwDatReq,fillCtrlPdu) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwDatReq *kwDatReq; -Bool fillCtrlPdu; -#endif +void rlcAmmProcessSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq, bool fillCtrlPdu) { - TRC2(kwAmmProcessSdus) - - /* Assemble control information. fillCtrlPdu parameter check is added for CA * It is used to force cntrl Pdu scheduling on PCell. for Non CA case this * flag will always be TRUE. In CA case, for PCELL it is TRUE and for SCEll * it is FALSE */ - if ((AMDL.cntrlBo != 0) + if ((RLC_AMDL.cntrlBo != 0) #ifdef LTE_ADV && (fillCtrlPdu) #endif ) { - kwDatReq->boRep.staPduPrsnt = TRUE; - kwDatReq->boRep.staPduBo = AMDL.cntrlBo; + rlcDatReq->boRep.staPduPrsnt = TRUE; + rlcDatReq->boRep.staPduBo = RLC_AMDL.cntrlBo; - if (AMDL.pStaPdu != NULLP) + if (RLC_AMDL.pStaPdu != NULLP) { - kwAmmDlAssembleCntrlInfo (gCb, rbCb, kwDatReq); + rlcAmmDlAssembleCntrlInfo (gCb, rbCb, rlcDatReq); } else { - RLOG_ARG2(L_ERROR, DBG_RBID, rbCb->rlcId.rbId, - "Miscomputation of control Bo. UEID:%d CELLID:%d", - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); + DU_LOG("\nERROR --> RLC_DL : rlcAmmProcessSdus: Miscomputation of control Bo. \ + UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); } - AMDL.cntrlBo = 0; + RLC_AMDL.cntrlBo = 0; } /* Retransmit PDUs /portions of PDUs available in retxLst */ - if ((kwDatReq->pduSz > 0) && (AMDL.nxtRetx != NULLP)) + if ((rlcDatReq->pduSz > 0) && (RLC_AMDL.nxtRetx != NULLP)) { - kwResegRetxPdus (gCb,rbCb, kwDatReq); + rlcResegRetxPdus (gCb,rbCb, rlcDatReq); } /* Assemble SDUs to form new PDUs */ - if ((kwDatReq->pduSz > 0) && (AMDL.nxtTx != 0)) + if ((rlcDatReq->pduSz > 0) && (RLC_AMDL.nxtTx != 0)) { - kwAssembleSdus(gCb,rbCb, kwDatReq); + rlcAssembleSdus(gCb,rbCb, rlcDatReq); } - if (AMDL.nxtRetx != NULLP) + if (RLC_AMDL.nxtRetx != NULLP) { - kwDatReq->boRep.oldestSduArrTime = AMDL.nxtRetx->sduMap.sdu->arrTime; + rlcDatReq->boRep.oldestSduArrTime = RLC_AMDL.nxtRetx->sduMap.sdu->arrTime; } - else if (AMDL.nxtTx != NULLP) + else if (RLC_AMDL.nxtTx != NULLP) { - kwDatReq->boRep.oldestSduArrTime = AMDL.nxtTx->arrTime; + rlcDatReq->boRep.oldestSduArrTime = RLC_AMDL.nxtTx->arrTime; } /* Accumulate bo */ - kwDatReq->boRep.bo = kwAmmCalculateBo(&AMDL); - kwDatReq->boRep.staPduBo = AMDL.cntrlBo; + rlcDatReq->boRep.bo = rlcAmmCalculateBo(&RLC_AMDL); + rlcDatReq->boRep.staPduBo = RLC_AMDL.cntrlBo; /* Hdr estimation is moved to kwAmmCreatePDu */ - kwDatReq->boRep.estHdrSz = AMDL.estHdrSz; + rlcDatReq->boRep.estHdrSz = RLC_AMDL.estHdrSz; - if(kwDatReq->pduSz > 0) + if(rlcDatReq->pduSz > 0) { - gRlcStats.amRlcStats.numDLBytesUnused += kwDatReq->pduSz; + gRlcStats.amRlcStats.numDLBytesUnused += rlcDatReq->pduSz; } - RETVOID; + return; } /** @@ -1402,35 +1227,18 @@ Bool fillCtrlPdu; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwSplitPdu -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwRetx *crnt, -KwRetx *next, -U16 size -) -#else -PRIVATE Void kwSplitPdu(gCb, rbCb, crnt, next, size) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwRetx *crnt; -KwRetx *next; -U16 size; -#endif +static void rlcSplitPdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcRetx *crnt, RlcRetx *next, uint16_t size) { - U8 si; - KwAmDl *amDl = &AMDL; + uint8_t si; + RlcAmDl *amDl = &RLC_AMDL; - TRC2(kwSplitPdu) /* Set the SN for the new segment */ next->amHdr.sn = crnt->amHdr.sn; /* Set the protocol specific fields appropriately */ si = crnt->amHdr.si; - crnt->amHdr.si = si | KW_SI_FIRST_SEG; - next->amHdr.si = si | KW_SI_LAST_SEG; + crnt->amHdr.si = si | RLC_SI_FIRST_SEG; + next->amHdr.si = si | RLC_SI_LAST_SEG; crnt->amHdr.p = 0; @@ -1459,44 +1267,44 @@ U16 size; next->sduMap.sduSz = next->segSz; /* Segment the payload into two parts based on the size passed */ - SSegMsg(crnt->seg, size, &next->seg); + ODU_SEGMENT_MSG(crnt->seg, size, &next->seg); next->retxCnt = crnt->retxCnt; next->yetToConst = TRUE; next->pendingReTrans = crnt->pendingReTrans; /* Compute the header size and update the BO appropriately */ - if(amDl->snLen == KW_AM_CFG_12BIT_SN_LEN) + if(amDl->snLen == RLC_AM_CFG_12BIT_SN_LEN) { - next->hdrSz = KW_AM_SEG_12BIT_SN_WITH_SO_HDRSZ; - if(crnt->amHdr.si == KW_SI_FIRST_SEG) + next->hdrSz = RLC_AM_SEG_12BIT_SN_WITH_SO_HDRSZ; + if(crnt->amHdr.si == RLC_SI_FIRST_SEG) { - crnt->hdrSz = KW_AM_SEG_12BIT_SN_WITHOUT_SO_HDRSZ; + crnt->hdrSz = RLC_AM_SEG_12BIT_SN_WITHOUT_SO_HDRSZ; } else { - crnt->hdrSz = KW_AM_SEG_12BIT_SN_WITH_SO_HDRSZ; + crnt->hdrSz = RLC_AM_SEG_12BIT_SN_WITH_SO_HDRSZ; } } else { - next->hdrSz = KW_AM_SEG_18BIT_SN_WITH_SO_HDRSZ; - if(crnt->amHdr.si == KW_SI_FIRST_SEG) + next->hdrSz = RLC_AM_SEG_18BIT_SN_WITH_SO_HDRSZ; + if(crnt->amHdr.si == RLC_SI_FIRST_SEG) { - crnt->hdrSz = KW_AM_SEG_18BIT_SN_WITHOUT_SO_HDRSZ; + crnt->hdrSz = RLC_AM_SEG_18BIT_SN_WITHOUT_SO_HDRSZ; } else { - crnt->hdrSz = KW_AM_SEG_18BIT_SN_WITH_SO_HDRSZ; + crnt->hdrSz = RLC_AM_SEG_18BIT_SN_WITH_SO_HDRSZ; } } /* Add the next to the retx list */ - AMDL.retxLst.crnt = &crnt->lstEnt; - CM_LLIST_INS_AFT_CRNT(AMDL.retxLst, next); - AMDL.nxtRetx = next; + RLC_AMDL.retxLst.crnt = &crnt->lstEnt; + CM_LLIST_INS_AFT_CRNT(RLC_AMDL.retxLst, next); + RLC_AMDL.nxtRetx = next; amDl->estHdrSz += next->hdrSz; - RETVOID; + return; } /** @@ -1511,7 +1319,7 @@ U16 size; * - While pdusize is available and retxBuf has data (pdu or portion * of pdu) to be sent, form the pdu as it is if it matches with the * pdusize else segment the PDUs/portion of PDUs - * - Call kwAmmDlCheckAndSetPoll function to check and set the poll bit as + * - Call rlcAmmDlCheckAndSetPoll function to check and set the poll bit as * required * - Concatenate data and header info and fill pduInfo * - Update retxCnt and send indication to PDCP if it reaches maxRetx @@ -1524,112 +1332,94 @@ U16 size; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwResegRetxPdus -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwDatReq *kwDatReq -) -#else -PRIVATE Void kwResegRetxPdus(gCb, rbCb, kwDatReq) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwDatReq *kwDatReq; -#endif +static void rlcResegRetxPdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) { - KwAmDl *amDl; - KwRetx *retx; - U8 hdr[KW_MAX_HDRSZ]; - U16 idx; + RlcAmDl *amDl; + RlcRetx *retx; + uint8_t hdr[RLC_MAX_HDRSZ]; + uint16_t idx; Buffer *pdu; MsgLen pduSz; #ifdef LTE_L2_MEAS - U16 sduIdx; - KwL2MeasTb *l2MeasTb; - KwlchInfo *lchInfo; - U8 numSdus; + uint16_ sduIdx; + RlcL2MeasTb *l2MeasTb; + RlclchInfo *lchInfo; + uint8_t numSdus; #endif - TRC2(kwResegRetxPdus) - - - amDl = &AMDL; + amDl = &RLC_AMDL; #ifdef LTE_L2_MEAS /* TODO : This shoould be taken care in new Trasmissions */ /* This lchInfo should be retrieved there */ - l2MeasTb = kwUtlGetCurMeasTb(gCb, rbCb); + l2MeasTb = rlcUtlGetCurMeasTb(gCb, rbCb); if (l2MeasTb == NULLP) { - RETVOID; + return; } /* TODO : This lcid needs to be searched in case of normal Tx */ /* In retx here, its fine as this will be higher priority */ lchInfo = &l2MeasTb->lchInfo[l2MeasTb->numLchInfo]; - if (l2MeasTb->numLchInfo >= KW_MAX_ACTV_DRB) + if (l2MeasTb->numLchInfo >= RLC_MAX_ACTV_DRB) { - RETVOID; + return; } l2MeasTb->numLchInfo++; lchInfo->lcId = rbCb->lch.lChId; lchInfo->numSdus = 0; #endif - while ((kwDatReq->pduSz > 0) && (amDl->nxtRetx != NULLP)&& - (kwDatReq->pduInfo.numPdu < KW_MAX_PDU)) + while ((rlcDatReq->pduSz > 0) && (amDl->nxtRetx != NULLP)&& + (rlcDatReq->pduInfo.numPdu < RLC_MAX_PDU)) { - U16 tmpSz; + uint16_t tmpSz; retx = amDl->nxtRetx; /* kw003.201 : Add header size to seg size to determine if the */ /* the segment can be completed within the allocation */ /* kw003.201 - Eliminate MAC Header Size based on bites needed */ - tmpSz = KW_MIN((retx->segSz + retx->hdrSz), kwDatReq->pduSz); + tmpSz = RLC_MIN((retx->segSz + retx->hdrSz), rlcDatReq->pduSz); pduSz = (retx->segSz + retx->hdrSz); - /* 5GNR_RLC: length field in 5GNR MAC Hdr is 8/16 btis*/ - kwDatReq->pduSz -= (tmpSz < 255) ? KW_MAC_HDR_SZ2 : KW_MAC_HDR_SZ3; + /* 5GNR_RLC_DL : length field in 5GNR MAC Hdr is 8/16 btis*/ + rlcDatReq->pduSz -= (tmpSz < 255) ? RLC_MAC_HDR_SZ2 : RLC_MAC_HDR_SZ3; /* kw003.201 - We should have at least one more than basic header */ - if (kwDatReq->pduSz <= retx->hdrSz) + if (rlcDatReq->pduSz <= retx->hdrSz) { - RETVOID; + return; } - kwGetNxtRetx(gCb, &(amDl->nxtRetx)); + rlcGetNxtRetx(gCb, &(amDl->nxtRetx)); /* Send retx buf without segmentation */ - if (kwDatReq->pduSz >= pduSz) + if (rlcDatReq->pduSz >= pduSz) { - U8 pollBit; + uint8_t pollBit; - RLOG_ARG2(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, - "kwResegRetxPdus: Send retx buf without segmentation " - "UEID:%d CELLID:%d", - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); + DU_LOG("\nINFO --> RLC_DL : rlcResegRetxPdus: Send retx buf without segmentation " + "UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); if (retx->yetToConst) { /* Construct hdr with the available hdr values */ - kwConstructAmHdr(&retx->amHdr, hdr, amDl->snLen, &idx); + rlcConstructAmHdr(&retx->amHdr, hdr, amDl->snLen, &idx); /* Add header to the pdu/segment */ - SAddPreMsgMultInOrder(hdr, idx + 1, retx->seg); + ODU_ADD_PRE_MSG_MULT_IN_ORDER(hdr, idx + 1, retx->seg); retx->yetToConst = FALSE; } /* kw003.201 - Check if poll bit needs to be set. Retx size does */ /* not affect the poll bit so it is being passed as zero */ - pollBit = kwAmmDlCheckAndSetPoll(gCb,rbCb, FALSE, 0); - KW_UPD_POLL_BIT(gCb, retx, pollBit); + pollBit = rlcAmmDlCheckAndSetPoll(gCb,rbCb, FALSE, 0); + RLC_UPD_POLL_BIT(gCb, retx, pollBit); - kwDatReq->pduSz -= pduSz; - AMDL.estHdrSz -= retx->hdrSz; + rlcDatReq->pduSz -= pduSz; + RLC_AMDL.estHdrSz -= retx->hdrSz; #ifdef LTE_L2_MEAS if (rbCb->rlcId.rbType == CM_LTE_DRB) { numSdus = 0; for (sduIdx = lchInfo->numSdus ; - ((numSdus < retx->numSdu) && (sduIdx < KW_L2MEAS_SDUIDX)) ; + ((numSdus < retx->numSdu) && (sduIdx < RLC_L2MEAS_SDUIDX)) ; sduIdx++, numSdus++) { lchInfo->sduInfo[sduIdx].arvlTime = retx->sduMap[numSdus].sdu->arrTime; @@ -1641,54 +1431,50 @@ KwDatReq *kwDatReq; } else { - KwRetx *tNode; + RlcRetx *tNode; /* Segment this pdu / portion of pdu. Insert this segment into */ /* retxLst and update offset */ - RLOG_ARG2(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, - "kwResegRetxPdus: Segment retx buf UEID:%d CELLID:%d", - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); + DU_LOG("\nINFO --> RLC_DL : rlcResegRetxPdus: Segment retx buf UEID:%d CELLID:%d", + rbCb->rlcId.ueId, rbCb->rlcId.cellId); /* Eliminate fixed header size if the pdu is segmented for the */ /* first time */ - if(amDl->snLen == KW_AM_CFG_12BIT_SN_LEN) + if(amDl->snLen == RLC_AM_CFG_12BIT_SN_LEN) { - if(retx->amHdr.si < KW_SI_LAST_SEG) + if(retx->amHdr.si < RLC_SI_LAST_SEG) { - kwDatReq->pduSz -= KW_AM_SEG_12BIT_SN_WITHOUT_SO_HDRSZ; + rlcDatReq->pduSz -= RLC_AM_SEG_12BIT_SN_WITHOUT_SO_HDRSZ; } else { - kwDatReq->pduSz -= KW_AM_SEG_12BIT_SN_WITH_SO_HDRSZ; + rlcDatReq->pduSz -= RLC_AM_SEG_12BIT_SN_WITH_SO_HDRSZ; } } else { - if(retx->amHdr.si < KW_SI_LAST_SEG) + if(retx->amHdr.si < RLC_SI_LAST_SEG) { - kwDatReq->pduSz -= KW_AM_SEG_18BIT_SN_WITHOUT_SO_HDRSZ; + rlcDatReq->pduSz -= RLC_AM_SEG_18BIT_SN_WITHOUT_SO_HDRSZ; } else { - kwDatReq->pduSz -= KW_AM_SEG_18BIT_SN_WITH_SO_HDRSZ; + rlcDatReq->pduSz -= RLC_AM_SEG_18BIT_SN_WITH_SO_HDRSZ; } } - if (kwDatReq->pduSz <= 0) + if (rlcDatReq->pduSz <= 0) { - RETVOID; + return; } /* Allocate memory for tracking a new segment */ - RLC_ALLOC_WC(gCb,tNode, sizeof(KwRetx)); + RLC_ALLOC_WC(gCb,tNode, sizeof(RlcRetx)); #if (ERRCLASS & ERRCLS_ADD_RES) if (tNode == NULLP) { - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); - RETVOID; + DU_LOG("\nERROR --> RLC_DL : rlcResegRetxPdus: Memory allocation failed UEID:%d CELLID:%d", + rbCb->rlcId.ueId, rbCb->rlcId.cellId); + return; } #endif /* ERRCLASS & ERRCLS_RES */ @@ -1697,17 +1483,17 @@ KwDatReq *kwDatReq; tNode->lstEnt.prev = 0; /* Segment header and data */ - KW_AM_RMV_HDR(gCb, rbCb, retx); + RLC_AM_RMV_HDR(gCb, rbCb, retx); /* kw003.201 - Split the payload and update other fields */ - kwSplitPdu(gCb,rbCb, retx, tNode, kwDatReq->pduSz); + rlcSplitPdu(gCb,rbCb, retx, tNode, rlcDatReq->pduSz); #ifdef LTE_L2_MEAS numSdus = 0; /* ccpu00143043 */ sduIdx = lchInfo->numSdus; for (numSdus = 0, sduIdx = lchInfo->numSdus; - ((numSdus < retx->numSdu) && (sduIdx < KW_L2MEAS_SDUIDX)); + ((numSdus < retx->numSdu) && (sduIdx < RLC_L2MEAS_SDUIDX)); numSdus++, sduIdx++) { lchInfo->sduInfo[sduIdx].arvlTime = @@ -1721,23 +1507,23 @@ KwDatReq *kwDatReq; } #endif /* Construct hdr with the available hdr values */ - kwConstructAmHdr(&retx->amHdr, hdr, amDl->snLen, &idx); - SAddPreMsgMultInOrder(hdr, idx + 1, retx->seg); + rlcConstructAmHdr(&retx->amHdr, hdr, amDl->snLen, &idx); + ODU_ADD_PRE_MSG_MULT_IN_ORDER(hdr, idx + 1, retx->seg); retx->hdrSz = idx + 1; /* Poll bit need not be set for this seg, since its second */ /* half remains in retxLst */ - KW_UPD_POLL_BIT(gCb, retx, FALSE); + RLC_UPD_POLL_BIT(gCb, retx, FALSE); retx->yetToConst = FALSE; - kwDatReq->pduSz = 0; + rlcDatReq->pduSz = 0; } - kwCpyMsg(gCb,retx->seg, &pdu); + rlcCpyMsg(gCb,retx->seg, &pdu); /* Update pduInfo */ - kwDatReq->pduInfo.mBuf[kwDatReq->pduInfo.numPdu] = pdu; - kwDatReq->pduInfo.numPdu++; + rlcDatReq->pduInfo.mBuf[rlcDatReq->pduInfo.numPdu] = pdu; + rlcDatReq->pduInfo.numPdu++; /* kw005.201 ccpu00117318, updating the statistics */ gCb->genSts.pdusRetx += 1; gRlcStats.amRlcStats.numRlcAmCellRetxPdu++; @@ -1746,22 +1532,14 @@ KwDatReq *kwDatReq; amDl->retxBo -= retx->segSz; } #ifndef ALIGN_64BIT - RLOG_ARG3(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, - "kwResegRetxPdus: retxBo after resegmentation = %ld" - "UEID:%d CELLID:%d", - amDl->retxBo, - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); + DU_LOG("\nINFO --> RLC_DL : rlcResegRetxPdus: retxBo after resegmentation = %ld" + "UEID:%d CELLID:%d", amDl->retxBo, rbCb->rlcId.ueId, rbCb->rlcId.cellId); #else - RLOG_ARG3(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId, - "kwResegRetxPdus: retxBo after resegmentation = %d " - "UEID:%d CELLID:%d", - amDl->retxBo, - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); + DU_LOG("\nINFO --> RLC_DL : rlcResegRetxPdus: retxBo after resegmentation = %d " + "UEID:%d CELLID:%d", amDl->retxBo, rbCb->rlcId.ueId, rbCb->rlcId.cellId); #endif - RETVOID; + return; } @@ -1775,7 +1553,7 @@ KwDatReq *kwDatReq; * - While pdusize is available, segment/concatenate SDUs or else if it * matches the pdu size form PDUs accordingly. * - RLC header and MAC header size are eliminated while forming the PDUs - * - Call kwAmmDlCheckAndSetPoll function to check and set the poll bit + * - Call rlcAmmDlCheckAndSetPoll function to check and set the poll bit * as required * - Concatenate data and header info and fill pduInfo * @@ -1785,61 +1563,46 @@ KwDatReq *kwDatReq; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAssembleSdus -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwDatReq *kwDatReq -) -#else -PRIVATE Void kwAssembleSdus (gCb, rbCb, kwDatReq) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwDatReq *kwDatReq; -#endif +static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) { Buffer *pdu = NULLP; - MsgLen macGrntSz = kwDatReq->pduSz; - KwAmDl *amDl = &AMDL; - KwSdu *sdu = amDl->nxtTx; - KwSduMap sduMap; - Bool nxtTxUpd = FALSE; + MsgLen macGrntSz = rlcDatReq->pduSz; + RlcAmDl *amDl = &RLC_AMDL; + RlcSdu *sdu = amDl->nxtTx; + RlcSduMap sduMap; + bool nxtTxUpd = FALSE; KwuDiscSduInfo *discSduInfo = NULLP; - KwKwuSapCb* kwuSap = gCb->u.dlCb->kwuDlSap + KW_UI_PDCP; + RlcKwuSapCb* rlckwuSap = gCb->u.dlCb->rlcKwuDlSap + RLC_UI_PDCP; #ifdef LTE_L2_MEAS - KwContSduLst contSduLst; /*Contained sduLst */ - S32 dataVol = amDl->bo; - U32 *totMacGrant = &kwDatReq->totMacGrant; - KwL2MeasDlIpTh *dlIpThPut = &rbCb->l2MeasIpThruput.dlIpTh; - U8 *sduIdx = &dlIpThPut->lastSduIdx; - Bool newIdx; - Bool isSduSegmented; - S32 oldBo; - KwlchInfo lchInfo; - KwlchInfo *dstLchInfo; - U32 segSduCnt = 0; - U32 lchIdx; - U32 numSdus = 0; - U32 currSduIdx = 0; - KwL2MeasTb *l2MeasTb; + RlcContSduLst contSduLst; /*Contained sduLst */ + int32_t dataVol = amDl->bo; + uint32_t *totMacGrant = &rlcDatReq->totMacGrant; + RlcL2MeasDlIpTh *dlIpThPut = &rbCb->l2MeasIpThruput.dlIpTh; + uint8_t *sduIdx = &dlIpThPut->lastSduIdx; + bool newIdx; + bool isSduSegmented; + int32_t oldBo; + RlclchInfo lchInfo; + RlclchInfo *dstLchInfo; + uint32_t segSduCnt = 0; + uint32_t lchIdx; + uint32_t numSdus = 0; + uint32_t currSduIdx = 0; + RlcL2MeasTb *l2MeasTb; #endif /* Discard new changes starts */ Ticks timeDiff = 0; Ticks curTime = 0; - U8 numNewPdu = 0; - KwTx *txBuf = NULLP; + uint8_t numNewPdu = 0; + RlcTx *txBuf = NULLP; /* Discard new changes ends */ - VOLATILE U32 startTime = 0; - U32 hdrEstmt; - U32 fixedHdrSz; - U32 pduSz; - KwAmHdr *amHdr = NULLP; + volatile uint32_t startTime = 0; + uint32_t hdrEstmt; + uint32_t fixedHdrSz; + uint32_t pduSz; + RlcAmHdr *amHdr = NULLP; RlcDlPduInfo *pduInfo = NULLP; - TRC2(kwAssembleSdus) - - #ifdef LTE_L2_MEAS contSduLst.numSdus = 0; contSduLst.lcId = rbCb->lch.lChId; @@ -1849,41 +1612,38 @@ KwDatReq *kwDatReq; #endif /* Discard new changes starts */ /* Allocate memory for discSdu Info */ - RLC_SHRABL_STATIC_BUF_ALLOC(kwuSap->pst.region, - kwuSap->pst.pool, + RLC_SHRABL_STATIC_BUF_ALLOC(rlckwuSap->pst.region, + rlckwuSap->pst.pool, discSduInfo, sizeof(KwuDiscSduInfo)); #if (ERRCLASS & ERRCLS_ADD_RES) if (discSduInfo == NULLP) { - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); - RETVOID; + DU_LOG("\nERROR --> RLC_DL : rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d", + rbCb->rlcId.ueId, rbCb->rlcId.cellId); + return; } #endif /* ERRCLASS & ERRCLS_RES */ discSduInfo->numSduIds = 0; discSduInfo->rlcId = rbCb->rlcId; - kwUtlGetCurrTime(&curTime); + rlcUtlGetCurrTime(&curTime); amDl->sduQ.crnt = &sdu->lstEnt; /* Eliminate fixed header size */ - /*5GNR: value of KW_AM_PDU_FIXED_HDRSZ will be 2 or 3 depending on SN Size*/ - if(amDl->snLen == KW_AM_CFG_12BIT_SN_LEN) + if(amDl->snLen == RLC_AM_CFG_12BIT_SN_LEN) { - fixedHdrSz = KW_AM_PDU_12BIT_SN_HDRSZ; + fixedHdrSz = RLC_AM_PDU_12BIT_SN_HDRSZ; } else { - fixedHdrSz = KW_AM_PDU_18BIT_SN_HDRSZ; + fixedHdrSz = RLC_AM_PDU_18BIT_SN_HDRSZ; } while ((macGrntSz > fixedHdrSz) && (sdu != NULLP) && - (kwDatReq->pduInfo.numPdu < KW_MAX_PDU) && - (numNewPdu < KW_MAX_NEW_DL_PDU)) + (rlcDatReq->pduInfo.numPdu < RLC_MAX_PDU) && + (numNewPdu < RLC_MAX_NEW_DL_PDU)) { #ifdef LTE_L2_MEAS isSduSegmented = sdu->mode.am.isSegmented; @@ -1892,15 +1652,14 @@ KwDatReq *kwDatReq; if ((sdu->mode.am.isSegmented == FALSE) && (rbCb->discTmrInt > 0) && \ (rbCb->rlcId.rbType == CM_LTE_DRB)) { - //leftAmSdus[rbCb->qci]--; - timeDiff = KW_TIME_DIFF(curTime,sdu->arrTime); + timeDiff = RLC_TIME_DIFF(curTime,sdu->arrTime); if (timeDiff > rbCb->discTmrInt) { CmLList* nxtNode; /*starting Task*/ SStartTask(&startTime, PID_RLC_AMM_DISC_SDUS); #ifdef LTE_L2_MEAS - KW_UPD_L2_DL_DISC_SDU_STS(gCb,rbCb); + RLC_UPD_L2_DL_DISC_SDU_STS(gCb,rbCb); /* TODO need to send disc cfm to pdcp */ #endif /* Update bo for boReport */ @@ -1912,11 +1671,8 @@ KwDatReq *kwDatReq; /* store the info for sending it to PDCP */ if(discSduInfo->numSduIds > 500) { - RLOG_ARG2(L_ERROR,DBG_RBID, rbCb->rlcId.rbId, - "This is a big error, we shouldn't be here" - "UEID:%d CELLID:%d", - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); + DU_LOG("\nERROR --> RLC_DL : rlcAssembleSdus: This is a big error, we shouldn't be here" + "UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); break; } @@ -1925,20 +1681,20 @@ KwDatReq *kwDatReq; cmLListDelFrm(&amDl->sduQ, &sdu->lstEnt); - kwUtlAddSduToBeFreedQueue(gCb, sdu); - kwUtlRaiseDlCleanupEvent(gCb); + rlcUtlAddSduToBeFreedQueue(gCb, sdu); + rlcUtlRaiseDlCleanupEvent(gCb); /* We need to restore the crnt in the linked list which * would have become NULL in the DelFrm above */ amDl->sduQ.crnt = nxtNode; if(nxtNode) - sdu = (KwSdu*)nxtNode->node; + sdu = (RlcSdu*)nxtNode->node; else sdu = NULLP; /*stopping Task*/ - SStopTask(startTime, PID_RLC_AMM_DISC_SDUS); + ODU_STOP_TASK(startTime, PID_RLC_AMM_DISC_SDUS); continue; } } @@ -1947,15 +1703,11 @@ KwDatReq *kwDatReq; #ifdef LTE_L2_MEAS newIdx = FALSE; #endif - /** kw003.201 - Check for window stall when you are - * creating a new PDU - */ - if (KW_AM_IS_TRANS_WIN_STALLED(amDl)) + /** Check for window stall when you are creating a new PDU */ + if (RLC_AM_IS_TRANS_WIN_STALLED(amDl)) { - //int *a = NULLP; - printf("\n Window stalled \n"); + DU_LOG("\nINFO --> RLC_DL : Window stalled \n"); gRlcStats.amRlcStats.numRlcAmCellWinStall++; - //*a = 10; break; } @@ -1967,15 +1719,11 @@ KwDatReq *kwDatReq; hdrEstmt += 2; } /* Eliminate MAC header */ - /* ccpu00135743 : Fix for MAC Hdr size calculation */ - /*5GNR: value of mac hdr length field changed to 8/16bits */ - pduSz = KW_MIN(macGrntSz, (sdu->sduSz + hdrEstmt)); - hdrEstmt += (pduSz < 255) ? KW_MAC_HDR_SZ2 : KW_MAC_HDR_SZ3; + pduSz = RLC_MIN(macGrntSz, (sdu->sduSz + hdrEstmt)); + hdrEstmt += (pduSz < 255) ? RLC_MAC_HDR_SZ2 : RLC_MAC_HDR_SZ3; macGrntSz -= hdrEstmt; - /* kw005.201 Check for PDU Size is large enough. - * Fix for ccpu00118973 - * */ + /* Check for PDU Size is large enough */ if(macGrntSz <= 0) { break; @@ -1985,41 +1733,37 @@ KwDatReq *kwDatReq; if (!sdu->mode.am.isSegmented) { /* Update txBuf */ - RLC_ALLOC_WC(gCb,txBuf, sizeof(KwTx)); + RLC_ALLOC_WC(gCb,txBuf, sizeof(RlcTx)); cmLListInit(&txBuf->pduLst); #if (ERRCLASS & ERRCLS_ADD_RES) if (txBuf == NULLP) { - U32 avblMem = 0; + uint32_t avblMem = 0; SRegInfoShow(gCb->init.region, &avblMem); - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); - RETVOID; + DU_LOG("\nERROR --> RLC_DL : rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d", + rbCb->rlcId.ueId, rbCb->rlcId.cellId); + return; } #endif /* ERRCLASS & ERRCLS_RES */ - kwUtlStoreTxBuf(amDl->txBufLst, txBuf, amDl->txNext); + rlcUtlStoreTxBuf(amDl->txBufLst, txBuf, amDl->txNext); } else { - txBuf = kwUtlGetTxBuf(amDl->txBufLst, amDl->txNext); + txBuf = rlcUtlGetTxBuf(amDl->txBufLst, amDl->txNext); } RLC_ALLOC_WC(gCb,pduInfo, sizeof(RlcDlPduInfo)); #if (ERRCLASS & ERRCLS_ADD_RES) if (pduInfo == NULLP) { - U32 avblMem = 0; + uint32_t avblMem = 0; SRegInfoShow(gCb->init.region, &avblMem); - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); - RETVOID; + DU_LOG("\nERROR --> RLC_DL : rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d", + rbCb->rlcId.ueId, rbCb->rlcId.cellId); + return; } #endif /* ERRCLASS & ERRCLS_RES */ @@ -2036,6 +1780,12 @@ KwDatReq *kwDatReq; pduInfo->amHdr.sn = amDl->txNext; + /* No Segmentation scenario : + * If SDU size is less than or equal to the requested PDU size + * - Allocate memory and copy SDU into it. + * -# Update BO + * -# Remove SDU from the Queue. + */ if (macGrntSz >= sdu->sduSz) { pdu = sdu->mBuf; @@ -2043,16 +1793,13 @@ KwDatReq *kwDatReq; /* Update Framing Info */ if (sdu->mode.am.isSegmented) { - /*5GNR RLC: SN should be same for all segment of a SDU*/ + /*5GNR RLC_DL : SN should be same for all segment of a SDU*/ pduInfo->amHdr.sn = sdu->mode.am.sn; - pduInfo->amHdr.si = KW_SI_LAST_SEG; /* binary 10 */ + pduInfo->amHdr.si = RLC_SI_LAST_SEG; /* binary 10 */ pduInfo->amHdr.so = sdu->actSz - sdu->sduSz; sdu->mode.am.isSegmented = FALSE; - gRlcStats.amRlcStats.numRlcAmCellSduTx++; - //printf("\n 5GNRLOG: last segment of lcId %d SduId %u So %u macGrntSz %u sduActSz %u sdu->sduSz %u\n", - // rbCb->lch.lChId, sdu->mode.am.sduId, pduInfo->amHdr.so, macGrntSz, sdu->actSz, sdu->sduSz); } else { @@ -2060,18 +1807,16 @@ KwDatReq *kwDatReq; } amHdr = &pduInfo->amHdr; /* Create PDU with hdr and data */ - kwAmmCreatePdu(gCb,rbCb, amHdr, pduInfo, pdu); - - //printf("\n Segmentation not required case: numPdu %d pdu %p \n",kwDatReq->pduInfo.numPdu, pdu); + rlcAmmCreatePdu(gCb,rbCb, amHdr, pduInfo, pdu); #ifdef LTE_L2_MEAS_RLC - kwUtlUpdSduSnMap(rbCb, sdu, kwDatReq, TRUE); + rlcUtlUpdSduSnMap(rbCb, sdu, rlcDatReq, TRUE); #endif /* LTE_L2_MEAS */ /* kw005.201 ccpu00117318, updating the statistics */ - kwUtlIncrementKwuStsSduTx(gCb->u.dlCb->kwuDlSap + rbCb->kwuSapId); + rlcUtlIncrementKwuStsSduTx(gCb->u.dlCb->rlcKwuDlSap + rbCb->k1wuSapId); #ifdef LTE_L2_MEAS - if(KW_MEAS_IS_DL_ANY_MEAS_ON_FOR_RB(gCb,rbCb)) + if(RLC_MEAS_IS_DL_ANY_MEAS_ON_FOR_RB(gCb,rbCb)) { if(isSduSegmented) { @@ -2079,15 +1824,14 @@ KwDatReq *kwDatReq; } else { - KW_GETSDUIDX(*sduIdx); + RLC_GETSDUIDX(*sduIdx); newIdx = TRUE; } - kwUtlUpdateContainedSduLst(*sduIdx, &contSduLst); - kwUtlUpdateOutStandingSduLst(dlIpThPut, *sduIdx, sdu->actSz, + rlcUtlUpdateContainedSduLst(*sduIdx, &contSduLst); + rlcUtlUpdateOutStandingSduLst(dlIpThPut, *sduIdx, sdu->actSz, sdu->mode.am.sduId, newIdx); /* Update the arrival time for each SDU */ - /* ccpu00143043 */ - if ( lchInfo.numSdus < KW_L2MEAS_SDUIDX) + if ( lchInfo.numSdus < RLC_L2MEAS_SDUIDX) { lchInfo.sduInfo[lchInfo.numSdus].arvlTime = sdu->arrTime; lchInfo.numSdus++; @@ -2105,27 +1849,26 @@ KwDatReq *kwDatReq; Buffer *remSeg = NULLP; - //printf("\n SDU segmentation case: numPdu %d pdu %p \n", kwDatReq->pduInfo.numPdu, pdu); #ifdef LTE_L2_MEAS - if(KW_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(gCb,rbCb) || - KW_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(gCb,rbCb) || - KW_MEAS_IS_DL_UU_LOSS_MEAS_ON_FOR_RB(gCb,rbCb) ) + if(RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(gCb,rbCb) || + RLC_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(gCb,rbCb) || + RLC_MEAS_IS_DL_UU_LOSS_MEAS_ON_FOR_RB(gCb,rbCb) ) { /* If actual size of the sdu is equal to msgLen * then it is first segment of the SDU */ if(sdu->actSz == sdu->sduSz) { - KW_GETSDUIDX(*sduIdx); + RLC_GETSDUIDX(*sduIdx); newIdx = TRUE; } else { *sduIdx = dlIpThPut->lastSduIdx; } - kwUtlUpdateContainedSduLst(*sduIdx, &contSduLst); - kwUtlUpdateOutStandingSduLst(dlIpThPut, *sduIdx, sdu->actSz, + rlcUtlUpdateContainedSduLst(*sduIdx, &contSduLst); + rlcUtlUpdateOutStandingSduLst(dlIpThPut, *sduIdx, sdu->actSz, sdu->mode.am.sduId, newIdx); - if(KW_MEAS_IS_DL_UU_LOSS_MEAS_ON_FOR_RB(gCb,rbCb)) + if(RLC_MEAS_IS_DL_UU_LOSS_MEAS_ON_FOR_RB(gCb,rbCb)) { /* If actual size of the sdu is equal to msgLen * then it is first segment of the SDU */ @@ -2138,44 +1881,39 @@ KwDatReq *kwDatReq; #endif /* Segment the SDU to the size of the PDU and update header Info */ - SSegMsg(sdu->mBuf, macGrntSz, &remSeg); + ODU_SEGMENT_MSG(sdu->mBuf, macGrntSz, &remSeg); pdu = sdu->mBuf; sdu->mBuf = remSeg; /* Update SI and SN */ if (sdu->mode.am.isSegmented) { - /*5GNR RLC: SN should be same for all segment of a SDU. + /*5GNR RLC_DL : SN should be same for all segment of a SDU. * Sdu was already segmented and segmenting again*/ pduInfo->amHdr.sn = sdu->mode.am.sn; - pduInfo->amHdr.si = KW_SI_MID_SEG; /* binary 11 */ + pduInfo->amHdr.si = RLC_SI_MID_SEG; /* binary 11 */ pduInfo->amHdr.so = sdu->actSz - sdu->sduSz; - - //printf("\n 5GNRLOG: mid segment of lcId %d SduId %u So %u macGrntSz %u sduActSz %u sdu->sduSz %u\n", - // rbCb->lch.lChId, sdu->mode.am.sduId, txBuf->amHdr.so, macGrntSz, sdu->actSz, sdu->sduSz); } else { - /*5GNR RLC: This means it is the first*/ - pduInfo->amHdr.si = KW_SI_FIRST_SEG; /* binary 01 */ - /*5GNR_RLC: Store SN so that in sub-seqent SDU segments will use this SN*/ + /*5GNR RLC_DL : This means it is the first*/ + pduInfo->amHdr.si = RLC_SI_FIRST_SEG; /* binary 01 */ + /*5GNR_RLC_DL : Store SN so that in sub-seqent SDU segments will use this SN*/ sdu->mode.am.sn = pduInfo->amHdr.sn; pduInfo->amHdr.so = 0; - //printf("\n 5GNRLOG: First segment of lcId %d SduId %u So %u macGrntSz %u sduActSz %u sdu->sduSz %u\n", - // rbCb->lch.lChId, sdu->mode.am.sduId, txBuf->amHdr.so, macGrntSz, sdu->actSz, sdu->sduSz); } amHdr = &pduInfo->amHdr; /* Create PDU with hdr and data */ - kwAmmCreatePdu(gCb,rbCb, amHdr, pduInfo, pdu); + rlcAmmCreatePdu(gCb,rbCb, amHdr, pduInfo, pdu); sdu->mode.am.isSegmented = TRUE; sdu->sduSz -= macGrntSz; sduMap.sduSz = macGrntSz; #ifdef LTE_L2_MEAS_RLC - kwUtlUpdSduSnMap(rbCb, sdu, kwDatReq, FALSE); + rlcUtlUpdSduSnMap(rbCb, sdu, rlcDatReq, FALSE); #endif /* LTE_L2_MEAS */ amDl->nxtTx = sdu; @@ -2188,39 +1926,39 @@ KwDatReq *kwDatReq; sduMap.sdu = sdu; /* Update pduInfo */ - kwDatReq->pduInfo.mBuf[kwDatReq->pduInfo.numPdu] = pdu; - kwDatReq->pduInfo.numPdu++; + rlcDatReq->pduInfo.mBuf[rlcDatReq->pduInfo.numPdu] = pdu; + rlcDatReq->pduInfo.numPdu++; numNewPdu++; /* kw005.201 ccpu00117318, updating the statistics */ gCb->genSts.pdusSent++; gRlcStats.amRlcStats.numRlcAmCellSduBytesTx = gRlcStats.amRlcStats.numRlcAmCellSduBytesTx + sduMap.sduSz; /* Update the RLC Tx buffer with the new PDU info */ - KW_MEM_CPY(&pduInfo->sduMap, &sduMap, sizeof(KwSduMap)); + RLC_MEM_CPY(&pduInfo->sduMap, &sduMap, sizeof(RlcSduMap)); pdu = NULLP; macGrntSz -= sduMap.sduSz; /* Get next sdu for assembly */ - KW_LLIST_NEXT_SDU(amDl->sduQ, sdu); + RLC_LLIST_NEXT_SDU(amDl->sduQ, sdu); } /*End of pduSz loop */ - kwDatReq->pduSz = macGrntSz; + rlcDatReq->pduSz = macGrntSz; /* Updating nxtTx to sdu in the Q */ if (!nxtTxUpd) amDl->nxtTx = sdu; #ifdef LTE_L2_MEAS - if(KW_MEAS_IS_DL_ANY_MEAS_ON_FOR_RB(gCb,rbCb) && + if(RLC_MEAS_IS_DL_ANY_MEAS_ON_FOR_RB(gCb,rbCb) && (rbCb->rlcId.rbType == CM_LTE_DRB)) { numSdus = 0; currSduIdx = 0; - l2MeasTb = kwUtlGetCurMeasTb(gCb, rbCb); - kwUtlUpdateBurstSdus(gCb, rbCb, &contSduLst, dataVol, *totMacGrant); + l2MeasTb = rlcUtlGetCurMeasTb(gCb, rbCb); + rlcUtlUpdateBurstSdus(gCb, rbCb, &contSduLst, dataVol, *totMacGrant); if ((lchInfo.numSdus != 0) && (l2MeasTb != NULLP)) { for (lchIdx = 0; ((lchIdx < l2MeasTb->numLchInfo) - && (lchIdx < KW_MAX_ACTV_DRB )); lchIdx++) + && (lchIdx < RLC_MAX_ACTV_DRB )); lchIdx++) { if (l2MeasTb->lchInfo[lchIdx].lcId == rbCb->lch.lChId) { @@ -2228,7 +1966,7 @@ KwDatReq *kwDatReq; break; } } - if (lchIdx < KW_MAX_ACTV_DRB) + if (lchIdx < RLC_MAX_ACTV_DRB) { if (lchIdx == l2MeasTb->numLchInfo) { @@ -2238,7 +1976,7 @@ KwDatReq *kwDatReq; } dstLchInfo = &l2MeasTb->lchInfo[lchIdx]; currSduIdx = l2MeasTb->lchInfo[lchIdx].numSdus; - while ((numSdus < lchInfo.numSdus) && (currSduIdx < KW_L2MEAS_SDUIDX)) + while ((numSdus < lchInfo.numSdus) && (currSduIdx < RLC_L2MEAS_SDUIDX)) { dstLchInfo->sduInfo[currSduIdx].arvlTime = lchInfo.sduInfo[numSdus].arvlTime; dstLchInfo->sduInfo[currSduIdx].isRetxPdu = FALSE; @@ -2260,29 +1998,16 @@ KwDatReq *kwDatReq; if(discSduInfo->numSduIds != 0) { /* Sap control block */ - KwUiKwuDiscSduCfm(&kwuSap->pst, kwuSap->suId, discSduInfo); + RlcUiKwuDiscSduCfm(&rlckwuSap->pst, rlckwuSap->suId, discSduInfo); } else { - RLC_SHRABL_STATIC_BUF_FREE(kwuSap->pst.region, kwuSap->pst.pool, discSduInfo, sizeof(KwuDiscSduInfo)); + RLC_SHRABL_STATIC_BUF_FREE(rlckwuSap->pst.region, rlckwuSap->pst.pool, discSduInfo, sizeof(KwuDiscSduInfo)); } - -#ifndef ALIGN_64BIT - RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, - "kwAssembleSdus: BO after assembly = %ld UEID:%d CELLID:%d", - amDl->bo, - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); -#else - RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, - "kwAssembleSdus: BO after assembly = %d UEID:%d CELLID:%d", - amDl->bo, - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); -#endif - - RETVOID; + DU_LOG("\nDEBUG --> RLC_DL : rlcAssembleSdus: BO after assembly = %d UEID:%d CELLID:%d", + amDl->bo, rbCb->rlcId.ueId, rbCb->rlcId.cellId); + return; } /** @@ -2308,28 +2033,11 @@ KwDatReq *kwDatReq; * -# 0 - Poll bit is not set * */ -#ifdef ANSI -PRIVATE Bool kwAmmDlCheckAndSetPoll -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -Bool newPdu, -MsgLen bufSz -) -#else -PRIVATE Bool kwAmmDlCheckAndSetPoll(gCb, rbCb, newPdu, bufSz) -RlcCb *gCb; -RlcDlRbCb *rbCb; -Bool newPdu; -MsgLen bufSz; -#endif +static bool rlcAmmDlCheckAndSetPoll(RlcCb *gCb, RlcDlRbCb *rbCb, bool newPdu, MsgLen bufSz) { - Bool pollBit = FALSE; - KwAmDl *amDl = &(rbCb->m.amDl); + bool pollBit = FALSE; + RlcAmDl *amDl = &(rbCb->m.amDl); - TRC2(kwAmmDlCheckAndSetPoll) - - /* If it's a new PDU increment PDU without poll and bytes without poll and check if they cross the configured number of poll pdu and poll bytes*/ if (newPdu) @@ -2347,7 +2055,7 @@ MsgLen bufSz; /* Check if both tx/retx buffer are empty or if tx window is stalled */ if (((amDl->nxtTx == NULLP) && (amDl->nxtRetx == NULLP)) || - KW_AM_IS_TRANS_WIN_STALLED(amDl)) + RLC_AM_IS_TRANS_WIN_STALLED(amDl)) { pollBit = TRUE; } @@ -2359,23 +2067,20 @@ MsgLen bufSz; amDl->pollSn = (amDl->txNext - 1) & amDl->snModMask; - RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, - "kwAmmDlCheckAndSetPoll: Poll SN = %d UEID:%d CELLID:%d", - amDl->pollSn, - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); + DU_LOG("\nINFO --> RLC_DL : rlcAmmDlCheckAndSetPoll: Poll SN = %d UEID:%d CELLID:%d", + amDl->pollSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); /* kw005.201: Fix for poll retransmission timer. * Timer is stopped if it is already running and * then starting the timer. Fixes crs * ccpu00117216 and ccpu00118284 . * */ - if( TRUE == kwChkTmr(gCb,(PTR)rbCb,KW_EVT_AMDL_POLL_RETX_TMR) ) + if( TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMDL_POLL_RETX_TMR) ) { - kwStopTmr(gCb,(PTR)rbCb, KW_EVT_AMDL_POLL_RETX_TMR); + rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMDL_POLL_RETX_TMR); } - kwStartTmr(gCb,(PTR)rbCb, KW_EVT_AMDL_POLL_RETX_TMR); + rlcStartTmr(gCb,(PTR)rbCb, EVENT_RLC_AMDL_POLL_RETX_TMR); } return (pollBit); @@ -2397,58 +2102,37 @@ MsgLen bufSz; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAmmCreatePdu -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwAmHdr *amHdr, -RlcDlPduInfo *pduInfo, -Buffer *pdu -) -#else -PRIVATE Void kwAmmCreatePdu(gCb, rbCb, pduInfo, amHdr, pdu) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwAmHdr *amHdr; -RlcDlPduInfo *pduInfo; -Buffer *pdu; -#endif +static void rlcAmmCreatePdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcAmHdr *amHdr, +RlcDlPduInfo *pduInfo, Buffer *pdu) { - U8 hdr[KW_MAX_HDRSZ]; - U16 idx; - KwTx *txBuf; - MsgLen pduSz; - KwAmDl *amDl = &(rbCb->m.amDl); - - TRC2(kwAmmCreatePdu) - + uint8_t hdr[RLC_MAX_HDRSZ]; + uint16_t idx; + RlcTx *txBuf; + MsgLen pduSz; + RlcAmDl *amDl = &(rbCb->m.amDl); /* Update sn */ amHdr->sn = amDl->txNext; - - /*5GNR RLC: Increment txNext only if no segmentation of it is a last segment */ - if((!amHdr->si) || (amHdr->si == KW_SI_LAST_SEG)) + /*5GNR RLC_DL : Increment txNext only if no segmentation of it is a last segment */ + if((!amHdr->si) || (amHdr->si == RLC_SI_LAST_SEG)) { - //printf("\n 5GNRLOG: no segment/last seg SDU with lcId %d Sn %u txNext %u So %u\n", - // rbCb->lch.lChId, amHdr->sn, amDl->txNext, amHdr->so); amDl->txNext = (amDl->txNext + 1) & amDl->snModMask; } /* Update hdr Info */ - SFndLenMsg(pdu, &pduSz); + ODU_GET_MSG_LEN(pdu, &pduSz); /* passing newPDU = TRUE*/ - amHdr->p = kwAmmDlCheckAndSetPoll(gCb,rbCb, TRUE, pduSz); + amHdr->p = rlcAmmDlCheckAndSetPoll(gCb,rbCb, TRUE, pduSz); /* Construct header with the available hdr Info, set isSegment to FALSE */ - kwConstructAmHdr(amHdr, hdr, amDl->snLen, &idx); + rlcConstructAmHdr(amHdr, hdr, amDl->snLen, &idx); /* Concatenate hdr and data */ - SAddPreMsgMultInOrder(hdr, idx+1, pdu); + ODU_ADD_PRE_MSG_MULT_IN_ORDER(hdr, idx+1, pdu); - txBuf = kwUtlGetTxBuf(amDl->txBufLst, amHdr->sn); - kwCpyMsg(gCb,pdu,&(pduInfo->pdu)); + txBuf = rlcUtlGetTxBuf(amDl->txBufLst, amHdr->sn); + rlcCpyMsg(gCb,pdu,&(pduInfo->pdu)); pduInfo->pduSz = pduSz; pduInfo->hdrSz = idx+1; @@ -2457,7 +2141,7 @@ Buffer *pdu; /* Reestimate estHdrSz for mid and last seg */ if(amHdr->si & 0x1) { - amDl->estHdrSz += ((amHdr->si == KW_SI_MID_SEG)? pduInfo->hdrSz : (pduInfo->hdrSz + 2)); + amDl->estHdrSz += ((amHdr->si == RLC_SI_MID_SEG)? pduInfo->hdrSz : (pduInfo->hdrSz + 2)); } cmLListAdd2Tail(&txBuf->pduLst, &pduInfo->lstEnt); @@ -2465,7 +2149,7 @@ Buffer *pdu; gCb->genSts.bytesSent += pduSz; - RETVOID; + return; } /** @@ -2483,39 +2167,25 @@ Buffer *pdu; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwRemRetxPdu -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwRetx *retx -) -#else -PRIVATE Void kwRemRetxPdu(gCb, rbCb, retx) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwRetx *retx; -#endif +static Void rlcRemRetxPdu(RlcCb *gCb,RlcDlRbCb *rbCb,RlcRetx *retx) { - TRC2(kwRemRetxPdu) - - cmLListDelFrm(&AMDL.retxLst, &retx->lstEnt); + cmLListDelFrm(&RLC_AMDL.retxLst, &retx->lstEnt); - if( AMDL.retxLst.count == 0) + if( RLC_AMDL.retxLst.count == 0) { - AMDL.nxtRetx = NULLP; + RLC_AMDL.nxtRetx = NULLP; } if(retx->pendingReTrans == TRUE) { - AMDL.retxBo -= retx->segSz; - AMDL.estHdrSz -= retx->hdrSz; + RLC_AMDL.retxBo -= retx->segSz; + RLC_AMDL.estHdrSz -= retx->hdrSz; } - kwUtlAddReTxPduToBeFreedQueue(gCb, retx); - kwUtlRaiseDlCleanupEvent(gCb); + rlcUtlAddReTxPduToBeFreedQueue(gCb, retx); + rlcUtlRaiseDlCleanupEvent(gCb); - RETVOID; + return; } /** @@ -2534,24 +2204,11 @@ KwRetx *retx; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAmmDlMarkPduForReTx -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwRetx *retx -) -#else -PRIVATE Void kwAmmDlMarkPduForReTx(*gCb, rbCb, retx) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwRetx *retx; -#endif +static Void rlcAmmDlMarkPduForReTx(RlcCb *gCb,RlcDlRbCb *rbCb,RlcRetx *retx) { - TRC2(kwAmmDlMarkPduForReTx) - if (AMDL.maxReTxReached == TRUE) + if (RLC_AMDL.maxReTxReached == TRUE) { - RETVOID; + return; } if(retx->pendingReTrans == FALSE) @@ -2559,10 +2216,10 @@ KwRetx *retx; retx->pendingReTrans = TRUE; ++retx->retxCnt; - AMDL.retxBo += retx->segSz; - AMDL.estHdrSz += retx->hdrSz; + RLC_AMDL.retxBo += retx->segSz; + RLC_AMDL.estHdrSz += retx->hdrSz; - if (retx->retxCnt > AMDL.maxRetx) + if (retx->retxCnt > RLC_AMDL.maxRetx) { /* RLC_DL_MAX_RETX fix */ /* Marking the RB stalled for DL scheduling. This is to avoid unnecessary */ @@ -2575,27 +2232,27 @@ KwRetx *retx; rbCb->m.amDl.cntrlBo = 0; rbCb->m.amDl.retxBo = 0; /* Sending BO update to SCH */ - kwUtlSndDStaRsp(gCb, rbCb, 0,0,0,0); - kwAmmSndStaInd(gCb, rbCb, retx); + rlcUtlSendDedLcBoStatus(gCb, rbCb, 0,0,0,0); + rlcAmmSndStaInd(gCb, rbCb, retx); gRlcStats.amRlcStats.numDLMaxRetx++; } - kwRemRetxPdu(gCb,rbCb, retx); + rlcRemRetxPdu(gCb,rbCb, retx); - RETVOID; + return; } - if (AMDL.nxtRetx == NULLP) + if (RLC_AMDL.nxtRetx == NULLP) { - AMDL.nxtRetx = retx; + RLC_AMDL.nxtRetx = retx; } gRlcStats.amRlcStats.numDLRetransPdus++; } - RETVOID; + return; } /** @@ -2614,25 +2271,15 @@ KwRetx *retx; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAmmDlCheckIsSDUDelivered +static Void rlcAmmDlCheckIsSDUDelivered ( RlcCb *gCb, RlcDlRbCb *rbCb, -KwSduMap *sduMap, -KwuDatCfmInfo **datCfm +RlcSduMap *sduMap, +KwuDatCfmInfo **datCfm ) -#else -PRIVATE Void kwAmmDlCheckIsSDUDelivered(gCb, rbCb, sduMap, datCfm) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwSduMap *sduMap; -KwuDatCfmInfo **datCfm; -#endif { - KwSdu *sdu; - - TRC2(kwAmmDlCheckIsSDUDelivered) + RlcSdu *sdu; sdu = sduMap->sdu; @@ -2653,20 +2300,19 @@ KwuDatCfmInfo **datCfm; * send so many confirms in one go * Confrims to PDCP are being dropped in this case */ - KwKwuSapCb *kwuSap; - kwuSap = gCb->u.dlCb->kwuDlSap + KW_UI_PDCP; - KwUiKwuDatCfm(&kwuSap->pst, kwuSap->suId, *datCfm); + RlcKwuSapCb *rlckwuSap; + rlckwuSap = gCb->u.dlCb->rlcKwuDlSap + RLC_UI_PDCP; + RlcUiKwuDatCfm(&rlckwuSap->pst, rlckwuSap->suId, *datCfm); - RLC_SHRABL_STATIC_BUF_ALLOC(kwuSap->pst.region, kwuSap->pst.pool, *datCfm, sizeof(KwuDatCfmInfo)); + RLC_SHRABL_STATIC_BUF_ALLOC(rlckwuSap->pst.region, rlckwuSap->pst.pool, *datCfm, sizeof(KwuDatCfmInfo)); #if (ERRCLASS & ERRCLS_ADD_RES) if (*datCfm == NULLP) { - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RETVOID; + return; } #endif /* ERRCLASS & ERRCLS_RES */ @@ -2678,12 +2324,12 @@ KwuDatCfmInfo **datCfm; } /* Remove SDU from the sduQ */ - cmLListDelFrm(&AMDL.sduQ, &sdu->lstEnt); - kwUtlAddSduToBeFreedQueue(gCb, sdu); - kwUtlRaiseDlCleanupEvent(gCb); + cmLListDelFrm(&RLC_AMDL.sduQ, &sdu->lstEnt); + rlcUtlAddSduToBeFreedQueue(gCb, sdu); + rlcUtlRaiseDlCleanupEvent(gCb); } - RETVOID; + return; } /** @@ -2701,48 +2347,39 @@ KwuDatCfmInfo **datCfm; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAmmDlProcessSuccessfulTxPdu +static Void rlcAmmDlProcessSuccessfulTxPdu ( RlcCb *gCb, RlcDlRbCb *rbCb, -KwSn sn, -KwuDatCfmInfo **datCfm +RlcSn sn, +KwuDatCfmInfo **datCfm ) -#else -PRIVATE Void kwAmmDlProcessSuccessfulTxPdu(gCb, rbCb, sn, datCfm) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwSn sn; -KwuDatCfmInfo **datCfm; -#endif { - TRC2(kwAmmDlProcessSuccessfulTxPdu) CmLList *pduNode; - KwTx *txBuf = kwUtlGetTxBuf(AMDL.txBufLst, sn); + RlcTx *txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, sn); if (txBuf == NULLP) { - RETVOID; + return; } pduNode = txBuf->pduLst.first; while(pduNode) { RlcDlPduInfo *pduInfo = (RlcDlPduInfo *)(pduNode->node); - kwAmmDlCheckIsSDUDelivered(gCb, + rlcAmmDlCheckIsSDUDelivered(gCb, rbCb, &(pduInfo->sduMap), datCfm); pduNode = pduNode->next; } - kwUtlAddTxPduToBeFreedQueue(gCb, txBuf); - kwUtlRaiseDlCleanupEvent(gCb); + rlcUtlAddTxPduToBeFreedQueue(gCb, txBuf); + rlcUtlRaiseDlCleanupEvent(gCb); /* so that it is not processed again */ - kwUtlRemovTxBuf(AMDL.txBufLst, txBuf, gCb); + rlcUtlRemovTxBuf(RLC_AMDL.txBufLst, txBuf, gCb); - RETVOID; + return; } /** @@ -2759,55 +2396,44 @@ KwuDatCfmInfo **datCfm; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAmmSndStaInd +static Void rlcAmmSndStaInd ( RlcCb *gCb, RlcDlRbCb *rbCb, -KwRetx *retx +RlcRetx *retx ) -#else -PRIVATE Void kwAmmSndStaInd(gCb, rbCb, retx) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwRetx *retx; -#endif { KwuStaIndInfo *staInd; - KwKwuSapCb *kwuSap; - - TRC2(kwAmmSndStaInd); - + RlcKwuSapCb *rlckwuSap; /* Sap control block */ - kwuSap = gCb->u.dlCb->kwuDlSap + KW_UI_PDCP; + rlckwuSap = gCb->u.dlCb->rlcKwuDlSap + RLC_UI_PDCP; /* Allocate memory for staInd Info */ - RLC_SHRABL_STATIC_BUF_ALLOC(kwuSap->pst.region, kwuSap->pst.pool, staInd, sizeof(KwuStaIndInfo)); + RLC_SHRABL_STATIC_BUF_ALLOC(rlckwuSap->pst.region, rlckwuSap->pst.pool, staInd, sizeof(KwuStaIndInfo)); #if (ERRCLASS & ERRCLS_ADD_RES) if (staInd == NULLP) { - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RETVOID; + return; } #endif /* ERRCLASS & ERRCLS_RES */ /* Fill staInd Info */ - KW_MEM_CPY(&staInd->rlcId, &rbCb->rlcId, sizeof(CmLteRlcId)); + RLC_MEM_CPY(&staInd->rlcId, &rbCb->rlcId, sizeof(CmLteRlcId)); staInd->numSdu = 1; staInd->sduId[0] = retx->sduMap.sdu->mode.am.sduId; #ifdef KW_PDCP #else - KwUiKwuStaInd(&kwuSap->pst, kwuSap->suId, staInd); + RlcUiKwuStaInd(&rlckwuSap->pst, rlckwuSap->suId, staInd); #endif /* KW_PDCP */ - RETVOID; + return; } /** @@ -2824,22 +2450,10 @@ KwRetx *retx; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwGetNxtRetx -( -RlcCb *gCb, -KwRetx **retx -) -#else -PRIVATE Void kwGetNxtRetx(gCb, retx) -RlcCb *gCb; -KwRetx **retx; -#endif +static void rlcGetNxtRetx(RlcCb *gCb, RlcRetx **retx) { CmLList *tNode; - TRC2(kwGetNxtRetx); - do { tNode = &((*retx)->lstEnt); @@ -2847,16 +2461,16 @@ KwRetx **retx; if (tNode) { - *retx = (KwRetx *)tNode->node; + *retx = (RlcRetx *)tNode->node; } else { *retx = NULLP; - RETVOID; + return; } }while((*retx)->pendingReTrans == FALSE); - RETVOID; + return; } /** @@ -2871,35 +2485,28 @@ KwRetx **retx; * @return Void * */ -#ifdef ANSI -PUBLIC Void kwAmmDlReEstablish +Void rlcAmmDlReEstablish ( RlcCb *gCb, CmLteRlcId rlcId, RlcDlRbCb *rbCb ) -#else -PUBLIC Void kwAmmDlReEstablish(gCb, rlcId, rbCb) -RlcCb *gCb; -CmLteRlcId rlcId; -RlcDlRbCb *rbCb; -#endif { /* create a new AM DL RB, reset it and replace in the UeCb*/ RlcDlUeCb *ueCb; RlcDlRbCb *resetRb; - KwAmDl* newAmDl; - KwAmDl* oldAmDl; + RlcAmDl* newAmDl; + RlcAmDl* oldAmDl; RLC_ALLOC(gCb, resetRb, sizeof(RlcDlRbCb)); /* ccpu00135170 Removing KLOCK warning */ if(resetRb == NULLP) { - RETVOID; + return; } - KW_MEM_CPY(resetRb, rbCb, sizeof(RlcDlRbCb)); - RLC_MEM_SET(&resetRb->m.amDl, 0 , sizeof(KwAmDl)); + RLC_MEM_CPY(resetRb, rbCb, sizeof(RlcDlRbCb)); + RLC_MEM_SET(&resetRb->m.amDl, 0 , sizeof(RlcAmDl)); /* AGHOSH changes start */ /* restore the old AM values */ @@ -2912,18 +2519,17 @@ RlcDlRbCb *rbCb; newAmDl->snLen = oldAmDl->snLen; newAmDl->snModMask = oldAmDl->snModMask; newAmDl->pollRetxTmrInt = oldAmDl->pollRetxTmrInt; - rbCb->boUnRprtdCnt = (U32)0; - rbCb->lastRprtdBoToMac = (U32)0; + rbCb->boUnRprtdCnt = (uint32_t)0; + rbCb->lastRprtdBoToMac = (uint32_t)0; cmInitTimers(&(resetRb->m.amDl.pollRetxTmr), 1); /* AGHOSH changes end */ - if (ROK != kwDbmFetchDlUeCb(gCb,rlcId.ueId, rlcId.cellId, &ueCb)) + if (ROK != rlcDbmFetchDlUeCb(gCb,rlcId.ueId, rlcId.cellId, &ueCb)) { - RLOG_ARG2(L_ERROR,DBG_CELLID, rlcId.cellId, - "UeId [%d]: UeCb not found RBID;%d", + DU_LOG("\nERROR --> RLC_DL : UeId [%d]: UeCb not found RBID;%d", rlcId.ueId, rlcId.rbId); - RETVOID; + return; } if(rlcId.rbType == CM_LTE_SRB) @@ -2950,17 +2556,17 @@ RlcDlRbCb *rbCb; /* allocate the TX array again */ #ifndef LTE_TDD - U32 hashIndex; + uint32_t hashIndex; RLC_ALLOC(gCb, resetRb->m.amDl.txBufLst, - (KW_TX_BUF_BIN_SIZE * sizeof(CmLListCp))); - for(hashIndex = 0; hashIndex < KW_TX_BUF_BIN_SIZE; hashIndex++) + (RLC_TX_BUF_BIN_SIZE * sizeof(CmLListCp))); + for(hashIndex = 0; hashIndex < RLC_TX_BUF_BIN_SIZE; hashIndex++) { cmLListInit(&(resetRb->m.amDl.txBufLst[hashIndex])); } #endif /* send the old rb of deletion */ - kwAmmFreeDlRbCb(gCb,rbCb); + rlcAmmFreeDlRbCb(gCb,rbCb); /* TODO: for now we are re-settting the re-establishment flag here @@ -2975,7 +2581,7 @@ RlcDlRbCb *rbCb; rlcDlUtlResetReestInProgress(ueCb->drbCb[rlcId.rbId]); } - RETVOID; + return; } /** @@ -2994,22 +2600,9 @@ RlcDlRbCb *rbCb; * -# ROK In case of successful discard * -# RFAILED In case the SDU is not found or already mapped */ -#ifdef ANSI -PUBLIC S16 kwAmmDiscSdu -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -U32 sduId -) -#else -PUBLIC S16 kwAmmDiscSdu(gCb, rbCb, sduId) -RlcCb *gCb; -RlcDlRbCb *rbCb; -U32 sduId; -#endif +S16 rlcAmmDiscSdu(RlcCb *gCb,RlcDlRbCb *rbCb,uint32_t sduId ) { - TRC2(kwAmmDiscSdu); - return RFAILED; + return (RFAILED); } /** @@ -3024,25 +2617,13 @@ U32 sduId; * * @return Void */ -#ifdef ANSI -PUBLIC Void kwAmmPollRetxTmrExp -( -RlcCb *gCb, -RlcDlRbCb *rbCb -) -#else -PUBLIC Void kwAmmPollRetxTmrExp(gCb, rbCb) -RlcCb *gCb; -RlcDlRbCb *rbCb; -#endif +Void rlcAmmPollRetxTmrExp(RlcCb *gCb,RlcDlRbCb *rbCb) { - KwRetx *retx; - KwAmDl *amDl = &(rbCb->m.amDl); - KwSn sn; - KwTx *txBuf; - TRC2(kwAmmPollRetxTmrExp); + RlcRetx *retx; + RlcAmDl *amDl = &(rbCb->m.amDl); + RlcSn sn; + RlcTx *txBuf; - /* kw003.201 - Correcting the logic for determmining whether to do */ /* any transmission of PDU. As per the spec section */ /* 5.2.2.3, if there is any to transmit or retransmit, */ @@ -3060,35 +2641,35 @@ RlcDlRbCb *rbCb; } if (((amDl->nxtTx == NULLP) && (amDl->nxtRetx == NULLP)) || - KW_AM_IS_TRANS_WIN_STALLED(amDl)) + RLC_AM_IS_TRANS_WIN_STALLED(amDl)) { sn = (amDl->txNext - 1) & amDl->snModMask; - txBuf = kwUtlGetTxBuf(amDl->txBufLst, sn); + txBuf = rlcUtlGetTxBuf(amDl->txBufLst, sn); if (txBuf != NULLP) { - kwAmmDlMoveFrmTxtoRetxBuffer(gCb,amDl, &retx, sn); + rlcAmmDlMoveFrmTxtoRetxBuffer(gCb,amDl, &retx, sn); - if (AMDL.nxtRetx == NULLP) + if (RLC_AMDL.nxtRetx == NULLP) { - AMDL.nxtRetx = retx; + RLC_AMDL.nxtRetx = retx; } - kwAmmSendDStaRsp(gCb, rbCb, &AMDL); - RETVOID; + rlcAmmSendDedLcBoStatus(gCb, rbCb, &RLC_AMDL); + return; } /* Get the last node in retxLst */ - KW_LLIST_LAST_RETX(amDl->retxLst, retx); + RLC_LLIST_LAST_RETX(amDl->retxLst, retx); /* Unset wtForAck flag for the NACK PDUs */ if (retx != NULLP) { - kwAmmDlMarkPduForReTx(gCb, rbCb, retx); - kwAmmSendDStaRsp(gCb, rbCb, &AMDL); + rlcAmmDlMarkPduForReTx(gCb, rbCb, retx); + rlcAmmSendDedLcBoStatus(gCb, rbCb, &RLC_AMDL); } } - RETVOID; + return; } /** @@ -3109,40 +2690,29 @@ RlcDlRbCb *rbCb; * */ -#ifdef ANSI -PRIVATE Void kwAmmDlUpdateTxAndReTxBufForAckSn +static Void rlcAmmDlUpdateTxAndReTxBufForAckSn ( RlcCb *gCb, RlcDlRbCb *rbCb, -KwSn mAckSn, +RlcSn mAckSn, CmLList *retxNode, KwuDatCfmInfo **datCfm ) -#else -PRIVATE Void kwAmmDlUpdateTxAndReTxBufForAckSn(gCb, rbCb, mAckSn, retxNode, datCfm) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwSn mAckSn; -CmLList *retxNode; -KwuDatCfmInfo **datCfm; -#endif { - KwSn mSn; - KwSn sn; - KwRetx *retx; - KwTx *txBuf; - - TRC2(kwAmmDlUpdateTxAndReTxBufForAckSn); + RlcSn mSn; + RlcSn sn; + RlcRetx *retx; + RlcTx *txBuf; /* Remove pdus/segs from retxLst */ while (retxNode) { - retx = (KwRetx *)(retxNode->node); + retx = (RlcRetx *)(retxNode->node); retxNode = retxNode->next; - MODAMT(retx->amHdr.sn, mSn, AMDL.txNextAck,AMDL.snModMask); + MODAMT(retx->amHdr.sn, mSn, RLC_AMDL.txNextAck,RLC_AMDL.snModMask); if (mSn < mAckSn) { - kwAmmDlProcessSuccessfulReTx(gCb,rbCb, retx, datCfm); + rlcAmmDlProcessSuccessfulReTx(gCb,rbCb, retx, datCfm); } } @@ -3150,28 +2720,28 @@ KwuDatCfmInfo **datCfm; acknowledged by the ACK_SN*/ /* start from the starting of the transmission window and remove till just before ACK_SN*/ - mSn = 0; /* same as MODAMT(AMDL.txNextAck, mSn, AMDL.txNextAck);*/ - sn = AMDL.txNextAck; + mSn = 0; /* same as MODAMT(RLC_AMDL.txNextAck, mSn, RLC_AMDL.txNextAck);*/ + sn = RLC_AMDL.txNextAck; while(mSn < mAckSn) { - txBuf = kwUtlGetTxBuf(AMDL.txBufLst, sn); + txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, sn); if (txBuf != NULLP) { - RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, - "kwAmmDlUpdateTxAndReTxBufForAckSn: ACK for PDU " - "with sn = %ld UEID:%ld CELLID:%ld", + + DU_LOG("\nDEBUG --> RLC_DL : rlcAmmDlUpdateTxAndReTxBufForAckSn: ACK for PDU " + "with sn = %d UEID:%d CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); - kwAmmDlProcessSuccessfulTxPdu(gCb,rbCb, sn, datCfm); + rlcAmmDlProcessSuccessfulTxPdu(gCb,rbCb, sn, datCfm); } - sn = (sn + 1) & AMDL.snModMask; - MODAMT(sn, mSn, AMDL.txNextAck,AMDL.snModMask); + sn = (sn + 1) & RLC_AMDL.snModMask; + MODAMT(sn, mSn, RLC_AMDL.txNextAck,RLC_AMDL.snModMask); } - RETVOID; + return; } /** @@ -3191,40 +2761,28 @@ KwuDatCfmInfo **datCfm; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAmmDlUpdTxAndReTxBufForLessThanNackSn +static Void rlcAmmDlUpdTxAndReTxBufForLessThanNackSn ( RlcCb *gCb, RlcDlRbCb *rbCb, -KwSn sn, -KwSn mNackSn, +RlcSn sn, +RlcSn mNackSn, CmLList **retxNode, KwuDatCfmInfo **datCfm ) -#else -PRIVATE Void kwAmmDlUpdTxAndReTxBufForLessThanNackSn(gCb, rbCb, sn, mNackSn, retxNode, datCfm) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwSn sn; -KwSn mNackSn; -CmLList **retxNode; -KwuDatCfmInfo **datCfm; -#endif { - KwSn mSn; - KwRetx *retx; - KwTx *txBuf=NULLP; - - TRC2(kwAmmDlUpdTxAndReTxBufForLessThanNackSn); + RlcSn mSn; + RlcRetx *retx; + RlcTx *txBuf=NULLP; while (*retxNode) { - retx = (KwRetx *)((*retxNode)->node); - MODAMT(retx->amHdr.sn, mSn, AMDL.txNextAck,AMDL.snModMask); + retx = (RlcRetx *)((*retxNode)->node); + MODAMT(retx->amHdr.sn, mSn, RLC_AMDL.txNextAck,RLC_AMDL.snModMask); if (mSn < mNackSn) { (*retxNode) = (*retxNode)->next; - kwAmmDlProcessSuccessfulReTx(gCb,rbCb, retx, datCfm); + rlcAmmDlProcessSuccessfulReTx(gCb,rbCb, retx, datCfm); } else { @@ -3233,29 +2791,28 @@ KwuDatCfmInfo **datCfm; } /* Remove all pdus with SN < NACK_SN from the transmission buffer */ - MODAMT(sn, mSn, AMDL.txNextAck,AMDL.snModMask); + MODAMT(sn, mSn, RLC_AMDL.txNextAck,RLC_AMDL.snModMask); while (mSn < mNackSn) { /* this if check seems redundant,why should mSn ever be mTxSn (which actually is VT(A) */ - txBuf = kwUtlGetTxBuf(AMDL.txBufLst, sn); + txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, sn); if ((txBuf != NULLP)) { - RLOG_ARG3(L_DEBUG,DBG_RBID, rbCb->rlcId.rbId, - "kwHndlStaRsp: Handle ACK (sn = %d) UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_DL : rlcHndlStaRsp: Handle ACK (sn = %d) UEID:%d CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); /* Remove pdus from txBuf */ - kwAmmDlProcessSuccessfulTxPdu(gCb,rbCb, sn, datCfm); + rlcAmmDlProcessSuccessfulTxPdu(gCb,rbCb, sn, datCfm); } - sn = (sn + 1) & AMDL.snModMask; - MODAMT(sn, mSn, AMDL.txNextAck,AMDL.snModMask); + sn = (sn + 1) & RLC_AMDL.snModMask; + MODAMT(sn, mSn, RLC_AMDL.txNextAck,RLC_AMDL.snModMask); } - RETVOID; + return; } @@ -3275,53 +2832,37 @@ KwuDatCfmInfo **datCfm; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwConstructAmHdr -( -KwAmHdr *amHdr, -U8 *hdr, -U8 snLen, -U16 *idx -) -#else -PRIVATE Void kwConstructAmHdr(amHdr, hdr, snLen, idx) -KwAmHdr *amHdr; -U8 *hdr; -U8 snLen; -U16 *idx; -#endif +static void rlcConstructAmHdr(RlcAmHdr *amHdr, uint8_t *hdr, uint8_t snLen, uint16_t *idx) { - TRC2(kwConstructAmHdr); - *idx = 0; - hdr[0] = KW_DATA_BITMASK; + hdr[0] = RLC_DATA_BITMASK; hdr[0] = hdr[0] | (amHdr->p << 6); hdr[0] = hdr[0] | ((amHdr->si & 0x3) << 4); - if(snLen == KW_AM_CFG_12BIT_SN_LEN) + if(snLen == RLC_AM_CFG_12BIT_SN_LEN) { - hdr[0] = hdr[0] | (U8)((amHdr->sn & 0xF00) >> 8); - hdr[1] = (U8)(amHdr->sn & 0x0FF); + hdr[0] = hdr[0] | (uint8_t)((amHdr->sn & 0xF00) >> 8); + hdr[1] = (uint8_t)(amHdr->sn & 0x0FF); (*idx)++; } else { - hdr[0] = hdr[0] | (U8)((amHdr->sn & 0x30000) >> 16); - hdr[1] = (U8)((amHdr->sn & 0xFF00) >> 8); + hdr[0] = hdr[0] | (uint8_t)((amHdr->sn & 0x30000) >> 16); + hdr[1] = (uint8_t)((amHdr->sn & 0xFF00) >> 8); (*idx)++; - hdr[2] = (U8)(amHdr->sn & 0xFF); + hdr[2] = (uint8_t)(amHdr->sn & 0xFF); (*idx)++; } - if ((amHdr->si == KW_SI_MID_SEG) || (amHdr->si == KW_SI_LAST_SEG)) + if ((amHdr->si == RLC_SI_MID_SEG) || (amHdr->si == RLC_SI_LAST_SEG)) { (*idx)++; - hdr[(*idx)] = (U8)((amHdr->so & 0xFF00)>> 8); + hdr[(*idx)] = (uint8_t)((amHdr->so & 0xFF00)>> 8); (*idx)++; - hdr[(*idx)] = (U8)(amHdr->so & 0xFF); + hdr[(*idx)] = (uint8_t)(amHdr->so & 0xFF); } - RETVOID; + return; } /** @@ -3338,30 +2879,18 @@ U16 *idx; * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAmmAddPduToRetxLst -( -KwAmDl *amDl, -KwRetx *retx -) -#else -PRIVATE Void kwAmmAddPduToRetxLst(amDl, retx) -KwAmDl *amDl; -KwRetx *retx; -#endif +static Void rlcAmmAddPduToRetxLst(RlcAmDl *amDl,RlcRetx *retx) { CmLList *node; - KwRetx *tRetx; - KwSn tMSn; - KwSn retxMSn; + RlcRetx *tRetx; + RlcSn tMSn; + RlcSn retxMSn; - TRC2(kwAmmAddPduToRetxLst); - node = amDl->retxLst.last; MODAMT(retx->amHdr.sn, retxMSn, amDl->txNextAck,amDl->snModMask); while(node != NULLP) { - tRetx = (KwRetx *)(node->node); + tRetx = (RlcRetx *)(node->node); MODAMT(tRetx->amHdr.sn, tMSn, amDl->txNextAck,amDl->snModMask); if (tMSn > retxMSn) { @@ -3390,7 +2919,7 @@ KwRetx *retx; amDl->nxtRetx = retx; } - RETVOID; + return; } /** @@ -3409,56 +2938,47 @@ KwRetx *retx; * */ -#ifdef ANSI -PRIVATE Void kwAmmDlMoveFrmTxtoRetxBuffer +static Void rlcAmmDlMoveFrmTxtoRetxBuffer ( RlcCb *gCb, -KwAmDl *amDl, -KwRetx **retx, -KwSn sn +RlcAmDl *amDl, +RlcRetx **retx, +RlcSn sn ) -#else -PRIVATE Void kwAmmDlMoveFrmTxtoRetxBuffer(gCb, amDl, retx, sn) -RlcCb *gCb; -KwAmDl *amDl; -KwRetx **retx; -KwSn sn; -#endif { - KwTx* txBuf = kwUtlGetTxBuf(amDl->txBufLst, sn); - TRC2(kwAmmDlMoveFrmTxtoRetxBuffer); + RlcTx* txBuf = rlcUtlGetTxBuf(amDl->txBufLst, sn); if (txBuf == NULLP) { - RETVOID; + return; } while(txBuf->pduLst.first) { RlcDlPduInfo *pduInfo = (RlcDlPduInfo *)(txBuf->pduLst.first->node); - RLC_ALLOC_WC(gCb,*retx, sizeof(KwRetx)); + RLC_ALLOC_WC(gCb,*retx, sizeof(RlcRetx)); #if (ERRCLASS & ERRCLS_ADD_RES) if (*retx == NULLP) { - RLOG0(L_FATAL, "Memory allocation failed"); - RETVOID; + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed"); + return; } #endif /* ERRCLASS & ERRCLS_RES */ /* Move Sdu byte segment from TX buf to retx buf*/ - kwAmmDlMoveSduByteSegFrmTxtoRetxBuffer(gCb, + rlcAmmDlMoveSduByteSegFrmTxtoRetxBuffer(gCb, amDl, retx, pduInfo); /* Delete node from the txBuf Pdu lst */ cmLListDelFrm(&txBuf->pduLst, txBuf->pduLst.first); - RLC_FREE_WC(gCb, pduInfo, sizeof(RlcDlPduInfo)); + RLC_FREE(gCb, pduInfo, sizeof(RlcDlPduInfo)); } /* Remove PDU from txBuf */ - kwUtlDelTxBuf(amDl->txBufLst, txBuf,gCb); + rlcUtlDelTxBuf(amDl->txBufLst, txBuf,gCb); - RETVOID; + return; } @@ -3476,22 +2996,12 @@ KwSn sn; * * @return Void */ -#ifdef ANSI -PUBLIC Void kwAmmFreeDlRbCb -( -RlcCb *gCb, -RlcDlRbCb *rbCb -) -#else -PUBLIC Void kwAmmFreeDlRbCb(gCb,rbCb) -RlcCb *gCb; -RlcDlRbCb *rbCb; -#endif +Void rlcAmmFreeDlRbCb(RlcCb *gCb,RlcDlRbCb *rbCb) { /* stop the re-transmission timer */ - if(TRUE == kwChkTmr(gCb,(PTR)rbCb,KW_EVT_AMDL_POLL_RETX_TMR)) + if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMDL_POLL_RETX_TMR)) { - kwStopTmr(gCb,(PTR)rbCb, KW_EVT_AMDL_POLL_RETX_TMR); + rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMDL_POLL_RETX_TMR); } /* store the entire Rb pointer */ @@ -3501,9 +3011,9 @@ RlcDlRbCb *rbCb; /* the sdu queue */ cmLListCatLList(&(gCb->u.dlCb->toBeFreed.sduLst),&(rbCb->m.amDl.sduQ)); - kwUtlRaiseDlCleanupEvent(gCb); + rlcUtlRaiseDlCleanupEvent(gCb); - RETVOID; + return; } /** @@ -3514,41 +3024,26 @@ RlcDlRbCb *rbCb; * * @param[in] gCb RLC instance control block * @param[in] rbCb Downlink RB control block - * @param[in] kwDatReq The data to be passed to MAC + * @param[in] rlcDatReq The data to be passed to MAC * * @return Void * */ -#ifdef ANSI -PRIVATE Void kwAmmCreateStatusPdu -( -RlcCb *gCb, -RlcDlRbCb *rbCb, -KwDatReq *kwDatReq -) -#else -PRIVATE Void kwAmmCreateStatusPdu(gCb, rbCb, kwDatReq) -RlcCb *gCb; -RlcDlRbCb *rbCb; -KwDatReq *kwDatReq; -#endif +static void rlcAmmCreateStatusPdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) { - KwSn sn; /* sequence number */ - KwSn ack_sn; /* Ack sequence number */ + RlcSn sn; /* sequence number */ + RlcSn ack_sn; /* Ack sequence number */ Buffer *mBuf; /* control pdu buffer */ MsgLen cntrlPduSz; /* control pdu size */ - U8 cntrlPdu[KW_MAX_CNTRL_FIELDS]; /* control pdu to be added to mBuf */ - KwUdxDlStaPdu *pStaPdu; - U16 bytesToEncode = 0; /* bytes required to encode the STATUS PDU */ - U16 encIdx = 0; - U16 prevEncIdx = 0; - KwNackInfo *kwNackInfo; - U16 nkCnt = 0; + uint8_t cntrlPdu[RLC_MAX_CNTRL_FIELDS]; /* control pdu to be added to mBuf */ + RlcUdxDlStaPdu *pStaPdu; + uint16_t bytesToEncode = 0; /* bytes required to encode the STATUS PDU */ + uint16_t encIdx = 0; + uint16_t prevEncIdx = 0; + RlcNackInfo *rlcNackInfo; + uint16_t nkCnt = 0; - TRC2(kwAmmCreateStatusPdu) - - - pStaPdu = AMDL.pStaPdu; + pStaPdu = RLC_AMDL.pStaPdu; /* D/C| CPT| */ @@ -3563,7 +3058,7 @@ KwDatReq *kwDatReq; ack_sn = pStaPdu->ackSn; - if (rbCb->m.amDl.snLen == KW_AM_CFG_12BIT_SN_LEN) + if (rbCb->m.amDl.snLen == RLC_AM_CFG_12BIT_SN_LEN) { /* If alteast one NACK SN Info then set the E1 field */ @@ -3581,24 +3076,24 @@ KwDatReq *kwDatReq; { sn = pStaPdu->nackInfo[nkCnt].sn; - kwNackInfo = &(pStaPdu->nackInfo[nkCnt]); + rlcNackInfo = &(pStaPdu->nackInfo[nkCnt]); bytesToEncode += 2; /* 2 Octets for NACK SN */ /* Check if E2 : isSegment is set */ - if (kwNackInfo->isSegment) + if (rlcNackInfo->isSegment) { bytesToEncode += 4; /* 4 Octets: SOstart, SOend */ } /* Check if E3 : nackRange is set */ - if (kwNackInfo->nackRange) + if (rlcNackInfo->nackRange) { bytesToEncode += 1; /* 1 Octet: NACK range */ } /* Check if this NACK info can be accomodated in the Grant */ - if( kwDatReq->pduSz >= bytesToEncode) + if( rlcDatReq->pduSz >= bytesToEncode) { /* If there is a NACK SN before this then set its E1 bit */ @@ -3614,7 +3109,7 @@ KwDatReq *kwDatReq; /* Next Octet */ cntrlPdu[encIdx + 1] = (sn & 0xF) << 4; - if (kwNackInfo->isSegment) + if (rlcNackInfo->isSegment) { /*Set E2 Bit */ cntrlPdu[encIdx + 1] |= 0x4; @@ -3622,25 +3117,25 @@ KwDatReq *kwDatReq; /* Add soStart and soEnd */ /* SOstart */ - cntrlPdu[encIdx + 2] = (kwNackInfo->soStart) >> 8; - cntrlPdu[encIdx + 3] = kwNackInfo->soStart & 0xFF; + cntrlPdu[encIdx + 2] = (rlcNackInfo->soStart) >> 8; + cntrlPdu[encIdx + 3] = rlcNackInfo->soStart & 0xFF; /* SOend */ - cntrlPdu[encIdx + 4] = (kwNackInfo->soEnd) >> 8; - cntrlPdu[encIdx + 5] = kwNackInfo->soEnd & 0xFF; + cntrlPdu[encIdx + 4] = (rlcNackInfo->soEnd) >> 8; + cntrlPdu[encIdx + 5] = rlcNackInfo->soEnd & 0xFF; } - if (kwNackInfo->nackRange) + if (rlcNackInfo->nackRange) { /*Set E3 Bit */ cntrlPdu[encIdx + 1] |= 0x2; - if(kwNackInfo->isSegment) + if(rlcNackInfo->isSegment) { - cntrlPdu[encIdx + 6] = kwNackInfo->nackRange; + cntrlPdu[encIdx + 6] = rlcNackInfo->nackRange; } else { - cntrlPdu[encIdx + 2] = kwNackInfo->nackRange; + cntrlPdu[encIdx + 2] = rlcNackInfo->nackRange; } } @@ -3649,7 +3144,7 @@ KwDatReq *kwDatReq; /* Set ACK SN now */ else { - ack_sn = kwNackInfo->sn; + ack_sn = rlcNackInfo->sn; /* Not even one nack can be accomodated */ if (nkCnt == 0) @@ -3668,19 +3163,15 @@ KwDatReq *kwDatReq; /* set ACK SN */ { - RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, - "kwAssembleCntrlInfo: ACK PDU's SN = %d" - "UEID:%d CELLID:%d", - ack_sn, - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); + DU_LOG("\nINFO --> RLC_DL : rlcAssembleCntrlInfo: ACK PDU's SN = %d"\ + "UEID:%d CELLID:%d", ack_sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); cntrlPdu[0] |= (ack_sn & 0xF00)>> 8; - cntrlPdu[1] = (U8)ack_sn; + cntrlPdu[1] = (uint8_t)ack_sn; } } - else if (rbCb->m.amDl.snLen == KW_AM_CFG_18BIT_SN_LEN) + else if (rbCb->m.amDl.snLen == RLC_AM_CFG_18BIT_SN_LEN) { /* If alteast one NACK SN Info then set the E1 field */ if (pStaPdu->nackCount) @@ -3697,24 +3188,24 @@ KwDatReq *kwDatReq; { sn = pStaPdu->nackInfo[nkCnt].sn; - kwNackInfo = &(pStaPdu->nackInfo[nkCnt]); + rlcNackInfo = &(pStaPdu->nackInfo[nkCnt]); bytesToEncode += 3; /* 3 Octets for NACK SN */ /* Check if E2 : isSegment is set */ - if (kwNackInfo->isSegment) + if (rlcNackInfo->isSegment) { bytesToEncode += 4; /* 4 Octets: SOstart, SOend */ } /* Check if E3 : nackRange is set */ - if (kwNackInfo->nackRange) + if (rlcNackInfo->nackRange) { bytesToEncode += 1; /* 1 Octet: NACK range */ } /* Check if this NACK info can be accomodated in the Grant */ - if( kwDatReq->pduSz >= bytesToEncode) + if( rlcDatReq->pduSz >= bytesToEncode) { /* If there is a NACK SN before this then set its E1 bit */ @@ -3725,15 +3216,15 @@ KwDatReq *kwDatReq; } /* 18 BIT Nack SN encode */ - cntrlPdu[encIdx] = (U8)((sn & 0x3FC00) >> 10); + cntrlPdu[encIdx] = (uint8_t)((sn & 0x3FC00) >> 10); /* Next Octet */ - cntrlPdu[encIdx + 1] = (U8)((sn & 0x3FC) >> 2); + cntrlPdu[encIdx + 1] = (uint8_t)((sn & 0x3FC) >> 2); /* Next Octet */ - cntrlPdu[encIdx + 2] = (U8)((sn & 0x3)<< 6); + cntrlPdu[encIdx + 2] = (uint8_t)((sn & 0x3)<< 6); - if (kwNackInfo->isSegment) + if (rlcNackInfo->isSegment) { /* NACKSN E1 E2 E3 R R R */ /*Set E2 Bit */ @@ -3742,27 +3233,27 @@ KwDatReq *kwDatReq; /* Add soStart and soEnd */ /* SOstart */ - cntrlPdu[encIdx + 3] = (kwNackInfo->soStart) >> 8; - cntrlPdu[encIdx + 4] = (U8)kwNackInfo->soStart; + cntrlPdu[encIdx + 3] = (rlcNackInfo->soStart) >> 8; + cntrlPdu[encIdx + 4] = (uint8_t)rlcNackInfo->soStart; /* SOend */ - cntrlPdu[encIdx + 5] = (kwNackInfo->soEnd) >> 8; - cntrlPdu[encIdx + 6] = (U8)(kwNackInfo->soEnd); + cntrlPdu[encIdx + 5] = (rlcNackInfo->soEnd) >> 8; + cntrlPdu[encIdx + 6] = (uint8_t)(rlcNackInfo->soEnd); } - if (kwNackInfo->nackRange) + if (rlcNackInfo->nackRange) { /* NACKSN E1 E2 E3 R R R */ /*Set E3 Bit */ cntrlPdu[encIdx + 2] |= 0x08; - if (kwNackInfo->isSegment) + if (rlcNackInfo->isSegment) { - cntrlPdu[encIdx + 7] = kwNackInfo->nackRange; + cntrlPdu[encIdx + 7] = rlcNackInfo->nackRange; } else { - cntrlPdu[encIdx + 3] = kwNackInfo->nackRange; + cntrlPdu[encIdx + 3] = rlcNackInfo->nackRange; } } @@ -3771,7 +3262,7 @@ KwDatReq *kwDatReq; /* Set ACK SN now */ else { - ack_sn = kwNackInfo->sn; + ack_sn = rlcNackInfo->sn; /* Not even one nack can be accomodated */ if (nkCnt == 0) @@ -3790,13 +3281,8 @@ KwDatReq *kwDatReq; /* set ACK SN */ { - RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, - "kwAssembleCntrlInfo: ACK PDU's SN = %d" - "UEID:%d CELLID:%d", - ack_sn, - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); - + DU_LOG("\nINFO --> RLC_DL : rlcAssembleCntrlInfo: ACK PDU's SN = %d" + "UEID:%d CELLID:%d", ack_sn, rbCb->rlcId.ueId,rbCb->rlcId.cellId); cntrlPdu[0] |= (ack_sn & 0x3C000) >> 14; cntrlPdu[1] = (ack_sn & 0x3FC0) >> 6; @@ -3807,63 +3293,47 @@ KwDatReq *kwDatReq; else { /* ERROR Log */ - RLOG_ARG3(L_ERROR,DBG_RBID,rbCb->rlcId.rbId, - "kwAssembleCntrlInfo:Conf SN LEN %d is INVALID !!!! UEID:%d CELLID:%d", - rbCb->m.amDl.snLen, - rbCb->rlcId.ueId, - rbCb->rlcId.cellId); + DU_LOG("\nERROR --> RLC_DL : rlcAssembleCntrlInfo:Conf SN LEN %d is INVALID !!!! \ + UEID:%d CELLID:%d", rbCb->m.amDl.snLen, rbCb->rlcId.ueId, + rbCb->rlcId.cellId); } #ifndef L2_OPTMZ - SGetMsg(KW_GET_MEM_REGION(gCb), KW_GET_MEM_POOL(gCb),&mBuf); + SGetMsg(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb),&mBuf); #else - mBuf = (Buffer *)kwAmmStaPduList[kwAmmStaPduListCnt++]; + mBuf = (Buffer *)rlcAmmStaPduList[rlcAmmStaPduListCnt++]; SResetMBuf(mBuf); - if(kwAmmStaPduListCnt > 511) - kwAmmStaPduListCnt = 0; + if(rlcAmmStaPduListCnt > 511) + rlcAmmStaPduListCnt = 0; #endif cntrlPduSz = encIdx; - SAddPstMsgMult (cntrlPdu, cntrlPduSz, mBuf); + ODU_ADD_POST_MSG_MULT(cntrlPdu, cntrlPduSz, mBuf); - kwDatReq->pduSz -= cntrlPduSz; - /* Add mBuf to AMDL.mBuf */ - AMDL.mBuf = mBuf; + rlcDatReq->pduSz -= cntrlPduSz; + /* Add mBuf to RLC_AMDL.mBuf */ + RLC_AMDL.mBuf = mBuf; - RETVOID; + return; } #ifdef RLC_STA_PROC_IN_MAC/* RLC Status PDU Processing */ -S16 kwProcDlStatusPdu(Pst *udxPst,SuId suId, +S16 rlcProcDlStatusPdu(Pst *udxPst,SuId suId, CmLteCellId cellId,CmLteRnti rnti,CmLteLcId lcId,Buffer *rlcSdu); -#ifdef ANSI -PRIVATE Void rgAmmExtractElmnt -( -RlcCb *gCb, -Buffer *pdu, -KwExtHdr *hdrInfo -) -#else -PRIVATE Void rgAmmExtractElmnt(gCb, pdu, hdrInfo) -RlcCb *gCb; -Buffer *pdu; -KwExtHdr *hdrInfo; -#endif +static Void rgAmmExtractElmnt(RlcCb *gCb,Buffer *pdu,RlcExtHdr *hdrInfo) { - U8 hdr; - U8 pLen = hdrInfo->pLen; - U8 len = (U8)hdrInfo->len; - U16 val; - U8 tHdr; - U8 fLen; - U8 rLen; - /* U8 rLen1 = 0; */ - U16 tVal; - - TRC2(kwAmmExtractElmnt); + uint8_t hdr; + uint8_t pLen = hdrInfo->pLen; + uint8_t len = (uint8_t)hdrInfo->len; + uint16_t val; + uint8_t tHdr; + uint8_t fLen; + uint8_t rLen; + /* uint8_t rLen1 = 0; */ + uint16_t tVal; hdr = hdrInfo->hdr; @@ -3875,7 +3345,7 @@ KwExtHdr *hdrInfo; tHdr = hdr; if (len <= 8) { - val = tHdr >> (KW_BYTE_LEN - (len)); + val = tHdr >> (RLC_BYTE_LEN - (len)); hdr = hdr << len; pLen -= len; } @@ -3883,31 +3353,31 @@ KwExtHdr *hdrInfo; { fLen = pLen; val = tHdr; - val = val >> (KW_BYTE_LEN - fLen); + val = val >> (RLC_BYTE_LEN - fLen); val = val << (len - fLen); rLen = len - fLen; SRemPreMsg(&hdr, pdu); tHdr = hdr; if (rLen <= 8) { - hdr = hdr >> (KW_BYTE_LEN - rLen); + hdr = hdr >> (RLC_BYTE_LEN - rLen); val = val | hdr; hdr = tHdr << rLen; - pLen = (KW_BYTE_LEN - rLen); + pLen = (RLC_BYTE_LEN - rLen); } else { - rLen = rLen - KW_BYTE_LEN; + rLen = rLen - RLC_BYTE_LEN; tVal = hdr; tVal = tVal << rLen; val = val | tVal; SRemPreMsg(&hdr, pdu); tHdr = hdr; - hdr = hdr >> (KW_BYTE_LEN - rLen); + hdr = hdr >> (RLC_BYTE_LEN - rLen); val = val | hdr; hdr = tHdr << rLen; - pLen = (KW_BYTE_LEN - rLen); + pLen = (RLC_BYTE_LEN - rLen); } } @@ -3915,47 +3385,34 @@ KwExtHdr *hdrInfo; hdrInfo->hdr = hdr; hdrInfo->val = val; - RETVOID; + return; } -#ifdef ANSI -PRIVATE Void rgAmmUlHndlStatusPdu +static Void rgAmmUlHndlStatusPdu ( Pst *udxPst, SuId suId, -RlcCb *gCb, -RlcDlRbCb *rbCb, +RlcCb *gCb, +RlcDlRbCb *rbCb, Buffer *cntrlPdu, -U8 *fByte +uint8_t *fByte ) -#else -PRIVATE Void rgAmmUlHndlStatusPdu(udxPst,suId,gCb, rbCb, cntrlPdu, fByte) -Pst *udxPst; -SuId suId; -RlcCb *gCb; -RlcDlRbCb *rbCb; -Buffer *cntrlPdu; -U8 *fByte; -#endif { - U8 e1; - KwExtHdr hdrInfo; - KwUdxStaPdu *pStaPdu; - U8 e3; /* NACK RANGE : 5GNR */ - U32 snLen; - U32 snRange; - U32 resrvdBitsAckSn; - U32 resrvdBitsNackSn; - - - TRC2(rgAmmUlHndlStatusPdu) + uint8_t e1; + RlcExtHdr hdrInfo; + RlcUdxStaPdu *pStaPdu; + uint8_t e3; /* NACK RANGE : 5GNR */ + uint32_t snLen; + uint32_t snRange; + uint32_t resrvdBitsAckSn; + uint32_t resrvdBitsNackSn; - KWDBGP_BRIEF(gCb, "rgAmmUlHndlStatusPdu(rbCb, cntrlPdu, fByte) \n"); + RLCDBGP_BRIEF(gCb, "rgAmmUlHndlStatusPdu(rbCb, cntrlPdu, fByte) \n"); - KW_MEM_ZERO(&hdrInfo, sizeof(KwExtHdr)); + RLC_MEM_ZERO(&hdrInfo, sizeof(RlcExtHdr)); /* Extract the Control PDU */ hdrInfo.hdr = (*fByte << 1); @@ -3964,56 +3421,56 @@ U8 *fByte; /* D/C has been shifted in the calling function */ if (hdrInfo.hdr & 0xE0) { - KWDBGP_ERROR(gCb, "rgAmmUlHndlStatusPdu: Reserved value for CPT received \n"); - RETVOID; + RLCDBGP_ERROR(gCb, "rgAmmUlHndlStatusPdu: Reserved value for CPT received \n"); + return; } RLC_ALLOC_SHRABL_BUF(udxPst->region, udxPst->pool, pStaPdu, - sizeof(KwUdxStaPdu)); + sizeof(RlcUdxStaPdu)); #if (ERRCLASS & ERRCLS_ADD_RES) /* Memory allocation failure can not be expected */ if(!pStaPdu) { - RETVOID; + return; } #endif - if (rbCb->m.amDl.snLen == KW_AM_CFG_12BIT_SN_LEN) + if (rbCb->m.amDl.snLen == RLC_AM_CFG_12BIT_SN_LEN) { snLen = 12; - resrvdBitsAckSn = KW_STA_PDU_R_BITS_ACKSN_12BITS; - resrvdBitsNackSn = KW_STA_PDU_R_BITS_NACKSN_12BITS; + resrvdBitsAckSn = RLC_STA_PDU_R_BITS_ACKSN_12BITS; + resrvdBitsNackSn = RLC_STA_PDU_R_BITS_NACKSN_12BITS; } - else if (rbCb->m.amDl.snLen == KW_AM_CFG_18BIT_SN_LEN) + else if (rbCb->m.amDl.snLen == RLC_AM_CFG_18BIT_SN_LEN) { snLen = 18; - resrvdBitsAckSn = KW_STA_PDU_R_BITS_ACKSN_18BITS; - resrvdBitsNackSn = KW_STA_PDU_R_BITS_NACKSN_18BITS; + resrvdBitsAckSn = RLC_STA_PDU_R_BITS_ACKSN_18BITS; + resrvdBitsNackSn = RLC_STA_PDU_R_BITS_NACKSN_18BITS; } else { - snLen = KW_SN_LEN; + snLen = RLC_SN_LEN; resrvdBitsAckSn = 0; resrvdBitsAckSn = 0; } pStaPdu->nackCnt = 0; /* For CPT */ - hdrInfo.hdr = hdrInfo.hdr << KW_CPT_LEN; + hdrInfo.hdr = hdrInfo.hdr << RLC_CPT_LEN; /* ACK Sn */ - hdrInfo.len = KW_SN_LEN; + hdrInfo.len = RLC_SN_LEN; rgAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); pStaPdu->ackSn = hdrInfo.val; /* Check if NACK Exists */ - hdrInfo.len = KW_E1_LEN; + hdrInfo.len = RLC_E1_LEN; rgAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); - e1 = (U8)hdrInfo.val; - KWDBGP_DETAIL(gCb, "rgAmmUlHndlStatusPdu: ACK SN = %d \n", pStaPdu->ackSn); + e1 = (uint8_t)hdrInfo.val; + RLCDBGP_DETAIL(gCb, "rgAmmUlHndlStatusPdu: ACK SN = %d \n", pStaPdu->ackSn); /* Extract the Reserved Bits after ACK SN field */ hdrInfo.len = resrvdBitsAckSn; @@ -4022,30 +3479,30 @@ U8 *fByte; /* If NACK exists in control PDU */ /* For ACKs and NACKs */ - while (e1 && (pStaPdu->nackCnt < KW_MAX_NACK_CNT)) + while (e1 && (pStaPdu->nackCnt < RLC_MAX_NACK_CNT)) { hdrInfo.len = snLen; rgAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); pStaPdu->nackInfo[pStaPdu->nackCnt].sn = hdrInfo.val; - hdrInfo.len = KW_E1_LEN; + hdrInfo.len = RLC_E1_LEN; rgAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); - e1 = (U8)hdrInfo.val; + e1 = (uint8_t)hdrInfo.val; /* Extract e2 */ - /* hdrInfo.len = KW_E1_LEN; --> previusly stored value (for e1) is + /* hdrInfo.len = RLC_E1_LEN; --> previusly stored value (for e1) is already present*/ rgAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); - /* e2 = (U8) hdrInfo.val;*/ + /* e2 = (uint8_t) hdrInfo.val;*/ /* Store e2 value */ - pStaPdu->nackInfo[pStaPdu->nackCnt].isSegment = (U8) hdrInfo.val; + pStaPdu->nackInfo[pStaPdu->nackCnt].isSegment = (uint8_t) hdrInfo.val; /* Extract e3 : 5GNR */ - /* hdrInfo.len = KW_E1_LEN; --> previusly stored value (for e1) is + /* hdrInfo.len = RLC_E1_LEN; --> previusly stored value (for e1) is already present*/ rgAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); - e3 = (U8) hdrInfo.val; + e3 = (uint8_t) hdrInfo.val; /* Extract Reserved Bits after NACK SN */ hdrInfo.len = resrvdBitsNackSn; @@ -4054,14 +3511,14 @@ U8 *fByte; /* Test for resegmentation */ if (pStaPdu->nackInfo[pStaPdu->nackCnt].isSegment) { - hdrInfo.len = KW_SO_LEN_5GNR; /* 5GNR : SO Len 16 Bits */ + hdrInfo.len = RLC_SO_LEN_5GNR; /* 5GNR : SO Len 16 Bits */ rgAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); pStaPdu->nackInfo[pStaPdu->nackCnt].soStart = hdrInfo.val; rgAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); pStaPdu->nackInfo[pStaPdu->nackCnt].soEnd = hdrInfo.val; - KWDBGP_DETAIL(gCb, + RLCDBGP_DETAIL(gCb, "rgAmmUlHndlStatusPdu: soStart and soEnd = %d %d \n", pStaPdu->nackInfo[pStaPdu->nackCnt].soStart, pStaPdu->nackInfo[pStaPdu->nackCnt].soEnd); @@ -4077,9 +3534,9 @@ U8 *fByte; if (e3) { /* Extract NACK range field */ - hdrInfo.len = KW_NACK_RANGE_LEN; + hdrInfo.len = RLC_NACK_RANGE_LEN; rgAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); - snRange = (U8)hdrInfo.val; + snRange = (uint8_t)hdrInfo.val; pStaPdu->nackInfo[pStaPdu->nackCnt].nackRange = snRange; @@ -4092,9 +3549,9 @@ U8 *fByte; /* In case we have reached the MAX NACK CNT, then we should modify the ACK_SN to the last NACK SN + 1 and discard the original ACK_SN*/ - if(pStaPdu->nackCnt == KW_MAX_NACK_CNT) + if(pStaPdu->nackCnt == RLC_MAX_NACK_CNT) { - pStaPdu->ackSn = (pStaPdu->nackInfo[KW_MAX_NACK_CNT-1].sn + 1) & amDl->snModMask; + pStaPdu->ackSn = (pStaPdu->nackInfo[RLC_MAX_NACK_CNT-1].sn + 1) & amDl->snModMask; } @@ -4102,25 +3559,25 @@ U8 *fByte; //rlcUlUdxStaUpdReq(&(sapCb->pst), sapCb->spId, &rbCb->rlcId, pStaPdu); rlcUlUdxStaUpdReq(udxPst, suId, &rbCb->rlcId, pStaPdu); - RETVOID; + return; } -PUBLIC S16 kwProcDlStatusPdu(Pst *udxPst,SuId suId, +S16 rlcProcDlStatusPdu(Pst *udxPst,SuId suId, CmLteCellId cellId,CmLteRnti rnti,CmLteLcId lcId,Buffer *rlcSdu) { RlcDlRbCb *rbCb = NULLP; RlcDlUeCb *ueCb = NULLP; - U8 fByte; - U8 temp; + uint8_t fByte; + uint8_t temp; S16 retVal = RFAILED; RlcCb *gCb; Pst dlRlcPst = *udxPst; gCb = RLC_GET_RLCCB(1); /* DL RLC instance */ - if( ROK != kwDbmFetchDlUeCb(gCb,rnti,cellId,&(ueCb))) + if( ROK != rlcDbmFetchDlUeCb(gCb,rnti,cellId,&(ueCb))) { - printf("\n RLC UECb Not found...\n"); + DU_LOG("\nERROR --> RLC_DL : RLC UECb Not found...\n"); return RFAILED; } @@ -4128,7 +3585,7 @@ PUBLIC S16 kwProcDlStatusPdu(Pst *udxPst,SuId suId, rbCb = ueCb->lCh[lcId - 1].dlRbCb; /* Skip if mode is not AM */ - if((rbCb == NULLP) || (rbCb->mode != CM_LTE_MODE_AM)) + if((rbCb == NULLP) || (rbCb->mode != RLC_MODE_AM)) { return RFAILED; } @@ -4136,11 +3593,11 @@ PUBLIC S16 kwProcDlStatusPdu(Pst *udxPst,SuId suId, if(ROK != SExamMsg((Data *)(&fByte), rlcSdu, 0)) { - printf("\n Failure in Rlc Hdr SExamMsg\n"); + DU_LOG("\nERROR --> RLC_DL : Failure in Rlc Hdr SExamMsg\n"); return RFAILED; } - if(KW_CNTRL_PDU == ((fByte & KW_DC_POS) >> KW_DC_SHT)) + if(RLC_CNTRL_PDU == ((fByte & RLC_DC_POS) >> RLC_DC_SHT)) { SRemPreMsg(&temp, rlcSdu); dlRlcPst.selector = 1;/* LWLC*/