X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Frg_com.c;h=ed4e14d5a25fb8a4e2bbfac9b798004905eece42;hb=de6a435729e3cad9d4a66329080b8206a64f452c;hp=6b55a6ad0682c87b62a27ae5ea7a35b522eb2e68;hpb=0a26c487f1b6bbb5217e47b15fa8273b2e749283;p=o-du%2Fl2.git diff --git a/src/5gnrmac/rg_com.c b/src/5gnrmac/rg_com.c index 6b55a6ad0..ed4e14d5a 100755 --- a/src/5gnrmac/rg_com.c +++ b/src/5gnrmac/rg_com.c @@ -33,9 +33,6 @@ invoked by RRC towards MAC. */ -static const char* RLOG_MODULE_NAME="MAC"; -static int RLOG_FILE_ID=181; -static int RLOG_MODULE_ID=4096; /* header include files -- defines (.h) */ #include "common_def.h" @@ -61,11 +58,11 @@ static int RLOG_MODULE_ID=4096; #include "rg_pom_scell.x" #endif /* local defines */ -PRIVATE S16 rgCOMHndlCfgReq ARGS((Inst inst,CrgCfg *cfg, RgErrInfo *errInfo,Bool *isCfmRqrd,CrgCfgTransId transId)); -PRIVATE S16 rgCOMHndlRecfgReq ARGS((Inst inst,CrgRecfg *recfg, RgErrInfo *errInfo, \ +static S16 rgCOMHndlCfgReq ARGS((Inst inst,CrgCfg *cfg, RgErrInfo *errInfo,Bool *isCfmRqrd,CrgCfgTransId transId)); +static S16 rgCOMHndlRecfgReq ARGS((Inst inst,CrgRecfg *recfg, RgErrInfo *errInfo, \ CrgCfgTransId transId,Bool *isCfmRqrd)); -PRIVATE S16 rgCOMHndlDelReq ARGS((Inst inst,CrgDel *del, RgErrInfo *errInfo, Bool *isCfmRqrd, CrgCfgTransId transId)); -PRIVATE S16 rgCOMHndlResetReq ARGS((Inst inst,CrgRst *reset,RgErrInfo *errInfo)); +static S16 rgCOMHndlDelReq ARGS((Inst inst,CrgDel *del, RgErrInfo *errInfo, Bool *isCfmRqrd, CrgCfgTransId transId)); +static S16 rgCOMHndlResetReq ARGS((Inst inst,CrgRst *reset,RgErrInfo *errInfo)); /* local typedefs */ /* local externs */ @@ -97,27 +94,18 @@ PRIVATE S16 rgCOMHndlResetReq ARGS((Inst inst,CrgRst *reset,RgErrInfo *errInfo)) * -# ROK * -# RFAILED **/ -#ifdef ANSI S16 rgCOMCfgReq ( Inst inst, CrgCfgTransId transId, CrgCfgReqInfo *crgCfgReq ) -#else -S16 rgCOMCfgReq(inst,transId, crgCfgReq) -Inst inst; -CrgCfgTransId transId; -CrgCfgReqInfo *crgCfgReq; -#endif { S16 ret; - U8 cfmStatus = CRG_CFG_CFM_OK; + uint8_t cfmStatus = CRG_CFG_CFM_OK; RgErrInfo errInfo; Bool isCfmRqrd = TRUE; - TRC2(rgCOMCfgReq); - /* Process Config/Reconfig/Delete request from RRC */ switch (crgCfgReq->action) { @@ -145,8 +133,8 @@ CrgCfgReqInfo *crgCfgReq; } default: { - RLOG1(L_ERROR, "Invalid configuration action %d", - crgCfgReq->action); + DU_LOG("\nERROR --> MAC : Invalid configuration action %d", + crgCfgReq->action); ret = RFAILED; } @@ -169,7 +157,7 @@ if(TRUE == isCfmRqrd) #ifdef LTE_ADV } #endif - RGDBGINFO(inst,(rgPBuf(inst), "CRG Configuration request processed\n")); + DU_LOG("\nINFO --> MAC : CRG Configuration request processed\n"); return (ret); } /* rgCOMCfgReq */ /** @@ -197,8 +185,7 @@ if(TRUE == isCfmRqrd) * -# ROK * -# RFAILED **/ -#ifdef ANSI -PRIVATE S16 rgCOMHndlCfgReq +static S16 rgCOMHndlCfgReq ( Inst inst, CrgCfg *cfg, @@ -206,21 +193,11 @@ RgErrInfo *errInfo, Bool *isCfmRqrd, CrgCfgTransId transId ) -#else -PRIVATE S16 rgCOMHndlCfgReq(inst,cfg, errInfo,isCfmRqrd,transId) -Inst inst; -CrgCfg *cfg; -RgErrInfo *errInfo; -Bool *isCfmRqrd; -CrgCfgTransId transId; -#endif { S16 ret; RgCellCb *cell = NULLP; RgUeCb *ue = NULLP; - TRC2(rgCOMHndlCfgReq); - errInfo->errType = RGERR_COM_CFG_REQ; /* Validate and process the configuration request */ @@ -231,7 +208,7 @@ CrgCfgTransId transId; ret = rgCFGVldtCrgCellCfg(inst,&cfg->u.cellCfg,errInfo); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cfg->u.cellCfg.cellId, "Cell configuration validation FAILED\n"); + DU_LOG("\nERROR --> MAC : Cell configuration validation FAILED\n"); return RFAILED; } ret = rgCFGCrgCellCfg(inst,&cfg->u.cellCfg, errInfo); @@ -243,7 +220,7 @@ CrgCfgTransId transId; ret = rgCFGVldtCrgUeCfg(inst,&cfg->u.ueCfg, &cell, errInfo); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CRNTI,cfg->u.ueCfg.crnti, "Ue configuration validation FAILED\n"); + DU_LOG("\nERROR --> MAC : UE configuration validation FAILED\n"); return RFAILED; } ret = rgCFGCrgUeCfg(inst,cell, &cfg->u.ueCfg, errInfo); @@ -257,8 +234,7 @@ CrgCfgTransId transId; if (ret != ROK) { - RLOG_ARG1(L_ERROR,DBG_CELLID,cfg->u.cellCfg.cellId, - "LC configuration validation FAILED: LC %d\n", cfg->u.lchCfg.lcId); + DU_LOG("\nERROR --> MAC : LC configuration validation FAILED: LC %d\n", cfg->u.lchCfg.lcId); return RFAILED; } ret = rgCFGCrgLcCfg(inst,cell, ue, &cfg->u.lchCfg, errInfo,isCfmRqrd,transId); @@ -266,7 +242,7 @@ CrgCfgTransId transId; } default: { - RLOG1(L_ERROR, "Should never come here: cfgType %d",cfg->cfgType); + DU_LOG("\nERROR --> MAC : Should never come here: cfgType %d",cfg->cfgType); return RFAILED; } } @@ -300,8 +276,7 @@ CrgCfgTransId transId; * -# ROK * -# RFAILED **/ -#ifdef ANSI -PRIVATE S16 rgCOMHndlRecfgReq +static S16 rgCOMHndlRecfgReq ( Inst inst, CrgRecfg *recfg, @@ -309,22 +284,12 @@ RgErrInfo *errInfo, CrgCfgTransId transId, Bool *isCfmRqrd ) -#else -PRIVATE S16 rgCOMHndlRecfgReq(inst,recfg, errInfo, transId, isCfmRqrd) -Inst inst; -CrgRecfg *recfg; -RgErrInfo *errInfo; -CrgCfgTransId transId; -Bool *isCfmRqrd; -#endif { S16 ret; RgCellCb *cell = rgCb[inst].cell; RgUeCb *ue = NULLP; RgUlLcCb *ulLc = NULLP; - TRC2(rgCOMHndlRecfgReq); - errInfo->errType = RGERR_COM_RECFG_REQ; /* Validate and process the re-configuration request */ @@ -335,8 +300,7 @@ Bool *isCfmRqrd; ret = rgCFGVldtCrgCellRecfg(inst,&recfg->u.cellRecfg, &cell, errInfo); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,recfg->u.cellRecfg.cellId, - "Cell Recfg Validation FAILED"); + DU_LOG("\nERROR --> MAC : Cell Recfg Validation FAILED"); return RFAILED; } ret = rgCFGCrgCellRecfg(inst,cell, &recfg->u.cellRecfg, errInfo); @@ -360,8 +324,8 @@ Bool *isCfmRqrd; ret = rgFillAndAddSCellCfg(inst, cell, &recfg->u.ueRecfg, transId, isCfmRqrd); if (ret != ROK) { - RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Ue SCell configuration FAILED for inst [%d]\n", - recfg->u.ueRecfg.oldCrnti, inst)); + DU_LOG("\nERROR --> MAC : [%d]UE SCell configuration FAILED for inst [%d]\n", + recfg->u.ueRecfg.oldCrnti, inst); return RFAILED; } @@ -372,8 +336,7 @@ Bool *isCfmRqrd; ret = rgCFGVldtCrgUeRecfg(inst,&recfg->u.ueRecfg, &cell, &ue, errInfo); if ( ret != ROK) { - RLOG_ARG1(L_ERROR,DBG_CELLID,recfg->u.ueRecfg.cellId, - "Ue Re-configuration validation FAILED OLD CRNTI:%d", + DU_LOG("\nERROR --> MAC : UE Re-configuration validation FAILED OLD CRNTI:%d", recfg->u.ueRecfg.oldCrnti); return RFAILED; } @@ -390,15 +353,14 @@ Bool *isCfmRqrd; &ulLc, errInfo); if (ret != ROK) { - RLOG_ARG2(L_ERROR,DBG_CELLID,recfg->u.lchRecfg.cellId, - "LC Re-configuration validation FAILED LCID:%d CRNTI:%d", + DU_LOG("\nERROR --> MAC : LC Re-configuration validation FAILED LCID:%d CRNTI:%d", recfg->u.lchRecfg.lcId,recfg->u.lchRecfg.crnti); return RFAILED; } #ifdef LTE_ADV /*ERAB- multicell fix*/ - cmMemcpy( (U8*)&(ue->cfgCfmInfo.transId), (U8*)&transId, + memcpy( &(ue->cfgCfmInfo.transId), &transId, sizeof(CrgCfgTransId)); #endif ret = rgCFGCrgLcRecfg(inst,cell, ue, ulLc, @@ -408,7 +370,7 @@ Bool *isCfmRqrd; } default: { - RLOG1(L_ERROR, "Should never come here: recfgType %d", + DU_LOG("\nERROR --> MAC : Should never come here: recfgType %d", recfg->recfgType); return RFAILED; } @@ -439,26 +401,17 @@ Bool *isCfmRqrd; * -# ROK * -# RFAILED **/ -#ifdef ANSI -PRIVATE S16 rgCOMHndlResetReq +static S16 rgCOMHndlResetReq ( Inst inst, CrgRst *reset, RgErrInfo *errInfo ) -#else -PRIVATE S16 rgCOMHndlResetReq(inst,reset, errInfo) -Inst inst; -CrgRst *reset; -RgErrInfo *errInfo; -#endif { - TRC2(rgCOMHndlResetReq); - /* Fix : ccpu00126865: ignore CRG reset. Let SCH trigger it. */ errInfo->errCause = RGERR_NONE; - RGDBGINFO(inst,(rgPBuf(inst), "CRG UE Reset processed \n")); + DU_LOG("\nINFO --> MAC : CRG UE Reset processed \n"); return ROK; } /* rgCOMHndlResetReq */ /*End: LTEMAC_2.1_DEV_CFG */ @@ -485,8 +438,7 @@ RgErrInfo *errInfo; * -# ROK * -# RFAILED **/ -#ifdef ANSI -PRIVATE S16 rgCOMHndlDelReq +static S16 rgCOMHndlDelReq ( Inst inst, CrgDel *del, @@ -494,21 +446,11 @@ RgErrInfo *errInfo, Bool *isCfmRqrd, CrgCfgTransId transId ) -#else -PRIVATE S16 rgCOMHndlDelReq(inst,del, errInfo,isCfmRqrd,transId) -Inst inst; -CrgDel *del; -RgErrInfo *errInfo; -Bool *isCfmRqrd; -CrgCfgTransId transId; -#endif { - S16 ret; - VOLATILE U32 startTime=0; + S16 ret; + volatile uint32_t startTime=0; - TRC2(rgCOMHndlDelReq); - errInfo->errType = RGERR_COM_DEL_REQ; /* Process the delete request */ @@ -524,9 +466,8 @@ CrgCfgTransId transId; /*starting Task*/ SStartTask(&startTime,PID_MAC_UE_DEL); - ret = rgCFGCrgUeDel(inst,del, errInfo); - RGDBGINFONEW(inst,(rgPBuf(inst),"[%d] Delete UE Done \n", del->u.ueDel.crnti)); + DU_LOG("\nINFO --> MAC : [%d] Delete UE Done \n", del->u.ueDel.crnti); /*stoping Task*/ SStopTask(startTime,PID_MAC_UE_DEL); @@ -540,7 +481,7 @@ CrgCfgTransId transId; } default: { - RLOG1(L_ERROR, "Should never come here: delType %d", + DU_LOG("\nERROR --> MAC : Should never come here: delType %d", del->delType); return RFAILED; } @@ -570,17 +511,11 @@ CrgCfgTransId transId; * -# ROK * -# RFAILED **/ -#ifdef ANSI S16 RgPrgPMacSMacUeSCellCfgReq ( Pst *pst, RgPrgUeSCellCfgInfo *ueSCellCb ) -#else -S16 RgPrgPMacSMacUeSCellCfgReq(pst, ueSCellCb) -Pst *pst; -RgPrgUeSCellCfgInfo *ueSCellCb; -#endif { RgPrgCfgCfmInfo cfgCfm; Inst inst = pst->dstInst; @@ -588,11 +523,9 @@ RgPrgUeSCellCfgInfo *ueSCellCb; S16 ret; Pst cfmPst; - TRC2(RgPrgPMacSMacUeSCellCfgReq); - RGDBGPRM(inst,(rgPBuf(inst), - "APPLYING CRG UE SCELL CONFIG: cellId %d ueId %d\n", - ueSCellCb->cellId, ueSCellCb->ueId)); + DU_LOG("\nDEBUG --> MAC : APPLYING CRG UE SCELL CONFIG: cellId %d ueId %d\n", + ueSCellCb->cellId, ueSCellCb->ueId); cfgCfm.ueId = ueSCellCb->ueId; cfgCfm.sCellId = ueSCellCb->cellId; @@ -603,8 +536,8 @@ RgPrgUeSCellCfgInfo *ueSCellCb; ret = rgUtlVltdAddSCellCfg(ueSCellCb, cell, inst); if(ret != ROK) { - RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Crg Ue SCell failed:\ - cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId)); + DU_LOG("\nERROR --> MAC : [%d]Crg UE SCell failed:\ + cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId); /* Set status as Not OK*/ cfgCfm.status = PRG_CFG_CFM_NOK; } @@ -613,15 +546,15 @@ RgPrgUeSCellCfgInfo *ueSCellCb; ret = rgCfgAddUeSCellCfg(inst, ueSCellCb, cell); if(ret != ROK) { - RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Crg Ue SCell failed:\ - cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId)); + DU_LOG("\nERROR --> MAC : [%d]Crg UE SCell failed:\ + cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId); /* Set status as Not OK*/ cfgCfm.status = PRG_CFG_CFM_NOK; } } - RGDBGINFONEW(inst,(rgPBuf(inst), "[%d]Crg Ue SCell Config done:\ - cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId)); + DU_LOG("\nINFO --> MAC : [%d]Crg UE SCell Config done:\ + cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId); /* Send positive confirmation to primary cell*/ RgPrgSMacPMacCfg(&cfmPst, &cfgCfm); @@ -652,36 +585,26 @@ RgPrgUeSCellCfgInfo *ueSCellCb; * -# ROK * -# RFAILED **/ -#ifdef ANSI S16 RgPrgSMacPMacCfgCfm ( Pst *pst, RgPrgCfgCfmInfo *cfgCfm ) -#else -S16 RgPrgSMacPMacCfgCfm(pst, cfgCfm) -Pst *pst; -RgPrgCfgCfmInfo *cfgCfm; -#endif { Inst inst = pst->dstInst; RgCellCb *cell; RgUeCb *ue; - TRC2(RgPrgSMacPMacCfgCfm); - RG_IS_INST_VALID(inst); - RGDBGPRM(pst->dstInst,(rgPBuf(pst->dstInst), - "Config Confirm Rcvd from Inst %d ueId %d cellId %d\n", - pst->srcInst, cfgCfm->ueId, cfgCfm->cellId)); + DU_LOG("\nINFO --> MAC : Config Confirm Rcvd from Inst %d ueId %d cellId %d\n", + pst->srcInst, cfgCfm->ueId, cfgCfm->cellId); cell = rgCb[inst].cell; if ((ue = rgDBMGetUeCb(cell, cfgCfm->ueId)) == NULLP) { - RGDBGERRNEW(inst,(rgPBuf(inst), - "[%d]Ue does not exist\n", cfgCfm->ueId)); + DU_LOG("\nERROR --> MAC : [%d]UE does not exist\n", cfgCfm->ueId); return RFAILED; } switch(cfgCfm->event) @@ -699,7 +622,7 @@ RgPrgCfgCfmInfo *cfgCfm; /* Send back confirmation status to RRC */ rgUIMCrgCfgCfm(inst, ue->cfgCfmInfo.transId, ue->cfgCfmInfo.mask); ue->cfgCfmInfo.mask = 0; - RGDBGINFO(inst,(rgPBuf(inst), "CRG Configuration request processed\n")); + DU_LOG("\nINFO --> MAC : CRG Configuration request processed\n"); } } break; @@ -721,14 +644,14 @@ RgPrgCfgCfmInfo *cfgCfm; /* Send back confirmation status to RRC */ rgUIMCrgCfgCfm(inst, ue->cfgCfmInfo.transId, ue->cfgCfmInfo.mask); ue->cfgCfmInfo.mask = 0; - RGDBGINFO(inst,(rgPBuf(inst), "CRG Configuration request processed\n")); + DU_LOG("\nINFO --> MAC : CRG Configuration request processed\n"); } } break; default: { - RGDBGERRNEW(inst,(rgPBuf(inst), "Invalid configuration confirm event %d\n", - cfgCfm->event)); + DU_LOG("\nERROR --> MAC : Invalid configuration confirm event %d\n", + cfgCfm->event); return RFAILED; } @@ -752,24 +675,16 @@ RgPrgCfgCfmInfo *cfgCfm; * @param[in] RgPrgUeSCellDelInfo *ueSCellDelInfo * @return ROK is SUCCESS **/ -#ifdef ANSI S16 RgPrgPMacSMacUeSCellDelReq ( Pst *pst, RgPrgUeSCellDelInfo *ueSCellDelInfo ) -#else -S16 RgPrgPMacSMacUeSCellDelReq(pst, ueSCellDelInfo) -Pst *pst; -RgPrgUeSCellDelInfo *ueSCellDelInfo; -#endif { Inst inst = pst->dstInst - RG_INST_START; RgCellCb *sCell = rgCb[inst].cell; RgUeCb *sCellUe = NULLP; - TRC2(RgPrgPMacSMacUeSCellDelReq) - /* Checking for cell Cb because in case of shutdownReq it is possible that * cell is already deleted for this cell*/ if(sCell == NULLP) @@ -779,8 +694,8 @@ RgPrgUeSCellDelInfo *ueSCellDelInfo; /* Retrive the UeCb from sec cell*/ if ((sCellUe = rgDBMGetUeCb(sCell, ueSCellDelInfo->ueId)) == NULLP) { - RGDBGERRNEW(inst, (rgPBuf(inst), "[%d]UE:does not exist in sCell(%d)\n", - ueSCellDelInfo->ueId, sCell->cellId)); + DU_LOG("\nERROR --> MAC : [%d]UE:does not exist in sCell(%d)\n", + ueSCellDelInfo->ueId, sCell->cellId); return RFAILED; } @@ -792,8 +707,8 @@ RgPrgUeSCellDelInfo *ueSCellDelInfo; /* Retrive the UeCb from sec cell*/ if ((rgDBMGetUeCb(sCell, ueSCellDelInfo->newRnti)) != NULLP) { - RGDBGERRNEW(inst, (rgPBuf(inst), "[%d]UE:UE context already exist in\ - sCell(%d)",ueSCellDelInfo->newRnti, sCell->cellId)); + DU_LOG("\nERROR --> MAC : [%d]UE:UE context already exist in\ + sCell(%d)",ueSCellDelInfo->newRnti, sCell->cellId); return RFAILED; }