X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Frg_mux.c;h=22b8f1eae7c5c882b03792071fd5b4572bef02a3;hb=3330932565e15a749fd5dd5039cdea2862ca51cc;hp=2e1acbb2b8a339b7ca86b7ab0bef8789365f238b;hpb=aee73991f728cc127d1ed76d5a52571d916235a4;p=o-du%2Fl2.git diff --git a/src/5gnrmac/rg_mux.c b/src/5gnrmac/rg_mux.c index 2e1acbb2b..22b8f1eae 100755 --- a/src/5gnrmac/rg_mux.c +++ b/src/5gnrmac/rg_mux.c @@ -32,9 +32,6 @@ @brief MAC Multiplexing API. */ -static const char* RLOG_MODULE_NAME="MAC"; -static int RLOG_FILE_ID=229; -static int RLOG_MODULE_ID=4096; /* header include files -- defines (.h) */ #include "common_def.h" @@ -66,25 +63,25 @@ static int RLOG_MODULE_ID=4096; #include "ss_msg.x" /* MAC includes */ /* local defines */ #ifndef T2K_MEM_LEAK_DBG -EXTERN S16 ssGetDBufOfSize(Region region,Size size,Buffer **dBuf); + S16 ssGetDBufOfSize(Region region,Size size,Buffer **dBuf); #else char* file = __FILE__; -U32 line = __LINE__; +uint32_t line = __LINE__; #endif /* local typedefs */ /* global variables */ -U32 rgDlrate_rgu; +uint32_t rgDlrate_rgu; /* local externs */ -PRIVATE Void rgMUXGet20bitRarGrnt ARGS((U8 ulBw, +static Void rgMUXGet20bitRarGrnt ARGS((uint8_t ulBw, RgInfRarUlGrnt *msg3Grnt, - U8 *grnt)); -EXTERN U16 rgMUXCalcRiv ARGS((U8 bw, - U8 rbStart, - U8 numRb)); + uint8_t *grnt)); +uint16_t rgMUXCalcRiv ARGS((uint8_t bw, + uint8_t rbStart, + uint8_t numRb)); #ifndef MS_MBUF_CORRUPTION #define MS_BUF_ADD_ALLOC_CALLER() @@ -100,11 +97,11 @@ EXTERN U16 rgMUXCalcRiv ARGS((U8 bw, #define RG_PACK_CE(_ce, _len, _ceBuf, _ret) {\ MS_BUF_ADD_ALLOC_CALLER(); \ - _ret = SAddPstMsgMult((U8 *)(&(_ce)), _len, _ceBuf);\ + _ret = SAddPstMsgMult((uint8_t *)(&(_ce)), _len, _ceBuf);\ } #define RG_MUX_CALC_LEN(_len,_lenBytes,_elmTotLen) {\ - U8 _hdrLen;\ + uint8_t _hdrLen;\ _lenBytes = (_len <= 255) ? 1 : 2;\ _hdrLen = _lenBytes + RG_SDU_SHDR_LEN;\ _elmTotLen = _hdrLen + _len;\ @@ -155,27 +152,17 @@ EXTERN U16 rgMUXCalcRiv ARGS((U8 bw, * -# ROK * -# RFAILED **/ -#ifdef ANSI -PRIVATE S16 rgMUXAddCes +static S16 rgMUXAddCes ( Inst inst, RgBldPduInfo *pdu, Buffer *ceBuf, RgErrInfo *err ) -#else -PRIVATE S16 rgMUXAddCes(inst,pdu, ceShdrBuf, ceBuf, err) -Inst inst; -RgBldPduInfo *pdu; -Buffer *ceBuf; -RgErrInfo *err; -#endif { S16 ret; RgMUXSubHdr subHdr; - TRC2(rgMUXAddCes) - if (NULLP != pdu->contResId) { if(pdu->schdTbSz >= RG_CRES_ELM_LEN) @@ -185,7 +172,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_CEHDR_FAIL; - RLOG0(L_ERROR, "Muxing of Contention Resolution CE sub-header is failed"); + DU_LOG("\nERROR --> MAC : Muxing of Contention Resolution CE sub-header is failed"); return RFAILED; } @@ -194,7 +181,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_CE_FAIL; - RLOG0(L_ERROR, "Muxing of Contention Resolution CE is failed") + DU_LOG("\nERROR --> MAC : Muxing of Contention Resolution CE is failed"); return RFAILED; } pdu->schdTbSz -= RG_CRES_ELM_LEN; @@ -204,13 +191,13 @@ RgErrInfo *err; { if(pdu->schdTbSz >= RG_TA_ELM_LEN) { - U8 taVal; /* Moving from outer scope to available scope */ + uint8_t taVal; /* Moving from outer scope to available scope */ RG_PACK_SHDR_FIXD_SZ(subHdr, RG_TA_LCID_IDX, ceBuf, ret); if(ret != ROK) { err->errCause = RGERR_MUX_BLD_CEHDR_FAIL; - RLOG0(L_ERROR, "Muxing of TA CE sub-hdr is failed") + DU_LOG("\nERROR --> MAC : Muxing of TA CE sub-hdr is failed"); return RFAILED; } @@ -220,11 +207,11 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_CE_FAIL; - RLOG0(L_ERROR, "Muxing of TA CE is failed") + DU_LOG("\nERROR --> MAC : Muxing of TA CE is failed"); return RFAILED; } pdu->schdTbSz -= RG_TA_ELM_LEN; - RLOG1(L_DEBUG,"TA muxed by MAC: %u", pdu->ta.val); + DU_LOG("\nDEBUG --> MAC : TA muxed by MAC: %u", pdu->ta.val); } } #ifdef LTE_ADV @@ -238,7 +225,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_CEHDR_FAIL; - RLOG0(L_ERROR, "Muxing of SCELL Activation CE sub-hdr is failed") + DU_LOG("\nERROR --> MAC : Muxing of SCELL Activation CE sub-hdr is failed") return RFAILED; } @@ -248,7 +235,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_CE_FAIL; - RLOG0(L_ERROR, "Muxing of SCELL Activation CE is failed") + DU_LOG("\nERROR --> MAC : Muxing of SCELL Activation CE is failed") return RFAILED; } pdu->schdTbSz -= RG_SCELL_CE_ELM_LEN; @@ -272,7 +259,7 @@ RgErrInfo *err; * * @param[in] Inst inst * @param[in] MsgLen *schdTbSz - * @param[in] U8 lcId + * @param[in] uint8_t lcId * @param[in] Buffer *sdu * @param[out] Buffer *sduBuf * @param[out] RgErrInfo *err @@ -280,32 +267,21 @@ RgErrInfo *err; * -# ROK * -# RFAILED **/ -#ifdef ANSI -PRIVATE S16 rgMUXInsSdu +static S16 rgMUXInsSdu ( Inst inst, MsgLen *schdTbSz, -U8 lcId, +uint8_t lcId, Buffer *sdu, Buffer *sduBuf, RgErrInfo *err ) -#else -PRIVATE S16 rgMUXInsSdu(inst,schdTbSz, lcId, sdu, sduBuf, err) -Inst inst; -MsgLen *schdTbSz; -U8 lcId; -Buffer *sdu; -Buffer *sduBuf; -RgErrInfo *err; -#endif { S16 ret; MsgLen msgLen = 0; - U8 lenBytes; + uint8_t lenBytes; MsgLen elmTotLen; - TRC2(rgMUXInsSdu) SFndLenMsg(sdu, &msgLen); RG_MUX_CALC_LEN(msgLen,lenBytes,elmTotLen); @@ -321,7 +297,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_SDUHDR_FAIL; - RLOG1(L_ERROR, "RGERR_MUX_BLD_SDUHDR_FAIL for LCID:%d",lcId); + DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_SDUHDR_FAIL for LCID:%d",lcId); return RFAILED; } @@ -336,7 +312,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_SDU_FAIL; - RLOG1(L_ERROR, "RGERR_MUX_BLD_SDU_FAIL for LCID:%d",lcId); + DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_SDU_FAIL for LCID:%d",lcId); return RFAILED; } @@ -345,9 +321,9 @@ RgErrInfo *err; else { /* This Sub-PDU can not be accodmodated at all */ - RLOG4(L_ERROR, "Failed lcId %u, elmTotLen %d lenBytes %d LCID:%d", + DU_LOG("\nERROR --> MAC : Failed lcId %u, elmTotLen %d lenBytes %d LCID:%d", lcId, ((S16)elmTotLen), lenBytes,lcId); - RLOG3(L_ERROR, "msglen %d schdTbSz %d LCID:%d", + DU_LOG("\nERROR --> MAC : msglen %d schdTbSz %d LCID:%d", ((S16)msgLen), ((S16)*schdTbSz),lcId); return RFAILED; } @@ -370,10 +346,9 @@ RgErrInfo *err; * -# RFAILED **/ #ifdef L2_OPTMZ -U32 padSize = 0; +uint32_t padSize = 0; #endif -#ifdef ANSI -PUBLIC S16 rgMUXAddPadd +S16 rgMUXAddPadd ( Inst inst, MsgLen *schdTbSz, @@ -381,19 +356,10 @@ Buffer *sduBuf, Bool isRar, RgErrInfo *err ) -#else -PUBLIC S16 rgMUXAddPadd(inst,schdTbSz, sduBuf, isRar, err) -Inst inst; -MsgLen *schdTbSz; -Buffer *sduBuf; -Bool isRar; -RgErrInfo *err; -#endif { S16 ret = ROK; Buffer *padBuf = NULLP; RgMUXSubHdr subHdr; - TRC2(rgMUXAddPadd) #ifdef L2_OPTMZ padSize = 0; @@ -412,7 +378,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_PADHDR_FAIL; - RLOG0(L_ERROR, "RGERR_MUX_BLD_PADHDR_FAIL"); + DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_PADHDR_FAIL"); return RFAILED; } @@ -436,7 +402,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_PAD_FAIL; - RLOG0(L_ERROR, "RGERR_MUX_BLD_PAD_FAIL"); + DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_PAD_FAIL"); return RFAILED; } *schdTbSz = 0; @@ -461,7 +427,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_PAD_FAIL; - RLOG0(L_ERROR, "RGERR_MUX_BLD_PAD_FAIL"); + DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_PAD_FAIL"); return RFAILED; } @@ -483,7 +449,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_PAD_FAIL; - RLOG0(L_ERROR, "RGERR_MUX_BLD_PAD_FAIL"); + DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_PAD_FAIL"); return RFAILED; } @@ -513,27 +479,17 @@ RgErrInfo *err; * -# ROK * -# RFAILED **/ -#ifdef ANSI -PRIVATE S16 rgMUXAddSdus +static S16 rgMUXAddSdus ( Inst inst, RgBldPduInfo *pdu, Buffer *sduBuf, RgErrInfo *err ) -#else -PRIVATE S16 rgMUXAddSdus(inst,pdu, sduBuf, err) -Inst inst; -RgBldPduInfo *pdu; -Buffer *sduBuf; -RgErrInfo *err; -#endif { RgRguDDatReqPerUe *dDatReq; RgRguCmnDatReq *cDatReq; - TRC2(rgMUXAddSdus) - switch(pdu->reqType) { case EVTRGUCDATREQ: @@ -557,7 +513,7 @@ RgErrInfo *err; { if(pdu->tbIndex == 1) { - U16 idx1, idx2; + uint16_t idx1, idx2; /* Adding this temporary variable for optimization */ RguDatReqTb *datReqTb = &dDatReq->datReqTb[0]; @@ -574,7 +530,7 @@ RgErrInfo *err; datReqTb->lchData[idx1].pdu.mBuf[idx2], sduBuf, err) != ROK) { - RLOG1(L_ERROR, "FAILED for LCID:%d",datReqTb->lchData[idx1].lcId); + DU_LOG("\nERROR --> MAC : FAILED for LCID:%d",datReqTb->lchData[idx1].lcId); return RFAILED; } } @@ -584,7 +540,7 @@ RgErrInfo *err; } else if(pdu->tbIndex == 2) { - U16 idx1, idx2; + uint16_t idx1, idx2; RguDatReqTb *datReqTb = &dDatReq->datReqTb[1]; for (idx1=0; (idx1 < datReqTb->nmbLch); idx1++) { @@ -599,7 +555,7 @@ RgErrInfo *err; datReqTb->lchData[idx1].pdu.mBuf[idx2], sduBuf, err) != ROK) { - RLOG2(L_ERROR, "FAILED TB Size %d LCID:%d", + DU_LOG("\nERROR --> MAC : FAILED TB Size %d LCID:%d", ((S16)pdu->schdTbSz),datReqTb->lchData[idx1].lcId); return RFAILED; } @@ -616,7 +572,7 @@ RgErrInfo *err; } /* End of switch(reqType) */ if(rgMUXAddPadd(inst,&pdu->schdTbSz, sduBuf, FALSE, err) != ROK) { - RLOG1(L_ERROR, "FAILED for TB Size:%d",(S16)pdu->schdTbSz); + DU_LOG("\nERROR --> MAC : FAILED for TB Size:%d",(S16)pdu->schdTbSz); return RFAILED; } return ROK; @@ -649,33 +605,22 @@ RgErrInfo *err; * -# ROK * -# RFAILED **/ -#ifdef ANSI -PUBLIC S16 rgMUXBldPdu +S16 rgMUXBldPdu ( Inst inst, RgBldPduInfo *pdu, Buffer **txPdu, RgErrInfo *err ) -#else -PUBLIC S16 rgMUXBldPdu(inst, pdu, txPdu, err) -Inst inst; -RgBldPduInfo *pdu; -Buffer **txPdu; -RgErrInfo *err; -#endif { Buffer *mBuf = NULLP; - TRC2(rgMUXBldPdu) - - if (rgGetMsg(inst, &mBuf) != ROK) { /* Buffer couldnt get allocated. Return a failure */ err->errCause = RGERR_MUX_MEM_ALLOC_FAIL; err->errType = RGERR_MUX_BLD_PDU; - RLOG1(L_FATAL, "Memory allocation failed during MUXing of MAC TB: MacInst %d", inst); + DU_LOG("\nERROR --> MAC : Memory allocation failed during MUXing of MAC TB: MacInst %d", inst); return RFAILED; } @@ -683,7 +628,7 @@ RgErrInfo *err; { RG_FREE_MSG(mBuf); err->errType = RGERR_MUX_BLD_PDU; - RLOG1(L_ERROR, "Failed to Multiplex MAC CEs: MacInst %d", inst); + DU_LOG("\nERROR --> MAC : Failed to Multiplex MAC CEs: MacInst %d", inst); return RFAILED; } @@ -691,7 +636,7 @@ RgErrInfo *err; { RG_FREE_MSG(mBuf); err->errType = RGERR_MUX_BLD_PDU; - RLOG1(L_ERROR, "FAILED to Multiplex MAC SDU: MacInst %d", inst); + DU_LOG("\nERROR --> MAC : FAILED to Multiplex MAC SDU: MacInst %d", inst); return RFAILED; } @@ -717,8 +662,7 @@ RgErrInfo *err; * -# ROK * -# RFAILED **/ -#ifdef ANSI -PRIVATE S16 rgMUXAddSdus +static S16 rgMUXAddSdus ( Inst inst, RgBldPduInfo *pdu, @@ -726,20 +670,10 @@ Buffer *sHdrBuf, RgTfuDatReqTbInfo *tb, RgErrInfo *err ) -#else -PRIVATE S16 rgMUXAddSdus(pdu, sHdrBuf, tb, err) -Inst inst; -RgBldPduInfo *pdu; -Buffer *sHdrBuf; -RgTfuDatReqTbInfo *tb; -RgErrInfo *err; -#endif { RgRguDDatReqPerUe *dDatReq; RgRguCmnDatReq *cDatReq; - U32 lchIdx, pduIdx; - - TRC2(rgMUXAddSdus) + uint32_t lchIdx, pduIdx; switch(pdu->reqType) { @@ -762,7 +696,8 @@ RgErrInfo *err; = cDatReq->pdu; tb->lchInfo[tb->numLch].numPdu++; tb->numLch++; - RLOG3(L_INFO,"MSG4 is muxed numLch=%ld numPdu=%ld tbaddr =%p", tb->numLch,tb->lchInfo[tb->numLch-1].numPdu, (U32)tb); + DU_LOG("\nINFO --> MAC : MSG4 is muxed numLch=%ld numPdu=%ld tbaddr =%p",\ + tb->numLch,tb->lchInfo[tb->numLch-1].numPdu, (uint32_t)tb); } break; @@ -773,7 +708,7 @@ RgErrInfo *err; { if(pdu->tbIndex == 1) { - U16 idx1, idx2; + uint16_t idx1, idx2; /* Adding this temporary variable for optimization */ RguDatReqTb *datReqTb = &dDatReq->datReqTb[0]; @@ -794,7 +729,7 @@ RgErrInfo *err; datReqTb->lchData[idx1].pdu.mBuf[idx2], sHdrBuf, NULLP, err) != ROK) { - RGDBGERRNEW(inst,(rgPBuf(inst), "FAILED\n")); + DU_LOG("\nERROR --> MAC : Failed to insert SDU in rgMUXAddSdus\n"); return RFAILED; } @@ -816,12 +751,12 @@ RgErrInfo *err; tmp = datReqTb->lchData[idx1].pdu.mBuf[idx2]->b_cont; if(NULL == tmp->b_rptr) { - RLOG0(L_INFO,"11111Its Null here only "); + DU_LOG("\nERROR --> MAC : rgMUXAddSdus failed in EVTRGUDDATREQ"); } } else { - RLOG0(L_INFO,"222222Its Null here only \n"); + DU_LOG("\nERROR --> MAC : rgMUXAddSdus failed in EVTRGUDDATREQ"); } pduIdx++; //tb->lchInfo[tb->numLch].numPdu++; @@ -842,7 +777,7 @@ RgErrInfo *err; } else if(pdu->tbIndex == 2) { - U16 idx1, idx2; + uint16_t idx1, idx2; RguDatReqTb *datReqTb = &dDatReq->datReqTb[1]; tb->numLch = lchIdx = 0; // prc_trace_format_string(0x40,3,": AddSdus: numOfLch=%d numOfPdu=%d, schdSz=%d", datReqTb->nmbLch, datReqTb->lchData[0].pdu.numPdu, pdu->schdTbSz); @@ -860,8 +795,8 @@ RgErrInfo *err; datReqTb->lchData[idx1].pdu.mBuf[idx2], sHdrBuf, NULLP, err) != ROK) { - RGDBGERRNEW(inst,(rgPBuf(inst), "FAILED TB Size %d\n", - ((S16)pdu->schdTbSz))); + DU_LOG("\nERROR --> MAC : FAILED TB Size %d\n", + ((S16)pdu->schdTbSz)); return RFAILED; } /* L2 Optimization for mUe/Tti:Increment numPdu by 1 @@ -880,12 +815,12 @@ RgErrInfo *err; tmp = datReqTb->lchData[idx1].pdu.mBuf[idx2]->b_cont; if(NULL == tmp->b_rptr) { - RLOG0(L_INFO,"2212121Its Null here only \n"); + DU_LOG("\nERROR --> MAC : rgMUXAddSdus failed in EVTRGUDDATREQ"); } } else { - RLOG0(L_INFO,"343343433ts Null here only \n"); + DU_LOG("\nERROR --> MAC : rgMUXAddSdus failed in EVTRGUDDATREQ"); } pduIdx++; // tb->lchInfo[tb->numLch].numPdu++; @@ -956,28 +891,18 @@ RgErrInfo *err; * -# ROK * -# RFAILED **/ -#ifdef ANSI -PUBLIC S16 rgMUXBldPdu +S16 rgMUXBldPdu ( Inst inst, RgBldPduInfo *pdu, RgTfuDatReqTbInfo *tb, RgErrInfo *err ) -#else -PUBLIC S16 rgMUXBldPdu(inst, pdu, tb, err) -Inst inst; -RgBldPduInfo *pdu; -RgTfuDatReqTbInfo *tb; -RgErrInfo *err; -#endif { Buffer *mBuf1; /* MAC hearder */ Buffer *mBuf2; /* MAC CEs */ - //U32 lchIdx, pduIdx; + //uint32_t lchIdx, pduIdx; - TRC2(rgMUXBldPdu) - /* Reseting macHdr and macCes pointers */ if(tb->macHdr) SResetMBuf(tb->macHdr); @@ -991,7 +916,7 @@ RgErrInfo *err; if(rgMUXAddCes(inst, pdu, mBuf1, mBuf2, err) != ROK) { /* Reset rPtr and wPtr to the base of data buffer(db_base)*/ - RLOG0(L_INFO,"rgMUXBldPdu: rgMUXAddCes is Failed \n"); + DU_LOG("\nERROR --> MAC : rgMUXBldPdu: rgMUXAddCes is Failed \n"); RG_FREE_TB(tb); err->errType = RGERR_MUX_BLD_PDU; //RGDBGERRNEW((rgPBuf, "FAILED")); @@ -1001,7 +926,7 @@ RgErrInfo *err; { /*TODO:MP Reset rPtr and wPtr to the base of data buffer(db_base) * Reset numLch and numPdu to zero and set MAC SDU buf to NULLP */ - RLOG0(L_INFO, "rgMUXBldPdu: rgMUXAddSdus is Failed \n"); + DU_LOG("\nERROR --> MAC : rgMUXBldPdu: rgMUXAddSdus is Failed \n"); RG_FREE_TB(tb); err->errType = RGERR_MUX_BLD_PDU; @@ -1036,32 +961,22 @@ RgErrInfo *err; * -# ROK * -# RFAILED **/ -#ifdef ANSI -PUBLIC S16 rgMUXBldRarPdu +S16 rgMUXBldRarPdu ( RgCellCb *cell, RgInfRaRntiInfo *alloc, Buffer **txPdu, RgErrInfo *err ) -#else -PUBLIC S16 rgMUXBldRarPdu(cell, alloc, txPdu, err) -RgCellCb *cell; -RgInfRaRntiInfo *alloc; -Buffer **txPdu; -RgErrInfo *err; -#endif { Buffer *datBuf = NULLP; S16 ret; - U8 data[RG_RAR_ELEM_LEN]; - U8 hdrByte; + uint8_t data[RG_RAR_ELEM_LEN]; + uint8_t hdrByte; MsgLen schdTbSz; - U8 idx; + uint8_t idx; Inst inst = cell->macInst - RG_INST_START; - TRC2(rgMUXBldRarPdu) - schdTbSz = alloc->schdTbSz; /* RAR PDU Requirements */ /* @@ -1084,7 +999,7 @@ RgErrInfo *err; { /* Buffer couldnt get allocated. Return a failure */ err->errCause = RGERR_MUX_MEM_ALLOC_FAIL; - RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "FAILED to getMsg"); + DU_LOG("\nERROR --> MAC : FAILED to getMsg"); return RFAILED; } @@ -1100,7 +1015,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_BI_FAIL; - RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"RGERR_MUX_BLD_BI_FAIL"); + DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_BI_FAIL"); RG_FREE_MSG(datBuf); return RFAILED; } @@ -1120,7 +1035,7 @@ RgErrInfo *err; if(ret != ROK) { err->errCause = RGERR_MUX_BLD_RAPIDHDR_FAIL; - RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"RGERR_MUX_BLD_RAPIDHDR_FAIL"); + DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_RAPIDHDR_FAIL"); RG_FREE_MSG(datBuf); return RFAILED; } @@ -1133,19 +1048,18 @@ RgErrInfo *err; { rgMUXGet20bitRarGrnt(cell->bwCfg.ulTotalBw, &(alloc->crntiInfo[idx].grnt), &data[1]); } - data[1] |= ((U8)((alloc->crntiInfo[idx].ta.val) << 4)); + data[1] |= ((uint8_t)((alloc->crntiInfo[idx].ta.val) << 4)); data[4] = (alloc->crntiInfo[idx].tmpCrnti) >> 8; - data[5] = (U8) (alloc->crntiInfo[idx].tmpCrnti); + data[5] = (uint8_t) (alloc->crntiInfo[idx].tmpCrnti); - RLOG_ARG2(L_DEBUG,DBG_CELLID,cell->cellId, - "Rar,Rapid=%d, Temp CRNTI:%d", + DU_LOG("\nDEBUG --> MAC : Rar,Rapid=%d, Temp CRNTI:%d", alloc->crntiInfo[idx].rapId, alloc->crntiInfo[idx].tmpCrnti); MS_BUF_ADD_ALLOC_CALLER(); if(SAddPstMsgMult(&data[0], RG_RAR_ELEM_LEN, datBuf) != ROK) { err->errCause = RGERR_MUX_BLD_RAPID_FAIL; - RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"RGERR_MUX_BLD_RAPID_FAIL"); + DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_RAPID_FAIL"); RG_FREE_MSG(datBuf); return RFAILED; } @@ -1155,7 +1069,7 @@ RgErrInfo *err; if(rgMUXAddPadd(inst,&schdTbSz, datBuf, TRUE, err) != ROK) { RG_FREE_MSG(datBuf); - RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"FAILED to mux add padding"); + DU_LOG("\nERROR --> MAC : FAILED to mux add padding"); return RFAILED; } @@ -1178,23 +1092,14 @@ RgErrInfo *err; * File : rg_mux.c * **********************************************************/ -#ifdef ANSI -PRIVATE Void rgMUXGet20bitRarGrnt +static Void rgMUXGet20bitRarGrnt ( -U8 ulBw, +uint8_t ulBw, RgInfRarUlGrnt *msg3Grnt, -U8 *grnt +uint8_t *grnt ) -#else -PRIVATE Void rgMUXGet20bitRarGrnt(ulBw, msg3Grnt, grnt) -U8 ulBw; -RgInfRarUlGrnt *msg3Grnt; -U8 *grnt; -#endif { - U16 riv = rgMUXCalcRiv(ulBw, msg3Grnt->rbStart, msg3Grnt->numRb); - - TRC2(rgMUXGet20bitRarGrnt); + uint16_t riv = rgMUXCalcRiv(ulBw, msg3Grnt->rbStart, msg3Grnt->numRb); grnt[2] = msg3Grnt->cqiBit; /* cqi bit is 0, output from sched */ grnt[2] |= (msg3Grnt->delayBit << 1); @@ -1204,12 +1109,12 @@ U8 *grnt; grnt[1] = (msg3Grnt->iMcsCrnt >> 3); /* Forcing right shift to insert 0 as the LSB: * since this is assumed in the computation */ - grnt[1] |= (U8)((riv << 1) & 0xFE); + grnt[1] |= (uint8_t)((riv << 1) & 0xFE); - grnt[0] = (U8)((riv >> 7) & 0x07); + grnt[0] = (uint8_t)((riv >> 7) & 0x07); grnt[0] |= ((msg3Grnt->hop & 0x01) << 3); - RETVOID; + return; } /* rgMUXGet20bitRarGrnt */ /*********************************************************** @@ -1225,24 +1130,15 @@ U8 *grnt; * File : rg_mux.c * **********************************************************/ -#ifdef ANSI -PUBLIC U16 rgMUXCalcRiv +uint16_t rgMUXCalcRiv ( -U8 bw, -U8 rbStart, -U8 numRb +uint8_t bw, +uint8_t rbStart, +uint8_t numRb ) -#else -PUBLIC U16 rgMUXCalcRiv(bw, rbStart, numRb) -U8 bw; -U8 rbStart; -U8 numRb; -#endif { - U8 numRbMinus1 = numRb - 1; - U16 riv; - - TRC2(rgMUXCalcRiv); + uint8_t numRbMinus1 = numRb - 1; + uint16_t riv; if (numRbMinus1 <= bw/2) {