X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Fkw_amm_ul.c;h=afdd334993bcc4365b31675bd1a1f56a0a499be3;hb=de455b62ebaa9e36fe74dc36d342d7f6a22314e1;hp=a0c15ea3dbe688cd6f26faf502d450dca7b9ca26;hpb=3f340f5742e5c7c92b8541479ee7f2d670200cfb;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/kw_amm_ul.c b/src/5gnrrlc/kw_amm_ul.c index a0c15ea3d..afdd33499 100755 --- a/src/5gnrrlc/kw_amm_ul.c +++ b/src/5gnrrlc/kw_amm_ul.c @@ -35,9 +35,6 @@ File: kw_amm_ul.c *********************************************************************21*/ -static const char* RLOG_MODULE_NAME="AMM"; -static int RLOG_MODULE_ID=2048; -static int RLOG_FILE_ID=190; /* header include files (.h) */ #include "common_def.h" @@ -66,7 +63,7 @@ static int RLOG_FILE_ID=190; #ifndef RGL_SPECIFIC_CHANGES #ifndef TENB_ACC #ifndef LTE_PAL_ENB -extern U32 ulrate_rgu; +uint32_t ulrate_rgu; #endif #endif #endif @@ -74,11 +71,11 @@ extern U32 ulrate_rgu; #ifndef TENB_ACC #ifndef TENB_T2K3K_SPECIFIC_CHANGES #ifndef LTE_PAL_ENB -extern U32 isMemThreshReached(Region region); +uint32_t isMemThreshReached(Region region); #endif #else #ifndef LTE_PAL_ENB -extern U32 isMemThreshReached(Region region); +uint32_t isMemThreshReached(Region region); #endif #endif #endif @@ -90,41 +87,41 @@ extern U32 isMemThreshReached(Region region); /* private function declarations */ -void rlcAmmUlAssembleCntrlInfo ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb)); +static void rlcAmmUlAssembleCntrlInfo ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb)); -uint8_t rlcAmmExtractHdr ARGS ((RlcCb *gCb, +static uint8_t rlcAmmExtractHdr ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *pdu, RlcAmHdr *amHdr, uint8_t *fByte)); -bool rlcAmmUlPlacePduInRecBuf ARGS ((RlcCb *gCb, +static bool rlcAmmUlPlacePduInRecBuf ARGS ((RlcCb *gCb, Buffer *pdu, RlcUlRbCb *rbCb, RlcAmHdr *amHdr)); -void rlcAmmTriggerStatus ARGS ((RlcCb *gCb, +static void rlcAmmTriggerStatus ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb, RlcSn sn, bool discFlg)); -uint8_t rlcAmmUlReassembleSdus ARGS ((RlcCb *gCb, +static uint8_t rlcAmmUlReassembleSdus ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmRecBuf *recBuf)); -PRIVATE Void rlcAmmProcPduOrSeg ARGS ((RlcCb *gCb, +static Void rlcAmmProcPduOrSeg ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu)); -PRIVATE Void rlcAmmUpdExpByteSeg ARGS ((RlcCb *gCb,RlcAmUl *amUl, RlcSeg* newSeg)); +static Void rlcAmmUpdExpByteSeg ARGS ((RlcCb *gCb,RlcAmUl *amUl, RlcSeg* newSeg)); -PRIVATE Void rlcAmmExtractElmnt ARGS ((RlcCb *gCb, Buffer *pdu, RlcExtHdr *hdrInfo)); +static Void rlcAmmExtractElmnt ARGS ((RlcCb *gCb, Buffer *pdu, RlcExtHdr *hdrInfo)); -PRIVATE Void rlcAmmUlHndlStatusPdu ARGS ((RlcCb *gCb, +static Void rlcAmmUlHndlStatusPdu ARGS ((RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *cntrlPdu, - U8 *fByte)); + uint8_t *fByte)); /****************************************************************************** @@ -159,7 +156,7 @@ PRIVATE Void rlcAmmUlHndlStatusPdu ARGS ((RlcCb *gCb, * The number of bytes required to encode this NACK information * */ -uint8_t rlcAmmUlSetNackInfo(RlcUlRbCb *rbCb, RlcSn sn, bool isSegment, \ +static uint8_t rlcAmmUlSetNackInfo(RlcUlRbCb *rbCb, RlcSn sn, bool isSegment, \ uint16_t soStart, uint16_t soEnd, RlcUdxDlStaPdu *statusPdu, RlcSn *prevNackSn) { RlcNackInfo *nackInfo = (statusPdu->nackInfo + statusPdu->nackCount); @@ -172,7 +169,7 @@ uint8_t rlcAmmUlSetNackInfo(RlcUlRbCb *rbCb, RlcSn sn, bool isSegment, \ * 4) NACK_SN is continuous with previous but previous NACK_SN segments * are not missing in sequence till end */ - if((*prevNackSn == 0xffffffff) || ((((*prevNackSn) + 1) & AMUL.snModMask) != sn) || + if((*prevNackSn == 0xffffffff) || ((((*prevNackSn) + 1) & RLC_AMUL.snModMask) != sn) || (((*prevNackSn) == sn) && (((nackInfo->soEnd + 1) != soStart))) || ((nackInfo->isSegment) && (((*prevNackSn) + 1) == sn) && (nackInfo->soEnd != RLC_ALL_BYTES_MISSING))) { @@ -205,11 +202,11 @@ uint8_t rlcAmmUlSetNackInfo(RlcUlRbCb *rbCb, RlcSn sn, bool isSegment, \ if(isSegment) { - sizeToBeEncd += ((AMUL.snLen == RLC_AM_CFG_12BIT_SN_LEN)?6:7); /* NACK,E1,E2,Sostart,SoEnd */ + sizeToBeEncd += ((RLC_AMUL.snLen == RLC_AM_CFG_12BIT_SN_LEN)?6:7); /* NACK,E1,E2,Sostart,SoEnd */ } else { - sizeToBeEncd += ((AMUL.snLen == RLC_AM_CFG_12BIT_SN_LEN)?2:3); /* NACK,E1,E2 */ + sizeToBeEncd += ((RLC_AMUL.snLen == RLC_AM_CFG_12BIT_SN_LEN)?2:3); /* NACK,E1,E2 */ } } else @@ -221,7 +218,7 @@ uint8_t rlcAmmUlSetNackInfo(RlcUlRbCb *rbCb, RlcSn sn, bool isSegment, \ /* This case means there are continuous SNs/Segments. If it is the next * Sn then increment nackRnage. if same SN but different segment then * dont increment nackRange */ - if((((*prevNackSn) + 1) & AMUL.snModMask) == sn) + if((((*prevNackSn) + 1) & RLC_AMUL.snModMask) == sn) { nackInfo->nackRange++; } @@ -278,7 +275,7 @@ uint8_t rlcAmmUlSetNackInfo(RlcUlRbCb *rbCb, RlcSn sn, bool isSegment, \ * @return Void * */ -void rlcAmmUlAssembleCntrlInfo(RlcCb *gCb, RlcUlRbCb *rbCb) +static void rlcAmmUlAssembleCntrlInfo(RlcCb *gCb, RlcUlRbCb *rbCb) { RlcUdxDlStaPdu *pStatusPdu; RlcNackInfo *nackInfo; @@ -310,18 +307,18 @@ void rlcAmmUlAssembleCntrlInfo(RlcCb *gCb, RlcUlRbCb *rbCb) } #endif - sn = AMUL.rxNext; - MODAMR(sn, mSn, AMUL.rxNext, AMUL.snModMask); - MODAMR(AMUL.rxHighestStatus, rxHighestStatus, AMUL.rxNext, AMUL.snModMask); + sn = RLC_AMUL.rxNext; + MODAMR(sn, mSn, RLC_AMUL.rxNext, RLC_AMUL.snModMask); + MODAMR(RLC_AMUL.rxHighestStatus, rxHighestStatus, RLC_AMUL.rxNext, RLC_AMUL.snModMask); - recBuf = rlcUtlGetRecBuf(AMUL.recBufLst, sn); + recBuf = rlcUtlGetRecBuf(RLC_AMUL.recBufLst, sn); while (mSn < rxHighestStatus ) { /* For missing PDUs */ if ((NULLP == recBuf) && nackCnt < RLC_MAX_NACK_CNT ) { - DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: Missing PDU's SN = %d UEID:%d \ + DU_LOG("\nERROR --> RLC_UL : rlcAmmUlAssembleCntrlInfo: Missing PDU's SN = %d UEID:%d \ CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); staPduEncSize += rlcAmmUlSetNackInfo(rbCb, sn, @@ -352,9 +349,9 @@ void rlcAmmUlAssembleCntrlInfo(RlcCb *gCb, RlcUlRbCb *rbCb) pStatusPdu, &prevNackSn); - DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: Missing byte segment's" + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmUlAssembleCntrlInfo: Missing byte segment's" " SN:%d UEID:%d CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); - DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: soStart and soEnd = %d, %d \ + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmUlAssembleCntrlInfo: soStart and soEnd = %d, %d \ UEID:%d CELLID:%d", seqSo, seg->amHdr.so - 1, rbCb->rlcId.ueId, rbCb->rlcId.cellId); } @@ -376,21 +373,21 @@ void rlcAmmUlAssembleCntrlInfo(RlcCb *gCb, RlcUlRbCb *rbCb) pStatusPdu, &prevNackSn); - DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: Missing (last) byte " + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmUlAssembleCntrlInfo: Missing (last) byte " "segment's SN:%d UEID:%d CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); - DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: soStart and soEnd = %d, %d\ + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmUlAssembleCntrlInfo: soStart and soEnd = %d, %d\ UEID:%d CELLID:%d", seqSo, RLC_ALL_BYTES_MISSING, rbCb->rlcId.ueId, rbCb->rlcId.cellId); } } - sn = (sn + 1) & (AMUL.snModMask); /* MOD 1024 */ - MODAMR(sn, mSn, AMUL.rxNext, AMUL.snModMask); + sn = (sn + 1) & (RLC_AMUL.snModMask); /* MOD 1024 */ + MODAMR(sn, mSn, RLC_AMUL.rxNext, RLC_AMUL.snModMask); /* Get the received Buffer the updated/next SN */ - recBuf = rlcUtlGetRecBuf(AMUL.recBufLst, sn); + recBuf = rlcUtlGetRecBuf(RLC_AMUL.recBufLst, sn); /* Find the next missing sequence number if nackCnt reaches maximum and still Reordering window has some missing AMDPDUs / AMDPDU segments. The @@ -430,21 +427,21 @@ void rlcAmmUlAssembleCntrlInfo(RlcCb *gCb, RlcUlRbCb *rbCb) /* Update ACK SN with the last sn for which feedback is not assembled */ if ( mSn == rxHighestStatus) { - pStatusPdu->ackSn = AMUL.rxHighestStatus; + pStatusPdu->ackSn = RLC_AMUL.rxHighestStatus; } else { pStatusPdu->ackSn = sn; } - DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: ACK PDU's SN = %d" + DU_LOG("\nINFO --> RLC_UL : rlcAmmUlAssembleCntrlInfo: ACK PDU's SN = %d" "UEID:%d CELLID:%d", pStatusPdu->ackSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); pStatusPdu->controlBo = staPduEncSize; /*Its already in bytes */ - AMUL.staTrg = FALSE; - AMUL.gatherStaPduInfo = FALSE; + RLC_AMUL.staTrg = FALSE; + RLC_AMUL.gatherStaPduInfo = FALSE; if (rlcUlUdxStaPduReq(&sapCb->pst, @@ -452,7 +449,7 @@ void rlcAmmUlAssembleCntrlInfo(RlcCb *gCb, RlcUlRbCb *rbCb) &rbCb->rlcId, pStatusPdu) != ROK) { - DU_LOG("\nRLC: rlcAmmUlAssembleCntrlInfo: Failed to Send Sta Pdu UEID:%d \ + DU_LOG("\nERROR --> RLC_UL : rlcAmmUlAssembleCntrlInfo: Failed to Send Sta Pdu UEID:%d \ CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); RLC_FREE_SHRABL_BUF_WC(sapCb->pst.region, sapCb->pst.pool, @@ -464,11 +461,11 @@ void rlcAmmUlAssembleCntrlInfo(RlcCb *gCb, RlcUlRbCb *rbCb) } #ifdef XEON_SPECIFIC_CHANGES -extern U32 gRlcDatIndUL; +uint32_t gRlcDatIndUL; #endif #ifdef T2K_TRIGGER_RLC_REEST -U32 drpRlcDrbPack; +uint32_t drpRlcDrbPack; #endif /** * @brief Handler to process the PDUs received from MAC and send it to PDCP @@ -506,10 +503,10 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) MsgLen rlcSduSz; /*Holds length of Rlc Sdu*/ #endif /* LTE_L2_MEAS */ - amUl = &AMUL; + amUl = &RLC_AMUL; numPduToProcess = RLC_MIN(pduInfo->numPdu, RGU_MAX_PDU); - DU_LOG("\nRLC : rlcAmmProcessPdus: numPdu[%d],numPduToProcess[%d] UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmProcessPdus: numPdu[%d],numPduToProcess[%d] UEID:%d CELLID:%d", numPdu, numPduToProcess, rbCb->rlcId.ueId, rbCb->rlcId.cellId); while (numPdu < numPduToProcess) @@ -520,7 +517,7 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) if (! pdu) { - DU_LOG("\nRLC : rlcAmmProcessPdus: Null Pdu UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_UL : rlcAmmProcessPdus: Null Pdu UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); gCb->genSts.errorPdusRecv++; break; @@ -540,9 +537,9 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) a single pointer */ if (rlcAmmExtractHdr(gCb, rbCb, pdu, &amHdr, &fByte) != ROK) { - DU_LOG("\nRLC : rlcAmmProcessPdus: Header Extraction Failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_UL : rlcAmmProcessPdus: Header Extraction Failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); gCb->genSts.errorPdusRecv++; continue; } @@ -550,15 +547,15 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) if (amHdr.dc == 0) { rlcAmmUlHndlStatusPdu(gCb, rbCb, pdu, &fByte); - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); continue; } if((amHdr.si == RLC_SI_LAST_SEG) && (!amHdr.so)) { - DU_LOG("\nRLC: rlcAmmProcessPdus: Dropping PDU because SO can't be zero\ + DU_LOG("\nERROR --> RLC_UL : rlcAmmProcessPdus: Dropping PDU because SO can't be zero\ for last segment sn:%u UEID:%d CELLID:%d", amHdr.sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); continue; } #ifndef RGL_SPECIFIC_CHANGES @@ -569,9 +566,9 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) /* Changed the condition to TRUE from ROK */ if(isMemThreshReached(rlcCb[0]->init.region) == TRUE) { - extern U32 rlculdrop; + uint32_t rlculdrop; rlculdrop++; - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); continue; } #endif @@ -580,9 +577,9 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) /*ccpu00142274 - UL memory based flow control*/ if(isMemThreshReached(rlcCb[0]->init.region) != ROK) { - extern U32 rlculdrop; + uint32_t rlculdrop; rlculdrop++; - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); continue; } #endif @@ -596,7 +593,7 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) { if(rbCb->rlcId.rbType == CM_LTE_DRB) { - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); continue; } } @@ -622,7 +619,7 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) { amUl->rxNextHighestRcvd = ((sn + 1) & (amUl->snModMask)); - DU_LOG("\nRLC: rlcAmmProcessPdus: Updated rxNextHighestRcvd = %d UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmProcessPdus: Updated rxNextHighestRcvd = %d UEID:%d CELLID:%d", amUl->rxNextHighestRcvd, rbCb->rlcId.ueId, rbCb->rlcId.cellId); } @@ -648,8 +645,7 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) { if ((NULLP == recBuf) || (!recBuf->allRcvd)) { - RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, - "rlcAmmProcessPdus: Updated rxHighestStatus:%d " + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmProcessPdus: Updated rxHighestStatus:%d " "UEID:%d CELLID:%d", tSn, rbCb->rlcId.ueId, @@ -695,29 +691,34 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) } } - /* Check if reOrdTmr is running and update rxNextStatusTrig accordingly */ - tmrRunning = rlcChkTmr(gCb,(PTR)rbCb, RLC_EVT_AMUL_REORD_TMR); + /* Check if reAsmblTmr is running and update rxNextStatusTrig accordingly */ + tmrRunning = rlcChkTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); if (tmrRunning) { Bool snInWin = RLC_AM_CHK_SN_WITHIN_RECV_WINDOW(amUl->rxNextStatusTrig, amUl); - - if ( (amUl->rxNextStatusTrig == amUl->rxNext) || ( (!snInWin) && - (amUl->rxNextStatusTrig != amUl->vrMr) ) ) + /* spec 38.322v15.3.0 - 5.2.3.2.3 */ + if((amUl->rxNextStatusTrig == amUl->rxNext) || ( (!snInWin) && + (amUl->rxNextStatusTrig != amUl->vrMr) )|| + (amUl->rxNextStatusTrig == amUl->rxNext && recBuf &&recBuf->noMissingSeg)) { - rlcStopTmr(gCb,(PTR)rbCb, RLC_EVT_AMUL_REORD_TMR); + rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); tmrRunning = FALSE; + DU_LOG("\nINFO --> RLC_UL: rlcAmmProcessPdus: Stopped ReAssembly Timer rxNextStatusTigger = %d" + "rxNextReassembly = %d", amUl->rxNextStatusTrig, amUl->rxNext); } } if (!tmrRunning) { - if (amUl->rxNextHighestRcvd > amUl->rxNext) + /* spec 38.322v15.3.0 - 5.2.3.2.3 */ + if((amUl->rxNextHighestRcvd > amUl->rxNext) || ((amUl->rxNextHighestRcvd == amUl->rxNext) && + (recBuf && (!recBuf->noMissingSeg)))) { - rlcStartTmr(gCb,(PTR)rbCb, RLC_EVT_AMUL_REORD_TMR); + rlcStartTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); amUl->rxNextStatusTrig = amUl->rxNextHighestRcvd; - DU_LOG("\nRLC: rlcAmmProcessPdus: Updated rxNextStatusTrig = %d \ - UEID:%d CELLID:%d", amUl->rxNextStatusTrig, rbCb->rlcId.ueId, + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmProcessPdus: Updated rxNextStatusTrig = %d" + "UEID:%d CELLID:%d", amUl->rxNextStatusTrig, rbCb->rlcId.ueId, rbCb->rlcId.cellId); } } @@ -768,7 +769,7 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) * -# RFAILED * */ -uint8_t rlcAmmExtractHdr(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *pdu, RlcAmHdr *amHdr, uint8_t *fByte) +static uint8_t rlcAmmExtractHdr(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *pdu, RlcAmHdr *amHdr, uint8_t *fByte) { uint8_t snByte; RlcSn sn = 0; @@ -783,7 +784,7 @@ uint8_t rlcAmmExtractHdr(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *pdu, RlcAmHdr *amH amHdr->dc = (*fByte & RLC_DC_POS) >> RLC_DC_SHT; if (RLC_CNTRL_PDU == amHdr->dc) { - //printf ("++++++++++++ 5GNRLOG HDR extracted CTRL : \n"); + //DU_LOG ("\nINFO --> RLC_UL : ++++++++++++ 5GNRLOG HDR extracted CTRL : \n"); return ROK; } @@ -808,7 +809,7 @@ uint8_t rlcAmmExtractHdr(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *pdu, RlcAmHdr *amH amHdr->sn = sn; } - if ((amHdr->si != 0) && (amHdr->si != 0x01)) + if ((amHdr->si != 0) && (amHdr->si != RLC_SI_FIRST_SEG)) { hdrInfo.len = RLC_SO_LEN_5GNR; rlcAmmExtractElmnt(gCb, pdu, &hdrInfo); @@ -841,25 +842,11 @@ uint8_t rlcAmmExtractHdr(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *pdu, RlcAmHdr *amH * -# RFAILED * */ -#ifdef ANSI -PRIVATE S16 rlcAmmExtractHdrOld -( -RlcCb *gCb, -Buffer *pdu, -RlcAmHdr *amHdr, -U8 *fByte -) -#else -PRIVATE S16 rlcAmmExtractHdrOld(gCb, pdu, amHdr, fByte) -RlcCb *gCb; -Buffer *pdu; -RlcAmHdr *amHdr; -U8 *fByte; -#endif +static S16 rlcAmmExtractHdrOld(RlcCb *gCb,Buffer *pdu,RlcAmHdr *amHdr,uint8_t *fByte) { - U8 e; - U8 snByte; - U16 sn; + uint8_t e; + uint8_t snByte; + uint16_t sn; MsgLen pduSz; MsgLen totalSz = 0; RlcExtHdr hdrInfo; @@ -882,14 +869,14 @@ U8 *fByte; e = amHdr->e = (*fByte & RLC_E_POS)>> RLC_E_SHT; SRemPreMsg(&snByte, pdu); - sn = (U16)(((*fByte & RLC_SN_POS) << RLC_BYTE_LEN ) | snByte); + sn = (uint16_t)(((*fByte & RLC_SN_POS) << RLC_BYTE_LEN ) | snByte); amHdr->sn = sn; if (amHdr->rf == 1) { /* Extract extn part of the header */ hdrInfo.len = RLC_LSF_LEN; rlcAmmExtractElmnt(gCb, pdu, &hdrInfo); - amHdr->lsf = (U8)hdrInfo.val; + amHdr->lsf = (uint8_t)hdrInfo.val; hdrInfo.len = RLC_SO_LEN; rlcAmmExtractElmnt(gCb, pdu, &hdrInfo); @@ -903,7 +890,7 @@ U8 *fByte; { hdrInfo.len = RLC_E_LEN; rlcAmmExtractElmnt(gCb, pdu, &hdrInfo); - e = amHdr->e = (U8)hdrInfo.val; + e = amHdr->e = (uint8_t)hdrInfo.val; /* Extract LI value*/ hdrInfo.len = RLC_LI_LEN; @@ -913,7 +900,7 @@ U8 *fByte; /* check if LI is zero */ if (! hdrInfo.val) { - RLOG0(L_ERROR, "Received LI as 0"); + DU_LOG("\nERROR --> RLC_UL : Received LI as 0"); return RFAILED; } @@ -925,7 +912,7 @@ U8 *fByte; /*ccpu00122597:PDU is dropped if liCnt exceeds RLC_MAX_LI*/ if(e && (amHdr->numLi >= RLC_MAX_UL_LI)) { - RLOG2(L_ERROR,"LI Count [%u] exceeds Max LI Count[%u]", + DU_LOG("\nERROR --> RLC_UL : LI Count [%u] exceeds Max LI Count[%u]", amHdr->numLi, RLC_MAX_UL_LI); return RFAILED; } @@ -935,7 +922,7 @@ U8 *fByte; if ( totalSz >= pduSz ) { - RLOG3(L_ERROR,"SN [%d]:Corrupted PDU as TotSz[%lu] PduSz[%lu] ", + DU_LOG("\nERROR --> RLC_UL : SN [%d]:Corrupted PDU as TotSz[%lu] PduSz[%lu] ", amHdr->sn, totalSz, pduSz); return RFAILED; } @@ -963,7 +950,7 @@ U8 *fByte; * @return Void * */ -void rlcAmmUlHndlStatusPdu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *cntrlPdu, uint8_t *fByte) +static void rlcAmmUlHndlStatusPdu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *cntrlPdu, uint8_t *fByte) { uint8_t e1; RlcExtHdr hdrInfo; @@ -984,7 +971,7 @@ void rlcAmmUlHndlStatusPdu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *cntrlPdu, uint8_ /* D/C has been shifted in the calling function */ if (hdrInfo.hdr & 0xE0) { - DU_LOG("\nRLC: rlcAmmUlHndlStatusPdu: Reserved value for CPT received UEID:%d \ + DU_LOG("\nINFO --> RLC_UL : rlcAmmUlHndlStatusPdu: Reserved value for CPT received UEID:%d \ CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); return; } @@ -1032,12 +1019,12 @@ void rlcAmmUlHndlStatusPdu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *cntrlPdu, uint8_ rlcAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); pStaPdu->ackSn = hdrInfo.val; - //printf ("++++++++++++ 5GNRLOG HNDL STATUS acksn %d : \n", pStaPdu->ackSn); + //DU_LOG ("\nINFO --> RLC_UL : ++++++++++++ 5GNRLOG HNDL STATUS acksn %d : \n", pStaPdu->ackSn); /* Check if NACK Exists */ hdrInfo.len = RLC_E1_LEN; rlcAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); - e1 = (U8)hdrInfo.val; - DU_LOG("\nRLC: rlcAmmUlHndlStatusPdu: ACK SN = %d UEID:%d CELLID:%d", + e1 = (uint8_t)hdrInfo.val; + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmUlHndlStatusPdu: ACK SN = %d UEID:%d CELLID:%d", pStaPdu->ackSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); /* Extract the Reserved Bits after ACK SN field */ @@ -1054,22 +1041,22 @@ void rlcAmmUlHndlStatusPdu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *cntrlPdu, uint8_ hdrInfo.len = RLC_E1_LEN; rlcAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); - e1 = (U8)hdrInfo.val; + e1 = (uint8_t)hdrInfo.val; /* Extract e2 */ /* hdrInfo.len = RLC_E1_LEN; --> previusly stored value (for e1) is already present*/ rlcAmmExtractElmnt(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 = RLC_E1_LEN; --> previusly stored value (for e1) is already present*/ rlcAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); - e3 = (U8) hdrInfo.val; + e3 = (uint8_t) hdrInfo.val; /* Extract Reserved Bits after NACK SN */ hdrInfo.len = resrvdBitsNackSn; @@ -1085,7 +1072,7 @@ void rlcAmmUlHndlStatusPdu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *cntrlPdu, uint8_ rlcAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); pStaPdu->nackInfo[pStaPdu->nackCnt].soEnd = hdrInfo.val; - DU_LOG("\nRLC: rlcAmmUlHndlStatusPdu: soStart and soEnd = %d %d" + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmUlHndlStatusPdu: soStart and soEnd = %d %d" "UEID:%d CELLID:%d", pStaPdu->nackInfo[pStaPdu->nackCnt].soStart, pStaPdu->nackInfo[pStaPdu->nackCnt].soEnd, rbCb->rlcId.ueId, rbCb->rlcId.cellId); @@ -1103,7 +1090,7 @@ void rlcAmmUlHndlStatusPdu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *cntrlPdu, uint8_ /* Extract NACK range field */ hdrInfo.len = RLC_NACK_RANGE_LEN; rlcAmmExtractElmnt(gCb, cntrlPdu, &hdrInfo); - snRange = (U8)hdrInfo.val; + snRange = (uint8_t)hdrInfo.val; pStaPdu->nackInfo[pStaPdu->nackCnt].nackRange = snRange; @@ -1141,16 +1128,16 @@ void rlcAmmUlHndlStatusPdu(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *cntrlPdu, uint8_ * @return Void * */ -void rlcAmmUlRlsAllSegs(RlcCb *gCb, RlcAmRecBuf *recBuf) +static void rlcAmmUlRlsAllSegs(RlcCb *gCb, RlcAmRecBuf *recBuf) { RlcSeg *seg; RLC_LLIST_FIRST_SEG(recBuf->segLst, seg); while (seg != NULLP) { - RLC_FREE_BUF_WC(seg->seg); + ODU_PUT_MSG_BUF(seg->seg); cmLListDelFrm(&(recBuf->segLst),&(seg->lstEnt)); - RLC_FREE_WC(gCb,seg, sizeof(RlcSeg)); + RLC_FREE(gCb,seg, sizeof(RlcSeg)); RLC_LLIST_FIRST_SEG(recBuf->segLst, seg); } @@ -1177,7 +1164,7 @@ void rlcAmmUlRlsAllSegs(RlcCb *gCb, RlcAmRecBuf *recBuf) * -#TRUE Successful insertion into the receiver buffer * -#FALSE Possibly a duplicate segment */ -bool rlcAmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu, uint16_t pduSz) +static bool rlcAmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu, uint16_t pduSz) { RlcAmRecBuf *recBuf = NULLP; RlcSeg *seg; @@ -1186,7 +1173,7 @@ bool rlcAmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu, uint16_t expSo = 0; /* Expected SO */ soEnd = amHdr->so + pduSz - 1; - recBuf = rlcUtlGetRecBuf(AMUL.recBufLst, amHdr->sn); + recBuf = rlcUtlGetRecBuf(RLC_AMUL.recBufLst, amHdr->sn); if (NULLP == recBuf) { @@ -1194,20 +1181,20 @@ bool rlcAmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu, #if (ERRCLASS & ERRCLS_ADD_RES) if (recBuf == NULLP) { - DU_LOG("\nRLC: rlcAmmAddRcvdSeg: Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_UL : rlcAmmAddRcvdSeg: Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); return FALSE; } #endif /* ERRCLASS & ERRCLS_RES */ - rlcUtlStoreRecBuf(AMUL.recBufLst, recBuf, amHdr->sn); + rlcUtlStoreRecBuf(RLC_AMUL.recBufLst, recBuf, amHdr->sn); } else { if (recBuf->allRcvd == TRUE) { - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); return FALSE; } } @@ -1227,7 +1214,7 @@ bool rlcAmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu, { /* This is a duplicate segment */ gRlcStats.amRlcStats.numRlcAmCellDupPduRx++; - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); return FALSE; } @@ -1235,7 +1222,7 @@ bool rlcAmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu, { /* This is a duplicate segment */ gRlcStats.amRlcStats.numRlcAmCellDupPduRx++; - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); return FALSE; } @@ -1246,9 +1233,9 @@ bool rlcAmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu, #if (ERRCLASS & ERRCLS_ADD_RES) if (tseg == NULLP) { - DU_LOG("\nRLC: rlcAmmAddRcvdSeg: Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_UL : rlcAmmAddRcvdSeg: Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); return FALSE; } #endif /* ERRCLASS & ERRCLS_RES */ @@ -1269,7 +1256,7 @@ bool rlcAmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu, cmLListInsCrnt(&recBuf->segLst, &tseg->lstEnt); } tseg->lstEnt.node = (PTR)tseg; - rlcAmmUpdExpByteSeg(gCb,&AMUL,tseg); + rlcAmmUpdExpByteSeg(gCb,&RLC_AMUL,tseg); return TRUE; } @@ -1292,7 +1279,7 @@ bool rlcAmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu, * -# FALSE * */ -bool rlcAmmUlPlacePduInRecBuf(RlcCb *gCb, Buffer *pdu, RlcUlRbCb *rbCb, RlcAmHdr *amHdr) +static bool rlcAmmUlPlacePduInRecBuf(RlcCb *gCb, Buffer *pdu, RlcUlRbCb *rbCb, RlcAmHdr *amHdr) { RlcSn sn; MsgLen pduSz; @@ -1306,11 +1293,11 @@ bool rlcAmmUlPlacePduInRecBuf(RlcCb *gCb, Buffer *pdu, RlcUlRbCb *rbCb, RlcAmHdr if (!RLC_AM_CHK_SN_WITHIN_RECV_WINDOW(sn, amUl)) { gRlcStats.amRlcStats.numRlcAmCellDropOutWinRx++; - DU_LOG("\nRLC: rlcAmmUlPlacePduInRecBuf: SN %d outside the window" + DU_LOG("\nERROR --> RLC_UL : rlcAmmUlPlacePduInRecBuf: SN %d outside the window" "UEID:%d CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); gCb->genSts.unexpPdusRecv++; - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); return FALSE; } @@ -1327,13 +1314,13 @@ bool rlcAmmUlPlacePduInRecBuf(RlcCb *gCb, Buffer *pdu, RlcUlRbCb *rbCb, RlcAmHdr #if (ERRCLASS & ERRCLS_ADD_RES) if (recBuf == NULLP) { - DU_LOG("\nRLC: rlcAmmUlPlacePduInRecBuf: Memory allocation failed \ + DU_LOG("\nERROR --> RLC_UL : rlcAmmUlPlacePduInRecBuf: Memory allocation failed \ UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); return FALSE; } #endif /* ERRCLASS & ERRCLS_RES */ - rlcUtlStoreRecBuf(AMUL.recBufLst, recBuf, sn); + rlcUtlStoreRecBuf(RLC_AMUL.recBufLst, recBuf, sn); } else if (recBuf->allRcvd != TRUE) { @@ -1343,7 +1330,7 @@ bool rlcAmmUlPlacePduInRecBuf(RlcCb *gCb, Buffer *pdu, RlcUlRbCb *rbCb, RlcAmHdr { gRlcStats.amRlcStats.numRlcAmCellDupPduRx++; gCb->genSts.unexpPdusRecv++; - RLC_FREE_BUF(pdu); + ODU_PUT_MSG_BUF(pdu); return FALSE; } recBuf->isDelvUpperLayer = FALSE; @@ -1374,7 +1361,7 @@ bool rlcAmmUlPlacePduInRecBuf(RlcCb *gCb, Buffer *pdu, RlcUlRbCb *rbCb, RlcAmHdr * staTrg flag. * - If staProhTmr is not running, calculate cntrlBo, else it'll be * updated at the expiry of staProhTmr. - * - Expiry of reOrdTmr also will set staTrg flag. + * - Expiry of reAsmblTmr also will set staTrg flag. * * @param[in] gCb RLC instance control block * @param[in] rbCb Uplink RB control block @@ -1385,7 +1372,7 @@ bool rlcAmmUlPlacePduInRecBuf(RlcCb *gCb, Buffer *pdu, RlcUlRbCb *rbCb, RlcAmHdr * @return Void * */ -void rlcAmmTriggerStatus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcSn sn, bool discFlg) +static void rlcAmmTriggerStatus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcSn sn, bool discFlg) { bool tmrRunning; RlcSn tSn; @@ -1401,14 +1388,14 @@ void rlcAmmTriggerStatus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcSn sn, bool discFlg) * The "=" in the 2nd condition is removed */ if ((discFlg) || (tSn < trxHighestStatus) || (tSn >= tVrMr)) { - DU_LOG("\nRLC: rlcAmmTriggerStatus: Set Status Trigger UEID:%d CELLID:%d", + DU_LOG("\nINFO --> RLC_UL : rlcAmmTriggerStatus: Set Status Trigger UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); amUl->staTrg = TRUE; amUl->gatherStaPduInfo = FALSE; /* Check if staProhTmr is running */ - tmrRunning = rlcChkTmr(gCb,(PTR) rbCb, RLC_EVT_AMUL_STA_PROH_TMR); + tmrRunning = rlcChkTmr(gCb,(PTR) rbCb, EVENT_RLC_AMUL_STA_PROH_TMR); if (!tmrRunning) { @@ -1437,42 +1424,41 @@ void rlcAmmTriggerStatus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcSn sn, bool discFlg) * @return Void * */ -void rlcAmmProcPduOrSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu) +static void rlcAmmProcPduOrSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pdu) { - if ((AMUL.expSn != amHdr->sn) || (AMUL.expSo != amHdr->so)) + if ((RLC_AMUL.expSn != amHdr->sn) || (RLC_AMUL.expSo != amHdr->so)) { /* Release the existing partial SDU as we have PDUs or */ /* segments that are out of sequence */ rbCb->m.amUl.isOutOfSeq = TRUE; - RLC_FREE_BUF(AMUL.partialSdu); + ODU_PUT_MSG_BUF(RLC_AMUL.partialSdu); } - //if (amHdr->fi & RLC_FI_FIRST_SEG) - if (amHdr->si == 0x01) + if (amHdr->si == RLC_SI_FIRST_SEG) {/* first Segment of the SDU */ - if (AMUL.partialSdu != NULLP) + if (RLC_AMUL.partialSdu != NULLP) { /* Some old SDU may be present */ - RLC_FREE_BUF_WC(AMUL.partialSdu); + ODU_PUT_MSG_BUF(RLC_AMUL.partialSdu); } - AMUL.partialSdu = pdu; + RLC_AMUL.partialSdu = pdu; pdu = NULLP; } - else if(amHdr->si == 0x03) + else if(amHdr->si == RLC_SI_MID_SEG) {/* Middle or last segment of the SUD */ - ODU_CAT_MSG(AMUL.partialSdu,pdu, M1M2); - RLC_FREE_BUF_WC(pdu); + ODU_CAT_MSG(RLC_AMUL.partialSdu,pdu, M1M2); + ODU_PUT_MSG_BUF(pdu); pdu = NULLP; } - else if (amHdr->si == 0x02) + else if (amHdr->si == RLC_SI_LAST_SEG) { - ODU_CAT_MSG(pdu,AMUL.partialSdu,M2M1); - RLC_FREE_BUF_WC(AMUL.partialSdu); + ODU_CAT_MSG(pdu,RLC_AMUL.partialSdu,M2M1); + ODU_PUT_MSG_BUF(RLC_AMUL.partialSdu); } if (pdu != NULLP) { - AMUL.partialSdu = NULLP; + RLC_AMUL.partialSdu = NULLP; rlcUtlSendUlDataToDu(gCb,rbCb, pdu); } @@ -1499,7 +1485,7 @@ void rlcAmmProcPduOrSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buffer *pd * -# RFAILED * */ -uint8_t rlcAmmUlReassembleSdus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmRecBuf *recBuf) +static uint8_t rlcAmmUlReassembleSdus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmRecBuf *recBuf) { RlcSeg *seg; @@ -1510,27 +1496,27 @@ uint8_t rlcAmmUlReassembleSdus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmRecBuf *recBuf) rlcAmmProcPduOrSeg(gCb,rbCb, &recBuf->amHdr, recBuf->pdu); /* Assign NULLP to recBuf->pdu as this PDU is sent to PDCP */ recBuf->pdu = NULLP; - AMUL.expSn = (recBuf->amHdr.sn + 1) & (AMUL.snModMask); /* MOD 1024 */ - AMUL.expSo = 0; + RLC_AMUL.expSn = (recBuf->amHdr.sn + 1) & (RLC_AMUL.snModMask); /* MOD 1024 */ + RLC_AMUL.expSo = 0; } else { /* This is a set of segments */ RLC_LLIST_FIRST_SEG(recBuf->segLst, seg); - AMUL.expSn = recBuf->amHdr.sn; - AMUL.expSo = 0; + RLC_AMUL.expSn = recBuf->amHdr.sn; + RLC_AMUL.expSo = 0; while(seg) { rlcAmmProcPduOrSeg(gCb,rbCb, &seg->amHdr, seg->seg); - AMUL.expSo = seg->soEnd + 1; + RLC_AMUL.expSo = seg->soEnd + 1; cmLListDelFrm(&(recBuf->segLst),&(seg->lstEnt)); - RLC_FREE_WC(gCb, seg, sizeof(RlcSeg)); + RLC_FREE(gCb, seg, sizeof(RlcSeg)); RLC_LLIST_FIRST_SEG(recBuf->segLst, seg); } - AMUL.expSn = (recBuf->amHdr.sn + 1) & (AMUL.snModMask); /* MOD 1024 */ - AMUL.expSo = 0; + RLC_AMUL.expSn = (recBuf->amHdr.sn + 1) & (RLC_AMUL.snModMask); /* MOD 1024 */ + RLC_AMUL.expSo = 0; } return ROK; @@ -1547,21 +1533,7 @@ uint8_t rlcAmmUlReassembleSdus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmRecBuf *recBuf) * @return Void * */ -#ifdef ANSI -Void rlcAmmUlReEstablish -( -RlcCb *gCb, -CmLteRlcId rlcId, -Bool sendReEst, -RlcUlRbCb *rbCb -) -#else -Void rlcAmmUlReEstablish(gCb, rlcId, sendReEst, rbCb) -RlcCb *gCb; -CmLteRlcId rlcId; -Bool sendReEst; -RlcUlRbCb *rbCb; -#endif +Void rlcAmmUlReEstablish(RlcCb *gCb,CmLteRlcId rlcId,Bool sendReEst,RlcUlRbCb *rbCb) { RlcSn sn; RlcSn mSn; @@ -1572,15 +1544,15 @@ RlcUlRbCb *rbCb; #endif RlcAmRecBuf *recBuf = NULLP; - sn = AMUL.rxNext; + sn = RLC_AMUL.rxNext; - MODAMR(AMUL.vrMr, mVrMr, AMUL.rxNext, AMUL.snModMask); - MODAMR(sn, mSn, AMUL.rxNext, AMUL.snModMask); + MODAMR(RLC_AMUL.vrMr, mVrMr, RLC_AMUL.rxNext, RLC_AMUL.snModMask); + MODAMR(sn, mSn, RLC_AMUL.rxNext, RLC_AMUL.snModMask); /* Reassemble SDUs from PDUs with SN less than upper edge of the window */ while (mSn < mVrMr) { - recBuf = rlcUtlGetRecBuf(AMUL.recBufLst, sn); + recBuf = rlcUtlGetRecBuf(RLC_AMUL.recBufLst, sn); if (NULLP != recBuf) { if (recBuf->allRcvd == TRUE) @@ -1592,40 +1564,40 @@ RlcUlRbCb *rbCb; /* Remove PDU and segments */ if(recBuf->pdu) { - RLC_FREE_BUF_WC(recBuf->pdu); + ODU_PUT_MSG_BUF(recBuf->pdu); } /* Release all the segments*/ rlcAmmUlRlsAllSegs(gCb,recBuf); } - rlcUtlDelRecBuf(AMUL.recBufLst, recBuf, gCb); + rlcUtlDelRecBuf(RLC_AMUL.recBufLst, recBuf, gCb); } - sn = (sn + 1) & (AMUL.snModMask); /* MOD 1024 */ - MODAMR(sn, mSn, AMUL.rxNext, AMUL.snModMask); + sn = (sn + 1) & (RLC_AMUL.snModMask); /* MOD 1024 */ + MODAMR(sn, mSn, RLC_AMUL.rxNext, RLC_AMUL.snModMask); } /* Discard remaining PDUs and bytesegments in recBuf */ /* Stop all timers and reset variables */ - if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,RLC_EVT_AMUL_REORD_TMR)) + if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMUL_REASSEMBLE_TMR)) { - rlcStopTmr(gCb,(PTR)rbCb, RLC_EVT_AMUL_REORD_TMR); + rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); } - if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,RLC_EVT_AMUL_STA_PROH_TMR)) + if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMUL_STA_PROH_TMR)) { - rlcStopTmr(gCb,(PTR)rbCb, RLC_EVT_AMUL_STA_PROH_TMR); + rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_STA_PROH_TMR); } - AMUL.rxNext = 0; - AMUL.rxNextHighestRcvd = 0; - AMUL.rxNextStatusTrig = 0; + RLC_AMUL.rxNext = 0; + RLC_AMUL.rxNextHighestRcvd = 0; + RLC_AMUL.rxNextStatusTrig = 0; rbCb->m.amUl.vrMr = (rbCb->m.amUl.rxNext + RLC_AM_GET_WIN_SZ(rbCb->m.amUl.snLen)) & (rbCb->m.amUl.snModMask); - AMUL.rxHighestStatus = 0; - AMUL.staTrg = FALSE; - AMUL.gatherStaPduInfo = FALSE; - AMUL.expSn = 0; - AMUL.expSo = 0; - if (AMUL.partialSdu != NULLP) + RLC_AMUL.rxHighestStatus = 0; + RLC_AMUL.staTrg = FALSE; + RLC_AMUL.gatherStaPduInfo = FALSE; + RLC_AMUL.expSn = 0; + RLC_AMUL.expSo = 0; + if (RLC_AMUL.partialSdu != NULLP) { - RLC_FREE_BUF(AMUL.partialSdu); + ODU_PUT_MSG_BUF(RLC_AMUL.partialSdu); } rlcKwuSap = gCb->u.ulCb->rlcKwuUlSap + RLC_UI_PDCP; @@ -1635,7 +1607,7 @@ RlcUlRbCb *rbCb; rbCb->m.amUl.isOutOfSeq = FALSE; } - RETVOID; + return; } /** @@ -1651,17 +1623,7 @@ RlcUlRbCb *rbCb; * */ -#ifdef ANSI -Void rlcAmmReOrdTmrExp -( -RlcCb *gCb, -RlcUlRbCb *rbCb -) -#else -Void rlcAmmReOrdTmrExp(rbCb) -RlcCb *gCb; -RlcUlRbCb *rbCb; -#endif +Void rlcAmmReAsmblTmrExp(RlcCb *gCb,RlcUlRbCb *rbCb) { RlcAmUl *amUl = &(rbCb->m.amUl); RlcSn sn; @@ -1677,7 +1639,7 @@ RlcUlRbCb *rbCb; MODAMR(sn, mSn, amUl->rxNext, amUl->snModMask); MODAMR(amUl->vrMr, mVrMr, amUl->rxNext, amUl->snModMask); - recBuf = rlcUtlGetRecBuf(AMUL.recBufLst, sn); + recBuf = rlcUtlGetRecBuf(RLC_AMUL.recBufLst, sn); while (mSn < mVrMr) { @@ -1689,11 +1651,11 @@ RlcUlRbCb *rbCb; amUl->gatherStaPduInfo = FALSE; /* Check if staProhTmr is running */ - tmrRunning = rlcChkTmr(gCb,(PTR) rbCb, RLC_EVT_AMUL_STA_PROH_TMR); + tmrRunning = rlcChkTmr(gCb,(PTR) rbCb, EVENT_RLC_AMUL_STA_PROH_TMR); if (!tmrRunning) { - gRlcStats.amRlcStats.numULReOrdTimerExpires++; + gRlcStats.amRlcStats.numULReAsmblTimerExpires++; amUl->gatherStaPduInfo = TRUE; rlcAmmUlAssembleCntrlInfo(gCb, rbCb); } @@ -1707,14 +1669,16 @@ RlcUlRbCb *rbCb; /* Update rxNextStatusTrig */ MODAMR(amUl->rxNextHighestRcvd, mrxNextHighestRcvd, amUl->rxNext, amUl->snModMask); MODAMR(amUl->rxHighestStatus, mrxHighestStatus, amUl->rxNext, amUl->snModMask); - if (mrxNextHighestRcvd > mrxHighestStatus) + /* spec 38.322v15.3.0 - 5.2.3.2.4 */ + if((mrxNextHighestRcvd > mrxHighestStatus) || ((mrxNextHighestRcvd == mrxHighestStatus) && + ((recBuf) && !(recBuf->noMissingSeg)))) { - rlcStartTmr(gCb,(PTR)rbCb, RLC_EVT_AMUL_REORD_TMR); + rlcStartTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); amUl->rxNextStatusTrig = amUl->rxNextHighestRcvd; } - RETVOID; -} /* rlcAmmReOrdTmrExp */ + return; +} /* rlcAmmReAsmblTmrExp */ /** * @brief Handler for status prohibit timer expiry @@ -1730,17 +1694,7 @@ RlcUlRbCb *rbCb; * */ -#ifdef ANSI -Void rlcAmmStaProTmrExp -( -RlcCb *gCb, -RlcUlRbCb *rbCb -) -#else -Void rlcAmmStaProTmrExp(gCb, rbCb) -RlcCb *gCb; -RlcUlRbCb *rbCb; -#endif +Void rlcAmmStaProTmrExp(RlcCb *gCb,RlcUlRbCb *rbCb) { RlcAmUl *amUl = &(rbCb->m.amUl); @@ -1753,7 +1707,7 @@ RlcUlRbCb *rbCb; rlcAmmUlAssembleCntrlInfo(gCb,rbCb); } - RETVOID; + return; } /* rlcAmmStaProTmrExp */ /** @@ -1769,16 +1723,16 @@ RlcUlRbCb *rbCb; * */ -void rlcAmmExtractElmnt(RlcCb *gCb, Buffer *pdu, RlcExtHdr *hdrInfo) +static void rlcAmmExtractElmnt(RlcCb *gCb, Buffer *pdu, RlcExtHdr *hdrInfo) { uint8_t hdr; uint8_t pLen = hdrInfo->pLen; - uint8_t len = (U8)hdrInfo->len; + uint8_t len = (uint8_t)hdrInfo->len; uint32_t val; uint8_t tHdr; uint8_t fLen; uint8_t rLen; - /* U8 rLen1 = 0; */ + /* uint8_t rLen1 = 0; */ uint16_t tVal; hdr = hdrInfo->hdr; @@ -1852,7 +1806,7 @@ void rlcAmmExtractElmnt(RlcCb *gCb, Buffer *pdu, RlcExtHdr *hdrInfo) * */ -void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) +static void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) { uint16_t newExpSo; /* The new expected SO */ RlcSn sn = seg->amHdr.sn; @@ -1864,11 +1818,10 @@ void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) { return; } - + recBuf->noMissingSeg = FALSE; newExpSo = seg->soEnd + 1; recBuf->expSo = newExpSo; - //lstRcvd = seg->amHdr.lsf; - if(seg->amHdr.si == 0x2) + if(seg->amHdr.si == RLC_SI_LAST_SEG) { lstRcvd = TRUE; } @@ -1878,7 +1831,7 @@ void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) { /* keep going ahead as long as the expectedSo match with the header so else store the expSo for later checking again */ - if(seg->amHdr.si == 0x2) + if(seg->amHdr.si == RLC_SI_LAST_SEG) { lstRcvd = TRUE; } @@ -1886,7 +1839,6 @@ void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) { newExpSo = seg->soEnd + 1; recBuf->expSo = newExpSo; - //lstRcvd = seg->amHdr.lsf; RLC_LLIST_NEXT_SEG(recBuf->segLst, seg); } else @@ -1900,7 +1852,7 @@ void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) recBuf->allRcvd = TRUE; gRlcStats.amRlcStats.numRlcAmCellSduRx++; } - + recBuf->noMissingSeg = TRUE; return; } @@ -1917,17 +1869,7 @@ void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) * * @return void */ -#ifdef ANSI -Void rlcAmmFreeUlRbCb -( -RlcCb *gCb, -RlcUlRbCb *rbCb -) -#else -Void rlcAmmFreeUlRbCb(gCb,rbCb) -RlcCb *gCb; -RlcUlRbCb *rbCb; -#endif +Void rlcAmmFreeUlRbCb(RlcCb *gCb,RlcUlRbCb *rbCb) { RlcSn curSn = 0; /* Sequence number of PDU */ RlcSn windSz; /* PDU window size */ @@ -1935,13 +1877,13 @@ RlcUlRbCb *rbCb; windSz = (RLC_AM_GET_WIN_SZ(rbCb->m.amUl.snLen)) << 1; - if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,RLC_EVT_AMUL_REORD_TMR)) + if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMUL_REASSEMBLE_TMR)) { - rlcStopTmr(gCb,(PTR)rbCb, RLC_EVT_AMUL_REORD_TMR); + rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); } - if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,RLC_EVT_AMUL_STA_PROH_TMR)) + if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMUL_STA_PROH_TMR)) { - rlcStopTmr(gCb,(PTR)rbCb, RLC_EVT_AMUL_STA_PROH_TMR); + rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_STA_PROH_TMR); } @@ -1954,7 +1896,7 @@ RlcUlRbCb *rbCb; { if (recBuf->pdu != NULLP) { - RLC_FREE_BUF_WC(recBuf->pdu); + ODU_PUT_MSG_BUF(recBuf->pdu); } /* Release all the segments */ rlcAmmUlRlsAllSegs(gCb,recBuf); @@ -1964,15 +1906,15 @@ RlcUlRbCb *rbCb; }while ( curSn < windSz ); #ifndef LTE_TDD - RLC_FREE_WC(gCb,rbCb->m.amUl.recBufLst, (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp))); + RLC_FREE(gCb,rbCb->m.amUl.recBufLst, (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp))); rbCb->m.amUl.recBufLst = NULLP; #endif if(rbCb->m.amUl.partialSdu != NULLP) { - RLC_FREE_BUF_WC(rbCb->m.amUl.partialSdu); + ODU_PUT_MSG_BUF(rbCb->m.amUl.partialSdu); } - RETVOID; + return; } /* rlcAmmFreeUlRbCb */