# macro for output file name and makefile name
#
-PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI #-DODU_SLOT_IND_DEBUG_LOG -DEGTP_TEST
+PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI #-DNR_RLC_UL -DODU_SLOT_IND_DEBUG_LOG -DEGTP_TEST
ifeq ($(MODE),TDD)
PLTFRM_FLAGS += -DMODE=TDD
{ \
SPutMsg(_sdu->mBuf); \
cmLListDelFrm(_sduQ,&_sdu->lstEnt); \
- RLC_FREE_WC(_cb,_sdu, sizeof(RlcSdu)); \
+ RLC_FREE(_cb,_sdu, sizeof(RlcSdu)); \
}
#define RLC_FREE(_cb,_buf, _size) \
_buf = NULLP; \
}
-#define RLC_FREE_BUF(_buf) \
-{ \
- SPutMsg(_buf); \
- _buf = NULLP; \
-}
-
#else
#define RLC_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \
} \
}
-#define RLC_FREE_BUF(_buf) \
-{ \
- if (_buf != NULLP) \
- { \
- SPutMsg(_buf); \
- } \
- _buf = NULLP; \
-}
#endif
-
-
-
-#define RLC_FREE_WC(_cb,_buf, _size) \
-{ \
- (Void) SPutSBuf(_cb->init.region, _cb->init.pool, \
- (Data *) _buf, (Size) _size); \
- _buf = NULLP; /*assigning NULLP after free*/ \
-}
-
/* kw002.201 Freeing from region of pst */
#define RLC_PST_FREE(_region, _pool, _buf, _size) \
{ \
}
#endif
-#define RLC_FREE_BUF_WC(_buf) SPutMsg((_buf));
-
#define RLC_MEM_CPY(_dst, _src, _size) memcpy(_dst, _src, _size);
#define RLC_MEM_ZERO(_buf, _size) memset((_buf), 0, _size);
/*******************************************************************************
* AMM Defines
******************************************************************************/
-#define AMDL rbCb->m.amDl
-#define AMUL rbCb->m.amUl
+#define RLC_AMDL rbCb->m.amDl
+#define RLC_AMUL rbCb->m.amUl
/* PDU Types */
#define RLC_DATA_PDU 1
#define RLC_SN_POS_12BIT 0x0F
#define RLC_SN_POS_18BIT 0x03
#define RLC_AM_GET_WIN_SZ(_snLen) ((RLC_AM_CFG_12BIT_SN_LEN == (_snLen)) ? (2048) : (131072)) /* 5GNR */
-#define RLC_RCV_BUF_BIN_SIZE 512 /* Could be increased to avoid the search time.
- with the memory trade-off */
-#define RLC_TX_BUF_BIN_SIZE 512 /* Could be increased to avoid the search time.
- with the memory trade-off */
+#define RLC_RCV_BUF_BIN_SIZE 512 /* receive buffer size */
+#define RLC_TX_BUF_BIN_SIZE 512 /* receive buffer size */
#define RLC_SDU_LST 1
#define RLC_SEG_LST 2
nod = NULLP; \
}
-
#define RLC_LLIST_FIRST_RETX(lstCp, nod) \
{ \
CmLList *tmpNode; \
} \
}
+#ifdef NR_RLC_UL
+#define RLC_UMM_LLIST_FIRST_SEG(lstCp, nod) \
+{ \
+ CmLList *tmpNode; \
+ if((tmpNode=cmLListFirst(&lstCp))) \
+ nod = (RlcUmSeg *)tmpNode->node; \
+ else \
+ nod = NULLP; \
+} /*!< um mode first segment of linked list*/
+
+#define RLC_UMM_LLIST_NEXT_SEG(lstCp, nod) \
+{ \
+ CmLList *tmpNode; \
+ (lstCp).crnt = &((nod)->lstEnt); \
+ if((tmpNode = cmLListNext(&lstCp))) \
+ nod = (RlcUmSeg *)tmpNode->node; \
+ else \
+ nod = NULLP; \
+}/*!< next segment in um mode linked list*/
+
+#endif
+
#define MODAMT(x, y, z,_snModMask) \
{ \
y = (x - z) & _snModMask; \
#endif
#define RLC_AM_IS_POLL_BIT_SET(_amDl) \
- (AMDL.pollSn == ((AMDL.txNext - 1) & AMDL.snModMask))
+ (RLC_AMDL.pollSn == ((RLC_AMDL.txNext - 1) & RLC_AMDL.snModMask))
#define RLC_FILL_CNTRL_INFO(cntrlInfo, _val, _len, _idx, _eb)\
{ \
*/
typedef struct rlcUmHdr
{
+#ifdef NR_RLC_UL
+ uint8_t si; /*!< Segmentation Info */
+ uint16_t so; /*!< Segment offset 5G NR */
+#endif
uint8_t fi; /*!< Framing Info */
RlcSn sn; /*!< Sequence number */
uint16_t numLi; /*!< Number of LIs */
uint16_t li[RLC_MAX_UL_LI]; /*!< Array of LIs */
}RlcUmHdr;
+
/**
* @brief Structure to hold an Acknowledged Mode header
*
{\
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;\
CmLList *lnk;
CmLList *nextLnk;
- txBuf = rlcUtlGetTxBuf(AMDL.txBufLst, nackSnInfo->sn);
+ txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, nackSnInfo->sn);
if (txBuf == NULLP)
{
return;
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*/
- rlcUtlDelTxBuf(AMDL.txBufLst, txBuf,gCb);
+ rlcUtlDelTxBuf(RLC_AMDL.txBufLst, txBuf,gCb);
}
return;
/* if the NACK_SN is in the transmit buffer, move it to the re-
transmit buffer */
- txBuf = rlcUtlGetTxBuf(AMDL.txBufLst, nackSnInfo->sn);
+ txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, nackSnInfo->sn);
if (txBuf != NULLP)
{
if(nackSnInfo->isSegment)
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(rlckwuSap->pst.region, rlckwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo));
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)
{
"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(rlckwuSap->pst.region, rlckwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); */
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)
RlcNackInfo nackSnInfo;
RlcSn mNackSn;
RlcSn txNextAck;
- RlcSn transWinStartSn = AMDL.txNextAck; /*used to track the SN from which
+ RlcSn transWinStartSn = RLC_AMDL.txNextAck; /*used to track the SN from which
to start processing the transmission
buffer */
uint32_t idx = 0;
/* 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))
{
* nack sn*/
do
{
- RlcDlAmmGetNackSnInfoFrmNackRangeIdx(&AMDL, &pStaPdu->nackInfo[idx],
+ RlcDlAmmGetNackSnInfoFrmNackRangeIdx(&RLC_AMDL, &pStaPdu->nackInfo[idx],
retxNode, &nackSnInfo, idx1);
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));
rlcAmmDlUpdateTxAndReTxBufForAckSn(gCb,rbCb, mAckSn, retxNode, &datCfm);
/* Update txNextAck */
- rlcAmmDlSetTxNextAck(&AMDL,txNextAck);
+ rlcAmmDlSetTxNextAck(&RLC_AMDL,txNextAck);
}
else
{
rlcAmmDlUpdateTxAndReTxBufForAckSn(gCb,rbCb, mAckSn, retxNode, &datCfm);
/* update txNextAck */
- rlcAmmDlSetTxNextAck(&AMDL, pStaPdu->ackSn);
+ rlcAmmDlSetTxNextAck(&RLC_AMDL, pStaPdu->ackSn);
}
if(datCfm->numSduIds != 0)
}
/* Fix for memory corruption */
- RLC_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)
{
- rlcAmmSendDedLcBoStatus(gCb, rbCb, &AMDL);
+ rlcAmmSendDedLcBoStatus(gCb, rbCb, &RLC_AMDL);
}
return;
#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)
{
DU_LOG("\nRLC : rlcAmmQSdu: Received SDU will be transmitted next \
UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
- AMDL.nxtTx = sdu;
+ 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;
}
- rlcWinSz = RLC_AM_TRANS_WIN_SIZE(&AMDL);
+ rlcWinSz = RLC_AM_TRANS_WIN_SIZE(&RLC_AMDL);
if (rlcWinSz > rbCb->ueCb->tenbStats->stats.nonPersistent.rlc.dlMaxWindowSz)
{
rbCb->ueCb->tenbStats->stats.nonPersistent.rlc.dlMaxWindowSz = rlcWinSz;
#endif
#endif
/* Update BO and estimate header size for the current BO */
- AMDL.bo = AMDL.bo + sdu->sduSz;
- if(AMDL.snLen == RLC_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 */
if(!rlcDlUtlIsReestInProgress(rbCb))
{
- rlcAmmSendDedLcBoStatus(gCb, rbCb, &AMDL);
+ rlcAmmSendDedLcBoStatus(gCb, rbCb, &RLC_AMDL);
}
return;
sapCb->suId, &(rbCb->rlcId));
/* Update number of pdus in pduInfo */
- rlcDatReq->pduInfo.mBuf[rlcDatReq->pduInfo.numPdu] = AMDL.mBuf;
+ 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,
+ RLC_AMDL.pStaPdu,
sizeof(RlcUdxDlStaPdu));
- AMDL.pStaPdu = NULLP;
- AMDL.mBuf = NULLP;
+ RLC_AMDL.pStaPdu = NULLP;
+ RLC_AMDL.mBuf = NULLP;
gRlcStats.amRlcStats.numDLStaPduSent++;
}
* 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
)
{
rlcDatReq->boRep.staPduPrsnt = TRUE;
- rlcDatReq->boRep.staPduBo = AMDL.cntrlBo;
+ rlcDatReq->boRep.staPduBo = RLC_AMDL.cntrlBo;
- if (AMDL.pStaPdu != NULLP)
+ if (RLC_AMDL.pStaPdu != NULLP)
{
rlcAmmDlAssembleCntrlInfo (gCb, rbCb, rlcDatReq);
}
DU_LOG("\nRLC: 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 ((rlcDatReq->pduSz > 0) && (AMDL.nxtRetx != NULLP))
+ if ((rlcDatReq->pduSz > 0) && (RLC_AMDL.nxtRetx != NULLP))
{
rlcResegRetxPdus (gCb,rbCb, rlcDatReq);
}
/* Assemble SDUs to form new PDUs */
- if ((rlcDatReq->pduSz > 0) && (AMDL.nxtTx != 0))
+ if ((rlcDatReq->pduSz > 0) && (RLC_AMDL.nxtTx != 0))
{
rlcAssembleSdus(gCb,rbCb, rlcDatReq);
}
- if (AMDL.nxtRetx != NULLP)
+ if (RLC_AMDL.nxtRetx != NULLP)
{
- rlcDatReq->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)
{
- rlcDatReq->boRep.oldestSduArrTime = AMDL.nxtTx->arrTime;
+ rlcDatReq->boRep.oldestSduArrTime = RLC_AMDL.nxtTx->arrTime;
}
/* Accumulate bo */
- rlcDatReq->boRep.bo = rlcAmmCalculateBo(&AMDL);
- rlcDatReq->boRep.staPduBo = AMDL.cntrlBo;
+ rlcDatReq->boRep.bo = rlcAmmCalculateBo(&RLC_AMDL);
+ rlcDatReq->boRep.staPduBo = RLC_AMDL.cntrlBo;
/* Hdr estimation is moved to kwAmmCreatePDu */
- rlcDatReq->boRep.estHdrSz = AMDL.estHdrSz;
+ rlcDatReq->boRep.estHdrSz = RLC_AMDL.estHdrSz;
if(rlcDatReq->pduSz > 0)
{
static void rlcSplitPdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcRetx *crnt, RlcRetx *next, uint16_t size)
{
uint8_t si;
- RlcAmDl *amDl = &AMDL;
+ RlcAmDl *amDl = &RLC_AMDL;
/* Set the SN for the new segment */
next->amHdr.sn = crnt->amHdr.sn;
}
/* 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;
return;
uint8_t numSdus;
#endif
- amDl = &AMDL;
+ amDl = &RLC_AMDL;
#ifdef LTE_L2_MEAS
/* TODO : This shoould be taken care in new Trasmissions */
/* This lchInfo should be retrieved there */
RLC_UPD_POLL_BIT(gCb, retx, pollBit);
rlcDatReq->pduSz -= pduSz;
- AMDL.estHdrSz -= retx->hdrSz;
+ RLC_AMDL.estHdrSz -= retx->hdrSz;
#ifdef LTE_L2_MEAS
if (rbCb->rlcId.rbType == CM_LTE_DRB)
{
Buffer *pdu = NULLP;
MsgLen macGrntSz = rlcDatReq->pduSz;
- RlcAmDl *amDl = &AMDL;
+ RlcAmDl *amDl = &RLC_AMDL;
RlcSdu *sdu = amDl->nxtTx;
RlcSduMap sduMap;
bool nxtTxUpd = FALSE;
*/
static Void rlcRemRetxPdu(RlcCb *gCb,RlcDlRbCb *rbCb,RlcRetx *retx)
{
- 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;
}
rlcUtlAddReTxPduToBeFreedQueue(gCb, retx);
*/
static Void rlcAmmDlMarkPduForReTx(RlcCb *gCb,RlcDlRbCb *rbCb,RlcRetx *retx)
{
- if (AMDL.maxReTxReached == TRUE)
+ if (RLC_AMDL.maxReTxReached == TRUE)
{
return;
}
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 */
}
- if (AMDL.nxtRetx == NULLP)
+ if (RLC_AMDL.nxtRetx == NULLP)
{
- AMDL.nxtRetx = retx;
+ RLC_AMDL.nxtRetx = retx;
}
gRlcStats.amRlcStats.numDLRetransPdus++;
}
/* Remove SDU from the sduQ */
- cmLListDelFrm(&AMDL.sduQ, &sdu->lstEnt);
+ cmLListDelFrm(&RLC_AMDL.sduQ, &sdu->lstEnt);
rlcUtlAddSduToBeFreedQueue(gCb, sdu);
rlcUtlRaiseDlCleanupEvent(gCb);
}
{
CmLList *pduNode;
- RlcTx *txBuf = rlcUtlGetTxBuf(AMDL.txBufLst, sn);
+ RlcTx *txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, sn);
if (txBuf == NULLP)
{
rlcUtlAddTxPduToBeFreedQueue(gCb, txBuf);
rlcUtlRaiseDlCleanupEvent(gCb);
/* so that it is not processed again */
- rlcUtlRemovTxBuf(AMDL.txBufLst, txBuf, gCb);
+ rlcUtlRemovTxBuf(RLC_AMDL.txBufLst, txBuf, gCb);
return;
}
{
rlcAmmDlMoveFrmTxtoRetxBuffer(gCb,amDl, &retx, sn);
- if (AMDL.nxtRetx == NULLP)
+ if (RLC_AMDL.nxtRetx == NULLP)
{
- AMDL.nxtRetx = retx;
+ RLC_AMDL.nxtRetx = retx;
}
- rlcAmmSendDedLcBoStatus(gCb, rbCb, &AMDL);
+ rlcAmmSendDedLcBoStatus(gCb, rbCb, &RLC_AMDL);
return;
}
/* Get the last node in retxLst */
if (retx != NULLP)
{
rlcAmmDlMarkPduForReTx(gCb, rbCb, retx);
- rlcAmmSendDedLcBoStatus(gCb, rbCb, &AMDL);
+ rlcAmmSendDedLcBoStatus(gCb, rbCb, &RLC_AMDL);
}
}
{
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)
{
rlcAmmDlProcessSuccessfulReTx(gCb,rbCb, retx, 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 = rlcUtlGetTxBuf(AMDL.txBufLst, sn);
+ txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, sn);
if (txBuf != NULLP)
{
RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId,
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);
}
return;
while (*retxNode)
{
retx = (RlcRetx *)((*retxNode)->node);
- MODAMT(retx->amHdr.sn, mSn, AMDL.txNextAck,AMDL.snModMask);
+ MODAMT(retx->amHdr.sn, mSn, RLC_AMDL.txNextAck,RLC_AMDL.snModMask);
if (mSn < mNackSn)
{
(*retxNode) = (*retxNode)->next;
}
/* 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 = rlcUtlGetTxBuf(AMDL.txBufLst, sn);
+ txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, sn);
if ((txBuf != NULLP))
{
RLOG_ARG3(L_DEBUG,DBG_RBID, rbCb->rlcId.rbId,
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);
}
return;
/* 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 */
rlcUtlDelTxBuf(amDl->txBufLst, txBuf,gCb);
RlcNackInfo *rlcNackInfo;
uint16_t nkCnt = 0;
- pStaPdu = AMDL.pStaPdu;
+ pStaPdu = RLC_AMDL.pStaPdu;
/* D/C| CPT| */
ODU_ADD_POST_MSG_MULT(cntrlPdu, cntrlPduSz, mBuf);
rlcDatReq->pduSz -= cntrlPduSz;
- /* Add mBuf to AMDL.mBuf */
- AMDL.mBuf = mBuf;
+ /* Add mBuf to RLC_AMDL.mBuf */
+ RLC_AMDL.mBuf = mBuf;
return;
}
* 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)))
{
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
/* 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++;
}
}
#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 )
{
}
- 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
/* 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->controlBo = staPduEncSize; /*Its already in bytes */
- AMUL.staTrg = FALSE;
- AMUL.gatherStaPduInfo = FALSE;
+ RLC_AMUL.staTrg = FALSE;
+ RLC_AMUL.gatherStaPduInfo = FALSE;
if (rlcUlUdxStaPduReq(&sapCb->pst,
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("\nRLC : 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;
}
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\
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
{
uint32_t rlculdrop;
rlculdrop++;
- RLC_FREE_BUF(pdu);
+ ODU_PUT_MSG_BUF(pdu);
continue;
}
#endif
{
uint32_t rlculdrop;
rlculdrop++;
- RLC_FREE_BUF(pdu);
+ ODU_PUT_MSG_BUF(pdu);
continue;
}
#endif
{
if(rbCb->rlcId.rbType == CM_LTE_DRB)
{
- RLC_FREE_BUF(pdu);
+ ODU_PUT_MSG_BUF(pdu);
continue;
}
}
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);
}
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)
{
DU_LOG("\nRLC: 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;
}
}
{
/* This is a duplicate segment */
gRlcStats.amRlcStats.numRlcAmCellDupPduRx++;
- RLC_FREE_BUF(pdu);
+ ODU_PUT_MSG_BUF(pdu);
return FALSE;
}
{
/* This is a duplicate segment */
gRlcStats.amRlcStats.numRlcAmCellDupPduRx++;
- RLC_FREE_BUF(pdu);
+ ODU_PUT_MSG_BUF(pdu);
return FALSE;
}
{
DU_LOG("\nRLC: 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 */
cmLListInsCrnt(&recBuf->segLst, &tseg->lstEnt);
}
tseg->lstEnt.node = (PTR)tseg;
- rlcAmmUpdExpByteSeg(gCb,&AMUL,tseg);
+ rlcAmmUpdExpByteSeg(gCb,&RLC_AMUL,tseg);
return TRUE;
}
"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;
}
{
DU_LOG("\nRLC: 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)
{
{
gRlcStats.amRlcStats.numRlcAmCellDupPduRx++;
gCb->genSts.unexpPdusRecv++;
- RLC_FREE_BUF(pdu);
+ ODU_PUT_MSG_BUF(pdu);
return FALSE;
}
recBuf->isDelvUpperLayer = FALSE;
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)
{/* 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)
{/* 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)
{
- 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);
}
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;
#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)
/* 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 */
rlcStopTmr(gCb,(PTR)rbCb, RLC_EVT_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;
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)
{
{
if (recBuf->pdu != NULLP)
{
- RLC_FREE_BUF_WC(recBuf->pdu);
+ ODU_PUT_MSG_BUF(recBuf->pdu);
}
/* Release all the segments */
rlcAmmUlRlsAllSegs(gCb,recBuf);
}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);
}
return;
} /* rlcAmmFreeUlRbCb */
/*Allocating the memory for receive buffer */
if(CM_LTE_MODE_UM == cfgToValidate->entMode)
{
- uint16_t winLen;
-
-
+ uint32_t hashIndex;
cfgEntData->rbCb->m.umUl.umWinSz = RLC_POWER(2,
((cfgToValidate->m.umInfo.ul.snLen *5)-1));
- winLen = cfgEntData->rbCb->m.umUl.umWinSz << 1;
+#ifdef NR_RLC_UL
RLC_ALLOC(gCb,
- cfgEntData->rbCb->m.umUl.recBuf,
- (winLen * sizeof(RlcUmRecBuf*)));
+ cfgEntData->rbCb->m.umUl.recBufLst,
+ (RLC_RCV_BUF_BIN_SIZE * sizeof(CmLListCp )));
+ for(hashIndex = 0; hashIndex < RLC_RCV_BUF_BIN_SIZE; hashIndex++)
+ {
+ cmLListInit(&(cfgEntData->rbCb->m.umUl.recBufLst[hashIndex]));
+ }
+#endif
}
else if(CM_LTE_MODE_AM == cfgToValidate->entMode)
{
{
if(datInd->lchData[numLch].pdu.mBuf[numPdu])
{
- RLC_FREE_BUF_WC(datInd->lchData[numLch].pdu.mBuf[numPdu]);
+ ODU_PUT_MSG_BUF(datInd->lchData[numLch].pdu.mBuf[numPdu]);
}
}
}
DU_LOG("\nRLC: rlcTmmSendToMac: sfn %d slot %d UEID:%d CELLID:%d",
sfn, slot, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
cmLListDelFrm(&(rbCb->m.tm.sduQ), &sdu->lstEnt);
- RLC_FREE_BUF(sdu->mBuf);
+ ODU_PUT_MSG_BUF(sdu->mBuf);
RLC_FREE(gCb, sdu, sizeof(RlcSdu));
}
else
the Sdu %u UEID:%d CELLID:%d", sdu->mode.tm.rnti, rbCb->rlcId.ueId,
rbCb->rlcId.cellId);
cmLListDelFrm(&(rbCb->m.tm.sduQ), &sdu->lstEnt);
- RLC_FREE_BUF(sdu->mBuf);
+ ODU_PUT_MSG_BUF(sdu->mBuf);
RLC_FREE(gCb, sdu, sizeof(RlcSdu));
continue;
}
return RFAILED;
}
- AMDL.cntrlBo = pStaPdu->controlBo;
+ RLC_AMDL.cntrlBo = pStaPdu->controlBo;
/* If there already exists a STAUS PDU, free it and take the new one
into account */
- if(AMDL.pStaPdu)
+ if(RLC_AMDL.pStaPdu)
{
RLC_FREE_SHRABL_BUF(pst->region,
pst->pool,
- AMDL.pStaPdu,
+ RLC_AMDL.pStaPdu,
sizeof(RlcUdxDlStaPdu));
}
- AMDL.pStaPdu = pStaPdu;
- rlcAmmSendDedLcBoStatus(tRlcCb, rbCb, &AMDL);
+ RLC_AMDL.pStaPdu = pStaPdu;
+ rlcAmmSendDedLcBoStatus(tRlcCb, rbCb, &RLC_AMDL);
return (ROK);
}
/* only newUeInfo needs to be freed here, ueInfo would be freed at the
interface or by he receipient in case of tight coupling */
RLC_PST_FREE(pst->region, pst->pool, cfgTmpData->newUeInfo, sizeof(CkwUeInfo));
- RLC_FREE_WC(tRlcCb, cfgTmpData, sizeof (RlcUlCfgTmpData));
+ RLC_FREE(tRlcCb, cfgTmpData, sizeof (RlcUlCfgTmpData));
return ROK;
}
{
DU_LOG("\nRLC : CellId[%u]:DL RbId [%d] not found",
datReq->rlcId.cellId,datReq->rlcId.rbId);
- RLC_FREE_BUF(mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
return RFAILED;
}
/* kw002.201 Freeing from proper region */
RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, datReq,
sizeof(KwuDatReqInfo));
- RLC_FREE_BUF(mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
return RFAILED;
}
typedef struct rlcUlUeCb RlcUlUeCb;
+#ifdef NR_RLC_UL
+/**
+ * @brief Structure to hold a RLC UM PDU segment
+ *
+ * @details
+ * - lstEnt : This is required for the linked list in which the segments
+ * are stored
+ * - seg : Holds the segment data
+ * - segSz : The length of the segment in bytes
+ * - soEnd : SOEnd
+ * - umHdr : The UM Header for the PDU segment
+ *
+*/
+typedef struct rlcUmSeg
+{
+ CmLList lstEnt; /*!< List entry for PDU segment */
+ Buffer *seg; /*!< PDU segment */
+ MsgLen segSz; /*!< Buffer Size */
+ uint16_t soEnd; /*!< Segment Offset End */
+ RlcUmHdr umHdr; /*!<Um Header */
+}RlcUmSeg;
+#endif
+
/** @defgroup um_uplink UM Uplink Module
*/
*/
typedef struct rlcUmRecBuf
{
+#ifdef NR_RLC_UL
+ RlcSn sn; /*!< Sequence Number */
+ CmLList lnk; /*!< Link to the receive buffer list */
+ Bool allSegRcvd; /*!< Flag to check whether all seg are received */
+ Bool noMissingSeg; /*!< Flag to check all the bytes are received before the last byte of segment */
+ CmLListCp segLst; /*!< PDU Segments list */
+ uint16_t expSo; /*!< Next expected seg offset */
+ Bool allRcvd; /*!< All bytes received or not */
+ RlcUmSeg *expByteSeg; /*!< Next expected byte segment */
+#endif
Buffer *pdu; /**< Buffer holding the UM PDU */
RlcUmHdr umHdr; /**< UM PDU Header Information */
MsgLen pduSz; /**< PDU Size */
{
uint8_t snLen; /**< Sequence number length */
uint8_t reOrdTmrInt; /**< Timer Interval */
+#ifdef NR_RLC_UL
+ CmLListCp *recBufLst; /*!<Reception Buffer List */
+#endif
RlcUmRecBuf **recBuf; /**< Reception buffer */
RlcSn umWinSz; /**< UM window size */
- uint16_t modBitMask; /**< Bitmask for modulus to wrap around variables */
+ uint16_t modBitMask; /**< Bitmask for modulus to wrap around variables */
RlcSn sn; /**< Sequence number */
RlcSn vrUr; /**< VR(UR) - Receive state variable */
RlcSn vrUh; /**< VR(UH) - Highest received state variable */
RlcSn vrUx; /**< VR(UX) - Reordering state variable */
CmTimer reOrdTmr; /**< Reordering Timer */
- Buffer *partialSdu; /**< Partial SDU - Remains till the complete SDU
- is received */
+ Buffer *assembleSdu; /**< Assemble Sdu - Remains till the complete SDU is received */
+ uint16_t expSo; /*!< Expected SO for reassembly */
+ RlcSn expSn; /*!< Expected Sn */
}RlcUmUl;
/*@}*/
/****************************************************************************
* Utility Functions
***************************************************************************/
-Void rlcUtlStoreRecBuf ARGS ((CmLListCp *recBufLst,
+
+#ifdef NR_RLC_UL
+void rlcUtlStoreUmRecBuf ARGS ((CmLListCp *recBufLst,
+ RlcUmRecBuf *recBuf,
+ RlcSn sn
+ ));
+RlcUmRecBuf* rlcUtlGetUmRecBuf ARGS ((CmLListCp *recBufLst,
+ RlcSn sn
+ ));
+#endif
+void rlcUtlStoreRecBuf ARGS ((CmLListCp *recBufLst,
RlcAmRecBuf *recBuf,
RlcSn sn
));
else
{
ODU_CAT_MSG(pdu, sdu->mBuf, M1M2);
- RLC_FREE_BUF_WC(sdu->mBuf);
+ ODU_PUT_MSG_BUF(sdu->mBuf);
}
sdu->sduSz -= pduSz;
}
else
{
- RLC_FREE_BUF_WC(pdu);
+ ODU_PUT_MSG_BUF(pdu);
}
}
Buffer *pdu,
RlcUmHdr *umHdr));
-static void rlcUmmReAssembleSdus ARGS ((RlcCb *gCb,
- RlcUlRbCb *rbCb,
- RlcUmRecBuf *umRecBuf));
+uint8_t rlcUmmReAssembleSdus ARGS ((RlcCb *gCb,
+ RlcUlRbCb *rbCb,
+ RlcUmRecBuf *umRecBuf));
+
+#ifdef NR_RLC_UL
+bool rlcUmmAddRcvdSeg ARGS ((RlcCb *gCb,
+ RlcUlRbCb *rbCb,
+ RlcUmHdr *umHdr,
+ Buffer *pdu,
+ uint16_t pduSz));
+
+void rlcUmmRelAllSegs(RlcCb *gCb, RlcUmRecBuf *recBuf);
+
+#endif
#ifndef TENB_ACC
#ifndef LTE_PAL_ENB
return (RLC_UM_GET_VALUE(sn, *umUl) < RLC_UM_GET_VALUE(umUl->vrUh, *umUl));
}
+#ifdef NR_RLC_UL
+
+/**
+ * @brief Handler to updated expected byte seg
+ *
+ * @details
+ * This function is used to update expected byte segment. The next segment
+ * expected is indicated by the SO of the segment which is expected. Intially
+ * the segment with SO 0 is expected and then in order. When all the segments
+ * are received (which would happen when an expected SO is encountered
+ * with LSF set) the allRcvd flag is set to TRUE
+ *
+ * @param[in] gCb RLC instance control block
+ * @param[in] umUl AM Uplink Control Block
+ * @param[in] seg Newly received segment
+ *
+ * @return void
+ *
+ */
+
+void rlcUmmUpdExpByteSeg(RlcCb *gCb, RlcUmUl *umUl, RlcUmSeg *seg)
+{
+ uint16_t newExpSo; /* The new expected SO */
+ RlcSn sn = seg->umHdr.sn;
+ bool lstRcvd=FALSE;
+ RlcUmRecBuf *recBuf = NULLP;
+
+ recBuf = rlcUtlGetUmRecBuf(umUl->recBufLst, sn);
+ if ((recBuf == NULLP) || (recBuf && (seg->umHdr.so != recBuf->expSo)))
+ {
+ return;
+ }
+ recBuf->noMissingSeg = FALSE;
+ newExpSo = seg->soEnd + 1;
+ recBuf->expSo = newExpSo;
+ if(seg->umHdr.si == RLC_SI_LAST_SEG)
+ {
+ lstRcvd = TRUE;
+ }
+ RLC_UMM_LLIST_NEXT_SEG(recBuf->segLst, seg);
+ while(seg)
+ {
+ /* keep going ahead as long as the expectedSo match with the header so
+ else store the expSo for later checking again */
+ if(seg->umHdr.si == RLC_SI_LAST_SEG)
+ {
+ lstRcvd = TRUE;
+ }
+ if (seg->umHdr.so == newExpSo)
+ {
+ newExpSo = seg->soEnd + 1;
+ recBuf->expSo = newExpSo;
+ RLC_UMM_LLIST_NEXT_SEG(recBuf->segLst, seg);
+ }
+ else
+ {
+ recBuf->expSo = newExpSo;
+ return;
+ }
+ }
+ if (lstRcvd == TRUE)
+ {
+ recBuf->allSegRcvd = TRUE;
+ }
+ recBuf->noMissingSeg = TRUE;
+
+ return;
+}
+/**
+ * @brief Private handler to store the received segment
+ *
+ * @details
+ * Private handler invokded by rlcUmmUlPlacePduInRecBuf to add a received
+ * segment in reception buffer of a RBCB.
+ * - It is responsible for detecting duplicate segments
+ * - Adding it at appropriate position in the received buffer
+ * - Calling ExpByteSeg to set expSo field in the receiver buffer
+ *
+ * @param[in] gCb RLC instance control block
+ * @param[in] rbCb Radio Bearer Contro Block
+ * @param[in] umHdr UM Header received
+ * @param[in] pdu Buffer received other than the headers
+ * @param[in] pduSz size of the PDU buffer received
+ *
+ * @return bool
+ * -#TRUE Successful insertion into the receiver buffer
+ * -#FALSE Possibly a duplicate segment
+ */
+
+bool rlcUmmAddRcvdSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcUmHdr *umHdr, Buffer *pdu, uint16_t pduSz)
+{
+ RlcUmRecBuf *recBuf = NULLP;
+ RlcUmSeg *seg;
+ RlcUmSeg *tseg;
+ uint16_t soEnd; /* Holds the SoEnd of received segment */
+ uint16_t expSo = 0; /* Expected SO */
+
+ soEnd = umHdr->so + pduSz - 1;
+ recBuf = rlcUtlGetUmRecBuf(RLC_UMUL.recBufLst, umHdr->sn);
+
+ if (NULLP == recBuf)
+ {
+ RLC_ALLOC(gCb,recBuf, sizeof(RlcUmRecBuf));
+ if (recBuf == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC_UL : Failed to allocate memory to recv buf for UEID:%d CELLID:%d in rlcUmmAddRcvdSeg()",
+ rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+
+ ODU_PUT_MSG_BUF(pdu);
+ return FALSE;
+ }
+ rlcUtlStoreUmRecBuf(RLC_UMUL.recBufLst, recBuf, umHdr->sn);
+ }
+ else
+ {
+ if (recBuf->allSegRcvd == TRUE)
+ {
+ ODU_PUT_MSG_BUF(pdu);
+ return FALSE;
+ }
+ }
+
+ RLC_UMM_LLIST_FIRST_SEG(recBuf->segLst, seg);
+ while ((seg != NULLP) && (seg->umHdr.so < umHdr->so))
+ {
+ expSo = seg->umHdr.so + seg->segSz;
+ RLC_UMM_LLIST_NEXT_SEG(recBuf->segLst, seg);
+ }
+
+ if (expSo > umHdr->so)
+ {
+ DU_LOG("\nDEBUG --> RLC_UL : Received duplicate segment in rlcUmmAddRcvdSeg()");
+ /* This is a duplicate segment */
+ ODU_PUT_MSG_BUF(pdu);
+ return FALSE;
+ }
+
+ if ((seg) && (seg->umHdr.so <= soEnd))
+ {
+ DU_LOG("\nDEBUG --> RLC_UL : Received duplicate segment in rlcUmmAddRcvdSeg()");
+ /* This is a duplicate segment */
+ ODU_PUT_MSG_BUF(pdu);
+ return FALSE;
+ }
+
+ /* If we have come this far, we have to add this segment to the */
+ /* reception buffer as we either have eliminated duplicates or */
+ /* have found none. */
+ RLC_ALLOC_WC(gCb, tseg, sizeof(RlcUmSeg));
+ if (tseg == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC_UL : Failed to allocate memory to segment for UEID:%d CELLID:%d in rlcUmmAddRcvdSeg()",
+ rbCb->rlcId.ueId, rbCb->rlcId.cellId);
+ ODU_PUT_MSG_BUF(pdu);
+ return FALSE;
+ }
+
+ tseg->seg = pdu;
+ tseg->segSz = pduSz;
+ RLC_MEM_CPY(&tseg->umHdr, umHdr, sizeof(RlcUmHdr));
+ RLC_MEM_CPY(&recBuf->umHdr, umHdr, sizeof(RlcUmHdr));
+ recBuf->sn = umHdr->sn;
+ tseg->soEnd = soEnd;
+ if (seg == NULLP)
+ {
+ cmLListAdd2Tail(&recBuf->segLst, &tseg->lstEnt);
+ }
+ else
+ {
+ recBuf->segLst.crnt = &seg->lstEnt;
+ cmLListInsCrnt(&recBuf->segLst, &tseg->lstEnt);
+ }
+ tseg->lstEnt.node = (PTR)tseg;
+ rlcUmmUpdExpByteSeg(gCb, &RLC_UMUL, tseg);
+ return TRUE;
+}
+
+/**
+ * @brief Private handler to release all stored segments
+ *
+ * @details
+ * Private handler invokded by rlcUmmRelAllSegs to release the
+ * stored segements in case a complete PDU is received later.
+ *
+ * @param[in] gCb RLC instance control block
+ * @param[in] recBuf Buffer that stores a received PDU or segments
+ *
+ * @return void
+ *
+ */
+void rlcUmmRelAllSegs(RlcCb *gCb, RlcUmRecBuf *recBuf)
+{
+ RlcUmSeg *seg;
+
+ RLC_UMM_LLIST_FIRST_SEG(recBuf->segLst, seg);
+ while (seg != NULLP)
+ {
+ ODU_PUT_MSG_BUF(seg->seg);
+ cmLListDelFrm(&(recBuf->segLst), &(seg->lstEnt));
+ RLC_FREE(gCb, seg, sizeof(RlcUmSeg));
+ RLC_UMM_LLIST_FIRST_SEG(recBuf->segLst, seg);
+ }
+
+ return;
+}
+
+/**
+ * @brief Private handler to reassemble from a segment or a PDU
+ *
+ * @details
+ * Private handler invokded by rlcUmmReAssembleSdus with either a
+ * PDU or a segment of a PDU. This is also called in the case of
+ * reestablishment and hence out of sequence joining is also to
+ * be supported
+ *
+ *
+ * @param[in] gCb RLC instance control block
+ * @param[in] rbCb Uplink RB control block
+ * @param[in] umHdr UM header received for this segment/PDU
+ * @param[in] pdu PDU to be reassembled
+ *
+ * @return ROK/RFILED
+ *
+ */
+
+uint8_t rlcUmmProcSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcUmHdr *umHdr, Buffer *pdu)
+{
+
+ if ((RLC_UMUL.expSn != umHdr->sn) || (RLC_UMUL.expSo != umHdr->so))
+ {
+ /* Release the existing SDU as we have PDUs or */
+ /* segments that are out of sequence */
+ DU_LOG("\nDEBUG --> RLC_UL : Received Segments are out of sequence in rlcUmmProcSeg()");
+ ODU_PUT_MSG_BUF(RLC_UMUL.assembleSdu);
+ return RFAILED;
+ }
+
+ if (umHdr->si == RLC_SI_FIRST_SEG)
+ {/* first Segment of the SDU */
+ if (RLC_UMUL.assembleSdu != NULLP)
+ { /* Some old SDU may be present */
+ ODU_PUT_MSG_BUF(RLC_UMUL.assembleSdu);
+ }
+ RLC_UMUL.assembleSdu = pdu;
+ pdu = NULLP;
+ }
+ else if(umHdr->si == RLC_SI_MID_SEG)
+ {/* Middle Segment of the SDU */
+ ODU_CAT_MSG(RLC_UMUL.assembleSdu,pdu, M1M2);
+ ODU_PUT_MSG_BUF(pdu);
+ pdu = NULLP;
+ }
+ else if(umHdr->si == RLC_SI_LAST_SEG)
+ {
+ ODU_CAT_MSG(pdu, RLC_UMUL.assembleSdu, M2M1);
+ ODU_PUT_MSG_BUF(RLC_UMUL.assembleSdu);
+ }
+
+ if (pdu != NULLP)
+ {
+ RLC_UMUL.assembleSdu = NULLP;
+ rlcUtlSendUlDataToDu(gCb,rbCb, pdu);
+ }
+
+ return ROK;
+}
+/**
+ *
+ * @brief Private handler to reassemble SDUs
+ *
+ * @details
+ * Private handler invokded by rlcUmmProcessPdus with the PDU
+ * from the reception buffer in sequence to reassemble SDUs and
+ * send it to PDCP.
+ *
+ * - With the stored header info, FI and LSF segment / concatenate
+ * PDUs or byte segments of PDUs to get the associated SDU.
+ *
+ * @param[in] rbCb RB control block
+ * @param[in] pdu PDU to be reassembled
+ *
+ * @return uint8_t
+ * -# ROK
+ * -# RFAILED
+ *
+ */
+uint8_t rlcUmmReAssembleSdus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcUmRecBuf *recBuf)
+{
+ RlcUmSeg *seg;
+
+ /* This is a set of segments */
+ RLC_UMM_LLIST_FIRST_SEG(recBuf->segLst, seg);
+ RLC_UMUL.expSn = recBuf->sn;
+ RLC_UMUL.expSo = 0;
+ while(seg)
+ {
+ if(rlcUmmProcSeg(gCb, rbCb, &seg->umHdr, seg->seg) == RFAILED)
+ {
+ rlcUmmRelAllSegs(gCb, recBuf);
+ break;
+ }
+ RLC_UMUL.expSo = seg->soEnd + 1;
+ cmLListDelFrm(&(recBuf->segLst),&(seg->lstEnt));
+ RLC_FREE(gCb, seg, sizeof(RlcSeg));
+ RLC_UMM_LLIST_FIRST_SEG(recBuf->segLst, seg);
+ }
+ RLC_UMUL.expSn = (recBuf->umHdr.sn + 1) & (RLC_UMUL.modBitMask);
+ RLC_UMUL.expSo = 0;
+ return ROK;
+}
+
+#endif
+
/**
* @brief Handler to process the Data Indication from the lower layer
* and send the PDUs to re-assembly unit.
{
uint32_t rlculdrop;
rlculdrop++;
- RLC_FREE_BUF(pdu);
- RLC_FREE_WC(gCb, tmpRecBuf, sizeof(RlcUmRecBuf));
+ ODU_PUT_MSG_BUF(pdu);
+ RLC_FREE(gCb, tmpRecBuf, sizeof(RlcUmRecBuf));
/*Fix for CR ccpu00144030: If threshhold is hit then also count
*should be incrmented */
count++;
/* Header extraction is a problem.
* log an error and free the allocated memory */
/* ccpu00136940 */
- RLC_FREE_WC(gCb, tmpRecBuf, sizeof(RlcUmRecBuf));
+ RLC_FREE(gCb, tmpRecBuf, sizeof(RlcUmRecBuf));
ODU_PUT_MSG_BUF(pdu);
count++;
/* kw005.201 ccpu00117318, updating the statistics */
gCb->genSts.errorPdusRecv++;
continue;
}
+#ifdef NR_RLC_UL
+
+ /*TODO 1.Extract Hdr */
+ /* 2.Add Seg into Reception Buffer */
+ /* 3.If All Seg Recvd in Reception buffer list */
+ /* 4.Step 3 is true call Assemble Sdus */
+#endif
curSn = tmpRecBuf->umHdr.sn;
/* Check if the PDU should be discarded or not */
DU_LOG("\nRLC : rlcUmmProcessPdus: Received a duplicate pdu with sn %d \
UEID:%d CELLID:%d", curSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
- RLC_FREE_BUF(pdu);
- RLC_FREE_WC(gCb, tmpRecBuf, sizeof(RlcUmRecBuf));
+ ODU_PUT_MSG_BUF(pdu);
+ RLC_FREE(gCb, tmpRecBuf, sizeof(RlcUmRecBuf));
count++;
/* kw005.201 ccpu00117318, updating the statistics */
gCb->genSts.unexpPdusRecv++;
{
if (recBuf[sn])
{
+#ifdef NR_RLC_UL
rlcUmmReAssembleSdus(gCb,rbCb,recBuf[sn]);
- RLC_FREE_WC(gCb,recBuf[sn],sizeof(RlcUmRecBuf));
+#endif
+ RLC_FREE(gCb,recBuf[sn],sizeof(RlcUmRecBuf));
recBuf[sn] = NULLP;
}
sn = (sn + 1) & RLC_UMUL.modBitMask;
tVrUr = RLC_UM_GET_VALUE(*vrUr,RLC_UMUL);
while (recBuf[sn] && tSn < tVrUr)
{
+#ifdef NR_RLC_UL
rlcUmmReAssembleSdus(gCb,rbCb,recBuf[sn]);
- RLC_FREE_WC(gCb,recBuf[sn],sizeof(RlcUmRecBuf));
+#endif
+ RLC_FREE(gCb,recBuf[sn],sizeof(RlcUmRecBuf));
recBuf[sn] = NULLP;
sn = (sn + 1) & RLC_UMUL.modBitMask;
tSn = RLC_UM_GET_VALUE(sn, RLC_UMUL);
return;
}
-/**
- * @brief Handler to reassemble the SDUs and send them to the upper layer.
- *
- * @details
- * This function processes the received in-sequence PDU and
- * re-assembles the SDUs and sends them to the upper layer.
- *
- * @param[in] gCb RLC Instance control block
- * @param[in] rbCb RB control block
- * @param[in] umRecBuf Reception Buffer to be Re-Assembled
- *
- * @return Void
-*/
-static void rlcUmmReAssembleSdus(RlcCb *gCb, RlcUlRbCb *rbCb, RlcUmRecBuf *umRecBuf)
-{
- uint32_t liCount; /* LI count */
- uint32_t count; /* Loop counter */
- uint8_t fi; /* Framing Info */
- uint16_t sn; /* Sequence Number of current PDU */
- MsgLen len; /* PDU Length */
- Buffer *sdu; /* SDU to be sent to upper layer */
- Buffer *remPdu; /* Remaining PDU */
- Buffer **partialSdu; /* Partial SDU */
-
- liCount = umRecBuf->umHdr.numLi;
- fi = umRecBuf->umHdr.fi;
- sn = umRecBuf->umHdr.sn;
-
- for (count = 0; (count <= liCount);count++)
- {
- if (count < liCount )
- len = umRecBuf->umHdr.li[count];
- else
- {
- if (!(umRecBuf->pdu))
- {
- return;
- }
- ODU_GET_MSG_LEN(umRecBuf->pdu,&len);
- }
-
- /* get the sdu out of the pdu */
- ODU_SEGMENT_MSG(umRecBuf->pdu,len,&remPdu);
- sdu = umRecBuf->pdu;
- umRecBuf->pdu = remPdu;
-
- partialSdu = &(rbCb->m.umUl.partialSdu);
- /* While re-assembling the SDUs, consider the first LI and perform
- * the following steps.
- -# If the first bit of FI(Framing Info of 2 bits) is set =>
- -# The current Data field in the PDU is a segment.
- So form a SDU only if the
- rbCb->m.um.umUl.partialSdu exists and the SNs are
- in-sequence.
- -# If there are no LIs and the second bit of LI is 1
- then a partial SDU is formed which would not be sent
- to the upper layer.
- -# else
- -# If rbCb->partialSdu is not NULL then flush it off.
- -# If LI count > 0 or LI count is 0 and second bit
- of FI is not 1
- The SDU is complete.So send it to upper layer.
- -# else
- The SDU is partial and is placed
- in rbCb->m.um.umUl.partialSdu;
- */
-
- if (0 == count )
- {
- if (fi & 2)
- {
- if ((*partialSdu) &&
- (sn == ((rbCb->m.umUl.sn + 1) & rbCb->m.umUl.modBitMask)))
- {
- ODU_CAT_MSG(*partialSdu,sdu,M1M2);
- RLC_FREE_BUF(sdu);
- if (liCount > 0 || !(fi & 1))
- {
- rlcUtlSendUlDataToDu(gCb,rbCb,*partialSdu);
- *partialSdu = NULLP;
- }
- }
- else
- {
- /* Partial Sdu stored is not valid now.So free it */
- if (*partialSdu)
- {
- RLC_FREE_BUF(*partialSdu);
- *partialSdu = NULLP;
- }
-
- RLC_FREE_BUF(sdu);
- sdu = NULLP;
- }
- }
- else
- {
- if (*partialSdu)
- {
- RLC_FREE_BUF(*partialSdu); /* RLC mem leak fix */
- *partialSdu = NULLP;
- }
-
- if (liCount > 0 || !( fi & 1))
- {
- rlcUtlSendUlDataToDu(gCb,rbCb,sdu);
- }
- else
- {
- *partialSdu = sdu;
- }
- }
- }
- /*
- If the SDU pointer has the last Data field of the PDU
- -# If FI is 1,place the SDU in rbCb->m.um.umDl.partialSdu
- -# else send the SDU to upper layer.
- */
- else if (count == liCount)
- {
- if (fi & 1)
- {
- *partialSdu = sdu;
- }
- else
- {
- rlcUtlSendUlDataToDu(gCb, rbCb, sdu);
- }
- }
- /*
- If the LI is something other than the first one,
- just send the SDU to the upper layer */
- else
- {
- rlcUtlSendUlDataToDu(gCb, rbCb, sdu);
- }
- }
- rbCb->m.umUl.sn = sn;
-
- return;
-}
-
/**
* @brief Handler to process the re-establishment request received
* from the upper layer.
{
if ( recBuf[curSn] != NULLP )
{
+#ifdef NR_RLC_UL
rlcUmmReAssembleSdus(gCb,rbCb,recBuf[curSn]);
- RLC_FREE_WC(gCb,recBuf[curSn],sizeof(RlcUmRecBuf));
+#endif
+ RLC_FREE(gCb,recBuf[curSn],sizeof(RlcUmRecBuf));
recBuf[curSn] = NULLP;
}
curSn = (curSn + 1) & rbCb->m.umUl.modBitMask;
{
if (RLC_UMUL.recBuf[prevVrUr])
{
+#ifdef NR_RLC_UL
rlcUmmReAssembleSdus(gCb, rbCb, RLC_UMUL.recBuf[prevVrUr]);
+#endif
if(RLC_UMUL.recBuf[prevVrUr]->pdu != NULLP) /* RLC mem leak fix */
{
- RLC_FREE_BUF(RLC_UMUL.recBuf[prevVrUr]->pdu);
+ ODU_PUT_MSG_BUF(RLC_UMUL.recBuf[prevVrUr]->pdu);
}
- RLC_FREE_WC(gCb, RLC_UMUL.recBuf[prevVrUr], sizeof(RlcUmRecBuf));
+ RLC_FREE(gCb, RLC_UMUL.recBuf[prevVrUr], sizeof(RlcUmRecBuf));
RLC_UMUL.recBuf[prevVrUr] = NULLP;
}
{
if (umRecBuf[curSn] != NULLP)
{
- RLC_FREE_BUF_WC(umRecBuf[curSn]->pdu);
+ ODU_PUT_MSG_BUF(umRecBuf[curSn]->pdu);
umRecBuf[curSn]->pdu = NULLP;
- RLC_FREE_WC(gCb, umRecBuf[curSn], sizeof(RlcUmRecBuf));
+ RLC_FREE(gCb, umRecBuf[curSn], sizeof(RlcUmRecBuf));
umRecBuf[curSn] = NULLP;
}
curSn++;
}
- RLC_FREE_WC(gCb,rbCb->m.umUl.recBuf, (windSz ) * sizeof(RlcUmRecBuf*));
+ RLC_FREE(gCb,rbCb->m.umUl.recBuf, (windSz ) * sizeof(RlcUmRecBuf*));
rbCb->m.umUl.recBuf = NULLP;
return;
}
ulInst->genSts.pdusRecv,
ulInst->genSts.unexpPdusRecv,
ulInst->genSts.errorPdusRecv);
- RLOG4(L_ALWAYS,"RLC Stats: AMDL: "
+ RLOG4(L_ALWAYS,"RLC Stats: RLC_AMDL: "
"StaPduSent:%lu NacksInStaPdu:%lu BytesUnused:%lu PollTimerExpires SRB:%lu ",
gRlcStats.amRlcStats.numDLStaPduSent, gRlcStats.amRlcStats.numDLNacksInStaPdu,
gRlcStats.amRlcStats.numDLBytesUnused, gRlcStats.amRlcStats.numDLPollTimerExpiresSrb);
- RLOG3(L_ALWAYS,"RLC Stats: AMDL: "
+ RLOG3(L_ALWAYS,"RLC Stats: RLC_AMDL: "
"DRB:%lu MaxRetx:%lu RetransPdus:%lu",
gRlcStats.amRlcStats.numDLPollTimerExpiresDrb, gRlcStats.amRlcStats.numDLMaxRetx,
gRlcStats.amRlcStats.numDLRetransPdus);
- RLOG4(L_ALWAYS,"RLC Stats: AMUL: "
+ RLOG4(L_ALWAYS,"RLC Stats: RLC_AMUL: "
" PdusDiscarded:%lu ReOrdTimerExpires:%lu StaPduRcvd:%lu NackInStaPduRcvd:%lu ",
gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReOrdTimerExpires,
gRlcStats.amRlcStats.numULStaPduRcvd, gRlcStats.amRlcStats.numULNackInStaPduRcvd);
ulInst->genSts.unexpPdusRecv,
ulInst->genSts.errorPdusRecv);
RTLIN_DUMP_DEBUG("RLC Stats:"
- "AMDL: StaPduSent:%lu NacksInStaPdu:%lu BytesUnused:%lu PollTimerExpires SRB:%lu DRB:%lu MaxRetx:%lu RetransPdus:%lu \n"
- "AMUL: PdusDiscarded:%lu ReOrdTimerExpires:%lu StaPduRcvd:%lu NackInStaPduRcvd:%lu \n",
+ "RLC_AMDL: StaPduSent:%lu NacksInStaPdu:%lu BytesUnused:%lu PollTimerExpires SRB:%lu DRB:%lu MaxRetx:%lu RetransPdus:%lu \n"
+ "RLC_AMUL: PdusDiscarded:%lu ReOrdTimerExpires:%lu StaPduRcvd:%lu NackInStaPduRcvd:%lu \n",
gRlcStats.amRlcStats.numDLStaPduSent, gRlcStats.amRlcStats.numDLNacksInStaPdu, gRlcStats.amRlcStats.numDLBytesUnused,
gRlcStats.amRlcStats.numDLPollTimerExpiresSrb, gRlcStats.amRlcStats.numDLPollTimerExpiresDrb, gRlcStats.amRlcStats.numDLMaxRetx,
gRlcStats.amRlcStats.numDLRetransPdus, gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReOrdTimerExpires,
ulInst->genSts.pdusRecv,
ulInst->genSts.unexpPdusRecv,
ulInst->genSts.errorPdusRecv);
- RLOG4(L_ALWAYS,"RLC Stats: AMDL: "
+ RLOG4(L_ALWAYS,"RLC Stats: RLC_AMDL: "
"StaPduSent:%lu NacksInStaPdu:%lu BytesUnused:%lu PollTimerExpires SRB:%lu ",
gRlcStats.amRlcStats.numDLStaPduSent, gRlcStats.amRlcStats.numDLNacksInStaPdu,
gRlcStats.amRlcStats.numDLBytesUnused, gRlcStats.amRlcStats.numDLPollTimerExpiresSrb);
- RLOG3(L_ALWAYS,"RLC Stats: AMDL: "
+ RLOG3(L_ALWAYS,"RLC Stats: RLC_AMDL: "
"DRB:%lu MaxRetx:%lu RetransPdus:%lu",
gRlcStats.amRlcStats.numDLPollTimerExpiresDrb, gRlcStats.amRlcStats.numDLMaxRetx,
gRlcStats.amRlcStats.numDLRetransPdus);
- RLOG4(L_ALWAYS,"RLC Stats: AMUL: "
+ RLOG4(L_ALWAYS,"RLC Stats: RLC_AMUL: "
" PdusDiscarded:%lu ReOrdTimerExpires:%lu StaPduRcvd:%lu NackInStaPduRcvd:%lu ",
gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReOrdTimerExpires,
gRlcStats.amRlcStats.numULStaPduRcvd, gRlcStats.amRlcStats.numULNackInStaPduRcvd);
/* RTLIN_DUMP_DEBUG("AM RLC Stats:"
- "AMDL: SDUs Tx :(%u) SDU Bytes Tx :(%u) SDUs Retx :(%u) MaxRetx:(%u) WindowStalls: (%u) \n"
- "AMUL: DropOutWinRx :(%u) SDUs Rx :(%u) SDU Bytes Rx :(%u) SDUNack Rx :(%u) Duplicate Pdu Rx :(%u) \n",
+ "RLC_AMDL: SDUs Tx :(%u) SDU Bytes Tx :(%u) SDUs Retx :(%u) MaxRetx:(%u) WindowStalls: (%u) \n"
+ "RLC_AMUL: DropOutWinRx :(%u) SDUs Rx :(%u) SDU Bytes Rx :(%u) SDUNack Rx :(%u) Duplicate Pdu Rx :(%u) \n",
gRlcStats.amRlcStats.numRlcAmCellSduTx, gRlcStats.amRlcStats.numRlcAmCellSduBytesTx,
gRlcStats.amRlcStats.numRlcAmCellRetxPdu, gRlcStats.amRlcStats.numRlcAmMaxRetx, gRlcStats.amRlcStats.numRlcAmCellWinStall,
gRlcStats.amRlcStats.numRlcAmCellDropOutWinRx, gRlcStats.amRlcStats.numRlcAmCellSduRx,
ulInst->genSts.pdusRecv,
ulInst->genSts.unexpPdusRecv,
ulInst->genSts.errorPdusRecv);
- RTLIN_DUMP_DEBUG("AMDL: StaPduSent:%u NacksInStaPdu:%u BytesUnused:%u PollTimerExpires SRB:%u DRB:%u MaxRetx:%u RetransPdus:%u \n"
+ RTLIN_DUMP_DEBUG("RLC_AMDL: StaPduSent:%u NacksInStaPdu:%u BytesUnused:%u PollTimerExpires SRB:%u DRB:%u MaxRetx:%u RetransPdus:%u \n"
" SDUs Tx :(%u) SDU Bytes Tx :(%u) SDUs Retx :(%u) WindowStalls: (%u) \n"
- "AMUL: PdusDiscarded:%u ReOrdTimerExpires:%u StaPduRcvd:%u NackInStaPduRcvd:%u \n"
+ "RLC_AMUL: PdusDiscarded:%u ReOrdTimerExpires:%u StaPduRcvd:%u NackInStaPduRcvd:%u \n"
" DropOutWinRx :(%u) SDUs Rx :(%u) SDU Bytes Rx :(%u) SDUNack Rx :(%u) Duplicate Pdu Rx:(%u) \n",
gRlcStats.amRlcStats.numDLStaPduSent, gRlcStats.amRlcStats.numDLNacksInStaPdu, gRlcStats.amRlcStats.numDLBytesUnused,
gRlcStats.amRlcStats.numDLPollTimerExpiresSrb, gRlcStats.amRlcStats.numDLPollTimerExpiresDrb,
datIndSz += len;
}
datReqTb->lchData[count].setMaxUlPrio = FALSE;
- if (RLC_AM_IS_POLL_BIT_SET(AMDL) &&
- (AMDL.sduQ.count > 1))
+ if (RLC_AM_IS_POLL_BIT_SET(RLC_AMDL) &&
+ (RLC_AMDL.sduQ.count > 1))
{
/* Poll bit is set indicate to MAC*/
datReqTb->lchData[count].setMaxUlPrio = TRUE;
#ifndef TENB_ACC
if ((rbCb->lastRprtdBoToMac > (uint32_t)8000) && (rbCb->boUnRprtdCnt < (uint32_t)5)
- && (!staPduPrsnt) && ((CM_LTE_MODE_AM == rbCb->mode ) && (AMDL.nxtRetx == NULLP)))
+ && (!staPduPrsnt) && ((CM_LTE_MODE_AM == rbCb->mode ) && (RLC_AMDL.nxtRetx == NULLP)))
{
rbCb->boUnRprtdCnt++;
return ROK;
RlcSn mTxNext; /* send state variable */
RlcTx *txBuf;
- MODAMT(AMDL.txNext, mTxNext, AMDL.txNextAck,AMDL.snModMask);
+ MODAMT(RLC_AMDL.txNext, mTxNext, RLC_AMDL.txNextAck,RLC_AMDL.snModMask);
/* TODO : to be checked changed from <= to < */
while ((0 < mTxNext) && *toBeFreed)
{
- txBuf = rlcUtlGetTxBuf(AMDL.txBufLst, AMDL.txNextAck);
+ txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, RLC_AMDL.txNextAck);
if (txBuf && txBuf->pduLst.first)
{
while(txBuf->pduLst.first)
{
RlcDlPduInfo *pduInfo = (RlcDlPduInfo *)(txBuf->pduLst.first->node);
- RLC_FREE_BUF(pduInfo->pdu);
+ ODU_PUT_MSG_BUF(pduInfo->pdu);
/* 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));
}
- rlcUtlDelTxBuf(AMDL.txBufLst, txBuf, gCb);
+ rlcUtlDelTxBuf(RLC_AMDL.txBufLst, txBuf, gCb);
if(gCb->u.dlCb->shutdownReceived == 0)
{
(*toBeFreed)--;
}
}
- AMDL.txNextAck = (AMDL.txNextAck + 1) & AMDL.snModMask;
- MODAMT(AMDL.txNext, mTxNext, AMDL.txNextAck,AMDL.snModMask);
+ RLC_AMDL.txNextAck = (RLC_AMDL.txNextAck + 1) & RLC_AMDL.snModMask;
+ MODAMT(RLC_AMDL.txNext, mTxNext, RLC_AMDL.txNextAck,RLC_AMDL.snModMask);
}
if(*toBeFreed == 0)
{
}
#ifndef LTE_TDD
- RLC_FREE(gCb,AMDL.txBufLst, (RLC_TX_BUF_BIN_SIZE * sizeof(CmLListCp)));
+ RLC_FREE(gCb,RLC_AMDL.txBufLst, (RLC_TX_BUF_BIN_SIZE * sizeof(CmLListCp)));
#endif
- RLC_LLIST_FIRST_RETX(AMDL.retxLst, retx);
+ RLC_LLIST_FIRST_RETX(RLC_AMDL.retxLst, retx);
while (retx && (*toBeFreed)) /* Till to be freed becomes 0 */
{
- RLC_FREE_BUF(retx->seg);
+ ODU_PUT_MSG_BUF(retx->seg);
- cmLListDelFrm(&AMDL.retxLst, &retx->lstEnt);
- RLC_FREE_WC(gCb, retx, sizeof(RlcRetx));
+ cmLListDelFrm(&RLC_AMDL.retxLst, &retx->lstEnt);
+ RLC_FREE(gCb, retx, sizeof(RlcRetx));
- RLC_LLIST_FIRST_RETX(AMDL.retxLst, retx);
+ RLC_LLIST_FIRST_RETX(RLC_AMDL.retxLst, retx);
if(gCb->u.dlCb->shutdownReceived == 0)
{
(*toBeFreed)--;
}
- AMDL.nxtRetx = NULLP;
+ RLC_AMDL.nxtRetx = NULLP;
/* clean up if there is info about STATUS PDU to be sent */
- if(AMDL.pStaPdu)
+ if(RLC_AMDL.pStaPdu)
{
Pst *udxPst;
udxPst = &gCb->u.dlCb->udxDlSap->pst;
RLC_FREE_SHRABL_BUF_WC(udxPst->region,
udxPst->pool,
- AMDL.pStaPdu,
+ RLC_AMDL.pStaPdu,
sizeof(RlcUdxDlStaPdu));
- AMDL.pStaPdu = NULLP;
+ RLC_AMDL.pStaPdu = NULLP;
}
if(*toBeFreed == 0)
{
RlcRetx* seg = (RlcRetx *)(lst->first->node);
cmLListDelFrm(lst, lst->first);
- RLC_FREE_BUF_WC(seg->seg);
- RLC_FREE_WC(gCb,seg, sizeof(RlcRetx));
+ ODU_PUT_MSG_BUF(seg->seg);
+ RLC_FREE(gCb,seg, sizeof(RlcRetx));
toBeFreed--;
}
RlcDlPduInfo *pduInfo = (RlcDlPduInfo *)(pdu->pduLst.first->node);
cmLListDelFrm(&pdu->pduLst, pdu->pduLst.first);
- RLC_FREE_BUF_WC(pduInfo->pdu);
- RLC_FREE_WC(gCb, pduInfo, sizeof(RlcDlPduInfo));
+ ODU_PUT_MSG_BUF(pduInfo->pdu);
+ RLC_FREE(gCb, pduInfo, sizeof(RlcDlPduInfo));
}
- RLC_FREE_WC(gCb,pdu, sizeof(RlcTx));
+ RLC_FREE(gCb,pdu, sizeof(RlcTx));
toBeFreed--;
}
if(!moreToBeFreed)
{
cmLListDelFrm(lst, lst->first);
- RLC_FREE_WC(gCb, rbCb, sizeof(RlcDlRbCb));
+ RLC_FREE(gCb, rbCb, sizeof(RlcDlRbCb));
}
}
txBufLstCp = &txBufLst[hashKey];
//printf("D-sn(%d)\n", txBuf->hdr.sn);
cmLListDelFrm(txBufLstCp, &txBuf->lnk);
- RLC_FREE_WC(gCb, txBuf, sizeof(RlcTx));
+ RLC_FREE(gCb, txBuf, sizeof(RlcTx));
return;
} /* rlcUtlDelTxBuf */
{
if(datIndInfo->lchData[i].pdu.mBuf[j])
{
- RLC_FREE_BUF_WC(datIndInfo->lchData[i].pdu.mBuf[j]);
+ ODU_PUT_MSG_BUF(datIndInfo->lchData[i].pdu.mBuf[j]);
}
}
}
{
if(pduInfo->mBuf[j])
{
- RLC_FREE_BUF_WC(pduInfo->mBuf[j]);
+ ODU_PUT_MSG_BUF(pduInfo->mBuf[j]);
}
}
continue;
{
DU_LOG("\nRLC : rlcUtlSendUlDataToDu: Memory allocation failed UEID:%d \
CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId);
- RLC_FREE_BUF(sdu);
+ ODU_PUT_MSG_BUF(sdu);
return RFAILED;
}
#endif /* ERRCLASS & ERRCLS_ADD_RES */
CM_LLIST_NEXT_NODE(recBufLstCp, node);
}
return NULLP;
-} /* rlcUtlStoreRecBuf */
+} /* rlcUtlGetRecBuf */
/**
*
* @brief Delete the UL buffer from the list
recBufLstCp = &recBufLst[hashKey];
cmLListDelFrm(recBufLstCp, &recBuf->lnk);
- RLC_FREE_WC(gCb, recBuf, sizeof(RlcAmRecBuf));
+ RLC_FREE(gCb, recBuf, sizeof(RlcAmRecBuf));
return;
} /* rlcUtlDelRecBuf */
+#ifdef NR_RLC_UL
+/**
+ *
+ * @brief Store the UL buffer in hashList
+ *
+ *
+ * @b Description
+ *
+ * Use the SN % binSize as key and store the received UL buffer
+ * @param[in] recBufLst List CP array
+ * @param[in] recBuf received buffer
+ * @param[in] sn sn of the received buffer
+ *
+ *
+ * @return Void
+ */
+void rlcUtlStoreUmRecBuf(CmLListCp *recBufLst, RlcUmRecBuf *recBuf, RlcSn sn)
+{
+ uint32_t hashKey;
+
+ hashKey = (sn % RLC_RCV_BUF_BIN_SIZE );
+ recBuf->lnk.node = (PTR)recBuf;
+ cmLListAdd2Tail(&(recBufLst[hashKey]), &recBuf->lnk);
+ return;
+} /* rlcUtlStoreUmRecBuf */
+/**
+ *
+ * @brief Retrieve the UL buffer from the list
+ *
+ *
+ * @Description
+ *
+ * Use the SN % binSize as key and retrieve the UL buffer
+ * @param[in] recBufLst List CP array
+ * @param[in] sn sn of the received buffer
+ *
+ *
+ * @return Void
+ */
+RlcUmRecBuf* rlcUtlGetUmRecBuf(CmLListCp *recBufLst, RlcSn sn)
+{
+ uint32_t hashKey;
+ CmLListCp *recBufLstCp;
+ RlcUmRecBuf *recBuf;
+ CmLList *node = NULLP;
+
+ hashKey = (sn % RLC_RCV_BUF_BIN_SIZE );
+
+ recBufLstCp = &recBufLst[hashKey];
+ CM_LLIST_FIRST_NODE(recBufLstCp, node);
+ while(node)
+ {
+ recBuf = (RlcUmRecBuf *) node->node;
+ if(recBuf->umHdr.sn == sn)
+ {
+ return recBuf;
+ }
+ CM_LLIST_NEXT_NODE(recBufLstCp, node);
+ }
+ return NULLP;
+} /* rlcUtlGetUmRecBuf */
+#endif
/********************************************************************30**