From: Sphoorthi Dayanand Date: Wed, 3 Feb 2021 12:56:24 +0000 (+0000) Subject: Merge "Part -5 Separation of log [JIRA-ID ODUHIGH-275]" X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=6946c38335eb7394883a6f2686b2e6417e8ceb6f;hp=eb34581efbc9dc5697d7326c25e00a2a3c8be17b;p=o-du%2Fl2.git Merge "Part -5 Separation of log [JIRA-ID ODUHIGH-275]" --- diff --git a/src/5gnrmac/rg_lim.c b/src/5gnrmac/rg_lim.c index 9c92d9d81..e426f8f97 100755 --- a/src/5gnrmac/rg_lim.c +++ b/src/5gnrmac/rg_lim.c @@ -32,9 +32,6 @@ @brief It has APIs exposed by Lower Interface Modulue of MAC. It acts as an Interface handler for lower interface APIs. */ -static const char* RLOG_MODULE_NAME="MAC"; -static int RLOG_FILE_ID=182; -static int RLOG_MODULE_ID=4096; /* header include files -- defines (.h) */ #include "common_def.h" #include "rgu.h" /* RGU defines */ @@ -104,7 +101,7 @@ uint8_t status if (suId != tfuSap->sapCfg.suId) { - RLOG2(L_ERROR,"Incorrect SuId. Configured (%d) Recieved (%d)", + DU_LOG("\nERROR --> MAC : Incorrect SuId. Configured (%d) Recieved (%d)", tfuSap->sapCfg.suId, suId); return RFAILED; } @@ -133,13 +130,13 @@ static S16 rgLIMValidateSap(Inst inst,SuId suId) /* First lets check the suId */ if( suId != tfuSap->sapCfg.suId) { - RLOG2(L_ERROR,"Incorrect SuId. Configured (%d) Recieved (%d)", + DU_LOG("\nERROR --> MAC : Incorrect SuId. Configured (%d) Recieved (%d)", tfuSap->sapCfg.suId, suId); return RFAILED; } if (tfuSap->sapSta.sapState != LRG_BND) { - RLOG1(L_ERROR,"Lower SAP not enabled SuId (%d)", + DU_LOG("\nERROR --> MAC : Lower SAP not enabled SuId (%d)", tfuSap->sapCfg.suId); return RFAILED; } @@ -212,7 +209,7 @@ TfuDatIndInfo *datInd volatile uint32_t startTime=0; - // printf("5GTF:: DatindRcvd\n"); + // DU_LOG("5GTF:: DatindRcvd\n"); RG_IS_INST_VALID(pst->dstInst); inst = pst->dstInst - RG_INST_START; @@ -222,7 +219,7 @@ TfuDatIndInfo *datInd #ifndef NO_ERRCLS if ((ret = rgLIMValidateSap (inst,suId)) != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,datInd->cellId,"SAP Validation failed"); + DU_LOG("\nERROR --> MAC : SAP Validation failed"); rgLIMUtlFreeDatIndEvnt(datInd, TRUE); return (ret); } @@ -332,7 +329,7 @@ S16 rgLIMTfuDelDatReq(Inst inst,TfuDelDatReqInfo *delDatReq) #ifndef NO_ERRCLS if (tfuSap->sapSta.sapState != LRG_BND) { - RLOG_ARG1(L_ERROR,DBG_CELLID,delDatReq->cellId,"Lower SAP not bound (%d)", + DU_LOG("\nERROR --> MAC : Lower SAP not bound (%d)", tfuSap->sapSta.sapState); return RFAILED; } @@ -341,7 +338,7 @@ S16 rgLIMTfuDelDatReq(Inst inst,TfuDelDatReqInfo *delDatReq) if((ret = RgLiTfuDelDatReq (&tfuSap->sapCfg.sapPst, tfuSap->sapCfg.spId, delDatReq)) != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,delDatReq->cellId,"Call to RgLiTfuDelDatReq() failed"); + DU_LOG("\nERROR --> MAC : Call to RgLiTfuDelDatReq() failed"); } return (ret); } /* rgLIMTfuDatReq*/ @@ -369,7 +366,7 @@ S16 RgLiTfuNonRtInd(Pst *pst,SuId suId) #ifdef NO_ERRCLS if (rgLIMValidateSap (pst->dstInst - RG_INST_START, suId) != ROK) { - RGDBGERRNEW(pst->dstInst - RG_INST_START, (rgPBuf(pst->dstInst - RG_INST_START),"RgLiTfuNonRtInd() SAP Validation failed.\n")); + DU_LOG("\nERROR --> MAC : RgLiTfuNonRtInd() SAP Validation failed.\n"); return RFAILED; } #endif diff --git a/src/5gnrmac/rg_lmm.c b/src/5gnrmac/rg_lmm.c index db579fcf4..5fe6fe336 100755 --- a/src/5gnrmac/rg_lmm.c +++ b/src/5gnrmac/rg_lmm.c @@ -33,9 +33,6 @@ The functions for the configuration, control, status and statistics request primitives are defined here. */ -static const char* RLOG_MODULE_NAME="MAC"; -static int RLOG_FILE_ID=220; -static int RLOG_MODULE_ID=4096; /* header include files (.h) */ #include "common_def.h" @@ -239,8 +236,7 @@ RgMngmt *cfg /* config structure */ - RG_DIAG_LVL0(inst,0x0a0b0001, RG_DIAG_NA, SS_DIAG_INV_ARG,\ - "Received CfgReq for MAC layer, Entity = %d, Instance = %d\n", pst->srcEnt, pst->srcInst,0,0); + DU_LOG("\nINFO --> MAC : Received CfgReq for MAC layer, Entity = %d, Instance = %d\n", pst->srcEnt, pst->srcInst,0,0); RG_IS_INST_VALID(pst->dstInst); inst = pst->dstInst - RG_INST_START; @@ -275,7 +271,7 @@ RgMngmt *cfg /* config structure */ default: ret = LCM_PRIM_NOK; reason = LCM_REASON_INVALID_ELMNT; - RLOG1(L_ERROR, "Invalid Elmnt=%d", + DU_LOG("\nERROR --> MAC : Invalid Elmnt=%d", cfg->hdr.elmId.elmnt); break; } @@ -345,7 +341,7 @@ RgMngmt *sts /* statistics structure */ cfm.cfm.status = LCM_PRIM_NOK; cfm.cfm.reason = LCM_REASON_GENCFG_NOT_DONE; RgMiLrgStsCfm(&cfmPst,&cfm); - RLOG0(L_ERROR, "Gen Cfg not done"); + DU_LOG("\nERROR --> MAC : Gen Cfg not done"); return ROK; } @@ -453,7 +449,7 @@ RgMngmt *sts /* statistics structure */ default: cfm.cfm.status = LCM_PRIM_NOK; cfm.cfm.reason = LCM_REASON_INVALID_ELMNT; - RLOG1(L_ERROR, "Invalid Elmnt = %d",sts->hdr.elmId.elmnt); + DU_LOG("\nERROR --> MAC : Invalid Elmnt = %d",sts->hdr.elmId.elmnt); break; } RgMiLrgStsCfm(&cfmPst,&cfm); @@ -516,7 +512,7 @@ RgMngmt *sta /* status structure */ (Data **)&(cfm.t.ssta.s.sysId.ptNmb), LRG_MAX_PT_NUM_SIZE) != ROK) { - RLOG0(L_ERROR, "Memory Unavailable for Confirmation"); + DU_LOG("\nERROR --> MAC : Memory Unavailable for Confirmation"); return ROK; } memset((cfm.t.ssta.s.sysId.ptNmb), 0, LRG_MAX_PT_NUM_SIZE); @@ -525,7 +521,7 @@ RgMngmt *sta /* status structure */ cfm.cfm.reason = LCM_REASON_GENCFG_NOT_DONE; cfm.hdr.elmId.elmnt = sta->hdr.elmId.elmnt; RgMiLrgStaCfm(&cfmPst, &cfm); - RLOG0(L_ERROR, "Gen Cfg not done"); + DU_LOG("\nERROR --> MAC : Gen Cfg not done"); return ROK; } @@ -537,7 +533,7 @@ RgMngmt *sta /* status structure */ (Data **)&(cfm.t.ssta.s.sysId.ptNmb), LRG_MAX_PT_NUM_SIZE) != ROK) { - RLOG0(L_ERROR, "Memory Unavailable for Confirmation"); + DU_LOG("\nERROR --> MAC : Memory Unavailable for Confirmation"); return ROK; } memset((cfm.t.ssta.s.sysId.ptNmb), 0, LRG_MAX_PT_NUM_SIZE); @@ -575,7 +571,7 @@ RgMngmt *sta /* status structure */ cfm.cfm.status = LCM_PRIM_NOK; cfm.cfm.reason = LCM_REASON_INVALID_ELMNT; RgMiLrgStaCfm(&cfmPst, &cfm); - RLOG1(L_ERROR, "Invalid elmnt=%d",sta->hdr.elmId.elmnt); + DU_LOG("\nERROR --> MAC : Invalid elmnt=%d",sta->hdr.elmId.elmnt); break; } return ROK; @@ -634,7 +630,7 @@ RgMngmt *cntrl /* control structure */ cfm.cfm.reason = LCM_REASON_GENCFG_NOT_DONE; cfm.hdr.elmId.elmnt = cntrl->hdr.elmId.elmnt; RgMiLrgCntrlCfm(&cfmPst, &cfm); - RLOG0(L_ERROR, "Gen Cfg not done"); + DU_LOG("\nERROR --> MAC : Gen Cfg not done"); return ROK; } @@ -653,7 +649,7 @@ RgMngmt *cntrl /* control structure */ cfm.cfm.status = LCM_PRIM_NOK; cfm.cfm.reason = LCM_REASON_INVALID_PAR_VAL; RgMiLrgCntrlCfm(&cfmPst, &cfm); - RLOG1(L_ERROR, "invalid elmnt=%d",cntrl->hdr.elmId.elmnt); + DU_LOG("\nERROR --> MAC : invalid elmnt=%d",cntrl->hdr.elmId.elmnt); break; } return (ret); @@ -704,7 +700,7 @@ Elmnt sapType /* Sap Type */ (cfg->s.rguSap.selector != ODU_SELECTOR_LC)) { ret = LCM_REASON_INVALID_PAR_VAL; - RLOG0(L_ERROR, "unsupported Selector value for RGU"); + DU_LOG("\nERROR --> MAC : unsupported Selector value for RGU"); break; } upSapCb = &(rgCb[inst].rguSap[cfg->s.rguSap.spId]); @@ -735,7 +731,7 @@ Elmnt sapType /* Sap Type */ (cfg->s.crgSap.selector != ODU_SELECTOR_LC)) { ret = LCM_REASON_INVALID_PAR_VAL; - RLOG0(L_ERROR, "unsupported Selector value for CRG"); + DU_LOG("\nERROR --> MAC : unsupported Selector value for CRG"); break; } if(rgCb[inst].crgSap.sapSta.sapState == LRG_NOT_CFG) @@ -765,7 +761,7 @@ Elmnt sapType /* Sap Type */ (cfg->s.tfuSap.selector != ODU_SELECTOR_LC)) { ret = LCM_REASON_INVALID_PAR_VAL; - RLOG0(L_ERROR, "unsupported Selector value for TFU"); + DU_LOG("\nERROR --> MAC : unsupported Selector value for TFU"); break; } #endif @@ -836,7 +832,7 @@ RgCfg *cfg /* Configuaration information */ if ((cfg->s.genCfg.lmPst.selector != ODU_SELECTOR_TC) && (cfg->s.genCfg.lmPst.selector != ODU_SELECTOR_LC)) { - RLOG0(L_ERROR, "unsupported Selector value for RGU"); + DU_LOG("\nERROR --> MAC : unsupported Selector value for RGU"); return (LCM_REASON_INVALID_PAR_VAL); } /* Update the Pst structure for LM interface */ @@ -860,7 +856,7 @@ RgCfg *cfg /* Configuaration information */ if(cfg->s.genCfg.numRguSaps == 0) { - RGDBGERRNEW(inst,(rgPBuf(inst), "\nrgGenCfg(): Invalid numRguSap.\n")); + DU_LOG("\nERROR --> MAC : rgGenCfg(): Invalid numRguSap.\n"); return RFAILED; } @@ -870,7 +866,7 @@ RgCfg *cfg /* Configuaration information */ (Data **)&rgCb[inst].rguSap, (sizeof(RgUpSapCb) * cfg->s.genCfg.numRguSaps)) != ROK) { - RGDBGERRNEW(inst,(rgPBuf(inst), "\nrgGenCfg(): Failed to allocate mem for RGU SAP's.\n")); + DU_LOG("\nERROR --> MAC : rgGenCfg(): Failed to allocate mem for RGU SAP's.\n"); return RFAILED; } rgCb[inst].numRguSaps = cfg->s.genCfg.numRguSaps; @@ -894,7 +890,7 @@ RgCfg *cfg /* Configuaration information */ (S16)rgCb[inst].genCfg.tmrRes, rgActvTmr) != ROK) { - RLOG0(L_ERROR, "Failed to register timer"); + DU_LOG("\nERROR --> MAC : Failed to register timer"); SPutSBuf(rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, @@ -1050,7 +1046,7 @@ Pst *cfmPst default: cfm->cfm.status = LCM_PRIM_NOK; cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL; - RLOG1(L_ERROR, "invalid subaction=%d",cntrl->t.cntrl.subAction); + DU_LOG("\nERROR --> MAC : invalid subaction=%d",cntrl->t.cntrl.subAction); break; } break; @@ -1081,7 +1077,7 @@ Pst *cfmPst default: cfm->cfm.status = LCM_PRIM_NOK; cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL; - RLOG1(L_ERROR, "invalid subaction=%d",cntrl->t.cntrl.subAction); + DU_LOG("\nERROR --> MAC : invalid subaction=%d",cntrl->t.cntrl.subAction); break; } break; @@ -1092,7 +1088,7 @@ Pst *cfmPst default: cfm->cfm.status = LCM_PRIM_NOK; cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL; - RLOG1(L_ERROR, "invalid action=%d",cntrl->t.cntrl.action); + DU_LOG("\nERROR --> MAC : invalid action=%d",cntrl->t.cntrl.action); break; } RgMiLrgCntrlCfm(cfmPst, cfm); @@ -1206,8 +1202,8 @@ Pst *cfmPst default: cfm->cfm.status = LCM_PRIM_NOK; cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL; - RGDBGERRNEW(inst,(rgPBuf(inst), "\nrgLMMSapCntrl(): invalid action=%d", - cntrl->t.cntrl.action)); + DU_LOG("\nERROR --> MAC : rgLMMSapCntrl(): invalid action=%d", + cntrl->t.cntrl.action); break; } break; @@ -1223,8 +1219,8 @@ Pst *cfmPst default: cfm->cfm.status = LCM_PRIM_NOK; cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL; - RGDBGERRNEW(inst,(rgPBuf(inst), "\nrgLMMSapCntrl(): invalid action=%d", - cntrl->t.cntrl.action)); + DU_LOG("\nERROR --> MAC : rgLMMSapCntrl(): invalid action=%d", + cntrl->t.cntrl.action); break; } break; @@ -1240,7 +1236,7 @@ Pst *cfmPst default: cfm->cfm.status = LCM_PRIM_NOK; cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL; - RLOG1(L_ERROR, "invalid action=%d",cntrl->t.cntrl.action); + DU_LOG("\nERROR --> MAC : invalid action=%d",cntrl->t.cntrl.action); break; } @@ -1458,7 +1454,7 @@ S16 tmrEvnt /* Timer Event */ } break; default: - RLOG1(L_ERROR, "Invalid tmrEvnt=%d",tmrEvnt); + DU_LOG("\nERROR --> MAC : Invalid tmrEvnt=%d",tmrEvnt); ret = RFAILED; break; } @@ -1555,7 +1551,7 @@ uint8_t event /* event */ if ((rgCb[inst].trcLen == LRG_NO_TRACE) || (srcMbuf == NULLP)) { - RLOG0(L_ERROR, "Trace Disabled."); + DU_LOG("\nERROR --> MAC : Trace Disabled."); return; } @@ -1578,7 +1574,7 @@ uint8_t event /* event */ if (SCpyMsgMsg(srcMbuf, pst.region, pst.pool, &dstMbuf) != ROK) { - RLOG0(L_ERROR, "SCpyMsgMsg Failed."); + DU_LOG("\nERROR --> MAC : SCpyMsgMsg Failed."); return; } trc.cfm.status = LCM_PRIM_OK; @@ -1594,7 +1590,7 @@ uint8_t event /* event */ /* Get the length of the recvd message buffer */ if (SFndLenMsg(srcMbuf, &bufLen) != ROK) { - RLOG0(L_ERROR, "SFndLenMsg Failed."); + DU_LOG("\nERROR --> MAC : SFndLenMsg Failed."); return; } /* Check if the recvd buffer size is less than request trace len */ @@ -1605,7 +1601,7 @@ uint8_t event /* event */ if (SCpyMsgMsg(srcMbuf, pst.region, pst.pool, &dstMbuf) != ROK) { - RLOG0(L_ERROR, "SCpyMsgMsg Failed."); + DU_LOG("\nERROR --> MAC : SCpyMsgMsg Failed."); return; } @@ -1622,26 +1618,26 @@ uint8_t event /* event */ /* Get a temporary buffer to store the msg */ if (rgAllocSBuf(inst,&tempBuf, rgCb[inst].trcLen) != ROK) { - RLOG0(L_ERROR, "rgAllocSBuf Failed."); + DU_LOG("\nERROR --> MAC : rgAllocSBuf Failed."); return; } /* Copy trcLen nos of bytes from the recvd message */ if (SCpyMsgFix(srcMbuf,0,rgCb[inst].trcLen,tempBuf,&tempCnt) != ROK) { - RLOG0(L_ERROR, "SCpyMsgFix Failed."); + DU_LOG("\nERROR --> MAC : SCpyMsgFix Failed."); return; } if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK) { - RLOG0(L_ERROR, "dstMbuf Allocation Failed"); + DU_LOG("\nERROR --> MAC : dstMbuf Allocation Failed"); return; } /* Copy the tempBuf data to dst mBuf */ if (SCpyFixMsg(tempBuf,dstMbuf,0,rgCb[inst].trcLen,&tempCnt) != ROK) { - RLOG0(L_ERROR, "SCpyFixMsg Failed."); + DU_LOG("\nERROR --> MAC : SCpyFixMsg Failed."); return; } @@ -1700,7 +1696,7 @@ uint8_t status /* Status */ /* Check if the suId is valid */ if(rgCb[inst].tfuSap.sapCfg.suId != suId) { - RLOG0(L_ERROR, "Invalid SuId"); + DU_LOG("\nERROR --> MAC : Invalid SuId"); return RFAILED; } diff --git a/src/5gnrmac/rg_ram.c b/src/5gnrmac/rg_ram.c index e8e347357..225e44829 100755 --- a/src/5gnrmac/rg_ram.c +++ b/src/5gnrmac/rg_ram.c @@ -32,10 +32,6 @@ @brief This file has APIs to handle the random access procedure functionality. */ -static const char* RLOG_MODULE_NAME="MAC"; -static int RLOG_FILE_ID=132; -static int RLOG_MODULE_ID=4096; - /* header include files (.h) */ #include "common_def.h" #include "rg_env.h" /* MAC Environment Defines */ @@ -115,13 +111,12 @@ RgUeCb* rgRAMCreateUeCb(RgCellCb *cell,CmLteRnti tmpCrnti,Bool insert,RgErrInfo Inst inst = cell->macInst - RG_INST_START; RgUeCb *ueCb = NULLP; - RLOG_ARG1(L_INFO,DBG_CELLID,cell->cellId,"CREATE UECB FOR CRNTI:%d", + DU_LOG("\nINFO --> MAC : CREATE UECB FOR CRNTI:%d", tmpCrnti); /* Allocate the Ue control block */ if (rgAllocSBuf(inst,(Data **)&ueCb, sizeof(*ueCb)) != ROK) { - RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId, - "Memory allocation FAILED for CRNTI:%d",tmpCrnti); + DU_LOG("\nERROR --> MAC : Memory allocation FAILED for CRNTI:%d",tmpCrnti); err->errCause = RGERR_RAM_MEM_EXHAUST; return (NULLP); } @@ -255,7 +250,7 @@ S16 rgHndlRaResp(RgCellCb *cell,CmLteTimingInfo timingInfo,RgInfRarInfo *rarInfo } else { - RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RARNTI:%d Creation of RAR" + DU_LOG("\nERROR --> MAC : RARNTI:%d Creation of RAR" "PDU for failed", rarInfo->raRntiInfo[idx1].raRnti); continue; } diff --git a/src/5gnrmac/rg_rom.c b/src/5gnrmac/rg_rom.c index 363209dab..f0e3b7e90 100755 --- a/src/5gnrmac/rg_rom.c +++ b/src/5gnrmac/rg_rom.c @@ -32,9 +32,6 @@ @brief APIs to handle all the primitives invoked on RGU interface. */ -static const char* RLOG_MODULE_NAME="MAC"; -static int RLOG_FILE_ID=184; -static int RLOG_MODULE_ID=4096; /* header include files (.h) */ #include "common_def.h" @@ -133,8 +130,7 @@ S16 rgROMDedDatReq(Inst inst,RgRguDedDatReq *datReq) { #if (ERRCLASS & ERRCLS_INT_PAR) /* Handle Cell fetch failure */ - RGLOGERROR(inst,ERRCLS_INT_PAR,ERG001,(ErrVal)datReq->cellId, - "rgROMDedDatReq(): Invalid cell Id"); + DU_LOG("\nERROR --> MAC : rgROMDedDatReq(): Invalid cell Id"); #endif err.errType = RGERR_ROM_DEDDATREQ; err.errCause = RGERR_ROM_INV_CELL_ID; @@ -185,8 +181,7 @@ S16 rgROMDedDatReq(Inst inst,RgRguDedDatReq *datReq) { #if (ERRCLASS & ERRCLS_INT_PAR) /* Handle Ue fetch failure */ - RGLOGERROR(inst,ERRCLS_INT_PAR,ERG002,(ErrVal)datReq->datReq[idx].rnti, - "rgROMDedDatReq(): Invalid ue Id"); + DU_LOG("\nERROR --> MAC : rgROMDedDatReq(): Invalid ue Id"); #endif err.errType = RGERR_ROM_DEDDATREQ; err.errCause = RGERR_ROM_INV_UE_ID; @@ -199,7 +194,7 @@ S16 rgROMDedDatReq(Inst inst,RgRguDedDatReq *datReq) ret = rgROMUpdDlSfRemDataCnt(cell, sf); if(ret == RFAILED) { - RLOG0(L_INFO, "Dropping due to no ue \n"); + DU_LOG("\nERROR --> MAC : Dropping due to no ue \n"); #ifndef L2_OPTMZ RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[idx]); #endif @@ -218,8 +213,7 @@ S16 rgROMDedDatReq(Inst inst,RgRguDedDatReq *datReq) if (rgDHMHndlDedDatReq(inst,hqProc, &datReq->datReq[idx], sf, &err) == RFAILED) { - RLOG_ARG1(L_ERROR,DBG_CELLID,datReq->cellId, - "Handling of Data request in DHM failedi RNTI:%d", + DU_LOG("\nERROR --> MAC : Handling of Data request in DHM failedi RNTI:%d", datReq->datReq[idx].rnti); err.errType = RGERR_ROM_DEDDATREQ; /* errcause shall be filled in appropriately by DHM */ @@ -232,7 +226,7 @@ S16 rgROMDedDatReq(Inst inst,RgRguDedDatReq *datReq) ret = rgROMUpdDlSfRemDataCnt(cell, sf); if(ret == RFAILED) { - RLOG0(L_INFO, "Dropping due to no failure of remCnt update"); + DU_LOG("\nERROR --> MAC : Dropping due to no failure of remCnt update"); #ifndef L2_OPTMZ RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[idx]); #endif @@ -285,7 +279,7 @@ S16 rgROMDedDatReq(Inst inst,RgRguDedDatReq *datReq) ret = rgROMUpdDlSfRemDataCnt(cell, sf); if(ret == RFAILED) { - RLOG0(L_INFO, "\n Dropping due to no failure of remCnt update(1) \n"); + DU_LOG("\nERROR --> MAC : Dropping due to no failure of remCnt update(1) \n"); #ifndef L2_OPTMZ RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[idx]); #endif @@ -336,8 +330,7 @@ S16 rgROMCmnDatReq(Inst inst, RgRguCmnDatReq *datReq) { #if (ERRCLASS & ERRCLS_INT_PAR) /* Handle Cell fetch failure */ - RGLOGERROR(inst,ERRCLS_INT_PAR,ERG003,(ErrVal)datReq->cellId, - "rgROMCmnDatReq(): Invalid cell Id"); + DU_LOG("\nERROR --> MAC : rgROMCmnDatReq(): Invalid cell Id"); #endif err.errCause = RGERR_ROM_INV_CELL_ID; /* Update stats */ @@ -432,8 +425,7 @@ static S16 rgROMHndlCcchDatReq(RgCellCb *cell, RgRguCmnDatReq *datReq, RgErrInfo { #if (ERRCLASS & ERRCLS_INT_PAR) /* Handle Ue fetch failure */ - RGLOGERROR(inst,ERRCLS_INT_PAR,ERG004,(ErrVal)datReq->u.rnti, - "rgROMHndlCcchDatReq(): Invalid ue Id"); + DU_LOG("\nERROR --> MAC : rgROMHndlCcchDatReq(): Invalid ue Id"); #endif err->errCause = RGERR_ROM_INV_UE_ID; return RFAILED; @@ -468,8 +460,7 @@ static S16 rgROMHndlCcchDatReq(RgCellCb *cell, RgRguCmnDatReq *datReq, RgErrInfo /* invoke DHM to process CCCH data */ if (rgDHMHndlCmnDatReq(inst,hqProc, datReq, err) == RFAILED) { - RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId, - "Handling of Data request in DHM failed RNTI:%d LCID:%d", + DU_LOG("\nERROR --> MAC : Handling of Data request in DHM failed RNTI:%d LCID:%d", datReq->u.rnti,datReq->lcId); /* Release First TB */ rgDHMRlsHqProcTB(cell, hqProc, 1); @@ -563,8 +554,7 @@ static S16 rgROMHndlBcchPcchDatReq(RgCellCb *cell, RgRguCmnDatReq *datReq, RgErr } /* Handle lcCb fetch failure */ - RGLOGERROR(inst,ERRCLS_INT_PAR,ERG005,(ErrVal)datReq->lcId, - "rgROMHndlBcchPcchDatReq(): Invalid Lc Id"); + DU_LOG("\nERROR --> MAC : rgROMHndlBcchPcchDatReq(): Invalid Lc Id"); err->errCause = RGERR_ROM_INV_LC_ID; return RFAILED; @@ -617,7 +607,7 @@ S16 rgROMDedStaRsp(Inst inst, RgRguDedStaRsp *staRsp) //TODO: commented for compilation without SCH RgMacSchDedBoUpdt(&schPst, &boRpt); return ROK; } - RLOG_ARG2(L_ERROR,DBG_CELLID,staRsp->cellId,"Invalid cell for CRNTI:%d LCID:%d ", + DU_LOG("\nERROR --> MAC : Invalid cell for CRNTI:%d LCID:%d ", staRsp->rnti,staRsp->lcId); return RFAILED; @@ -679,8 +669,7 @@ S16 rgROMCmnStaRsp(Inst inst, RgRguCmnStaRsp *staRsp) || (cell->cellId != staRsp->cellId)) { /* Handle Cell fetch failure */ - RLOG_ARG2(L_ERROR,DBG_CELLID,staRsp->cellId, - "Invalid cell for CRNTI:%d LCID:%d",staRsp->u.rnti,staRsp->lcId); + DU_LOG("\nERROR --> MAC : Invalid cell for CRNTI:%d LCID:%d",staRsp->u.rnti,staRsp->lcId); err.errType = RGERR_ROM_CMNSTARSP; err.errCause = RGERR_ROM_INV_CELL_ID; return RFAILED; @@ -747,7 +736,7 @@ S16 rgROML2MUlThrpMeasReq(Inst inst, RgRguL2MUlThrpMeasReq *measReq) return ROK; } } - RLOG_ARG1(L_ERROR,DBG_CELLID,measReq->cellId,"Invalid cell CRNTI:%d", + DU_LOG("\nERROR --> MAC : Invalid cell CRNTI:%d", measReq->rnti); return RFAILED; } /* rgROML2MUlThrpMeasReq */ @@ -822,7 +811,7 @@ static S16 rgROMHndlBcchPcchStaRsp(RgCellCb *cell,RgRguCmnStaRsp *staRsp,RgErrIn if (rgDBMChkCmnLcCb(cell, staRsp->lcId) != ROK) { /* Handle lcCb fetch failure */ - RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid LCID:%d",staRsp->lcId); + DU_LOG("\nERROR --> MAC : Invalid LCID:%d",staRsp->lcId); err->errCause = RGERR_ROM_INV_LC_ID; return RFAILED; } @@ -888,8 +877,7 @@ static S16 rgROMUpdDlSfRemDataCnt(RgCellCb *cellCb, RgDlSf *dlSf) { /*This is an error scenario of RLC generating more data * request than the allocation. Do nothing for this. */ - RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId, - "RX new data while remDatReqCnt is 0 for cell"); + DU_LOG("\nERROR --> MAC : RX new data while remDatReqCnt is 0 for cell"); return RFAILED; } @@ -907,8 +895,7 @@ static S16 rgROMUpdDlSfRemDataCnt(RgCellCb *cellCb, RgDlSf *dlSf) if (ROK != rgTOMUtlProcDlSf (dlSf, cellCb, &err)) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId, - "Unable to process downlink slot for cell"); + DU_LOG("\nERROR --> MAC : Unable to process downlink slot for cell"); err.errType = RGERR_ROM_DEDDATREQ; } diff --git a/src/5gnrmac/rg_tom.c b/src/5gnrmac/rg_tom.c index dc5ec8c2a..ed398399f 100755 --- a/src/5gnrmac/rg_tom.c +++ b/src/5gnrmac/rg_tom.c @@ -28,9 +28,6 @@ **********************************************************************/ -static const char* RLOG_MODULE_NAME="MAC"; -static int RLOG_FILE_ID=237; -static int RLOG_MODULE_ID=4096; /** @file rg_tom.c @brief This module does processing related to handling of lower interface APIs invoked by PHY towards MAC @@ -185,27 +182,27 @@ static S16 rgTOMUtlFillDatReqPdus (TfuDatReqInfo *datInfo,RgDlSf *dlSf,RgCellCb { S16 ret; TfuDatReqPduInfo *datReq=NULLP; - /* Moving node declaration to limited scope for optimization */ + /* Moving node declaration to limited scope for optimization */ RgDlHqProcCb *hqCb; uint8_t idx; Inst inst = cellCb->macInst - RG_INST_START; - /* first lets send the BCCH data down to PHY */ + /* first lets send the BCCH data down to PHY */ if (dlSf->bcch.tb != NULLP) { if ((ret = rgGetEventMem(inst,(Ptr *)&datReq, sizeof(TfuDatReqPduInfo), - &(datInfo->memCp))) != ROK) + &(datInfo->memCp))) != ROK) { - err->errCause = RGERR_TOM_MEM_EXHAUST; - RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId,"Memory Exhaustion "); - return (ret); + err->errCause = RGERR_TOM_MEM_EXHAUST; + DU_LOG("\nERROR --> MAC : Memory Exhaustion "); + return (ret); } #ifdef TFU_ALLOC_EVENT_NO_INIT #ifndef L2_OPTMZ datReq->mBuf[1] = 0; #else - datReq->tbInfo[0].lchInfo[0].mBuf[0]=NULLP; + datReq->tbInfo[0].lchInfo[0].mBuf[0]=NULLP; #endif #endif datReq->rnti = RG_SI_RNTI; @@ -241,11 +238,11 @@ static S16 rgTOMUtlFillDatReqPdus (TfuDatReqInfo *datInfo,RgDlSf *dlSf,RgCellCb if (dlSf->pcch.tb != NULLP) { if ((ret = rgGetEventMem(inst,(Ptr *)&datReq, sizeof(TfuDatReqPduInfo), - &(datInfo->memCp))) != ROK) + &(datInfo->memCp))) != ROK) { - err->errCause = RGERR_TOM_MEM_EXHAUST; - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Memory Exhaustion CRNTI:%d",datReq->rnti); - return (ret); + err->errCause = RGERR_TOM_MEM_EXHAUST; + DU_LOG("\nERROR --> MAC : Memory Exhaustion CRNTI:%d",datReq->rnti); + return (ret); } #ifdef TFU_ALLOC_EVENT_NO_INIT #ifndef L2_OPTMZ @@ -280,12 +277,12 @@ static S16 rgTOMUtlFillDatReqPdus (TfuDatReqInfo *datInfo,RgDlSf *dlSf,RgCellCb for(idx=0; idx < dlSf->numRaRsp; idx++) { if ((ret = rgGetEventMem(inst,(Ptr *)&datReq, sizeof(TfuDatReqPduInfo), - &(datInfo->memCp))) != ROK) + &(datInfo->memCp))) != ROK) { - err->errCause = RGERR_TOM_MEM_EXHAUST; - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Memory Exhaustion CRNTI:%d", - datReq->rnti); - return (ret); + err->errCause = RGERR_TOM_MEM_EXHAUST; + DU_LOG("\nERROR --> MAC : Memory Exhaustion CRNTI:%d", + datReq->rnti); + return (ret); } #ifdef TFU_ALLOC_EVENT_NO_INIT #ifndef L2_OPTMZ @@ -307,7 +304,7 @@ static S16 rgTOMUtlFillDatReqPdus (TfuDatReqInfo *datInfo,RgDlSf *dlSf,RgCellCb #endif datReq->tbInfo[0].numLch = 1; datReq->tbInfo[0].lchInfo[0].numPdu = 1; - // prc_trace_format_string(0x40,3,"UE Id=(%d) tbSz=(%d)",datReq->rnti, datReq->tbInfo[0].tbSize); + // prc_trace_format_string(0x40,3,"UE Id=(%d) tbSz=(%d)",datReq->rnti, datReq->tbInfo[0].tbSize); #endif cmLListAdd2Tail(&datInfo->pdus, &(datReq->lnk)); datReq->lnk.node = (PTR)datReq; @@ -324,15 +321,14 @@ static S16 rgTOMUtlFillDatReqPdus (TfuDatReqInfo *datInfo,RgDlSf *dlSf,RgCellCb CmLList *node; while (dlSf->tbs.first) { - node = dlSf->tbs.first; - hqCb = (RgDlHqProcCb*)node->node; - if ((ret = rgDHMSndDatReq (cellCb, dlSf, datInfo, hqCb, err)) != ROK) - { - RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId, - "DHM unable to fill DATA request"); - err->errType = RGERR_TOM_TTIIND; - continue; - } + node = dlSf->tbs.first; + hqCb = (RgDlHqProcCb*)node->node; + if ((ret = rgDHMSndDatReq (cellCb, dlSf, datInfo, hqCb, err)) != ROK) + { + DU_LOG("\nERROR --> MAC : DHM unable to fill DATA request"); + err->errType = RGERR_TOM_TTIIND; + continue; + } } /* end of while */ } @@ -369,9 +365,9 @@ S16 rgTOMUtlProcDlSf(RgDlSf *dlSf,RgCellCb *cellCb,RgErrInfo *err) /* Fill Data Request Info from scheduler to PHY */ if ((ret = rgAllocEventMem(inst,(Ptr *)&datInfo, - sizeof(TfuDatReqInfo))) != ROK) + sizeof(TfuDatReqInfo))) != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to Allocate TfuDatReqInfo"); + DU_LOG("\nERROR --> MAC : Unable to Allocate TfuDatReqInfo"); return (ret); } else @@ -385,7 +381,7 @@ S16 rgTOMUtlProcDlSf(RgDlSf *dlSf,RgCellCb *cellCb,RgErrInfo *err) datInfo->cellId = cellCb->cellId; if((0 == (datInfo->timingInfo.sfn % 30)) && (0 == datInfo->timingInfo.slot)) { - //printf("5GTF_CHECK rgTOMUtlProcDlSf dat (%d : %d)\n", datInfo->timingInfo.sfn, datInfo->timingInfo.slot); + //DU_LOG("5GTF_CHECK rgTOMUtlProcDlSf dat (%d : %d)\n", datInfo->timingInfo.sfn, datInfo->timingInfo.slot); } #ifdef TFU_ALLOC_EVENT_NO_INIT datInfo->bchDat.pres = 0; @@ -394,37 +390,37 @@ S16 rgTOMUtlProcDlSf(RgDlSf *dlSf,RgCellCb *cellCb,RgErrInfo *err) /* Fill BCH data */ if (dlSf->bch.tb != NULLP) { - datInfo->bchDat.pres = PRSNT_NODEF; - datInfo->bchDat.val = dlSf->bch.tb; - dlSf->bch.tb = NULLP; + datInfo->bchDat.pres = PRSNT_NODEF; + datInfo->bchDat.val = dlSf->bch.tb; + dlSf->bch.tb = NULLP; } #ifdef EMTC_ENABLE /* Fill the DLSCH PDUs of BCCH, PCCH and Dedicated Channels */ if ((ret = rgTOMEmtcUtlFillDatReqPdus(datInfo, dlSf, cellCb, err)) != ROK) { - RG_FREE_MEM(datInfo); - return (ret); + RG_FREE_MEM(datInfo); + return (ret); } #endif /* Fill the DLSCH PDUs of BCCH, PCCH and Dedicated Channels */ if ((ret = rgTOMUtlFillDatReqPdus(datInfo, dlSf, cellCb, err)) != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to send data for cell"); - RG_FREE_MEM(datInfo); - return (ret); + DU_LOG("\nERROR --> MAC : Unable to send data for cell"); + RG_FREE_MEM(datInfo); + return (ret); } if((datInfo->pdus.count) || (datInfo->bchDat.pres == TRUE)) { - /* sending the data to Phy */ - //if (rgLIMTfuDatReq(inst,datInfo) != ROK) - { - RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to send data info for cell"); - } + /* sending the data to Phy */ + //if (rgLIMTfuDatReq(inst,datInfo) != ROK) + { + DU_LOG("\nERROR --> MAC : Unable to send data info for cell"); + } } else { - /* Nothing to send: free the allocated datInfo */ - RG_FREE_MEM(datInfo); + /* Nothing to send: free the allocated datInfo */ + RG_FREE_MEM(datInfo); } } return ROK; @@ -469,8 +465,8 @@ static S16 rgTOMUtlAllocPduEvnt (Inst inst,RgMacPdu **pdu) { rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM); rgLMMStaInd(inst,LCM_CATEGORY_RESOURCE, LCM_EVENT_DMEM_ALLOC_FAIL, - LCM_CAUSE_MEM_ALLOC_FAIL, &dgn); - RLOG0(L_ERROR,"Allocation of DUX event failed"); + LCM_CAUSE_MEM_ALLOC_FAIL, &dgn); + DU_LOG("\nERROR --> MAC : Allocation of DUX event failed"); return RFAILED; } @@ -510,9 +506,9 @@ static Void rgTOMUtlFreePduEvnt( RgMacPdu *pdu,Bool error) node = pdu->sduLst.first; while (node) { - sdu = (RgMacSdu*)node->node; - RG_FREE_MSG(sdu->mBuf); - node = node->next; + sdu = (RgMacSdu*)node->node; + RG_FREE_MSG(sdu->mBuf); + node = node->next; } } RG_FREE_MEM(pdu); @@ -555,8 +551,8 @@ static S16 rgTOMInfAllocPduEvnt (Inst inst,RgInfSfDatInd **sfInfo) { rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM); rgLMMStaInd(inst,LCM_CATEGORY_RESOURCE, LCM_EVENT_DMEM_ALLOC_FAIL, - LCM_CAUSE_MEM_ALLOC_FAIL, &dgn); - RLOG0(L_ERROR,"Allocation failed"); + LCM_CAUSE_MEM_ALLOC_FAIL, &dgn); + DU_LOG("\nERROR --> MAC : Allocation failed"); return RFAILED; } @@ -617,13 +613,13 @@ static S16 rgTomUtlPrepareL2MUlThrpInfo(RgCellCb *cellCb,RgUeCb *ueCb,RgRguDedDa lcId=dDatInd->lchData[loop].lcId; if (lcId) { - lcgId = ueCb->ul.lcCb[lcId - 1].lcgId; - if(ueCb->ul.lcgArr[lcgId].lcgBsInfo.outStndngBs > 0) - { - dDatInd->burstInd = RGU_L2M_UL_BURST_START; - break; - } - } + lcgId = ueCb->ul.lcCb[lcId - 1].lcgId; + if(ueCb->ul.lcgArr[lcgId].lcgBsInfo.outStndngBs > 0) + { + dDatInd->burstInd = RGU_L2M_UL_BURST_START; + break; + } + } } return ROK; @@ -658,30 +654,30 @@ static S16 rgTomUtlPrepareL2MUlThrpInfo(RgCellCb *cellCb,RgUeCb *ueCb,RgRguDedDa * -# ROK * -# RFAILED */ - RgUeCb *glblueCb4; - RgUeCb *glblueCb5; +RgUeCb *glblueCb4; +RgUeCb *glblueCb5; #ifdef LTEMAC_SPS -static S16 rgTOMUtlProcMsg + static S16 rgTOMUtlProcMsg ( -RgCellCb *cellCb, -RgUeCb *ueCb, -RgMacPdu *pdu, -Bool isSpsRnti, -Bool *spsToBeActvtd, -uint16_t *sduSize, -uint16_t slot, -uint32_t *lcgBytes -) + RgCellCb *cellCb, + RgUeCb *ueCb, + RgMacPdu *pdu, + Bool isSpsRnti, + Bool *spsToBeActvtd, + uint16_t *sduSize, + uint16_t slot, + uint32_t *lcgBytes + ) #else /* LTEMAC_SPS */ -static S16 rgTOMUtlProcMsg + static S16 rgTOMUtlProcMsg ( -RgCellCb *cellCb, -RgUeCb *ueCb, -RgMacPdu *pdu, -uint16_t slot, -uint32_t *lcgBytes -) + RgCellCb *cellCb, + RgUeCb *ueCb, + RgMacPdu *pdu, + uint16_t slot, + uint32_t *lcgBytes + ) #endif { Inst inst = cellCb->macInst - RG_INST_START; @@ -694,7 +690,7 @@ uint32_t *lcgBytes MsgLen cpySz; #ifdef LTEMAC_SPS Pst schPst1; -// RgInfSpsRelInfo relInfo; + // RgInfSpsRelInfo relInfo; #endif #ifdef LTE_L2_MEAS @@ -710,12 +706,12 @@ uint32_t *lcgBytes uint8_t lcgId; MsgLen bufSz; - /* Moved outside of LTE_L2_MEAS + /* Moved outside of LTE_L2_MEAS * scope as this pointer will now be used to * check for valid Logical Channel ID - */ + */ RgUlLcCb *ulLcCb; - + cDatInd = NULLP; dDatInd = NULLP; #ifdef LTE_L2_MEAS @@ -726,58 +722,58 @@ uint32_t *lcgBytes #ifdef SS_RBUF Void *elem = NULLP; #endif - + ulLcCb = NULLP; - + #ifndef LTE_L2_MEAS - UNUSED(slot); + UNUSED(slot); #endif if(pdu->sduLst.first) { sdu = (RgMacSdu*)(pdu->sduLst.first->node); - glblueCb4 = ueCb; + glblueCb4 = ueCb; if ((sdu->lcId == RG_CCCH_LCID)) { - /* code for common channel dat indications */ - if ((ret = rgAllocShrablSBuf (inst,(Data**)&cDatInd, sizeof(RgRguCmnDatInd))) != ROK) - { - return RFAILED; - } - cDatInd->cellId = cellCb->cellId; - cDatInd->rnti = ueCb->ueId; - /* rg001.101: Corrected lcId value for common data indication */ - cDatInd->lcId = cellCb->ulCcchId; - cDatInd->pdu = sdu->mBuf; - SFndLenMsg (sdu->mBuf, &ccchSz); - /* Fix : syed Contention resolution ID copy should consider only - * 6 bytes of information from sdu->mBuf. Incase of CCCH sdu for reest - * message/psuedo reest message, ccchSz can go beyond 6 and can corrupt - * other fields of ueCb. */ - if (ccchSz >= RG_CRES_LEN) - { - SCpyMsgFix (sdu->mBuf, (MsgLen)0, RG_CRES_LEN, ueCb->contResId.resId, - &cpySz); - } + /* code for common channel dat indications */ + if ((ret = rgAllocShrablSBuf (inst,(Data**)&cDatInd, sizeof(RgRguCmnDatInd))) != ROK) + { + return RFAILED; + } + cDatInd->cellId = cellCb->cellId; + cDatInd->rnti = ueCb->ueId; + /* rg001.101: Corrected lcId value for common data indication */ + cDatInd->lcId = cellCb->ulCcchId; + cDatInd->pdu = sdu->mBuf; + SFndLenMsg (sdu->mBuf, &ccchSz); + /* Fix : syed Contention resolution ID copy should consider only + * 6 bytes of information from sdu->mBuf. Incase of CCCH sdu for reest + * message/psuedo reest message, ccchSz can go beyond 6 and can corrupt + * other fields of ueCb. */ + if (ccchSz >= RG_CRES_LEN) + { + SCpyMsgFix (sdu->mBuf, (MsgLen)0, RG_CRES_LEN, ueCb->contResId.resId, + &cpySz); + } #ifdef XEON_SPECIFIC_CHANGES - CM_LOG_DEBUG(CM_LOG_ID_MAC, "CCCH SDU of size(%d) received for UE(%d) CRES[0x%x 0x%x 0x%x 0x%x 0x%x 0x%x] Time[%d %d]\n", ((S16)ccchSz), ueCb->ueId,ueCb->contResId.resId[0], ueCb->contResId.resId[1], ueCb->contResId.resId[2], ueCb->contResId.resId[3], ueCb->contResId.resId[4], ueCb->contResId.resId[5], cellCb->crntTime.sfn, cellCb->crntTime.slot); + CM_LOG_DEBUG(CM_LOG_ID_MAC, "CCCH SDU of size(%d) received for UE(%d) CRES[0x%x 0x%x 0x%x 0x%x 0x%x 0x%x] Time[%d %d]\n", ((S16)ccchSz), ueCb->ueId,ueCb->contResId.resId[0], ueCb->contResId.resId[1], ueCb->contResId.resId[2], ueCb->contResId.resId[3], ueCb->contResId.resId[4], ueCb->contResId.resId[5], cellCb->crntTime.sfn, cellCb->crntTime.slot); #endif - sdu->mBuf = NULLP; - rgUIMSndCmnDatInd(inst,cellCb->rguUlSap,cDatInd); - return ROK; + sdu->mBuf = NULLP; + rgUIMSndCmnDatInd(inst,cellCb->rguUlSap,cDatInd); + return ROK; } /* end of common channel processing */ #ifndef SS_RBUF if ((ret = rgAllocShrablSBuf (inst,(Data**)&dDatInd, sizeof(RgRguDedDatInd))) != ROK) { - return RFAILED; + return RFAILED; } #else - glblueCb5 = ueCb; + glblueCb5 = ueCb; elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); if (NULLP == elem) { - return RFAILED; + return RFAILED; } dDatInd = (RgRguDedDatInd *)elem; memset(dDatInd, 0x00, sizeof(RgRguDedDatInd)); @@ -790,46 +786,46 @@ uint32_t *lcgBytes ulSf = &cellCb->ulSf[(slot % RG_NUM_SUB_FRAMES)]; if(ulSf->ueUlAllocInfo != NULLP) { - for(idx1 = 0; idx1 < ulSf->numUe; idx1++) - { - if(ulSf->ueUlAllocInfo[idx1].rnti == ueCb->ueId) - { - numPrb = ulSf->ueUlAllocInfo[idx1].numPrb; - break; - } - } + for(idx1 = 0; idx1 < ulSf->numUe; idx1++) + { + if(ulSf->ueUlAllocInfo[idx1].rnti == ueCb->ueId) + { + numPrb = ulSf->ueUlAllocInfo[idx1].numPrb; + break; + } + } } #endif node = pdu->sduLst.first; while (node) { sdu = (RgMacSdu*)node->node; - + ulLcCb = rgDBMGetUlDedLcCb (ueCb, sdu->lcId); - + if(ulLcCb == NULLP) { - RLOG_ARG2(L_ERROR,DBG_CELLID,cellCb->cellId,"Unconfigured LCID:%d CRNTI:%d" - ,sdu->lcId,ueCb->ueId); - /* ccpu00128443: Fix for memory leak */ - /* Fix : syed Neccessary to set sdu->mBuf = NULLP */ - RG_FREE_MSG(sdu->mBuf); - node = node->next; - continue; + DU_LOG("\nERROR --> MAC : Unconfigured LCID:%d CRNTI:%d" + ,sdu->lcId,ueCb->ueId); + /* ccpu00128443: Fix for memory leak */ + /* Fix : syed Neccessary to set sdu->mBuf = NULLP */ + RG_FREE_MSG(sdu->mBuf); + node = node->next; + continue; } #ifdef RLC_STA_PROC_IN_MAC/* RLC Status PDU Processing */ { - S16 rlcProcDlStatusPdu(Pst *udxPst,SuId suId, - CmLteCellId cellId,CmLteRnti rnti,CmLteLcId lcId,Buffer *rlcSdu); - - if(ROK == rlcProcDlStatusPdu(&(cellCb->rguDlSap->sapCfg.sapPst), - cellCb->rguDlSap->sapCfg.suId, - cellCb->cellId,ueCb->ueId,sdu->lcId,sdu->mBuf)) - { - RG_FREE_MSG(sdu->mBuf); - node = node->next; - continue; - } + S16 rlcProcDlStatusPdu(Pst *udxPst,SuId suId, + CmLteCellId cellId,CmLteRnti rnti,CmLteLcId lcId,Buffer *rlcSdu); + + if(ROK == rlcProcDlStatusPdu(&(cellCb->rguDlSap->sapCfg.sapPst), + cellCb->rguDlSap->sapCfg.suId, + cellCb->cellId,ueCb->ueId,sdu->lcId,sdu->mBuf)) + { + RG_FREE_MSG(sdu->mBuf); + node = node->next; + continue; + } } #endif @@ -839,29 +835,28 @@ uint32_t *lcgBytes * of the freed memory */ if (dDatInd->numLch >= RGU_MAX_LC) { - if ((ret = rgUIMSndDedDatInd(inst,ueCb->rguUlSap,dDatInd)) != ROK) - { - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId, - "Failed to send datIndication to RGU CRNTI:%d",ueCb->ueId); - return (ret); - } + if ((ret = rgUIMSndDedDatInd(inst,ueCb->rguUlSap,dDatInd)) != ROK) + { + DU_LOG("\nERROR --> MAC : Failed to send datIndication to RGU CRNTI:%d",ueCb->ueId); + return (ret); + } #ifndef SS_RBUF - if ((ret = rgAllocShrablSBuf (inst,(Data**)&dDatInd, sizeof(RgRguDedDatInd))) != ROK) - { - return RFAILED; - } + if ((ret = rgAllocShrablSBuf (inst,(Data**)&dDatInd, sizeof(RgRguDedDatInd))) != ROK) + { + return RFAILED; + } #else - elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); - if (NULLP == elem) - { - return RFAILED; - } - dDatInd = (RgRguDedDatInd *)elem; - memset(dDatInd, 0x00, sizeof(RgRguDedDatInd)); + elem = SRngGetWIndx(SS_RNG_BUF_ULMAC_TO_ULRLC); + if (NULLP == elem) + { + return RFAILED; + } + dDatInd = (RgRguDedDatInd *)elem; + memset(dDatInd, 0x00, sizeof(RgRguDedDatInd)); #endif - dDatInd->cellId = cellCb->cellId; - dDatInd->rnti = ueCb->ueId; - dDatInd->numLch = 0; + dDatInd->cellId = cellCb->cellId; + dDatInd->rnti = ueCb->ueId; + dDatInd->numLch = 0; } dDatInd->lchData[dDatInd->numLch].lcId = sdu->lcId; dDatInd->lchData[dDatInd->numLch].pdu.mBuf[dDatInd->lchData[dDatInd->numLch].pdu.numPdu] = sdu->mBuf; @@ -871,13 +866,13 @@ uint32_t *lcgBytes #ifdef LTE_L2_MEAS if(ulLcCb->measOn) { - ueCb->ul.lcgArr[lcgId].lcgBsInfo.outStndngBs -= bufSz; + ueCb->ul.lcgArr[lcgId].lcgBsInfo.outStndngBs -= bufSz; } #endif //if ((lcgBytes != NULLP) && (ueCb->ul.lcgArr[lcgId].isGbr == TRUE)) if (lcgBytes != NULLP) { - lcgBytes[lcgId] += bufSz; + lcgBytes[lcgId] += bufSz; } sdu->mBuf = NULLP; dDatInd->numLch++; @@ -886,31 +881,31 @@ uint32_t *lcgBytes /* KWORK_FIX: Modified the index from lcId to lcId-1 for handling lcId 10 properly */ if (ueCb->ul.spsLcId[sdu->lcId-1] == TRUE) { - ueCb->ul.spsDatRcvd++; + ueCb->ul.spsDatRcvd++; } - + if(isSpsRnti) { - /* Data rcvd on CRNTI*/ - /* Retrieve the LCG ID of the LCID*/ - /* SPS LCG has data whose size > SID Size */ - /* Activate SPS if data recvd on SPS LCID and size > SID Packet Size */ - if((ueCb->ul.spsLcId[sdu->lcId-1] == TRUE) && - (sdu->len > RG_SPS_SID_PACKET_SIZE)) - { - *spsToBeActvtd = TRUE; - *sduSize = sdu->len; - } + /* Data rcvd on CRNTI*/ + /* Retrieve the LCG ID of the LCID*/ + /* SPS LCG has data whose size > SID Size */ + /* Activate SPS if data recvd on SPS LCID and size > SID Packet Size */ + if((ueCb->ul.spsLcId[sdu->lcId-1] == TRUE) && + (sdu->len > RG_SPS_SID_PACKET_SIZE)) + { + *spsToBeActvtd = TRUE; + *sduSize = sdu->len; + } } - + #endif #ifdef LTE_L2_MEAS if(cellCb->qciArray[ulLcCb->qci].mask == TRUE) { - sduLen[ulLcCb->qci] = sdu->len; - totalBytesRcvd += sdu->len; - qciVal[ulLcCb->qci] = ulLcCb->qci; + sduLen[ulLcCb->qci] = sdu->len; + totalBytesRcvd += sdu->len; + qciVal[ulLcCb->qci] = ulLcCb->qci; } #endif node = node->next; @@ -919,49 +914,49 @@ uint32_t *lcgBytes for(idx2 = 0; idx2 < RGU_MAX_LC; idx2++) { if((cellCb->qciArray[qciVal[idx2]].mask == TRUE) && - totalBytesRcvd > 0) + totalBytesRcvd > 0) { - cellCb->qciArray[qciVal[idx2]].prbCount += - ((numPrb * sduLen[idx2]) / totalBytesRcvd); + cellCb->qciArray[qciVal[idx2]].prbCount += + ((numPrb * sduLen[idx2]) / totalBytesRcvd); } - + /* RRM_RBC_X */ if(totalBytesRcvd > 0 && qciVal[idx2] > 0) { - RG_UPD_GBR_PRB(cellCb, qciVal[idx2], ((numPrb * sduLen[idx2])/totalBytesRcvd)); + RG_UPD_GBR_PRB(cellCb, qciVal[idx2], ((numPrb * sduLen[idx2])/totalBytesRcvd)); } /* RRM_RBC_Y */ } #endif -/*Added for explicit release - start*/ + /*Added for explicit release - start*/ #ifdef LTEMAC_SPS if(isSpsRnti && dDatInd && dDatInd->numLch) { if(ueCb->ul.spsDatRcvd != 0) { - ueCb->ul.explRelCntr = 0; - ueCb->ul.spsDatRcvd = 0; + ueCb->ul.explRelCntr = 0; + ueCb->ul.spsDatRcvd = 0; } else { - ueCb->ul.explRelCntr++; - if (ueCb->ul.explRelCntr == ueCb->ul.explRelCnt) - { - ueCb->ul.explRelCntr = 0; - /* Indicate scheduler for explicit release */ - memset(&schPst1, 0, sizeof(Pst)); - rgGetPstToInst(&schPst1,inst, cellCb->schInstMap.schInst); - //TODO: commented for compilation without SCH + ueCb->ul.explRelCntr++; + if (ueCb->ul.explRelCntr == ueCb->ul.explRelCnt) + { + ueCb->ul.explRelCntr = 0; + /* Indicate scheduler for explicit release */ + memset(&schPst1, 0, sizeof(Pst)); + rgGetPstToInst(&schPst1,inst, cellCb->schInstMap.schInst); + //TODO: commented for compilation without SCH #if 0 - relInfo.cellSapId = cellCb->schInstMap.cellSapId; - relInfo.cRnti = ueCb->ueId; - relInfo.isExplRel = TRUE; - /* Release indicator is called now through the matrix in the function below */ - //TODO: commented for compilation without SCH RgMacSchSpsRel( &schPst1, &relInfo ); -#endif - ueCb->ul.implRelCntr = 0; - } + relInfo.cellSapId = cellCb->schInstMap.cellSapId; + relInfo.cRnti = ueCb->ueId; + relInfo.isExplRel = TRUE; + /* Release indicator is called now through the matrix in the function below */ + //TODO: commented for compilation without SCH RgMacSchSpsRel( &schPst1, &relInfo ); +#endif + ueCb->ul.implRelCntr = 0; + } } } else @@ -969,9 +964,9 @@ uint32_t *lcgBytes /* SPS_FIX */ if(ueCb->ul.spsDatRcvd != 0) { - //ueCb->ul.implRelCntr = 0; - ueCb->ul.explRelCntr = 0; - ueCb->ul.spsDatRcvd = 0; + //ueCb->ul.implRelCntr = 0; + ueCb->ul.explRelCntr = 0; + ueCb->ul.spsDatRcvd = 0; } } #endif @@ -986,9 +981,8 @@ uint32_t *lcgBytes #endif if ((ret = rgUIMSndDedDatInd(inst,ueCb->rguUlSap,dDatInd)) != ROK) { - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId, - "Failed to send datIndication to RGU CRNTI:%d",ueCb->ueId); - return (ret); + DU_LOG("\nERROR --> MAC : Failed to send datIndication to RGU CRNTI:%d",ueCb->ueId); + return (ret); } } #ifndef SS_RBUF @@ -1017,25 +1011,25 @@ uint32_t *lcgBytes * @return */ #ifdef LTEMAC_SPS -static S16 rgTOMUtlInsSchInfo + static S16 rgTOMUtlInsSchInfo ( -RgMacPdu *pdu, -RgInfSfDatInd *sfInfo, -RgInfCeInfo *ceInfo, -CmLteRnti rnti, -Bool spsToBeActvtd, -uint16_t sduSize, -uint32_t *lcgBytes -) + RgMacPdu *pdu, + RgInfSfDatInd *sfInfo, + RgInfCeInfo *ceInfo, + CmLteRnti rnti, + Bool spsToBeActvtd, + uint16_t sduSize, + uint32_t *lcgBytes + ) #else -static S16 rgTOMUtlInsSchInfo + static S16 rgTOMUtlInsSchInfo ( -RgMacPdu *pdu, -RgInfSfDatInd *sfInfo, -RgInfCeInfo *ceInfo, -CmLteRnti rnti, -uint32_t *lcgBytes -) + RgMacPdu *pdu, + RgInfSfDatInd *sfInfo, + RgInfCeInfo *ceInfo, + CmLteRnti rnti, + uint32_t *lcgBytes + ) #endif { S16 ret; @@ -1052,17 +1046,17 @@ uint32_t *lcgBytes } ueInfo->rnti = rnti; - + ueInfo->ceInfo = *ceInfo; ueInfo->ueLstEnt.node = (PTR)ueInfo; for (lcgId = 1, idx = 0; lcgId < RGINF_MAX_LCG_PER_UE; lcgId++) { if (lcgBytes[lcgId] != 0) { - /* Only GBR bytes */ - ueInfo->lcgInfo[idx].lcgId = lcgId; - ueInfo->lcgInfo[idx++].bytesRcvd = lcgBytes[lcgId]; - lcgBytes[lcgId] = 0; + /* Only GBR bytes */ + ueInfo->lcgInfo[idx].lcgId = lcgId; + ueInfo->lcgInfo[idx++].bytesRcvd = lcgBytes[lcgId]; + lcgBytes[lcgId] = 0; } } cmLListAdd2Tail(&sfInfo->ueLst, &ueInfo->ueLstEnt); @@ -1126,7 +1120,7 @@ S16 rgTOMDatInd(Inst inst, TfuDatIndInfo *datInd) #ifdef LTEMAC_SPS Bool isSpsRnti=FALSE; Pst schPst1; - // RgInfSpsRelInfo relInfo; + // RgInfSpsRelInfo relInfo; Bool spsToBeActvtd = FALSE; uint16_t sduSize = 0; #endif @@ -1139,17 +1133,17 @@ S16 rgTOMDatInd(Inst inst, TfuDatIndInfo *datInd) { datInfo = (TfuDatInfo*)node->node; { - MsgLen len; - SFndLenMsg(datInfo->mBuf, &len); - rgUlrate_tfu += len; - if (rgUlrate_tfu > 100000) - { - printf("Sowmya:rgTOMDatInd datInfo->mBuf len =%d rgUlrate_tfu=%d",len,rgUlrate_tfu); - rgUlrate_tfu = 0; - } + MsgLen len; + SFndLenMsg(datInfo->mBuf, &len); + rgUlrate_tfu += len; + if (rgUlrate_tfu > 100000) + { + DU_LOG("\nINFO --> MAC : rgTOMDatInd datInfo->mBuf len =%d rgUlrate_tfu=%d",len,rgUlrate_tfu); + rgUlrate_tfu = 0; + } } } - return(RFAILED); + return(RFAILED); #endif memset(&lcgBytes, 0, sizeof(lcgBytes)); @@ -1158,10 +1152,10 @@ S16 rgTOMDatInd(Inst inst, TfuDatIndInfo *datInd) ueCb = NULLP; cellCb = rgCb[inst].cell; if((cellCb == NULLP) || - (cellCb->cellId != datInd->cellId)) + (cellCb->cellId != datInd->cellId)) { - - RLOG_ARG0(L_ERROR,DBG_CELLID,datInd->cellId,"Unable to get the cellCb for cell"); + + DU_LOG("\nERROR --> MAC : Unable to get the cellCb for cell"); return RFAILED; } /* Avoiding memset as all the fields are getting initialized further */ @@ -1169,7 +1163,7 @@ S16 rgTOMDatInd(Inst inst, TfuDatIndInfo *datInd) if (rgTOMInfAllocPduEvnt (inst,&sfInfo) != ROK) { err.errType = RGERR_TOM_DATIND; - RLOG_ARG0(L_ERROR,DBG_CELLID,datInd->cellId,"Unable to Allocate PDU for DUX cell"); + DU_LOG("\nERROR --> MAC : Unable to Allocate PDU for DUX cell"); node = datInd->datIndLst.first; return RFAILED; } @@ -1183,15 +1177,15 @@ S16 rgTOMDatInd(Inst inst, TfuDatIndInfo *datInd) { datInfo = (TfuDatInfo*)node->node; { - //uint32_t ulrate_tfu; - MsgLen len; - SFndLenMsg(datInfo->mBuf, &len); + //uint32_t ulrate_tfu; + MsgLen len; + SFndLenMsg(datInfo->mBuf, &len); #ifdef STUB_TTI_HANDLING_5GTF - // printf("Sowmya:rgTOMDatInd datInfo->mBuf len =%d",len); + // DU_LOG(":rgTOMDatInd datInfo->mBuf len =%d",len); #endif - rgUlrate_tfu += len; + rgUlrate_tfu += len; #ifdef EMTC_ENABLE - grgUlrate_tfu += len; + grgUlrate_tfu += len; #endif } #ifdef STUB_TTI_HANDLING_5GTF @@ -1206,22 +1200,22 @@ S16 rgTOMDatInd(Inst inst, TfuDatIndInfo *datInd) /* Lets allocate the event that needs to be passed to DUX */ if (rgTOMUtlAllocPduEvnt (inst,&pdu) != ROK) { - err.errType = RGERR_TOM_DATIND; - RLOG_ARG0(L_ERROR,DBG_CELLID,datInd->cellId,"Unable to Allocate PDU for DUX cell"); - rgTOMInfFreePduEvnt (sfInfo); - return RFAILED; + err.errType = RGERR_TOM_DATIND; + DU_LOG("\nERROR --> MAC : Unable to Allocate PDU for DUX cell"); + rgTOMInfFreePduEvnt (sfInfo); + return RFAILED; } if ((ret = rgDUXDemuxData (inst,pdu, &ceInfo, - &datInfo->mBuf, &err)) != ROK) + &datInfo->mBuf, &err)) != ROK) { - //exit(1); - /* Fix: sriky memory corruption precautions */ - rgTOMUtlFreePduEvnt (pdu, TRUE); - err.errType = RGERR_TOM_DATIND; - RLOG_ARG0(L_ERROR,DBG_CELLID,datInd->cellId,"DUX processing failed"); - tfuSap->sapSts.numPduDrop++; - continue; + //exit(1); + /* Fix: sriky memory corruption precautions */ + rgTOMUtlFreePduEvnt (pdu, TRUE); + err.errType = RGERR_TOM_DATIND; + DU_LOG("\nERROR --> MAC : DUX processing failed"); + tfuSap->sapSts.numPduDrop++; + continue; } /* It could be that a non-msg3 pdu contains a CRNTI Control element. We * should check for CRNTI CE and if it exists the UECb must exist, also an @@ -1231,110 +1225,109 @@ S16 rgTOMDatInd(Inst inst, TfuDatIndInfo *datInd) if (ceInfo.bitMask & RG_CCCH_SDU_PRSNT) { - ret = rgTOMProcCCCHSduInDatInd(pdu, prevUeCb, \ - cellCb, datInfo, &ceInfo, slot); - if (ret == RFAILED) - { - rgTOMUtlFreePduEvnt (pdu, TRUE); - err.errType = RGERR_TOM_DATIND; - tfuSap->sapSts.numPduDrop++; - continue; - } + ret = rgTOMProcCCCHSduInDatInd(pdu, prevUeCb, \ + cellCb, datInfo, &ceInfo, slot); + if (ret == RFAILED) + { + rgTOMUtlFreePduEvnt (pdu, TRUE); + err.errType = RGERR_TOM_DATIND; + tfuSap->sapSts.numPduDrop++; + continue; + } } /* end of Msg3 processing */ else if (ceInfo.bitMask & RG_CRNTI_CE_PRSNT) { - ret = rgTOMProcCrntiCEInDatInd(pdu, prevUeCb, \ - cellCb, datInfo, &ceInfo, slot); - if (ret == RFAILED) - { - rgTOMUtlFreePduEvnt (pdu, TRUE); - err.errType = RGERR_TOM_DATIND; - tfuSap->sapSts.numPduDrop++; - continue; - } + ret = rgTOMProcCrntiCEInDatInd(pdu, prevUeCb, \ + cellCb, datInfo, &ceInfo, slot); + if (ret == RFAILED) + { + rgTOMUtlFreePduEvnt (pdu, TRUE); + err.errType = RGERR_TOM_DATIND; + tfuSap->sapSts.numPduDrop++; + continue; + } } /* end of CRNTI based message */ else { - ueCb = rgDBMGetUeCb (cellCb, datInfo->rnti); - if (ueCb == NULLP) - { + ueCb = rgDBMGetUeCb (cellCb, datInfo->rnti); + if (ueCb == NULLP) + { #ifdef LTEMAC_SPS - /* Try getting the UE using SPS-RNTI. */ - ueCb = rgDBMGetSpsUeCb (cellCb, datInfo->rnti); - if (ueCb != NULLP) - { - isSpsRnti = TRUE; - /* Increment implrelCntr for an empty transmission */ - if (pdu->sduLst.count == 0) - { - ueCb->ul.implRelCntr++; - if (ueCb->ul.implRelCntr == ueCb->ul.implRelCnt) - { - /* Indicate scheduler for implicit release */ - memset(&schPst1, 0, sizeof(Pst)); - rgGetPstToInst(&schPst1,inst, cellCb->schInstMap.schInst); - - ueCb->ul.implRelCntr = 0; - ueCb->ul.explRelCntr = 0; + /* Try getting the UE using SPS-RNTI. */ + ueCb = rgDBMGetSpsUeCb (cellCb, datInfo->rnti); + if (ueCb != NULLP) + { + isSpsRnti = TRUE; + /* Increment implrelCntr for an empty transmission */ + if (pdu->sduLst.count == 0) + { + ueCb->ul.implRelCntr++; + if (ueCb->ul.implRelCntr == ueCb->ul.implRelCnt) + { + /* Indicate scheduler for implicit release */ + memset(&schPst1, 0, sizeof(Pst)); + rgGetPstToInst(&schPst1,inst, cellCb->schInstMap.schInst); + + ueCb->ul.implRelCntr = 0; + ueCb->ul.explRelCntr = 0; #if 0 - relInfo.cellSapId = cellCb->schInstMap.cellSapId; - relInfo.cRnti = ueCb->ueId; - relInfo.isExplRel= FALSE; - //TODO: commented for compilation without SCH RgMacSchSpsRel(&schPst1, &relInfo); + relInfo.cellSapId = cellCb->schInstMap.cellSapId; + relInfo.cRnti = ueCb->ueId; + relInfo.isExplRel= FALSE; + //TODO: commented for compilation without SCH RgMacSchSpsRel(&schPst1, &relInfo); #endif - } - } - else - { - /* Reset the implrelCntr */ - ueCb->ul.implRelCntr = 0; - } - } - else + } + } + else + { + /* Reset the implrelCntr */ + ueCb->ul.implRelCntr = 0; + } + } + else #endif - { - /* Perform failure if ueCb is still NULLP */ - rgTOMUtlFreePduEvnt (pdu, TRUE); - err.errType = RGERR_TOM_DATIND; - RLOG_ARG1(L_ERROR,DBG_CELLID,datInd->cellId,"RNTI:%d Unable to get the UE CB", - datInfo->rnti); - tfuSap->sapSts.numPduDrop++; - continue; - } - } + { + /* Perform failure if ueCb is still NULLP */ + rgTOMUtlFreePduEvnt (pdu, TRUE); + err.errType = RGERR_TOM_DATIND; + DU_LOG("\nERROR --> MAC : RNTI:%d Unable to get the UE CB", + datInfo->rnti); + tfuSap->sapSts.numPduDrop++; + continue; + } + } #ifdef LTE_L2_MEAS - rgTOMUtlL2MStoreBufSz(ueCb, &ceInfo); - rgTOML2MCompileActiveLCs (cellCb, ueCb, pdu, &ceInfo); + rgTOMUtlL2MStoreBufSz(ueCb, &ceInfo); + rgTOML2MCompileActiveLCs (cellCb, ueCb, pdu, &ceInfo); #endif #ifdef LTEMAC_SPS - if ((ret = rgTOMUtlProcMsg(cellCb, ueCb, pdu, isSpsRnti,&spsToBeActvtd,&sduSize, slot, (uint32_t *)&lcgBytes)) != ROK) + if ((ret = rgTOMUtlProcMsg(cellCb, ueCb, pdu, isSpsRnti,&spsToBeActvtd,&sduSize, slot, (uint32_t *)&lcgBytes)) != ROK) #else - if ((ret = rgTOMUtlProcMsg (cellCb, ueCb, pdu, slot, (uint32_t *)&lcgBytes)) != ROK) + if ((ret = rgTOMUtlProcMsg (cellCb, ueCb, pdu, slot, (uint32_t *)&lcgBytes)) != ROK) #endif /* LTEMAC_SPS */ - { - rgTOMUtlFreePduEvnt (pdu, TRUE); - err.errType = RGERR_TOM_DATIND; - RLOG_ARG1(L_ERROR,DBG_CELLID,datInd->cellId, - "Unable to handle Data Indication CRNTI:%d",ueCb->ueId); - tfuSap->sapSts.numPduDrop++; - continue; - } + { + rgTOMUtlFreePduEvnt (pdu, TRUE); + err.errType = RGERR_TOM_DATIND; + DU_LOG("\nERROR --> MAC : Unable to handle Data Indication CRNTI:%d",ueCb->ueId); + tfuSap->sapSts.numPduDrop++; + continue; + } } - + #ifdef LTEMAC_SPS if(rgTOMUtlInsSchInfo(pdu, sfInfo, &ceInfo, datInfo->rnti,spsToBeActvtd,sduSize, (uint32_t *)&lcgBytes) != ROK) #else - if(rgTOMUtlInsSchInfo(pdu, sfInfo, &ceInfo, datInfo->rnti, (uint32_t *)&lcgBytes) != ROK) + if(rgTOMUtlInsSchInfo(pdu, sfInfo, &ceInfo, datInfo->rnti, (uint32_t *)&lcgBytes) != ROK) #endif - - { - rgTOMInfFreePduEvnt (sfInfo); - rgTOMUtlFreePduEvnt (pdu, FALSE); - return RFAILED; - } + + { + rgTOMInfFreePduEvnt (sfInfo); + rgTOMUtlFreePduEvnt (pdu, FALSE); + return RFAILED; + } /* free up the PDU memory */ rgTOMUtlFreePduEvnt (pdu, FALSE); } @@ -1343,19 +1336,19 @@ S16 rgTOMDatInd(Inst inst, TfuDatIndInfo *datInd) if(cellCb->ulSf[(slot % RG_NUM_SUB_FRAMES)].ueUlAllocInfo != NULLP) { /*ccpu00117052 - MOD - Passing double for proper NULLP - assignment */ + assignment */ rgFreeSBuf(inst,(Data **)&(cellCb->ulSf[(slot % RG_NUM_SUB_FRAMES)].ueUlAllocInfo), - ((cellCb->ulSf[(slot % RG_NUM_SUB_FRAMES)].numUe) * sizeof(RgUeUlAlloc))); + ((cellCb->ulSf[(slot % RG_NUM_SUB_FRAMES)].numUe) * sizeof(RgUeUlAlloc))); } #endif /* RRM_RBC_X */ /* Update PRB used for all GBR QCIs to scheduler */ - memcpy( &sfInfo->qcisUlPrbCnt[0], - &cellCb->qcisUlPrbCnt[0], - (RGM_MAX_QCI_REPORTS * sizeof(uint32_t))); - /* clear the cellCb ul prb value */ - memset(&cellCb->qcisUlPrbCnt[0], 0, - (RGM_MAX_QCI_REPORTS * sizeof(uint32_t))); + memcpy( &sfInfo->qcisUlPrbCnt[0], + &cellCb->qcisUlPrbCnt[0], + (RGM_MAX_QCI_REPORTS * sizeof(uint32_t))); + /* clear the cellCb ul prb value */ + memset(&cellCb->qcisUlPrbCnt[0], 0, + (RGM_MAX_QCI_REPORTS * sizeof(uint32_t))); /* RRM_RBC_Y */ @@ -1392,17 +1385,17 @@ S16 rgTOMDatInd(Inst inst, TfuDatIndInfo *datInd) * -# ROK * -# RFAILED **/ -static S16 rgHndlCmnChnl + static S16 rgHndlCmnChnl ( -RgCellCb *cell, -CmLteTimingInfo timingInfo, -RgInfCmnLcInfo *cmnLcInfo, -RgErrInfo *err -) + RgCellCb *cell, + CmLteTimingInfo timingInfo, + RgInfCmnLcInfo *cmnLcInfo, + RgErrInfo *err + ) { - #if (ERRCLASS & ERRCLS_DEBUG) +#if (ERRCLASS & ERRCLS_DEBUG) RgPcchLcCb *pcch; - #endif +#endif #ifndef RGR_SI_SCH RgBcchDlschLcCb *bcch; #if (ERRCLASS & ERRCLS_DEBUG) @@ -1419,33 +1412,33 @@ RgErrInfo *err if(cmnLcInfo->bitMask & RGINF_BCH_INFO) { #ifndef RGR_SI_SCH - #if (ERRCLASS & ERRCLS_DEBUG) +#if (ERRCLASS & ERRCLS_DEBUG) if(NULLP == (bch = rgDBMGetBcchOnBch(cell))) { - return RFAILED; + return RFAILED; } if(cmnLcInfo->bchInfo.lcId != bch->lcId) { - return RFAILED; + return RFAILED; } - #endif +#endif if (rgAllocShrablSBuf (inst,(Data**)&staInd, sizeof(RguCStaIndInfo)) != ROK) { - err->errCause = RGERR_TOM_MEM_EXHAUST; - return RFAILED; + err->errCause = RGERR_TOM_MEM_EXHAUST; + return RFAILED; } staInd->cellId = cell->cellId; staInd->rnti = RG_INVALID_RNTI; staInd->lcId = cmnLcInfo->bchInfo.lcId; staInd->transId = (timingInfo.sfn << 8) | (timingInfo.slot); -/* ADD Changes for Downlink UE Timing Optimization */ + /* ADD Changes for Downlink UE Timing Optimization */ #ifdef LTEMAC_DLUE_TMGOPTMZ dlSf->remDatReqCnt++; #endif if (rgUIMSndCmnStaInd (inst,cell->rguDlSap,staInd) != ROK) { - return RFAILED; + return RFAILED; } #else /*Store the received BCH Data in the scheduled subframe*/ @@ -1455,35 +1448,35 @@ RgErrInfo *err if(cmnLcInfo->bitMask & RGINF_PCCH_INFO) { - #if (ERRCLASS & ERRCLS_DEBUG) +#if (ERRCLASS & ERRCLS_DEBUG) if(NULLP == (pcch = rgDBMGetPcch(cell))) { - return RFAILED; + return RFAILED; } if(cmnLcInfo->pcchInfo.lcId != pcch->lcId) { - return RFAILED; + return RFAILED; } - #endif +#endif dlSf->pcch.pdcch.rnti = - cmnLcInfo->pcchInfo.rnti; + cmnLcInfo->pcchInfo.rnti; dlSf->pcch.pdcch.dci = - cmnLcInfo->pcchInfo.dciInfo; + cmnLcInfo->pcchInfo.dciInfo; #ifdef TFU_UPGRADE /* ccpu00132314-ADD-Fill the tx Pwr offset from scheduler */ dlSf->pcch.txPwrOffset = cmnLcInfo->pcchInfo.txPwrOffset; #endif if (rgAllocShrablSBuf (inst,(Data**)&staInd, sizeof(RguCStaIndInfo)) != ROK) { - err->errCause = RGERR_TOM_MEM_EXHAUST; - return RFAILED; + err->errCause = RGERR_TOM_MEM_EXHAUST; + return RFAILED; } staInd->cellId = cell->cellId; staInd->rnti = RG_INVALID_RNTI; staInd->lcId = cmnLcInfo->pcchInfo.lcId; staInd->transId = (timingInfo.sfn << 8) | (timingInfo.slot); -/* ADD Changes for Downlink UE Timing Optimization */ + /* ADD Changes for Downlink UE Timing Optimization */ #ifdef LTEMAC_DLUE_TMGOPTMZ dlSf->remDatReqCnt++; #endif @@ -1492,52 +1485,52 @@ RgErrInfo *err */ if (rgUIMSndCmnStaInd (inst,cell->rguDlSap,staInd) != ROK) { - return RFAILED; + return RFAILED; } } if(cmnLcInfo->bitMask & RGINF_BCCH_INFO) { dlSf->bcch.pdcch.rnti = - cmnLcInfo->bcchInfo.rnti; + cmnLcInfo->bcchInfo.rnti; dlSf->bcch.pdcch.dci = - cmnLcInfo->bcchInfo.dciInfo; + cmnLcInfo->bcchInfo.dciInfo; #ifdef TFU_UPGRADE /* ccpu00132314-ADD-Fill the tx Pwr offset from scheduler */ dlSf->bcch.txPwrOffset = cmnLcInfo->bcchInfo.txPwrOffset; #endif #ifndef RGR_SI_SCH if(NULLP == - (bcch=rgDBMGetBcchOnDlsch(cell,cmnLcInfo->bcchInfo.lcId))) + (bcch=rgDBMGetBcchOnDlsch(cell,cmnLcInfo->bcchInfo.lcId))) { - return RFAILED; + return RFAILED; } if(TRUE == cmnLcInfo->bcchInfo.sndStatInd) { - RG_FREE_MSG(bcch->tb); - if (rgAllocShrablSBuf (inst,(Data**)&staInd, - sizeof(RguCStaIndInfo)) != ROK) - { - err->errCause = RGERR_TOM_MEM_EXHAUST; - return RFAILED; - } - staInd->cellId = cell->cellId; - staInd->rnti = RG_INVALID_RNTI; - staInd->lcId = cmnLcInfo->bcchInfo.lcId; - staInd->transId = (timingInfo.sfn << 8) | (timingInfo.slot); -/* ADD Changes for Downlink UE Timing Optimization */ + RG_FREE_MSG(bcch->tb); + if (rgAllocShrablSBuf (inst,(Data**)&staInd, + sizeof(RguCStaIndInfo)) != ROK) + { + err->errCause = RGERR_TOM_MEM_EXHAUST; + return RFAILED; + } + staInd->cellId = cell->cellId; + staInd->rnti = RG_INVALID_RNTI; + staInd->lcId = cmnLcInfo->bcchInfo.lcId; + staInd->transId = (timingInfo.sfn << 8) | (timingInfo.slot); + /* ADD Changes for Downlink UE Timing Optimization */ #ifdef LTEMAC_DLUE_TMGOPTMZ - dlSf->remDatReqCnt++; + dlSf->remDatReqCnt++; #endif - if (rgUIMSndCmnStaInd (inst,cell->rguDlSap,staInd) != ROK) - { - return RFAILED; - } + if (rgUIMSndCmnStaInd (inst,cell->rguDlSap,staInd) != ROK) + { + return RFAILED; + } } else { - SCpyMsgMsg(bcch->tb, RG_GET_MEM_REGION(rgCb[inst]), - RG_GET_MEM_POOL(rgCb[inst]), &dlSf->bcch.tb); + SCpyMsgMsg(bcch->tb, RG_GET_MEM_REGION(rgCb[inst]), + RG_GET_MEM_POOL(rgCb[inst]), &dlSf->bcch.tb); } #else /*Store the received BCCH Data in the scheduled subframe*/ @@ -1575,13 +1568,13 @@ RgErrInfo *err * -# ROK * -# RFAILED **/ -static S16 rgHndlSchdUe + static S16 rgHndlSchdUe ( -RgCellCb *cell, -CmLteTimingInfo timingInfo, -RgInfUeInfo *ueInfo, -RgErrInfo *err -) + RgCellCb *cell, + CmLteTimingInfo timingInfo, + RgInfUeInfo *ueInfo, + RgErrInfo *err + ) { @@ -1611,19 +1604,19 @@ RgErrInfo *err * -# ROK * -# RFAILED **/ -static S16 rgHndlUlUeInfo + static S16 rgHndlUlUeInfo ( -RgCellCb *cell, -CmLteTimingInfo timingInfo, -RgInfUlUeInfo *ueInfo -) + RgCellCb *cell, + CmLteTimingInfo timingInfo, + RgInfUlUeInfo *ueInfo + ) { Inst inst = cell->macInst - RG_INST_START; uint8_t idx; RgUlSf *ulSf; S16 ret; - + ulSf = &cell->ulSf[(timingInfo.slot % RGSCH_NUM_SUB_FRAMES)]; /* rg003.301-MOD- Corrected the purifier memory leak */ @@ -1631,8 +1624,8 @@ RgInfUlUeInfo *ueInfo { if (ulSf->ueUlAllocInfo) { - rgFreeSBuf(inst,(Data **)&(ulSf->ueUlAllocInfo), - ulSf->numUe * sizeof(RgUeUlAlloc)); + rgFreeSBuf(inst,(Data **)&(ulSf->ueUlAllocInfo), + ulSf->numUe * sizeof(RgUeUlAlloc)); } } #ifdef XEON_SPECIFIC_CHANGES @@ -1642,12 +1635,12 @@ RgInfUlUeInfo *ueInfo ulSf->numUe = ueInfo->numUes; if((ulSf->ueUlAllocInfo == NULLP) && (ueInfo->numUes > 0)) { - /* Allocate memory for ulAllocInfo */ - if((ret = rgAllocSBuf(inst,(Data**)&(cell->ulSf[(timingInfo.slot % RGSCH_NUM_SUB_FRAMES)]. - ueUlAllocInfo), ueInfo->numUes * sizeof(RgUeUlAlloc))) != ROK) - { - return (ret); - } + /* Allocate memory for ulAllocInfo */ + if((ret = rgAllocSBuf(inst,(Data**)&(cell->ulSf[(timingInfo.slot % RGSCH_NUM_SUB_FRAMES)]. + ueUlAllocInfo), ueInfo->numUes * sizeof(RgUeUlAlloc))) != ROK) + { + return (ret); + } } #ifdef XEON_SPECIFIC_CHANGES CM_MEAS_TIME((cell->crntTime.slot % RGSCH_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MEAS_ALLOC); @@ -1657,8 +1650,8 @@ RgInfUlUeInfo *ueInfo { for(idx = 0; idx < ueInfo->numUes; idx++) { - ulSf->ueUlAllocInfo[idx].rnti = ueInfo->ulAllocInfo[idx].rnti; - ulSf->ueUlAllocInfo[idx].numPrb = ueInfo->ulAllocInfo[idx].numPrb; + ulSf->ueUlAllocInfo[idx].rnti = ueInfo->ulAllocInfo[idx].rnti; + ulSf->ueUlAllocInfo[idx].numPrb = ueInfo->ulAllocInfo[idx].numPrb; } } RGCPYTIMEINFO(timingInfo, ulSf->schdTime); @@ -1692,29 +1685,29 @@ Void rgTOMRlsSf(Inst inst,RgDlSf *dlSf) if(dlSf->txDone == FALSE) { - RLOG0(L_ERROR, "SUBFRAME Not pushed to the PHY"); + DU_LOG("\nERROR --> MAC : SUBFRAME Not pushed to the PHY"); if (dlSf->bch.tb != NULLP) { - RG_FREE_MSG(dlSf->bch.tb); + RG_FREE_MSG(dlSf->bch.tb); } if (dlSf->bcch.tb != NULLP) { - RG_FREE_MSG(dlSf->bcch.tb); + RG_FREE_MSG(dlSf->bcch.tb); } if (dlSf->pcch.tb != NULLP) { - RG_FREE_MSG(dlSf->pcch.tb); + RG_FREE_MSG(dlSf->pcch.tb); } #ifdef EMTC_ENABLE rgTOMEmtcRlsSf(dlSf); #endif for(idx=0; idx < dlSf->numRaRsp; idx++) { - RG_FREE_MSG(dlSf->raRsp[idx].rar); + RG_FREE_MSG(dlSf->raRsp[idx].rar); } } -/* ADD Changes for Downlink UE Timing Optimization */ + /* ADD Changes for Downlink UE Timing Optimization */ #ifdef LTEMAC_DLUE_TMGOPTMZ dlSf->remDatReqCnt = 0; /* Fix[ccpu00126310]: Tracks Data Requests from RLC for both loosely and tight coupled @@ -1726,29 +1719,28 @@ Void rgTOMRlsSf(Inst inst,RgDlSf *dlSf) uint8_t i; CmLList *node; RgDlHqProcCb *hqP; - RGDBGERRNEW(inst, (rgPBuf(inst), - "Error Stale TBs in Subframes TBS list\n")); + DU_LOG("\nERROR --> MAC : Error Stale TBs in Subframes TBS list\n"); node = dlSf->tbs.first; while(node) { - hqP = (RgDlHqProcCb*)node->node; - node = node->next; - if (hqP) - { - for(i=0;i< RG_MAX_TB_PER_UE;i++) - { - if (hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf) - { - cmLListDelFrm(&dlSf->tbs, &(hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk)); - hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node = NULLP; - printf("\n rgTOMRlsSf:: hqP %p \n", (Void *)hqP); - } - hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf = NULLP; - } - } + hqP = (RgDlHqProcCb*)node->node; + node = node->next; + if (hqP) + { + for(i=0;i< RG_MAX_TB_PER_UE;i++) + { + if (hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf) + { + cmLListDelFrm(&dlSf->tbs, &(hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk)); + hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node = NULLP; + DU_LOG("\nERROR --> MAC : rgTOMRlsSf:: hqP %p \n", (Void *)hqP); + } + hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf = NULLP; + } } - } - /*arjun: check if dlSf laaTb list has to be freed???*/ + } + } + /*arjun: check if dlSf laaTb list has to be freed???*/ cmLListInit(&dlSf->tbs); dlSf->txDone = FALSE; dlSf->numRaRsp = 0; @@ -1784,21 +1776,21 @@ S16 rgHndlFlowCntrl(RgCellCb *cell,RgInfSfAlloc *sfInfo) flowCntrlInd = cell->flowCntrlInd; flowCntrlInd->cellId = sfInfo->cellId; flowCntrlInd->numUes = sfInfo->flowCntrlInfo.numUes; - + for (ueIdx = 0; ueIdx < sfInfo->flowCntrlInfo.numUes; ueIdx++) { flowCntrlInd->ueFlowCntrlInfo[ueIdx].ueId = sfInfo->flowCntrlInfo.ueFlowCntrlInfo[ueIdx].ueId; flowCntrlInd->ueFlowCntrlInfo[ueIdx].numLcs = sfInfo->flowCntrlInfo.ueFlowCntrlInfo[ueIdx].numLcs; - + for (lcIdx = 0; lcIdx < RGINF_MAX_NUM_DED_LC; lcIdx++) { - flowCntrlInd->ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].lcId = - sfInfo->flowCntrlInfo.ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].lcId; - flowCntrlInd->ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].pktAdmitCnt = - sfInfo->flowCntrlInfo.ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].pktAdmitCnt; - - flowCntrlInd->ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].maxBo4FlowCtrl = - sfInfo->flowCntrlInfo.ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].maxBo4FlowCtrl; + flowCntrlInd->ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].lcId = + sfInfo->flowCntrlInfo.ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].lcId; + flowCntrlInd->ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].pktAdmitCnt = + sfInfo->flowCntrlInfo.ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].pktAdmitCnt; + + flowCntrlInd->ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].maxBo4FlowCtrl = + sfInfo->flowCntrlInfo.ueFlowCntrlInfo[ueIdx].lcInfo[lcIdx].maxBo4FlowCtrl; } } RgUiRguFlowCntrlInd(pst, cell->rguDlSap->sapCfg.spId,flowCntrlInd); /* TODO: Rishi confirm if the suId and pst pointer is correct */ @@ -1851,7 +1843,7 @@ S16 RgSchMacSfAllocReq(Pst *pst,RgInfSfAlloc *sfInfo) if((cell = rgCb[inst].cell) == NULLP) { - RLOG_ARG0(L_ERROR,DBG_CELLID,sfInfo->cellId, "No cellCb found with cell"); + DU_LOG("\nERROR --> MAC : No cellCb found with cell"); return RFAILED; } @@ -1867,10 +1859,10 @@ S16 RgSchMacSfAllocReq(Pst *pst,RgInfSfAlloc *sfInfo) /* Fix : syed Ignore Failure Returns and continue processing. * Incomplete processing results in state sync loss between MAC-SCH. */ #ifdef EMTC_ENABLE - if(TRUE == cell->emtcEnable) - { - rgEmtcHndl(cell, sfInfo); - } + if(TRUE == cell->emtcEnable) + { + rgEmtcHndl(cell, sfInfo); + } #endif rgHndlCmnChnl(cell, sfInfo->timingInfo, &sfInfo->cmnLcInfo, &err); @@ -1892,7 +1884,7 @@ S16 RgSchMacSfAllocReq(Pst *pst,RgInfSfAlloc *sfInfo) #ifdef LTE_L2_MEAS if(rgHndlUlUeInfo(cell, sfInfo->ulUeInfo.timingInfo, - &sfInfo->ulUeInfo) != ROK) + &sfInfo->ulUeInfo) != ROK) { return RFAILED; } @@ -1912,18 +1904,18 @@ S16 RgSchMacSfAllocReq(Pst *pst,RgInfSfAlloc *sfInfo) RLC-MAC */ if(!(dlSf->txDone) && #ifdef LTE_ADV - (TRUE == rgLaaChkAllRxTbs(dlSf)) && + (TRUE == rgLaaChkAllRxTbs(dlSf)) && #endif - (0 == dlSf->remDatReqCnt) && (dlSf->statIndDone) && - (RG_TIMEINFO_SAME(cell->crntTime, dlSf->schdTime))) + (0 == dlSf->remDatReqCnt) && (dlSf->statIndDone) && + (RG_TIMEINFO_SAME(cell->crntTime, dlSf->schdTime))) { /*This is the case of rettransmission, so no need * to wait for TTI Ind to push TFU Data Request. Send * it right away.*/ if (ROK != rgTOMUtlProcDlSf (dlSf, cell, &err)) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to process downlink subframe for cell"); - err.errType = RGERR_ROM_DEDDATREQ; + DU_LOG("\nERROR --> MAC : Unable to process downlink subframe for cell"); + err.errType = RGERR_ROM_DEDDATREQ; } /* Mark this frame as sent */ dlSf->txDone = TRUE; @@ -1931,7 +1923,7 @@ S16 RgSchMacSfAllocReq(Pst *pst,RgInfSfAlloc *sfInfo) #endif if (sfInfo->flowCntrlInfo.numUes > 0) { - rgHndlFlowCntrl(cell,sfInfo); + rgHndlFlowCntrl(cell,sfInfo); } /*stoping Task*/ SStopTask(startTime, PID_MAC_SF_ALLOC_REQ); @@ -1966,15 +1958,15 @@ S16 RgSchMacSfAllocReq(Pst *pst,RgInfSfAlloc *sfInfo) * -# ROK * -# RFAILED **/ -static S16 rgTOMProcCrntiCEInDatInd + static S16 rgTOMProcCrntiCEInDatInd ( -RgMacPdu *pdu, -RgUeCb *prevUeCb, -RgCellCb *cellCb, -TfuDatInfo *datInfo, -RgInfCeInfo *ceInfo, -uint16_t slot -) + RgMacPdu *pdu, + RgUeCb *prevUeCb, + RgCellCb *cellCb, + TfuDatInfo *datInfo, + RgInfCeInfo *ceInfo, + uint16_t slot + ) { RgUeCb *ueCb = NULLP; Inst inst = cellCb->macInst - RG_INST_START; @@ -1987,41 +1979,37 @@ uint16_t slot #ifndef LTE_L2_MEAS - UNUSED(slot); + UNUSED(slot); #endif ueCb = rgDBMGetUeCbFromRachLst (cellCb, datInfo->rnti); if (ueCb == NULLP) { - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId, - "RNTI:%d Received MSG3 with CRNTI,unable to find ueCb", ceInfo->ces.cRnti); - return RFAILED; + DU_LOG("\nERROR --> MAC : RNTI:%d Received MSG3 with CRNTI,unable to find ueCb", ceInfo->ces.cRnti); + return RFAILED; } prevUeCb = rgDBMGetUeCb (cellCb, ceInfo->ces.cRnti); if (prevUeCb == NULLP) { - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId, - "RNTI:%d Received MSG3 with CRNTI,unable to find ueCb", ceInfo->ces.cRnti); - return RFAILED; + DU_LOG("\nERROR --> MAC : RNTI:%d Received MSG3 with CRNTI,unable to find ueCb", ceInfo->ces.cRnti); + return RFAILED; } - RLOG_ARG2(L_DEBUG,DBG_CELLID,cellCb->cellId, - "CRNTI CE(%d) received through tmpCrnti(%d)", - ceInfo->ces.cRnti, datInfo->rnti); + DU_LOG("\nERROR --> MAC : CRNTI CE(%d) received through tmpCrnti(%d)", + ceInfo->ces.cRnti, datInfo->rnti); rgDBMDelUeCbFromRachLst(cellCb, ueCb); rgRAMFreeUeCb(inst,ueCb); ueCb = prevUeCb; #ifdef LTEMAC_SPS if ((rgTOMUtlProcMsg(cellCb, ueCb, pdu, FALSE,&spsToBeActvtd,&sduSize, slot, NULLP)) != ROK) #else - if ((rgTOMUtlProcMsg (cellCb, ueCb, pdu, slot, NULLP)) != ROK) + if ((rgTOMUtlProcMsg (cellCb, ueCb, pdu, slot, NULLP)) != ROK) #endif /* LTEMAC_SPS */ - { - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId, - "RNTI:%d Processing for MSG3 failed",datInfo->rnti); - return RFAILED; - } + { + DU_LOG("\nERROR --> MAC : RNTI:%d Processing for MSG3 failed",datInfo->rnti); + return RFAILED; + } return ROK; } /** @@ -2057,15 +2045,15 @@ uint16_t slot * -# ROK * -# RFAILED **/ -static S16 rgTOMProcCCCHSduInDatInd + static S16 rgTOMProcCCCHSduInDatInd ( -RgMacPdu *pdu, -RgUeCb *prevUeCb, -RgCellCb *cellCb, -TfuDatInfo *datInfo, -RgInfCeInfo *ceInfo, -uint16_t slot -) + RgMacPdu *pdu, + RgUeCb *prevUeCb, + RgCellCb *cellCb, + TfuDatInfo *datInfo, + RgInfCeInfo *ceInfo, + uint16_t slot + ) { RgUeCb *ueCb = NULLP; Inst inst = cellCb->macInst - RG_INST_START; @@ -2078,52 +2066,49 @@ uint16_t slot #ifndef LTE_L2_MEAS - UNUSED(slot); + UNUSED(slot); #endif if (ceInfo->bitMask & RG_CRNTI_CE_PRSNT) { - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId, - "CRNTI:%d Received MSG3 with CCCH",ceInfo->ces.cRnti); - return RFAILED; + DU_LOG("\nERROR --> MAC : CRNTI:%d Received MSG3 with CCCH",ceInfo->ces.cRnti); + return RFAILED; } - + ueCb = rgDBMGetUeCbFromRachLst (cellCb, datInfo->rnti); - + if (ueCb == NULLP) { - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId, - "RNTI:%d Processing for MSG3 failed", datInfo->rnti); - return RFAILED; + DU_LOG("\nERROR --> MAC : RNTI:%d Processing for MSG3 failed", datInfo->rnti); + return RFAILED; } /* Fix: syed Drop any duplicate Msg3(CCCH Sdu) */ if (ueCb->dl.hqEnt.numHqProcs) { /* HqE is already initialized by a previuos Msg3 */ - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"RNTI:%d Processing for MSG3 failed. Duplicate " - "MSG3 received. Dropping", datInfo->rnti); - return RFAILED; + DU_LOG("\nERROR --> MAC : RNTI:%d Processing for MSG3 failed. Duplicate " + "MSG3 received. Dropping", datInfo->rnti); + return RFAILED; } - + if(rgDHMHqEntInit(inst,&ueCb->dl.hqEnt, - cellCb->maxDlHqProcPerUe) != ROK) + cellCb->maxDlHqProcPerUe) != ROK) { - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"RNTI:%d Harq Initialization failed ", - datInfo->rnti); - return RFAILED; + DU_LOG("\nERROR --> MAC : RNTI:%d Harq Initialization failed ", + datInfo->rnti); + return RFAILED; } - RLOG_ARG1(L_DEBUG,DBG_CELLID,cellCb->cellId, - "CCCH SDU received through tmpCrnti(%d)",datInfo->rnti); + DU_LOG("\nDEBUG --> MAC : CCCH SDU received through tmpCrnti(%d)",datInfo->rnti); #ifdef LTEMAC_SPS if ((rgTOMUtlProcMsg(cellCb, ueCb, pdu, FALSE,&spsToBeActvtd,&sduSize, slot, NULLP)) != ROK) #else - if ((rgTOMUtlProcMsg (cellCb, ueCb, pdu, slot, NULLP)) != ROK) + if ((rgTOMUtlProcMsg (cellCb, ueCb, pdu, slot, NULLP)) != ROK) #endif /* LTEMAC_SPS */ - { - RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"RNTI:%d Processing for MSG3 failed", - datInfo->rnti); - return RFAILED; - } + { + DU_LOG("\nERROR --> MAC : RNTI:%d Processing for MSG3 failed", + datInfo->rnti); + return RFAILED; + } return ROK; } @@ -2197,14 +2182,14 @@ static Void rgTOML2MCompileActiveLCs(RgCellCb *cellCb,RgUeCb *ueCb,RgMacPdu *pdu while (node) { sdu = (RgMacSdu*)node->node; - + if ((ulLcCb = rgDBMGetUlDedLcCb(ueCb, sdu->lcId)), ulLcCb != NULLP) { - if (ulLcCb->lcgId != 0) - { - ceInfo->bitMask |= RG_ACTIVE_LC_PRSNT; - ceInfo->ulActLCs[ulLcCb->lcId - 1] = TRUE; - } + if (ulLcCb->lcgId != 0) + { + ceInfo->bitMask |= RG_ACTIVE_LC_PRSNT; + ceInfo->ulActLCs[ulLcCb->lcId - 1] = TRUE; + } } node = node->next; } @@ -2215,6 +2200,6 @@ static Void rgTOML2MCompileActiveLCs(RgCellCb *cellCb,RgUeCb *ueCb,RgMacPdu *pdu #endif /********************************************************************** - - End of file -**********************************************************************/ + + End of file + **********************************************************************/ diff --git a/src/5gnrrlc/kw_amm_dl.c b/src/5gnrrlc/kw_amm_dl.c index 7e4d6ced5..1bc8ef544 100755 --- a/src/5gnrrlc/kw_amm_dl.c +++ b/src/5gnrrlc/kw_amm_dl.c @@ -35,9 +35,6 @@ File: kw_amm_dl.c *********************************************************************21*/ -static const char* RLOG_MODULE_NAME="AMM"; -static int RLOG_MODULE_ID=2048; -static int RLOG_FILE_ID=189; /* header include files (.h) */ #include "common_def.h" #include "lkw.h" /* LKW defines */ @@ -364,7 +361,7 @@ RlcDlPduInfo *pduInfo #if (ERRCLASS & ERRCLS_ADD_RES) if (*retx == NULLP) { - RLOG0(L_FATAL, "Memory allocation failed"); + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed"); return; } #endif /* ERRCLASS & ERRCLS_RES */ @@ -553,14 +550,12 @@ KwuDatCfmInfo **datCfm if ((nackSnInfo->isSegment) && ((retx->soEnd < nackSnInfo->soStart) /*|| (retx->amHdr.so > soEnd)*/)) { - RLOG_ARG3(L_DEBUG, DBG_RBID, rbCb->rlcId.rbId, - "rlcHndlStaRsp: Handle ACK for byte segment, Its " + DU_LOG( "\nDEBUG --> RLC_DL : rlcHndlStaRsp: Handle ACK for byte segment, Its " "sn = %d UEID:%d CELLID:%d", nackSnInfo->sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); - RLOG_ARG4(L_DEBUG, DBG_RBID, rbCb->rlcId.rbId, - "soStart and soEnd = %d, %d, UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_DL : soStart and soEnd = %d, %d, UEID:%d CELLID:%d", retx->amHdr.so, retx->soEnd, rbCb->rlcId.ueId, rbCb->rlcId.cellId); @@ -725,8 +720,7 @@ Void rlcAmmDlHndlStatusPdu(RlcCb *gCb,RlcDlRbCb *rbCb,RlcUdxStaPdu *pStaPdu) #if (ERRCLASS & ERRCLS_ADD_RES) if (datCfm == NULLP) { - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); RLC_SHRABL_STATIC_BUF_FREE(rlckwuSap->pst.region, rlckwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); @@ -742,8 +736,7 @@ Void rlcAmmDlHndlStatusPdu(RlcCb *gCb,RlcDlRbCb *rbCb,RlcUdxStaPdu *pStaPdu) if(mAckSn > mTxNext) { - RLOG_ARG4(L_WARNING,DBG_RBID, rbCb->rlcId.rbId, - "Invalid ACK SN = %d received. Current Vta =%d" + DU_LOG("\nERROR --> RLC_DL : Invalid ACK SN = %d received. Current Vta =%d" "UEID:%d CELLID:%d", pStaPdu->ackSn, RLC_AMDL.txNextAck, @@ -785,8 +778,7 @@ Void rlcAmmDlHndlStatusPdu(RlcCb *gCb,RlcDlRbCb *rbCb,RlcUdxStaPdu *pStaPdu) nackSnInfo.nackRange = pStaPdu->nackInfo[idx].nackRange; nackSnInfo.sn = pStaPdu->nackInfo[idx].sn; - RLOG_ARG3(L_DEBUG,DBG_RBID, rbCb->rlcId.rbId, - "rlcHndlStaRsp: NACK SN = %d UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_DL : rlcHndlStaRsp: NACK SN = %d UEID:%d CELLID:%d", nackSnInfo.sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); @@ -809,8 +801,7 @@ Void rlcAmmDlHndlStatusPdu(RlcCb *gCb,RlcDlRbCb *rbCb,RlcUdxStaPdu *pStaPdu) if ((mNackSn > mAckSn) || (mNackSn >= mTxNext)) { /* Erroneous NACK_SN, we should raise an error towards L3 */ - RLOG_ARG2(L_ERROR,DBG_RBID, rbCb->rlcId.rbId, - "Status Pdu is not correct UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : Status Pdu is not correct UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); RLC_SHRABL_STATIC_BUF_FREE(rlckwuSap->pst.region, rlckwuSap->pst.pool, datCfm, sizeof(KwuDatCfmInfo)); @@ -858,8 +849,7 @@ Void rlcAmmDlHndlStatusPdu(RlcCb *gCb,RlcDlRbCb *rbCb,RlcUdxStaPdu *pStaPdu) { rlcStatusAckCnt++; /* For All ACKs */ - RLOG_ARG2(L_UNUSED,DBG_RBID, rbCb->rlcId.rbId, - "rlcHndlStaRsp: Received All ACKS UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_DL : rlcHndlStaRsp: Received All ACKS UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); @@ -874,8 +864,7 @@ Void rlcAmmDlHndlStatusPdu(RlcCb *gCb,RlcDlRbCb *rbCb,RlcUdxStaPdu *pStaPdu) { if(datCfm->numSduIds > 1024) { - RLOG_ARG4(L_DEBUG,DBG_RBID,datCfm->rlcId.rbId, - "Sending [%lu] SDU Cfms to PDCP & [%lu] lost for" + DU_LOG("\nDEBUG --> RLC_DL : Sending [%u] SDU Cfms to PDCP & [%u] lost for" "UEID:%d CELLID:%d", datCfm->numSduIds, datCfm->numSduIds-1024, @@ -989,7 +978,7 @@ void rlcAmmQSdu(RlcCb *gCb, RlcDlRbCb *rbCb, Buffer *mBuf, KwuDatReqInfo *datReq #if (ERRCLASS & ERRCLS_ADD_RES) if (sdu == NULLP) { - DU_LOG("\n RLC : rlcAmmQSdu : Memory allocation failed UEID:%d CELLID:%d",\ + DU_LOG("\nERROR --> RLC_DL : rlcAmmQSdu : Memory allocation failed UEID:%d CELLID:%d",\ rbCb->rlcId.ueId, rbCb->rlcId.cellId); return; } @@ -1020,7 +1009,7 @@ dlrate_kwu += sdu->sduSz; * queue */ if (RLC_AMDL.nxtTx == NULLP) { - DU_LOG("\nRLC : rlcAmmQSdu: Received SDU will be transmitted next \ + DU_LOG("\nDEBUG --> RLC_DL : rlcAmmQSdu: Received SDU will be transmitted next \ UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); RLC_AMDL.nxtTx = sdu; } @@ -1180,7 +1169,7 @@ void rlcAmmProcessSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq, bool f } else { - DU_LOG("\nRLC: rlcAmmProcessSdus: Miscomputation of control Bo. \ + DU_LOG("\nERROR --> RLC_DL : rlcAmmProcessSdus: Miscomputation of control Bo. \ UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); } RLC_AMDL.cntrlBo = 0; @@ -1390,7 +1379,7 @@ static void rlcResegRetxPdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) /* kw003.201 - Eliminate MAC Header Size based on bites needed */ tmpSz = RLC_MIN((retx->segSz + retx->hdrSz), rlcDatReq->pduSz); pduSz = (retx->segSz + retx->hdrSz); - /* 5GNR_RLC: length field in 5GNR MAC Hdr is 8/16 btis*/ + /* 5GNR_RLC_DL : length field in 5GNR MAC Hdr is 8/16 btis*/ rlcDatReq->pduSz -= (tmpSz < 255) ? RLC_MAC_HDR_SZ2 : RLC_MAC_HDR_SZ3; /* kw003.201 - We should have at least one more than basic header */ @@ -1405,7 +1394,7 @@ static void rlcResegRetxPdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) { uint8_t pollBit; - DU_LOG("\nRLC: rlcResegRetxPdus: Send retx buf without segmentation " + DU_LOG("\nINFO --> RLC_DL : rlcResegRetxPdus: Send retx buf without segmentation " "UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); if (retx->yetToConst) @@ -1446,7 +1435,7 @@ static void rlcResegRetxPdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) /* Segment this pdu / portion of pdu. Insert this segment into */ /* retxLst and update offset */ - DU_LOG("\nRLC: rlcResegRetxPdus: Segment retx buf UEID:%d CELLID:%d", + DU_LOG("\nINFO --> RLC_DL : rlcResegRetxPdus: Segment retx buf UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); /* Eliminate fixed header size if the pdu is segmented for the */ @@ -1483,7 +1472,7 @@ static void rlcResegRetxPdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) #if (ERRCLASS & ERRCLS_ADD_RES) if (tNode == NULLP) { - DU_LOG("\nRLC: rlcResegRetxPdus: Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : rlcResegRetxPdus: Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); return; } @@ -1543,10 +1532,10 @@ static void rlcResegRetxPdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) amDl->retxBo -= retx->segSz; } #ifndef ALIGN_64BIT - DU_LOG("\nRLC: rlcResegRetxPdus: retxBo after resegmentation = %ld" + DU_LOG("\nINFO --> RLC_DL : rlcResegRetxPdus: retxBo after resegmentation = %ld" "UEID:%d CELLID:%d", amDl->retxBo, rbCb->rlcId.ueId, rbCb->rlcId.cellId); #else - DU_LOG("\nRLC: rlcResegRetxPdus: retxBo after resegmentation = %d " + DU_LOG("\nINFO --> RLC_DL : rlcResegRetxPdus: retxBo after resegmentation = %d " "UEID:%d CELLID:%d", amDl->retxBo, rbCb->rlcId.ueId, rbCb->rlcId.cellId); #endif @@ -1631,7 +1620,7 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) #if (ERRCLASS & ERRCLS_ADD_RES) if (discSduInfo == NULLP) { - DU_LOG("\nRLC: rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); return; } @@ -1684,7 +1673,7 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) /* store the info for sending it to PDCP */ if(discSduInfo->numSduIds > 500) { - DU_LOG("\nRLC: rlcAssembleSdus: This is a big error, we shouldn't be here" + DU_LOG("\nERROR --> RLC_DL : rlcAssembleSdus: This is a big error, we shouldn't be here" "UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); break; } @@ -1722,7 +1711,7 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) if (RLC_AM_IS_TRANS_WIN_STALLED(amDl)) { //int *a = NULLP; - printf("\n Window stalled \n"); + DU_LOG("\nINFO --> RLC_DL : Window stalled \n"); gRlcStats.amRlcStats.numRlcAmCellWinStall++; //*a = 10; break; @@ -1763,7 +1752,7 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) { uint32_t avblMem = 0; SRegInfoShow(gCb->init.region, &avblMem); - DU_LOG("\nRLC: rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); return; } @@ -1782,7 +1771,7 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) { uint32_t avblMem = 0; SRegInfoShow(gCb->init.region, &avblMem); - DU_LOG("\nRLC: rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : rlcAssembleSdus: Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); return; } @@ -1808,7 +1797,7 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) /* Update Framing Info */ if (sdu->mode.am.isSegmented) { - /*5GNR RLC: SN should be same for all segment of a SDU*/ + /*5GNR RLC_DL : SN should be same for all segment of a SDU*/ pduInfo->amHdr.sn = sdu->mode.am.sn; pduInfo->amHdr.si = RLC_SI_LAST_SEG; /* binary 10 */ pduInfo->amHdr.so = sdu->actSz - sdu->sduSz; @@ -1816,7 +1805,8 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) gRlcStats.amRlcStats.numRlcAmCellSduTx++; - //printf("\n 5GNRLOG: last segment of lcId %d SduId %u So %u macGrntSz %u sduActSz %u sdu->sduSz %u\n", + //DU_LOG("\nINFO --> RLC_DL : 5GNRLOG: last segment of lcId %d SduId %u So %u macGrntSz\ + %u sduActSz %u sdu->sduSz %u\n", // rbCb->lch.lChId, sdu->mode.am.sduId, pduInfo->amHdr.so, macGrntSz, sdu->actSz, sdu->sduSz); } else @@ -1827,7 +1817,7 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) /* Create PDU with hdr and data */ rlcAmmCreatePdu(gCb,rbCb, amHdr, pduInfo, pdu); - //printf("\n Segmentation not required case: numPdu %d pdu %p \n",rlcDatReq->pduInfo.numPdu, pdu); + //DU_LOG("\nINFO --> Segmentation not required case: numPdu %d pdu %p \n",rlcDatReq->pduInfo.numPdu, pdu); #ifdef LTE_L2_MEAS_RLC rlcUtlUpdSduSnMap(rbCb, sdu, rlcDatReq, TRUE); @@ -1870,7 +1860,7 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) Buffer *remSeg = NULLP; - //printf("\n SDU segmentation case: numPdu %d pdu %p \n", rlcDatReq->pduInfo.numPdu, pdu); + //DU_LOG("\nINFO --> SDU segmentation case: numPdu %d pdu %p \n", rlcDatReq->pduInfo.numPdu, pdu); #ifdef LTE_L2_MEAS if(RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(gCb,rbCb) || RLC_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(gCb,rbCb) || @@ -1910,24 +1900,26 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) /* Update SI and SN */ if (sdu->mode.am.isSegmented) { - /*5GNR RLC: SN should be same for all segment of a SDU. + /*5GNR RLC_DL : SN should be same for all segment of a SDU. * Sdu was already segmented and segmenting again*/ pduInfo->amHdr.sn = sdu->mode.am.sn; pduInfo->amHdr.si = RLC_SI_MID_SEG; /* binary 11 */ pduInfo->amHdr.so = sdu->actSz - sdu->sduSz; - //printf("\n 5GNRLOG: mid segment of lcId %d SduId %u So %u macGrntSz %u sduActSz %u sdu->sduSz %u\n", + //DU_LOG("\nINFO --> RLC_DL : 5GNRLOG: mid segment of lcId %d SduId %u So %u macGrntSz %u sduActSz\ + %u sdu->sduSz %u\n", // rbCb->lch.lChId, sdu->mode.am.sduId, txBuf->amHdr.so, macGrntSz, sdu->actSz, sdu->sduSz); } else { - /*5GNR RLC: This means it is the first*/ + /*5GNR RLC_DL : This means it is the first*/ pduInfo->amHdr.si = RLC_SI_FIRST_SEG; /* binary 01 */ - /*5GNR_RLC: Store SN so that in sub-seqent SDU segments will use this SN*/ + /*5GNR_RLC_DL : Store SN so that in sub-seqent SDU segments will use this SN*/ sdu->mode.am.sn = pduInfo->amHdr.sn; pduInfo->amHdr.so = 0; - //printf("\n 5GNRLOG: First segment of lcId %d SduId %u So %u macGrntSz %u sduActSz %u sdu->sduSz %u\n", + //DU_LOG("\nINFO --> RLC_DL : 5GNRLOG: First segment of lcId %d SduId %u So\ + %u macGrntSz %u sduActSz %u sdu->sduSz %u\n", // rbCb->lch.lChId, sdu->mode.am.sduId, txBuf->amHdr.so, macGrntSz, sdu->actSz, sdu->sduSz); } @@ -2032,7 +2024,7 @@ static void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) RLC_SHRABL_STATIC_BUF_FREE(rlckwuSap->pst.region, rlckwuSap->pst.pool, discSduInfo, sizeof(KwuDiscSduInfo)); } - DU_LOG("\nRLC: rlcAssembleSdus: BO after assembly = %d UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_DL : rlcAssembleSdus: BO after assembly = %d UEID:%d CELLID:%d", amDl->bo, rbCb->rlcId.ueId, rbCb->rlcId.cellId); return; } @@ -2094,7 +2086,7 @@ static bool rlcAmmDlCheckAndSetPoll(RlcCb *gCb, RlcDlRbCb *rbCb, bool newPdu, Ms amDl->pollSn = (amDl->txNext - 1) & amDl->snModMask; - DU_LOG("\nRLC: rlcAmmDlCheckAndSetPoll: Poll SN = %d UEID:%d CELLID:%d", + DU_LOG("\nINFO --> RLC_DL : rlcAmmDlCheckAndSetPoll: Poll SN = %d UEID:%d CELLID:%d", amDl->pollSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); /* kw005.201: Fix for poll retransmission timer. @@ -2141,10 +2133,10 @@ RlcDlPduInfo *pduInfo, Buffer *pdu) /* Update sn */ amHdr->sn = amDl->txNext; - /*5GNR RLC: Increment txNext only if no segmentation of it is a last segment */ + /*5GNR RLC_DL : Increment txNext only if no segmentation of it is a last segment */ if((!amHdr->si) || (amHdr->si == RLC_SI_LAST_SEG)) { - //printf("\n 5GNRLOG: no segment/last seg SDU with lcId %d Sn %u txNext %u So %u\n", + //DU_LOG("\nINFO --> RLC_DL : 5GNRLOG: no segment/last seg SDU with lcId %d Sn %u txNext %u So %u\n", // rbCb->lch.lChId, amHdr->sn, amDl->txNext, amHdr->so); amDl->txNext = (amDl->txNext + 1) & amDl->snModMask; } @@ -2339,8 +2331,7 @@ KwuDatCfmInfo **datCfm #if (ERRCLASS & ERRCLS_ADD_RES) if (*datCfm == NULLP) { - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); return; @@ -2446,8 +2437,7 @@ RlcRetx *retx #if (ERRCLASS & ERRCLS_ADD_RES) if (staInd == NULLP) { - RLOG_ARG2(L_FATAL,DBG_RBID,rbCb->rlcId.rbId, - "Memory allocation failed UEID:%d CELLID:%d", + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed UEID:%d CELLID:%d", rbCb->rlcId.ueId, rbCb->rlcId.cellId); return; @@ -2558,8 +2548,7 @@ RlcDlRbCb *rbCb if (ROK != rlcDbmFetchDlUeCb(gCb,rlcId.ueId, rlcId.cellId, &ueCb)) { - RLOG_ARG2(L_ERROR,DBG_CELLID, rlcId.cellId, - "UeId [%d]: UeCb not found RBID;%d", + DU_LOG("\nERROR --> RLC_DL : UeId [%d]: UeCb not found RBID;%d", rlcId.ueId, rlcId.rbId); return; @@ -2760,9 +2749,9 @@ KwuDatCfmInfo **datCfm txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, sn); if (txBuf != NULLP) { - RLOG_ARG3(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, - "rlcAmmDlUpdateTxAndReTxBufForAckSn: ACK for PDU " - "with sn = %ld UEID:%ld CELLID:%ld", + + DU_LOG("\nDEBUG --> RLC_DL : rlcAmmDlUpdateTxAndReTxBufForAckSn: ACK for PDU " + "with sn = %d UEID:%d CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); @@ -2832,8 +2821,7 @@ KwuDatCfmInfo **datCfm txBuf = rlcUtlGetTxBuf(RLC_AMDL.txBufLst, sn); if ((txBuf != NULLP)) { - RLOG_ARG3(L_DEBUG,DBG_RBID, rbCb->rlcId.rbId, - "rlcHndlStaRsp: Handle ACK (sn = %d) UEID:%d CELLID:%d", + DU_LOG("\nDEBUG --> RLC_DL : rlcHndlStaRsp: Handle ACK (sn = %d) UEID:%d CELLID:%d", sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); @@ -2994,7 +2982,7 @@ RlcSn sn #if (ERRCLASS & ERRCLS_ADD_RES) if (*retx == NULLP) { - RLOG0(L_FATAL, "Memory allocation failed"); + DU_LOG("\nERROR --> RLC_DL : Memory allocation failed"); return; } #endif /* ERRCLASS & ERRCLS_RES */ @@ -3197,7 +3185,7 @@ static void rlcAmmCreateStatusPdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDat /* set ACK SN */ { - DU_LOG("\nRLC: rlcAssembleCntrlInfo: ACK PDU's SN = %d"\ + DU_LOG("\nINFO --> RLC_DL : rlcAssembleCntrlInfo: ACK PDU's SN = %d"\ "UEID:%d CELLID:%d", ack_sn, rbCb->rlcId.ueId, rbCb->rlcId.cellId); cntrlPdu[0] |= (ack_sn & 0xF00)>> 8; @@ -3315,7 +3303,7 @@ static void rlcAmmCreateStatusPdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDat /* set ACK SN */ { - DU_LOG("\nRLC: rlcAssembleCntrlInfo: ACK PDU's SN = %d" + DU_LOG("\nINFO --> RLC_DL : rlcAssembleCntrlInfo: ACK PDU's SN = %d" "UEID:%d CELLID:%d", ack_sn, rbCb->rlcId.ueId,rbCb->rlcId.cellId); cntrlPdu[0] |= (ack_sn & 0x3C000) >> 14; @@ -3327,7 +3315,7 @@ static void rlcAmmCreateStatusPdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDat else { /* ERROR Log */ - DU_LOG("\nRLC: rlcAssembleCntrlInfo:Conf SN LEN %d is INVALID !!!! \ + DU_LOG("\nERROR --> RLC_DL : rlcAssembleCntrlInfo:Conf SN LEN %d is INVALID !!!! \ UEID:%d CELLID:%d", rbCb->m.amDl.snLen, rbCb->rlcId.ueId, rbCb->rlcId.cellId); } @@ -3611,7 +3599,7 @@ S16 rlcProcDlStatusPdu(Pst *udxPst,SuId suId, if( ROK != rlcDbmFetchDlUeCb(gCb,rnti,cellId,&(ueCb))) { - printf("\n RLC UECb Not found...\n"); + DU_LOG("\nERROR --> RLC_DL : RLC UECb Not found...\n"); return RFAILED; } @@ -3627,7 +3615,7 @@ S16 rlcProcDlStatusPdu(Pst *udxPst,SuId suId, if(ROK != SExamMsg((Data *)(&fByte), rlcSdu, 0)) { - printf("\n Failure in Rlc Hdr SExamMsg\n"); + DU_LOG("\nERROR --> RLC_DL : Failure in Rlc Hdr SExamMsg\n"); return RFAILED; } diff --git a/src/5gnrrlc/kw_ul_ex_ms.c b/src/5gnrrlc/kw_ul_ex_ms.c index 654a92bce..003ff9805 100755 --- a/src/5gnrrlc/kw_ul_ex_ms.c +++ b/src/5gnrrlc/kw_ul_ex_ms.c @@ -28,9 +28,6 @@ File: kw_ul_ex_ms.c *********************************************************************21*/ -static const char* RLOG_MODULE_NAME="RLC_UL"; -static int RLOG_MODULE_ID=2048; -static int RLOG_FILE_ID=206; /** @file kw_ul_ex_ms.c @brief RLC System Services Interface @@ -264,7 +261,7 @@ Buffer *mBuf /* message buffer */ ODU_PUT_MSG_BUF(mBuf); if (pst->dstInst < MAX_RLC_INSTANCES) { - RLOG1(L_FATAL,"Received Invalid Event[%d] from SM", + DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from SM", pst->event); } ret = RFAILED; @@ -309,7 +306,7 @@ Buffer *mBuf /* message buffer */ ODU_PUT_MSG_BUF(mBuf); if (pst->dstInst < MAX_RLC_INSTANCES) { - RLOG1(L_ERROR,"Received Invalid Event[%d] from RLC UL", + DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from RLC UL", pst->event); } ret = RFAILED; @@ -361,7 +358,7 @@ Buffer *mBuf /* message buffer */ ODU_PUT_MSG_BUF(mBuf); if (pst->dstInst < MAX_RLC_INSTANCES) { - RLOG1(L_ERROR,"Received Invalid Event[%d] from RRC", + DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from RRC", pst->event); } ret = RFAILED; @@ -392,7 +389,7 @@ Buffer *mBuf /* message buffer */ ODU_PUT_MSG_BUF(mBuf); if (pst->dstInst < MAX_RLC_INSTANCES) { - RLOG1(L_ERROR,"Received Invalid Event[%d] from PDCP", + DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from PDCP", pst->event); } ret = RFAILED; @@ -425,7 +422,7 @@ Buffer *mBuf /* message buffer */ ODU_PUT_MSG_BUF(mBuf); if (pst->dstInst < MAX_RLC_INSTANCES) { - RLOG1(L_ERROR,"Received Invalid Event[%d] from MAC", + DU_LOG("\nERROR --> RLC_UL : Received Invalid Event[%d] from MAC", pst->event); } ret = RFAILED; @@ -466,7 +463,7 @@ Buffer *mBuf /* message buffer */ } default: { - printf("\n ERROR Invalid Event[%d] from CL to PDCPUL\n", + DU_LOG("\nERROR --> RLC_UL : Invalid Event[%d] from CL to PDCPUL\n", pst->event); ODU_PUT_MSG_BUF(mBuf); break; @@ -480,7 +477,7 @@ Buffer *mBuf /* message buffer */ { if (pst->dstInst < MAX_RLC_INSTANCES) { - RLOG1(L_ERROR, "Received Invalid Source Entity[%d]",pst->event); + DU_LOG("\nERROR --> RLC_UL : Received Invalid Source Entity[%d]",pst->event); } ODU_PUT_MSG_BUF(mBuf); ret = RFAILED; diff --git a/src/5gnrrlc/kw_utl_dl.c b/src/5gnrrlc/kw_utl_dl.c index 1146d201a..7db5db729 100755 --- a/src/5gnrrlc/kw_utl_dl.c +++ b/src/5gnrrlc/kw_utl_dl.c @@ -35,9 +35,6 @@ File: kw_utl_dl.c **********************************************************************/ -static const char* RLOG_MODULE_NAME="UTL"; -static int RLOG_MODULE_ID=2048; -static int RLOG_FILE_ID=209; /** @file kw_utl_dl.c @brief RLC Utility Module @@ -104,24 +101,24 @@ Void PrintRLCStats(Void) RlcCb* dlInst = rlcCb[1]; RlcCb* ulInst = rlcCb[0]; - RLOG4(L_ALWAYS,"RLC Stats: PDUs Sent = (%ld), PdusRext = (%ld), TimeOut = (%ld), SduDiscarded = (%ld)", + DU_LOG("\nINFO --> RLC_DL : RLC Stats: PDUs Sent = (%ld), PdusRext = (%ld), TimeOut = (%ld), SduDiscarded = (%ld)", dlInst->genSts.pdusSent, dlInst->genSts.pdusRetx, dlInst->genSts.protTimeOut, dlInst->genSts.numSduDisc); - RLOG3(L_ALWAYS,"RLC Stats: PDUs Rcvd = (%ld), unexpPdus = (%ld), errorPdus = (%ld)", + DU_LOG("\nINFO --> RLC_DL : RLC Stats: PDUs Rcvd = (%ld), unexpPdus = (%ld), errorPdus = (%ld)", ulInst->genSts.pdusRecv, ulInst->genSts.unexpPdusRecv, ulInst->genSts.errorPdusRecv); - RLOG4(L_ALWAYS,"RLC Stats: RLC_AMDL: " + DU_LOG("\nINFO --> RLC_DL : RLC Stats: 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: RLC_AMDL: " + DU_LOG("\nINFO --> RLC_DL : RLC Stats: AMDL: " "DRB:%lu MaxRetx:%lu RetransPdus:%lu", gRlcStats.amRlcStats.numDLPollTimerExpiresDrb, gRlcStats.amRlcStats.numDLMaxRetx, gRlcStats.amRlcStats.numDLRetransPdus); - RLOG4(L_ALWAYS,"RLC Stats: RLC_AMUL: " + DU_LOG("\nINFO --> RLC_DL : RLC Stats: AMUL: " " PdusDiscarded:%lu ReOrdTimerExpires:%lu StaPduRcvd:%lu NackInStaPduRcvd:%lu ", gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReOrdTimerExpires, gRlcStats.amRlcStats.numULStaPduRcvd, gRlcStats.amRlcStats.numULNackInStaPduRcvd); @@ -149,26 +146,26 @@ Void PrintRLCStats(Void) RlcCb* dlInst = rlcCb[1]; RlcCb* ulInst = rlcCb[0]; - printf ("\n================================ RLC STATS ===========================\n"); - RLOG4(L_ALWAYS,"RLC Stats: PDUs Sent = (%ld), PdusRext = (%ld), TimeOut = (%ld), SduDiscarded = (%ld)", + DU_LOG ("\n ================================ RLC STATS ===========================\n"); + DU_LOG("\nINFO --> RLC_DL : RLC Stats: PDUs Sent = (%d), PdusRext = (%d), TimeOut = (%d), SduDiscarded = (%d)", dlInst->genSts.pdusSent, dlInst->genSts.pdusRetx, dlInst->genSts.protTimeOut, dlInst->genSts.numSduDisc); - RLOG3(L_ALWAYS,"RLC Stats: PDUs Rcvd = (%ld), unexpPdus = (%ld), errorPdus = (%ld)", + DU_LOG("\nINFO --> RLC_DL : RLC Stats: PDUs Rcvd = (%d), unexpPdus = (%d), errorPdus = (%d)", ulInst->genSts.pdusRecv, ulInst->genSts.unexpPdusRecv, ulInst->genSts.errorPdusRecv); - RLOG4(L_ALWAYS,"RLC Stats: RLC_AMDL: " - "StaPduSent:%lu NacksInStaPdu:%lu BytesUnused:%lu PollTimerExpires SRB:%lu ", + DU_LOG("\nINFO --> RLC_DL : RLC Stats: AMDL: " + "StaPduSent:%u NacksInStaPdu:%u BytesUnused:%u PollTimerExpires SRB:%u ", gRlcStats.amRlcStats.numDLStaPduSent, gRlcStats.amRlcStats.numDLNacksInStaPdu, gRlcStats.amRlcStats.numDLBytesUnused, gRlcStats.amRlcStats.numDLPollTimerExpiresSrb); - RLOG3(L_ALWAYS,"RLC Stats: RLC_AMDL: " - "DRB:%lu MaxRetx:%lu RetransPdus:%lu", + DU_LOG("\nINFO --> RLC_DL : RLC Stats: AMDL: " + "DRB:%u MaxRetx:%u RetransPdus:%u", gRlcStats.amRlcStats.numDLPollTimerExpiresDrb, gRlcStats.amRlcStats.numDLMaxRetx, gRlcStats.amRlcStats.numDLRetransPdus); - RLOG4(L_ALWAYS,"RLC Stats: RLC_AMUL: " - " PdusDiscarded:%lu ReOrdTimerExpires:%lu StaPduRcvd:%lu NackInStaPduRcvd:%lu ", + DU_LOG("\nINFO --> RLC_DL : RLC Stats: AMUL: " + " PdusDiscarded:%u ReOrdTimerExpires:%u StaPduRcvd:%u NackInStaPduRcvd:%u ", gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReOrdTimerExpires, gRlcStats.amRlcStats.numULStaPduRcvd, gRlcStats.amRlcStats.numULNackInStaPduRcvd); /* RTLIN_DUMP_DEBUG("AM RLC Stats:" @@ -243,7 +240,7 @@ uint8_t rlcSendDedLcDlData(Pst *post, SpId spId, RguDDatReqInfo *datReqInfo) dlData, sizeof(RlcData)); if ( dlData == NULLP ) { - DU_LOG("\nRLC: rlcSendDedLcDlData: Memory allocation failed for dl data"); + DU_LOG("\nERROR --> RLC_DL : rlcSendDedLcDlData: Memory allocation failed for dl data"); RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RguDDatReqInfo)); return RFAILED; @@ -281,7 +278,7 @@ uint8_t rlcSendDedLcDlData(Pst *post, SpId spId, RguDDatReqInfo *datReqInfo) if (dlData->pduInfo[dlData->numPdu].pduBuf == NULLP ) { - DU_LOG("\nRLC: rlcSendDedLcDlData: Memory allocation failed"); + DU_LOG("\nERROR --> RLC_DL : rlcSendDedLcDlData: Memory allocation failed"); for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++) { RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlData->pduInfo[pduIdx].pduBuf,\ @@ -310,7 +307,7 @@ uint8_t rlcSendDedLcDlData(Pst *post, SpId spId, RguDDatReqInfo *datReqInfo) dlRrcMsgRsp, sizeof(RlcDlRrcMsgRsp)); if( dlRrcMsgRsp == NULLP ) { - DU_LOG("\nRLC: rlcSendDedLcDlData: Memory allocation failed for dlRrcMsgRsp"); + DU_LOG("\nERROR --> RLC_DL : rlcSendDedLcDlData: Memory allocation failed for dlRrcMsgRsp"); for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++) { RLC_FREE_SHRABL_BUF(pst.region, pst.pool, dlData->pduInfo[pduIdx].pduBuf,\ @@ -410,7 +407,7 @@ uint8_t rlcUtlSendToMac(RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo) #if (ERRCLASS & ERRCLS_ADD_RES) if ( datReqInfo == NULLP ) { - DU_LOG("\nRLC: rlcUtlSendToMac: Memory allocation failed"); + DU_LOG("\nERROR --> RLC_DL : rlcUtlSendToMac: Memory allocation failed"); return RFAILED; } #endif /* ERRCLASS & ERRCLS_ADD_RES */ @@ -422,7 +419,7 @@ uint8_t rlcUtlSendToMac(RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo) if(ROK != rlcDbmFetchDlUeCb(gCb, ueIdx, staIndInfo->cellId,&ueCb)) { /* Fetch UeCb failed */ - DU_LOG("\nRLC: rlcUtlSendToMac: UeId[%u]:ueCb not found", + DU_LOG("\nERROR --> RLC_DL : rlcUtlSendToMac: UeId[%u]:ueCb not found", staInd->rnti); /* If ueCb is not found for current rnti then continue to look for next rnti*/ continue; @@ -1686,9 +1683,9 @@ S16 rlcUtlSndDlL2MeasCfm(RlcCb *gCb,RlcL2MeasEvtCb *measEvtCb) /* kw006.201 ccpu00120058 emoved 64 bit compilation warning */ #ifndef ALIGN_64BIT - RLOG1(L_DEBUG,"rlcUtlSndL2MeasCfm(transId(%ld))", measEvtCb->transId); + DU_LOG("\nDEBUG --> RLC_DL : rlcUtlSndL2MeasCfm(transId(%ld))", measEvtCb->transId); #else - RLOG1(L_DEBUG,"rlcUtlSndL2MeasCfm(transId(%d))", measEvtCb->transId); + DU_LOG("\nDEBUG --> RLC_DL : rlcUtlSndL2MeasCfm(transId(%d))", measEvtCb->transId); #endif /* Clean up the RB data structures */ @@ -1904,8 +1901,7 @@ static Void dumpRLCDlRbInformation(RlcDlRbCb* dlRbCb) { if(dlRbCb->mode == RLC_MODE_UM) { - RLOG_ARG3(L_DEBUG,DBG_RBID,dlRbCb->rlcId.rbId, - "UM Downlink UEID:%d CELLID:%d Q size = %d", + DU_LOG("\nDEBUG --> RLC_DL : UM Downlink UEID:%d CELLID:%d Q size = %d", dlRbCb->rlcId.ueId, dlRbCb->rlcId.cellId, (int)dlRbCb->m.umDl.sduQ.count); @@ -1921,14 +1917,12 @@ static Void dumpRLCDlRbInformation(RlcDlRbCb* dlRbCb) numTxPdus++; } } - RLOG_ARG4(L_DEBUG,DBG_RBID,dlRbCb->rlcId.rbId, - "AM Downlink UEID:%d CELLID:%d Sizes SDU Q = %d TX Q = %d ", + DU_LOG("\nDEBUG --> RLC_DL : AM Downlink UEID:%d CELLID:%d Sizes SDU Q = %d TX Q = %d ", dlRbCb->rlcId.ueId, dlRbCb->rlcId.cellId, (int)dlRbCb->m.amDl.sduQ.count, (int)numTxPdus); - RLOG_ARG3(L_DEBUG,DBG_RBID,dlRbCb->rlcId.rbId, - "AM Downlink UEID:%d CELLID:%d RETX Q= %d", + DU_LOG("\nDEBUG --> RLC_DL : AM Downlink UEID:%d CELLID:%d RETX Q= %d", dlRbCb->rlcId.ueId, dlRbCb->rlcId.cellId, (int)dlRbCb->m.amDl.retxLst.count); @@ -2156,7 +2150,7 @@ Void rlcUtlDelTxBuf (CmLListCp *txBufLst,RlcTx *txBuf,RlcCb *gCb) hashKey = (txBuf->sn % RLC_TX_BUF_BIN_SIZE ); txBufLstCp = &txBufLst[hashKey]; - //printf("D-sn(%d)\n", txBuf->hdr.sn); + //DU_LOG("\nINFO --> RLC_DL : D-sn(%d)\n", txBuf->hdr.sn); cmLListDelFrm(txBufLstCp, &txBuf->lnk); RLC_FREE(gCb, txBuf, sizeof(RlcTx)); return; @@ -2184,7 +2178,7 @@ Void rlcUtlRemovTxBuf(CmLListCp *txBufLst,RlcTx *txBuf,RlcCb *gCb) hashKey = (txBuf->sn % RLC_TX_BUF_BIN_SIZE ); txBufLstCp = &txBufLst[hashKey]; - //printf("D-sn(%d)\n", txBuf->hdr.sn); + //DU_LOG("\nINFO --> RLC_DL : D-sn(%d)\n", txBuf->hdr.sn); cmLListDelFrm(txBufLstCp, &txBuf->lnk); return; } /* rlcUtlRemovTxBuf */ diff --git a/src/5gnrrlc/kw_utl_ul.c b/src/5gnrrlc/kw_utl_ul.c index d27d1daed..6e86951b2 100755 --- a/src/5gnrrlc/kw_utl_ul.c +++ b/src/5gnrrlc/kw_utl_ul.c @@ -107,7 +107,7 @@ uint8_t rlcUtlRcvFrmMac(RlcCb *gCb, KwDatIndInfo *datIndInfo) if( ROK != rlcDbmFetchUlUeCb(gCb,datIndInfo->rnti,datIndInfo->cellId,&(ueCb))) { /* Fetch UeCb failed */ - DU_LOG("\nRLC : rlcUtlRcvFrmMac : UEID:%d UeCb not found", + DU_LOG("\nERROR --> RLC_UL : rlcUtlRcvFrmMac : UEID:%d UeCb not found", datIndInfo->rnti); /* free the buffers inside the datIndInfo */ uint32_t i,j; @@ -432,13 +432,13 @@ Void rlcUtlCalUlIpThrPutIncTTI(RlcCb *gCb,RlcUlRbCb *rbCb,uint32_t ttiCnt) /*starting Task*/ SStartTask(&startTime, PID_RLC_IP_TPT_INCTTI); #ifndef ALIGN_64BIT - RLOG_ARG4(L_UNUSED, DBG_RBID,rbCb->rlcId.rbId,"Log for ul ip throughput:" + DU_LOG("\nDEBUG --> RLC_UL : Log for ul ip throughput:" "RB_MeasOn:%d ttiCnt :%ld UEID:%d CELLID:%d", rbCb->rbL2Cb.measOn,ttiCnt, rbCb->rlcId.ueId, rbCb->rlcId.cellId); #else - RLOG_ARG4(L_UNUSED,DBG_RBID,rbCb->rlcId.rbId, "Log for ul ip throughput:" + DU_LOG("\nDEBUG --> RLC_UL : Log for ul ip throughput:" "RB_MeasOn:%d ttiCnt :%d UEID:%d CELLID:%d", rbCb->rbL2Cb.measOn,ttiCnt, rbCb->rlcId.ueId, @@ -598,9 +598,9 @@ S16 rlcUtlSndUlL2MeasCfm(RlcCb *gCb,RlcL2MeasEvtCb *measEvtCb) /* kw006.201 ccpu00120058 emoved 64 bit compilation warning */ #ifndef ALIGN_64BIT - RLOG1(L_DEBUG,"rlcUtlSndUlL2MeasCfm(transId(%ld))", measEvtCb->transId); + DU_LOG("\nDEBUG --> RLC_UL : rlcUtlSndUlL2MeasCfm(transId(%ld))", measEvtCb->transId); #else - RLOG1(L_DEBUG,"rlcUtlSndUlL2MeasCfm(transId(%d))", measEvtCb->transId); + DU_LOG("\nDEBUG --> RLC_UL : rlcUtlSndUlL2MeasCfm(transId(%d))", measEvtCb->transId); #endif /* Clean up the RB data structures */ diff --git a/src/5gnrrlc/rlc_mgr.c b/src/5gnrrlc/rlc_mgr.c index ffde7c4ea..76d85f37a 100644 --- a/src/5gnrrlc/rlc_mgr.c +++ b/src/5gnrrlc/rlc_mgr.c @@ -71,7 +71,7 @@ uint8_t SendRlcUeRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp) RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp)); if(!ueRsp) { - DU_LOG("RLC: Memory allocation failed for ueRsp at SendRlcUeCreateRspToDu()"); + DU_LOG("\nERROR --> RLC: Memory allocation failed for ueRsp at SendRlcUeCreateRspToDu()"); ret = RFAILED; } else @@ -83,13 +83,13 @@ uint8_t SendRlcUeRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp) ret = (*rlcUeCfgRspOpts[pst->selector])(pst, ueRsp); if(ret) { - DU_LOG("RLC: Failed at SendRlcUeRspToDu()"); + DU_LOG("\nERROR --> RLC: Failed at SendRlcUeRspToDu()"); RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp)); } } else { - DU_LOG("RLC: Failed at fillRlcUeCfgRsp() for event %d", pst->event); + DU_LOG("\nERROR --> RLC: Failed at fillRlcUeCfgRsp() for event %d", pst->event); RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp)); } } diff --git a/src/5gnrrlc/rlc_msg_hdl.c b/src/5gnrrlc/rlc_msg_hdl.c index 28a4f62c5..1b06379aa 100644 --- a/src/5gnrrlc/rlc_msg_hdl.c +++ b/src/5gnrrlc/rlc_msg_hdl.c @@ -125,7 +125,7 @@ void fillEntModeAndDir(uint8_t *entMode, uint8_t *direction, RlcMode rlcMode) *direction = RLC_CFG_DIR_DL; break; default : - DU_LOG("\nRLC: Rlc Mode invalid %d", rlcMode); + DU_LOG("\nERROR --> RLC: Rlc Mode invalid %d", rlcMode); break; } } @@ -254,7 +254,7 @@ uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) RLC_ALLOC(rlcUeCb, rlcUeCfg, sizeof(RlcCfgInfo)); if(rlcUeCfg == NULLP) { - DU_LOG("\nRLC: Failed to allocate memory at RlcProcUeCreateReq()"); + DU_LOG("\nERROR --> RLC: Failed to allocate memory at RlcProcUeCreateReq()"); ret = RFAILED; } else @@ -263,7 +263,7 @@ uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) fillRlcCfg(rlcUeCfg, ueCfg); ret = RlcProcCfgReq(pst, rlcUeCfg); if(ret != ROK) - DU_LOG("\nRLC: Failed to configure Add/Mod/Del entities at RlcProcUeCreateReq()"); + DU_LOG("\nERROR --> RLC: Failed to configure Add/Mod/Del entities at RlcProcUeCreateReq()"); } RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(RlcUeCfg)); @@ -289,7 +289,7 @@ uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo ) Pst pst; RrcDeliveryReport *rrcDelivery; - DU_LOG("\nRLC : Filling the RRC Delivery Report"); + DU_LOG("\nINFO --> RLC : Filling RRC Delivery Report"); RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, rrcDelivery, sizeof(RrcDeliveryReport)); if(rrcDelivery) @@ -307,7 +307,7 @@ uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo ) } else { - DU_LOG("\nRLC : Memory allocation failed"); + DU_LOG("\nERROR --> RLC : Memory allocation failed"); } return ROK; @@ -336,7 +336,7 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo) RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo)); if(!datReqInfo) { - DU_LOG("\nRLC : Memory allocation failed in RlcProcDlRrcMsgTransfer"); + DU_LOG("\nERROR --> RLC : Memory allocation failed in RlcProcDlRrcMsgTransfer"); RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen); RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo)); return RFAILED; @@ -352,7 +352,7 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo) /* Copy fixed buffer to message */ if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, &mBuf) != ROK) { - DU_LOG("\nRLC : Memory allocation failed at RlcMacProcUlData"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at RlcMacProcUlData"); RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo)); RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen); RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo)); @@ -408,7 +408,7 @@ uint8_t RlcProcUlData(Pst *pst, RlcData *ulData) RguCDatIndInfo *cLchUlDat; /* UL data on common logical channel */ /* Initializing dedicated logical channel Database */ - DU_LOG("\nRLC: Received UL Data request from MAC"); + DU_LOG("\nDEBUG --> RLC: Received UL Data request from MAC"); for(idx = 0; idx < MAX_NUM_LC; idx++) { dLchData[idx].lcId = idx; @@ -426,7 +426,7 @@ uint8_t RlcProcUlData(Pst *pst, RlcData *ulData) sizeof(RguCDatIndInfo)); if(!cLchUlDat) { - DU_LOG("\nRLC : Memory allocation failed at RlcProcUlData"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at RlcProcUlData"); ret = RFAILED; break; } @@ -439,7 +439,7 @@ uint8_t RlcProcUlData(Pst *pst, RlcData *ulData) /* Copy fixed buffer to message */ if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, &cLchUlDat->pdu) != ROK) { - DU_LOG("\nRLC : Memory allocation failed at RlcProcUlData"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at RlcProcUlData"); RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, cLchUlDat, \ sizeof(RguCDatIndInfo)); ret = RFAILED; @@ -458,7 +458,7 @@ uint8_t RlcProcUlData(Pst *pst, RlcData *ulData) sizeof(RguDDatIndInfo)); if(!dLchUlDat) { - DU_LOG("\nRLC : Memory allocation failed at RlcMacProcUlData"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at RlcMacProcUlData"); ret = RFAILED; break; } @@ -470,7 +470,7 @@ uint8_t RlcProcUlData(Pst *pst, RlcData *ulData) if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, \ &dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu]) != ROK) { - DU_LOG("\nRLC : Memory allocation failed at RlcMacProcUlData"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at RlcMacProcUlData"); for(pduIdx=0; pduIdx < dLchData[lcId].pdu.numPdu; pduIdx++) { ODU_PUT_MSG_BUF(dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu]); @@ -546,7 +546,7 @@ uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRep) RguCStaIndInfo *cLchSchInfo; /* Common logical channel scheduling result */ RguDStaIndInfo *dLchSchInfo; /* Dedicated logical channel scheduling result */ - DU_LOG("\nRLC : Received scheduling report from MAC"); + DU_LOG("\nDEBUG --> RLC : Received scheduling report from MAC"); for(idx=0; idx < schRep->numLc; idx++) { /* If it is common channel, fill status indication information @@ -557,7 +557,7 @@ uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRep) sizeof(RguCStaIndInfo)); if(!cLchSchInfo) { - DU_LOG("\nRLC: RlcProcSchedResultRpt: Memory allocation failed for cLchSchInfo"); + DU_LOG("\nERROR --> RLC: RlcProcSchedResultRpt: Memory allocation failed for cLchSchInfo"); ret = RFAILED; break; } @@ -581,7 +581,7 @@ uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRep) sizeof(RguDStaIndInfo)); if(!dLchSchInfo) { - DU_LOG("\nRLC: RlcProcSchedResultRpt: Memory allocation failed for dLchSchInfo"); + DU_LOG("\nERROR --> RLC: RlcProcSchedResultRpt: Memory allocation failed for dLchSchInfo"); ret = RFAILED; break; } @@ -647,13 +647,13 @@ uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg) RlcCfgInfo *rlcUeCfg = NULLP; //Seed code Rlc cfg struct RlcCb *rlcUeCb = NULLP; - DU_LOG("\nRLC: UE reconfig request received. CellID[%d] UEIDX[%d]",ueCfg->cellId, ueCfg->ueIdx); + DU_LOG("\nDEBUG --> RLC: UE reconfig request received. CellID[%d] UEIDX[%d]",ueCfg->cellId, ueCfg->ueIdx); rlcUeCb = RLC_GET_RLCCB(pst->dstInst); RLC_ALLOC(rlcUeCb, rlcUeCfg, sizeof(RlcCfgInfo)); if(rlcUeCfg == NULLP) { - DU_LOG("\nRLC: Failed to allocate memory at RlcProcUeReconfigReq()"); + DU_LOG("\nERROR --> RLC: Failed to allocate memory at RlcProcUeReconfigReq()"); ret = RFAILED; } else @@ -662,7 +662,7 @@ uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg) fillRlcCfg(rlcUeCfg, ueCfg); ret = RlcProcCfgReq(pst, rlcUeCfg); if(ret != ROK) - DU_LOG("\nRLC: Failed to configure Add/Mod/Del entities at RlcProcUeReconfigReq()"); + DU_LOG("\nERROR --> RLC: Failed to configure Add/Mod/Del entities at RlcProcUeReconfigReq()"); } RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(RlcUeCfg));