@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 "envopt.h" /* environment options */
-#include "envdep.h" /* environment dependent */
-#include "envind.h" /* environment independent */
-
-#include "gen.h" /* general */
-#include "ssi.h" /* system services */
-
-#include "cm_tkns.h" /* Common Token Defines */
-#include "cm_llist.h" /* Common Link List Defines */
-#include "cm_hash.h" /* Common Hash List Defines */
-#include "cm_mblk.h" /* memory management */
-#include "cm_lte.h" /* Common LTE Defines */
-
+#include "common_def.h"
#include "rg_env.h" /* MAC Environment Defines */
#include "tfu.h" /* TFU Interface defines */
#include "crg.h" /* CRG Interface defines */
#include "rg.h" /* MAC defines */
/* header/extern include files (.x) */
-#include "gen.x" /* general */
-#include "ssi.x" /* system services */
-#include "cm5.x" /* system services */
-#include "cm_tkns.x" /* Common Token Definitions */
-#include "cm_llist.x" /* Common Link List Definitions */
-#include "cm_lib.x" /* Common Library Definitions */
-#include "cm_hash.x" /* Common Hash List Definitions */
-#include "cm_mblk.x" /* memory management */
-#include "cm_lte.x" /* Common LTE Definitions */
#include "rgu.x" /* RGU Interface includes */
#include "tfu.x" /* CRG Interface includes */
#include "rgu.x" /* RGU Interface includes */
#include "lrg.x" /* LRG Interface includes */
-#include "mac_interface.h"
+#include "du_app_mac_inf.h"
#include "rg.x" /* MAC includes */
#include "ss_queue.h"
#include "ss_queue.x"
#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()
#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;\
* -# 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)
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_CEHDR_FAIL;
- RLOG0(L_ERROR, "Muxing of Contention Resolution CE sub-header is failed");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Muxing of Contention Resolution CE sub-header is failed");
+ return RFAILED;
}
RG_PACK_CE(pdu->contResId->resId[0], RG_CRES_LEN, ceBuf, ret);
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_CE_FAIL;
- RLOG0(L_ERROR, "Muxing of Contention Resolution CE is failed")
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Muxing of Contention Resolution CE is failed");
+ return RFAILED;
}
pdu->schdTbSz -= RG_CRES_ELM_LEN;
}
{
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")
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Muxing of TA CE sub-hdr is failed");
+ return RFAILED;
}
taVal = pdu->ta.val;
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_CE_FAIL;
- RLOG0(L_ERROR, "Muxing of TA CE is failed")
- RETVALUE(RFAILED);
+ 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
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_CEHDR_FAIL;
- RLOG0(L_ERROR, "Muxing of SCELL Activation CE sub-hdr is failed")
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Muxing of SCELL Activation CE sub-hdr is failed")
+ return RFAILED;
}
/* Adding the ACT CE */
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_CE_FAIL;
- RLOG0(L_ERROR, "Muxing of SCELL Activation CE is failed")
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Muxing of SCELL Activation CE is failed")
+ return RFAILED;
}
pdu->schdTbSz -= RG_SCELL_CE_ELM_LEN;
/*LcId is not yet decided in 5G-NR spec for MAC CEs Hence, not writing code
* new MAC CEs. */
- RETVALUE(ROK);
+ return ROK;
} /* rgMUXAddCes */
/**
*
* @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
* -# 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);
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_SDUHDR_FAIL;
- RLOG1(L_ERROR, "RGERR_MUX_BLD_SDUHDR_FAIL for LCID:%d",lcId);
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_SDUHDR_FAIL for LCID:%d",lcId);
+ return RFAILED;
}
#ifndef L2_OPTMZ /* no need to pack as passing not muxing all LCs PDUs to 1*/
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_SDU_FAIL;
- RLOG1(L_ERROR, "RGERR_MUX_BLD_SDU_FAIL for LCID:%d",lcId);
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_SDU_FAIL for LCID:%d",lcId);
+ return RFAILED;
}
*schdTbSz -= elmTotLen;
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);
- RETVALUE(RFAILED);
+ return RFAILED;
}
- RETVALUE(ROK);
+ return ROK;
}
/**
* -# RFAILED
**/
#ifdef L2_OPTMZ
-U32 padSize = 0;
+uint32_t padSize = 0;
#endif
-#ifdef ANSI
-PUBLIC S16 rgMUXAddPadd
+S16 rgMUXAddPadd
(
Inst inst,
MsgLen *schdTbSz,
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;
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_PADHDR_FAIL;
- RLOG0(L_ERROR, "RGERR_MUX_BLD_PADHDR_FAIL");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_PADHDR_FAIL");
+ return RFAILED;
}
*schdTbSz -= 1;
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_PAD_FAIL;
- RLOG0(L_ERROR, "RGERR_MUX_BLD_PAD_FAIL");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_PAD_FAIL");
+ return RFAILED;
}
*schdTbSz = 0;
}
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_PAD_FAIL;
- RLOG0(L_ERROR, "RGERR_MUX_BLD_PAD_FAIL");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_PAD_FAIL");
+ return RFAILED;
}
*schdTbSz -= RG_MAX_PAD_ARR_SZ;
if(ret != ROK)
{
err->errCause = RGERR_MUX_BLD_PAD_FAIL;
- RLOG0(L_ERROR, "RGERR_MUX_BLD_PAD_FAIL");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_PAD_FAIL");
+ return RFAILED;
}
*schdTbSz = 0;
}
}
- RETVALUE(ROK);
+ return ROK;
} /* rgMUXAddPadd */
#ifndef L2_OPTMZ
* -# 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:
if(rgMUXInsSdu(inst,&pdu->schdTbSz,
RG_CCCH_LCID, cDatReq->pdu, sduBuf, err) != ROK)
{
- RETVALUE(RFAILED);
+ return RFAILED;
}
RG_FREE_MSG(cDatReq->pdu);
}
{
if(pdu->tbIndex == 1)
{
- U16 idx1, idx2;
+ uint16_t idx1, idx2;
/* Adding this temporary variable for optimization */
RguDatReqTb *datReqTb = &dDatReq->datReqTb[0];
datReqTb->lchData[idx1].pdu.mBuf[idx2],
sduBuf, err) != ROK)
{
- RLOG1(L_ERROR, "FAILED for LCID:%d",datReqTb->lchData[idx1].lcId);
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : FAILED for LCID:%d",datReqTb->lchData[idx1].lcId);
+ return RFAILED;
}
}
RG_FREE_MSG(datReqTb->lchData[idx1].pdu.mBuf[idx2]);
}
else if(pdu->tbIndex == 2)
{
- U16 idx1, idx2;
+ uint16_t idx1, idx2;
RguDatReqTb *datReqTb = &dDatReq->datReqTb[1];
for (idx1=0; (idx1 < datReqTb->nmbLch); idx1++)
{
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);
- RETVALUE(RFAILED);
+ return RFAILED;
}
}
RG_FREE_MSG(datReqTb->lchData[idx1].pdu.mBuf[idx2]);
}
break;
- case EVTTFUTTIIND:
- break;
default:
break;
} /* End of switch(reqType) */
if(rgMUXAddPadd(inst,&pdu->schdTbSz, sduBuf, FALSE, err) != ROK)
{
- RLOG1(L_ERROR, "FAILED for TB Size:%d",(S16)pdu->schdTbSz);
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : FAILED for TB Size:%d",(S16)pdu->schdTbSz);
+ return RFAILED;
}
- RETVALUE(ROK);
+ return ROK;
}
/**
* -# 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);
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Memory allocation failed during MUXing of MAC TB: MacInst %d", inst);
+ return RFAILED;
}
if(rgMUXAddCes(inst, pdu, mBuf, err) != ROK)
{
RG_FREE_MSG(mBuf);
err->errType = RGERR_MUX_BLD_PDU;
- RLOG1(L_ERROR, "Failed to Multiplex MAC CEs: MacInst %d", inst);
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Failed to Multiplex MAC CEs: MacInst %d", inst);
+ return RFAILED;
}
if(rgMUXAddSdus(inst, pdu, mBuf, err) != ROK)
{
RG_FREE_MSG(mBuf);
err->errType = RGERR_MUX_BLD_PDU;
- RLOG1(L_ERROR, "FAILED to Multiplex MAC SDU: MacInst %d", inst);
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : FAILED to Multiplex MAC SDU: MacInst %d", inst);
+ return RFAILED;
}
*txPdu = mBuf;
- RETVALUE(ROK);
+ return ROK;
} /* rgMUXBldPdu */
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
-PRIVATE S16 rgMUXAddSdus
+static S16 rgMUXAddSdus
(
Inst inst,
RgBldPduInfo *pdu,
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)
{
RG_CCCH_LCID, cDatReq->pdu,
sHdrBuf, NULLP, err) != ROK)
{
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* L2 Optimization for mUe/Tti: RLC pdu mbuf pointer will be passed
* to CL it is stored in DlHqProc->TbInfo and it will be used in
= 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;
{
if(pdu->tbIndex == 1)
{
- U16 idx1, idx2;
+ uint16_t idx1, idx2;
/* Adding this temporary variable for optimization */
RguDatReqTb *datReqTb = &dDatReq->datReqTb[0];
datReqTb->lchData[idx1].pdu.mBuf[idx2],
sHdrBuf, NULLP, err) != ROK)
{
- RGDBGERRNEW(inst,(rgPBuf(inst), "FAILED\n"));
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Failed to insert SDU in rgMUXAddSdus\n");
+ return RFAILED;
}
/* L2 Optimization for mUe/Tti:Increment numPdu by 1
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++;
}
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);
datReqTb->lchData[idx1].pdu.mBuf[idx2],
sHdrBuf, NULLP, err) != ROK)
{
- RGDBGERRNEW(inst,(rgPBuf(inst), "FAILED TB Size %d\n",
- ((S16)pdu->schdTbSz)));
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : FAILED TB Size %d\n",
+ ((S16)pdu->schdTbSz));
+ return RFAILED;
}
/* L2 Optimization for mUe/Tti:Increment numPdu by 1
* Store pdu buffer in tb to send it to CL/PHY. Increment
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++;
}
break;
- case EVTTFUTTIIND:
+ case EVENT_SLOT_IND_TO_MAC:
break;
default:
break;
if(rgMUXAddPadd(inst, &pdu->schdTbSz, sduBuf, NULLP, FALSE, err) != ROK)
{
//RGDBGERRNEW((rgPBuf, "FAILED"));
- RETVALUE(RFAILED);
+ return RFAILED;
}
tb->padSize = padSize;
- RETVALUE(ROK);
+ return ROK;
}
/**
* -# 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);
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"));
- RETVALUE(RFAILED);
+ return RFAILED;
}
if(rgMUXAddSdus(inst, pdu, mBuf1, tb, err) != ROK)
{
/*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;
//RGDBGERRNEW((rgPBuf, "FAILED"));
- RETVALUE(RFAILED);
+ return RFAILED;
}
// UDAY
// SPrntMsg(tb->macHdr, 0, 0);
// prc_trace_format_string(0x40,3,": padSize=%ld", tb->padSize);
tb->tbPres = TRUE;
- RETVALUE(ROK);
+ return ROK;
} /* rgMUXBldPdu */
* -# 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 */
/*
{
/* 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");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : FAILED to getMsg");
+ return RFAILED;
}
if (TRUE == alloc->backOffInd.pres)
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);
- RETVALUE(RFAILED);
+ return RFAILED;
}
schdTbSz--;
}
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);
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* Prepare the data */
{
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);
- RETVALUE(RFAILED);
+ return RFAILED;
}
schdTbSz -= RG_RAR_ELEM_LEN+RG_RAR_SHDR_LEN;
}
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");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : FAILED to mux add padding");
+ return RFAILED;
}
*txPdu = datBuf;
- RETVALUE(ROK);
+ return ROK;
} /* rgMUXBldRarPdu */
/***********************************************************
* 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);
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 */
/***********************************************************
* 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)
{
{
riv = bw * (bw - numRbMinus1) + (bw - rbStart - 1);
}
- RETVALUE(riv);
+ return (riv);
} /* rgMUXCalcRiv */