X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Frg_com.c;h=1d31c55e9244374228bc2b667fc70645298ae933;hb=5d74fef7c9fe6b65a965ceac6bfe812872dab323;hp=4e15d764db71323f9f6f4c031432d1f4f7d47285;hpb=451e626d5ac7c7e7586bab23358161230449af46;p=o-du%2Fl2.git diff --git a/src/5gnrmac/rg_com.c b/src/5gnrmac/rg_com.c index 4e15d764d..1d31c55e9 100755 --- a/src/5gnrmac/rg_com.c +++ b/src/5gnrmac/rg_com.c @@ -36,44 +36,26 @@ 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 "envopt.h" /* environment options */ -#include "envdep.h" /* environment dependent */ -#include "envind.h" /* environment independent */ -#include "gen.h" /* general layer */ -#include "ssi.h" /* system service interface */ -#include "cm_hash.h" /* common hash list */ -#include "cm_mblk.h" /* common memory link list library */ -#include "cm_llist.h" /* common linked list library */ -#include "cm_err.h" /* common error */ -#include "cm_lte.h" /* common LTE */ +#include "common_def.h" +#include "tfu.h" +#include "du_app_mac_inf.h" #include "lrg.h" #include "crg.h" #include "rgu.h" -#include "tfu.h" #include "rg_sch_inf.h" -#include "rg_prg.h" /* PRG interface includes*/ #include "rg_env.h" #include "rg.h" #include "rg_err.h" /* header/extern include files (.x) */ -#include "gen.x" /* general layer */ -#include "ssi.x" /* system service interface */ -#include "cm5.x" /* common timers */ -#include "cm_lib.x" /* common library */ -#include "cm_hash.x" /* common hash list */ -#include "cm_mblk.x" /* common memory link list library */ -#include "cm_llist.x" /* common linked list library */ -#include "cm_tkns.x" /* common tokens */ -#include "cm_lte.x" /* common LTE */ +#include "tfu.x" #include "lrg.x" #include "crg.x" #include "rgu.x" -#include "tfu.x" #include "rg_sch_inf.x" #include "rg_prg.x" /* PRG interface typedefs*/ -#include "du_app_mac_inf.h" #include "rg.x" #ifdef LTE_ADV #include "rg_pom_scell.x" @@ -116,14 +98,14 @@ PRIVATE S16 rgCOMHndlResetReq ARGS((Inst inst,CrgRst *reset,RgErrInfo *errInfo)) * -# RFAILED **/ #ifdef ANSI -PUBLIC S16 rgCOMCfgReq +S16 rgCOMCfgReq ( Inst inst, CrgCfgTransId transId, CrgCfgReqInfo *crgCfgReq ) #else -PUBLIC S16 rgCOMCfgReq(inst,transId, crgCfgReq) +S16 rgCOMCfgReq(inst,transId, crgCfgReq) Inst inst; CrgCfgTransId transId; CrgCfgReqInfo *crgCfgReq; @@ -134,8 +116,6 @@ CrgCfgReqInfo *crgCfgReq; RgErrInfo errInfo; Bool isCfmRqrd = TRUE; - TRC2(rgCOMCfgReq); - /* Process Config/Reconfig/Delete request from RRC */ switch (crgCfgReq->action) { @@ -188,7 +168,7 @@ if(TRUE == isCfmRqrd) } #endif RGDBGINFO(inst,(rgPBuf(inst), "CRG Configuration request processed\n")); - RETVALUE(ret); + return (ret); } /* rgCOMCfgReq */ /** * @brief Handler for processing Cell/Ue/Logical channel configuration request @@ -237,8 +217,6 @@ CrgCfgTransId transId; RgCellCb *cell = NULLP; RgUeCb *ue = NULLP; - TRC2(rgCOMHndlCfgReq); - errInfo->errType = RGERR_COM_CFG_REQ; /* Validate and process the configuration request */ @@ -250,7 +228,7 @@ CrgCfgTransId transId; if (ret != ROK) { RLOG_ARG0(L_ERROR,DBG_CELLID,cfg->u.cellCfg.cellId, "Cell configuration validation FAILED\n"); - RETVALUE(RFAILED); + return RFAILED; } ret = rgCFGCrgCellCfg(inst,&cfg->u.cellCfg, errInfo); break; @@ -262,7 +240,7 @@ CrgCfgTransId transId; if (ret != ROK) { RLOG_ARG0(L_ERROR,DBG_CRNTI,cfg->u.ueCfg.crnti, "Ue configuration validation FAILED\n"); - RETVALUE(RFAILED); + return RFAILED; } ret = rgCFGCrgUeCfg(inst,cell, &cfg->u.ueCfg, errInfo); } @@ -277,7 +255,7 @@ CrgCfgTransId transId; RLOG_ARG1(L_ERROR,DBG_CELLID,cfg->u.cellCfg.cellId, "LC configuration validation FAILED: LC %d\n", cfg->u.lchCfg.lcId); - RETVALUE(RFAILED); + return RFAILED; } ret = rgCFGCrgLcCfg(inst,cell, ue, &cfg->u.lchCfg, errInfo,isCfmRqrd,transId); break; @@ -285,11 +263,11 @@ CrgCfgTransId transId; default: { RLOG1(L_ERROR, "Should never come here: cfgType %d",cfg->cfgType); - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ret); + return (ret); } /* rgCOMHndlCfgReq */ @@ -341,8 +319,6 @@ Bool *isCfmRqrd; RgUeCb *ue = NULLP; RgUlLcCb *ulLc = NULLP; - TRC2(rgCOMHndlRecfgReq); - errInfo->errType = RGERR_COM_RECFG_REQ; /* Validate and process the re-configuration request */ @@ -355,7 +331,7 @@ Bool *isCfmRqrd; { RLOG_ARG0(L_ERROR,DBG_CELLID,recfg->u.cellRecfg.cellId, "Cell Recfg Validation FAILED"); - RETVALUE(RFAILED); + return RFAILED; } ret = rgCFGCrgCellRecfg(inst,cell, &recfg->u.cellRecfg, errInfo); break; @@ -380,7 +356,7 @@ Bool *isCfmRqrd; { RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Ue SCell configuration FAILED for inst [%d]\n", recfg->u.ueRecfg.oldCrnti, inst)); - RETVALUE(RFAILED); + return RFAILED; } } @@ -393,7 +369,7 @@ Bool *isCfmRqrd; RLOG_ARG1(L_ERROR,DBG_CELLID,recfg->u.ueRecfg.cellId, "Ue Re-configuration validation FAILED OLD CRNTI:%d", recfg->u.ueRecfg.oldCrnti); - RETVALUE(RFAILED); + return RFAILED; } ret = rgCFGCrgUeRecfg(inst,cell, ue, &recfg->u.ueRecfg, errInfo); } @@ -411,12 +387,12 @@ Bool *isCfmRqrd; RLOG_ARG2(L_ERROR,DBG_CELLID,recfg->u.lchRecfg.cellId, "LC Re-configuration validation FAILED LCID:%d CRNTI:%d", recfg->u.lchRecfg.lcId,recfg->u.lchRecfg.crnti); - RETVALUE(RFAILED); + 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, @@ -428,11 +404,11 @@ Bool *isCfmRqrd; { RLOG1(L_ERROR, "Should never come here: recfgType %d", recfg->recfgType); - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ret); + return (ret); } /* rgCOMHndlRecfgReq */ /*Start: LTEMAC_2.1_DEV_CFG */ @@ -471,13 +447,11 @@ 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")); - RETVALUE(ROK); + return ROK; } /* rgCOMHndlResetReq */ /*End: LTEMAC_2.1_DEV_CFG */ @@ -525,8 +499,6 @@ CrgCfgTransId transId; S16 ret; VOLATILE U32 startTime=0; - TRC2(rgCOMHndlDelReq); - errInfo->errType = RGERR_COM_DEL_REQ; /* Process the delete request */ @@ -560,11 +532,11 @@ CrgCfgTransId transId; { RLOG1(L_ERROR, "Should never come here: delType %d", del->delType); - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ret); + return (ret); } /* rgCOMHndlDelReq */ #ifdef LTE_ADV @@ -589,13 +561,13 @@ CrgCfgTransId transId; * -# RFAILED **/ #ifdef ANSI -PUBLIC S16 RgPrgPMacSMacUeSCellCfgReq +S16 RgPrgPMacSMacUeSCellCfgReq ( Pst *pst, RgPrgUeSCellCfgInfo *ueSCellCb ) #else -PUBLIC S16 RgPrgPMacSMacUeSCellCfgReq(pst, ueSCellCb) +S16 RgPrgPMacSMacUeSCellCfgReq(pst, ueSCellCb) Pst *pst; RgPrgUeSCellCfgInfo *ueSCellCb; #endif @@ -606,7 +578,6 @@ RgPrgUeSCellCfgInfo *ueSCellCb; S16 ret; Pst cfmPst; - TRC2(RgPrgPMacSMacUeSCellCfgReq); RGDBGPRM(inst,(rgPBuf(inst), "APPLYING CRG UE SCELL CONFIG: cellId %d ueId %d\n", @@ -643,7 +614,7 @@ RgPrgUeSCellCfgInfo *ueSCellCb; /* Send positive confirmation to primary cell*/ RgPrgSMacPMacCfg(&cfmPst, &cfgCfm); - RETVALUE(ROK); + return ROK; } /* RgPrgPMacSMacUeSCellCfgReq */ /** @@ -671,13 +642,13 @@ RgPrgUeSCellCfgInfo *ueSCellCb; * -# RFAILED **/ #ifdef ANSI -PUBLIC S16 RgPrgSMacPMacCfgCfm +S16 RgPrgSMacPMacCfgCfm ( Pst *pst, RgPrgCfgCfmInfo *cfgCfm ) #else -PUBLIC S16 RgPrgSMacPMacCfgCfm(pst, cfgCfm) +S16 RgPrgSMacPMacCfgCfm(pst, cfgCfm) Pst *pst; RgPrgCfgCfmInfo *cfgCfm; #endif @@ -685,8 +656,6 @@ RgPrgCfgCfmInfo *cfgCfm; Inst inst = pst->dstInst; RgCellCb *cell; RgUeCb *ue; - TRC2(RgPrgSMacPMacCfgCfm); - RG_IS_INST_VALID(inst); @@ -700,7 +669,7 @@ RgPrgCfgCfmInfo *cfgCfm; { RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Ue does not exist\n", cfgCfm->ueId)); - RETVALUE(RFAILED); + return RFAILED; } switch(cfgCfm->event) { @@ -748,11 +717,11 @@ RgPrgCfgCfmInfo *cfgCfm; RGDBGERRNEW(inst,(rgPBuf(inst), "Invalid configuration confirm event %d\n", cfgCfm->event)); - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ROK); + return ROK; } /* RgPrgSMacPMacCfgCfm */ /** @@ -771,13 +740,13 @@ RgPrgCfgCfmInfo *cfgCfm; * @return ROK is SUCCESS **/ #ifdef ANSI -PUBLIC S16 RgPrgPMacSMacUeSCellDelReq +S16 RgPrgPMacSMacUeSCellDelReq ( Pst *pst, RgPrgUeSCellDelInfo *ueSCellDelInfo ) #else -PUBLIC S16 RgPrgPMacSMacUeSCellDelReq(pst, ueSCellDelInfo) +S16 RgPrgPMacSMacUeSCellDelReq(pst, ueSCellDelInfo) Pst *pst; RgPrgUeSCellDelInfo *ueSCellDelInfo; #endif @@ -786,20 +755,18 @@ RgPrgUeSCellDelInfo *ueSCellDelInfo; 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) { - RETVALUE(ROK); + return ROK; } /* 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)); - RETVALUE(RFAILED); + return RFAILED; } /*PMAC_Reest: ueId and newRnti is different that means its a UeId change @@ -812,7 +779,7 @@ RgPrgUeSCellDelInfo *ueSCellDelInfo; { RGDBGERRNEW(inst, (rgPBuf(inst), "[%d]UE:UE context already exist in\ sCell(%d)",ueSCellDelInfo->newRnti, sCell->cellId)); - RETVALUE(RFAILED); + return RFAILED; } rgDBMDelUeCb(sCell, sCellUe); @@ -830,7 +797,7 @@ RgPrgUeSCellDelInfo *ueSCellDelInfo; rgCFGFreeUeCb(sCell, sCellUe); } - RETVALUE(ROK); + return ROK; } /* RgPrgPMacSMacUeSCellDelReq */ #endif /*LTE_ADV */ /**********************************************************************