X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Frg_sch_gom.c;h=7582f609feee98d23d4ddc6862ba87c9f819c866;hb=e596baac85d7993d92b3077ddc1b99af14b5e8a6;hp=7a19658b12e2f556dc14d6231727b093e72c3762;hpb=65443172dd60a6ea312bd3a15959dbf54ad7f045;p=o-du%2Fl2.git diff --git a/src/5gnrsch/rg_sch_gom.c b/src/5gnrsch/rg_sch_gom.c index 7a19658b1..7582f609f 100755 --- a/src/5gnrsch/rg_sch_gom.c +++ b/src/5gnrsch/rg_sch_gom.c @@ -33,9 +33,6 @@ invoked by RRM towards MAC. */ -static const char* RLOG_MODULE_NAME="MAC"; -static int RLOG_MODULE_ID=4096; -static int RLOG_FILE_ID=164; /* header include files -- defines (.h) */ #include "common_def.h" @@ -46,8 +43,7 @@ static int RLOG_FILE_ID=164; #include "rg_sch_inf.h" #include "rg_sch.h" #include "rg_sch_err.h" -#include "rl_interface.h" -#include "rl_common.h" +#include "sch_utils.h" /* header/extern include files (.x) */ #include "lrg.x" @@ -55,6 +51,7 @@ static int RLOG_FILE_ID=164; #include "tfu.x" #include "rg_sch_inf.x" #include "rg_sch.x" +#include "mac_sch_interface.h" /* local defines */ static S16 rgSCHGomHndlCfgReq ARGS((RgSchCb *instCb, SpId spId, @@ -135,30 +132,13 @@ uint16_t idx * -# ROK * -# RFAILED **/ -#ifdef ANSI -S16 rgSCHGomHndlCfg -( -Pst *pst, -RgSchCb *instCb, -RgrCfgTransId transId, -RgrCfgReqInfo *cfgReqInfo -) -#else -S16 rgSCHGomHndlCfg(pst, instCb, transId, cfgReqInfo) -Pst *pst; -RgSchCb *instCb; -RgrCfgTransId transId; -RgrCfgReqInfo *cfgReqInfo; -#endif +S16 rgSCHGomHndlCfg(Pst *pst,RgSchCb *instCb,RgrCfgTransId transId,RgrCfgReqInfo *cfgReqInfo) { S16 ret; SpId spId = 0; CmLteCellId cellId; RgSchCellCb *cell = NULLP; - uint8_t cfmStatus = RGR_CFG_CFM_NOK; -#ifdef DEBUGP - Inst inst = (instCb->rgSchInit.inst ); -#endif + uint8_t cfmStatus = RGR_CFG_CFM_NOK; /* Apply the configuration for Cell Configuration or Delete */ if (cfgReqInfo->action != RGR_RECONFIG) @@ -171,9 +151,9 @@ RgrCfgReqInfo *cfgReqInfo; /* Fetch the cell Id for the recieved request */ if((rgSCHGomGetCellIdFrmCfgReq(cfgReqInfo, &cellId)) != ROK) { - RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "Action.Config Type Error"); + DU_LOG("\nERROR --> SCH : Action.Config Type Error"); - SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus); @@ -184,10 +164,10 @@ RgrCfgReqInfo *cfgReqInfo; { if(cellId != instCb->rgrSap[spId].cell->cellId) { - RLOG_ARG2(L_ERROR,DBG_CELLID,cellId, "Cell with Id %d already exists " + DU_LOG("\nERROR --> SCH : Cell with Id %d already exists " "on sap %d", instCb->rgrSap[spId].cell->cellId, spId); - SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus); @@ -199,10 +179,10 @@ RgrCfgReqInfo *cfgReqInfo; ret = rgSCHGomEnqCfgReq(pst->region, pst->pool, cell, transId, cfgReqInfo); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cellId, "rgSCHGomHndlCfg: Enqueuing CfgReq " + DU_LOG("\nERROR --> SCH : rgSCHGomHndlCfg: Enqueuing CfgReq " "Failed "); - SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus); @@ -211,7 +191,7 @@ RgrCfgReqInfo *cfgReqInfo; return ROK; } - SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus); @@ -244,33 +224,14 @@ RgrCfgReqInfo *cfgReqInfo; * -# ROK * -# RFAILED **/ -#ifdef ANSI -static S16 rgSCHGomCfgReq -( -Region reg, -Pool pool, -RgSchCb *instCb, -RgrCfgTransId transId, -RgrCfgReqInfo *cfgReqInfo -) -#else -static S16 rgSCHGomCfgReq(reg, pool, instCb, transId, cfgReqInfo) -Region reg; -Pool pool; -RgSchCb *instCb; -RgrCfgTransId transId; -RgrCfgReqInfo *cfgReqInfo; -#endif +static S16 rgSCHGomCfgReq(Region reg,Pool pool,RgSchCb *instCb,RgrCfgTransId transId,RgrCfgReqInfo *cfgReqInfo) { - SpId spId = 0; - uint8_t cfmStatus = RGR_CFG_CFM_OK; + SpId spId = 0; + uint8_t cfmStatus = RGR_CFG_CFM_OK; S16 ret; RgSchErrInfo errInfo; -#ifdef DEBUGP - Inst inst = (instCb->rgSchInit.inst ); -#endif #ifdef EMTC_ENABLE -printf("\n AT MAC rgSCHGomCfgReq \n"); +printf("\nDEBUG --> SCH: AT MAC rgSCHGomCfgReq \n"); #endif /* Process Config/Reconfig/Delete request from RRM */ @@ -312,7 +273,7 @@ printf("\n AT MAC rgSCHGomCfgReq \n"); #endif /* LTE_ADV */ default: { - RLOG_ARG1(L_ERROR,DBG_INSTID,inst, "Invalid configuration " + DU_LOG("\nERROR --> SCH : Invalid configuration " "action %d", cfgReqInfo->action); ret = RFAILED; } @@ -323,17 +284,17 @@ printf("\n AT MAC rgSCHGomCfgReq \n"); cfmStatus = RGR_CFG_CFM_NOK; } - SPutSBuf(reg, pool, (Data *)cfgReqInfo, + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; #ifdef EMTC_ENABLE -printf("\n AT MAC sending RGR cfg cfm \n"); +printf("\nDEBUG --> SCH: AT MAC sending RGR cfg cfm \n"); #endif /* Send back confirmation status to RRM */ schSendCfgCfm(reg, pool, transId, cfmStatus); #ifdef EMTC_ENABLE -printf("\n AT MAC RGR cfg cfm sent\n"); +printf("\nDEBUG --> SCH: AT MAC RGR cfg cfm sent\n"); #endif return (ret); @@ -368,26 +329,10 @@ printf("\n AT MAC RGR cfg cfm sent\n"); * -# ROK * -# RFAILED **/ -#ifdef ANSI -static S16 rgSCHGomEnqCfgReq -( -Region reg, -Pool pool, -RgSchCellCb *cell, -RgrCfgTransId transId, -RgrCfgReqInfo *rgrCfgReq -) -#else -static S16 rgSCHGomEnqCfgReq(reg, pool, cell, transId, rgrCfgReq) -Region reg; -Pool pool; -RgSchCellCb *cell; -RgrCfgTransId transId; -RgrCfgReqInfo *rgrCfgReq; -#endif +static S16 rgSCHGomEnqCfgReq(Region reg,Pool pool,RgSchCellCb *cell,RgrCfgTransId transId,RgrCfgReqInfo *rgrCfgReq) { S16 ret; - uint32_t sfDiff; + uint32_t sfDiff; RgSchCfgElem *rgrCfgElem = NULLP; CmLteTimingInfo actvTime; Inst inst = cell->instIdx; @@ -422,7 +367,7 @@ RgrCfgReqInfo *rgrCfgReq; if (actvTime.sfn >= RGSCH_MAX_SFN || actvTime.slot >= RGSCH_NUM_SUB_FRAMES_5G) { - RLOG_ARG4(L_ERROR,DBG_CELLID,cell->cellId, "Invalid activation time for RGR " + DU_LOG("\nERROR --> SCH : Invalid activation time for RGR " "config request: activation sfn %d activation slot %d current " "sfn %d current slot %d", actvTime.sfn, actvTime.slot, cell->crntTime.sfn, cell->crntTime.slot); @@ -436,7 +381,7 @@ RgrCfgReqInfo *rgrCfgReq; if (sfDiff > (RGR_ACTV_WIN_SIZE * RGSCH_NUM_SUB_FRAMES_5G)) { - RLOG_ARG4(L_ERROR,DBG_CELLID,cell->cellId,"Invalid activation time for RGR" + DU_LOG("\nERROR --> SCH : Invalid activation time for RGR" " config request: activation sfn %d activation slot %d " "current sfn %d current slot %d", actvTime.sfn, actvTime.slot, cell->crntTime.sfn, cell->crntTime.slot); @@ -485,17 +430,7 @@ RgrCfgReqInfo *rgrCfgReq; * -# ROK * -# RFAILED **/ -#ifdef ANSI -S16 rgSCHGomTtiHndlr -( -RgSchCellCb *cell, -SpId spId -) -#else -S16 rgSCHGomTtiHndlr(cell, spId) -RgSchCellCb *cell; -SpId spId; -#endif +S16 rgSCHGomTtiHndlr(RgSchCellCb *cell,SpId spId) { RgSchCfgElem *cfgElem; Inst inst= cell->instIdx; @@ -551,21 +486,7 @@ SpId spId; * -# ROK * -# RFAILED **/ -#ifdef ANSI -static S16 rgSCHGomHndlCfgReq -( -RgSchCb *instCb, -SpId spId, -RgrCfg *cfg, -RgSchErrInfo *errInfo -) -#else -static S16 rgSCHGomHndlCfgReq(instCb, spId, cfg, errInfo) -RgSchCb *instCb; -SpId spId; -RgrCfg *cfg; -RgSchErrInfo *errInfo; -#endif +static S16 rgSCHGomHndlCfgReq(RgSchCb *instCb,SpId spId,RgrCfg *cfg,RgSchErrInfo *errInfo) { S16 ret; RgSchCellCb *cell = instCb->rgrSap[spId].cell; @@ -582,7 +503,7 @@ RgSchErrInfo *errInfo; ret = rgSCHCfgVldtRgrCellCfg(inst, &cfg->u.cellCfg, cell, errInfo); if (ret != ROK) { - RLOG1(L_ERROR,"Rgr Cell configuration " + DU_LOG("\nERROR --> SCH : Rgr Cell configuration " "validation FAILED: Cell %d", cfg->u.cellCfg.cellId); return RFAILED; } @@ -595,7 +516,7 @@ RgSchErrInfo *errInfo; ret = rgSCHCfgVldtRgrUeCfg(inst, &cfg->u.ueCfg, &cell, errInfo); if (ret != ROK) { - RLOG1(L_ERROR,"Ue configuration validation" + DU_LOG("\nERROR --> SCH : Ue configuration validation" " FAILED: CRNTI:%d", cfg->u.ueCfg.crnti); return RFAILED; } @@ -607,7 +528,7 @@ RgSchErrInfo *errInfo; ret = rgSCHCfgVldtRgrLcCfg(inst, &cfg->u.lchCfg, &cell, &ue, errInfo); if (ret != ROK) { - RLOG1(L_ERROR,"LC configuration validation " + DU_LOG("\nERROR --> SCH : LC configuration validation " "FAILED: LCID:%d", cfg->u.lchCfg.lcId); return RFAILED; } @@ -619,7 +540,7 @@ RgSchErrInfo *errInfo; ret = rgSCHCfgVldtRgrLcgCfg(inst, &cfg->u.lcgCfg, &cell, &ue, errInfo); if (ret != ROK) { - RLOG1(L_ERROR,"LCG configuration validation " + DU_LOG("\nERROR --> SCH : LCG configuration validation " "FAILED: LCGID:%d", cfg->u.lcgCfg.ulInfo.lcgId); return RFAILED; } @@ -631,8 +552,7 @@ RgSchErrInfo *errInfo; ret = rgSCHCfgVldtRgrSchedEnbCfg(inst, &cfg->u.schedEnbCfg, errInfo); if (ret != ROK) { - RGSCHDBGERR(inst,(rgSchPBuf(inst), "SCH ENB configuration validation " - "FAILED: \n" )); + DU_LOG("\nERROR --> SCH : SCH ENB configuration validation FAILED: \n"); return RFAILED; } ret = rgSCHCfgRgrSchedEnbCfg(inst, spId, &cfg->u.schedEnbCfg, errInfo); @@ -641,7 +561,7 @@ RgSchErrInfo *errInfo; default: { #if(ERRCLASS & ERRCLS_INT_PAR) - RLOG1(L_ERROR,"Should never come here: " + DU_LOG("\nERROR --> SCH : Should never come here: " "cfgType %d", cfg->cfgType); #endif return RFAILED; @@ -675,31 +595,15 @@ RgSchErrInfo *errInfo; * -# ROK * -# RFAILED **/ -#ifdef ANSI -static S16 rgSCHGomHndlSCellActDeactReq -( -RgSchCb *instCb, -SpId spId, -RgrSCellActDeactEvnt *sCellActDeactEvnt, -RgSchErrInfo *errInfo, -uint8_t action -) -#else -static S16 rgSCHGomHndlSCellActDeactReq(instCb, spId, sCellActDeactEvnt, errInfo, action) -RgSchCb *instCb; -SpId spId; -RgrSCellActDeactEvnt *sCellActDeactEvnt; -RgSchErrInfo *errInfo; -uint8_t action; -#endif +static S16 rgSCHGomHndlSCellActDeactReq(RgSchCb *instCb,SpId spId,RgrSCellActDeactEvnt *sCellActDeactEvnt,RgSchErrInf *errInfo,uint8_t action) { RgSchUeCb *ue = NULLP; - uint16_t idx = 0; - uint16_t sCellIdx = 0; + uint16_t idx = 0; + uint16_t sCellIdx = 0; RgSchCellCb *cell = instCb->rgrSap[spId].cell; Inst inst = (instCb->rgSchInit.inst); - RGSCHDBGPRM(inst,(rgSchPBuf(inst), "Processing RGR SCell Actication request:" + DU_LOG(("\nDEBUG --> SCH : Processing RGR SCell Actication request:" "%d\n", sCellActDeactEvnt->crnti)); errInfo->errType = RGSCHERR_GOM_SCELL_REQ; @@ -707,7 +611,7 @@ uint8_t action; /* Fetch the Ue */ if ((ue = rgSCHDbmGetUeCb(cell, sCellActDeactEvnt->crnti)) == NULLP) { - RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "[%d]UE: does not exist\n", + DU_LOG(("\nERROR --> SCH : [%d]UE: does not exist\n", sCellActDeactEvnt->crnti)); return RFAILED; } @@ -718,15 +622,14 @@ uint8_t action; if (ROK != (rgSCHSCellTrigActDeact(cell, ue, sCellIdx, action))) { - RGSCHDBGERR(inst,(rgSchPBuf(inst), "SCell Actication failed" + DU_LOG("\nERROR --> SCH : SCell Actication failed" "for UE [%d] with SCellIdx [%d]\n", - sCellActDeactEvnt->crnti, idx)); + sCellActDeactEvnt->crnti, idx); return RFAILED; } - } - RGSCHDBGINFO(inst,(rgSchPBuf(inst), "RGR Reconfiguration processed\n")); + DU_LOG("\nINFO --> SCH : RGR Reconfiguration processed\n"); return ROK; } /* rgSCHGomHndlSCellActDeactReq */ @@ -754,21 +657,7 @@ uint8_t action; * -# ROK * -# RFAILED **/ -#ifdef ANSI -static S16 rgSCHGomHndlRecfgReq -( -RgSchCb *instCb, -SpId spId, -RgrRecfg *recfg, -RgSchErrInfo *errInfo -) -#else -static S16 rgSCHGomHndlRecfgReq(instCb, spId, recfg, errInfo) -RgSchCb *instCb; -SpId spId; -RgrRecfg *recfg; -RgSchErrInfo *errInfo; -#endif +static S16 rgSCHGomHndlRecfgReq(RgSchCb *instCb,SpId spId,RgrRecfg *recfg,RgSchErrInfo *errInfo) { RgSchUeCb *ue = NULLP; RgSchDlLcCb *dlLc = NULLP; /* PURIFY_FIX:UMR */ @@ -787,7 +676,7 @@ RgSchErrInfo *errInfo; errInfo); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,recfg->u.cellRecfg.cellId,"Rgr Cell Recfg Validation " + DU_LOG("\nERROR --> SCH : Rgr Cell Recfg Validation " "FAILED"); return RFAILED; } @@ -800,7 +689,7 @@ RgSchErrInfo *errInfo; ret = rgSCHCfgVldtRgrUeRecfg(inst, &recfg->u.ueRecfg, &cell, &ue, errInfo); if ( ret != ROK) { - RLOG_ARG1(L_ERROR,DBG_CELLID,recfg->u.ueRecfg.cellId,"Ue Recfg Validation FAILED" + DU_LOG("\nERROR --> SCH : Ue Recfg Validation FAILED" "OLD CRNTI:%d",recfg->u.ueRecfg.oldCrnti); return RFAILED; } @@ -813,7 +702,7 @@ RgSchErrInfo *errInfo; &dlLc, errInfo); if (ret != ROK) { - RLOG_ARG1(L_ERROR,DBG_CELLID,recfg->u.lchRecfg.cellId,"Lc Recfg Validation FAILED" + DU_LOG("\nERROR --> SCH : Lc Recfg Validation FAILED" "LCID:%d",recfg->u.lchRecfg.lcId); return RFAILED; } @@ -826,7 +715,7 @@ RgSchErrInfo *errInfo; errInfo); if (ret != ROK) { - RLOG_ARG1(L_ERROR,DBG_CELLID,recfg->u.lcgRecfg.cellId, "Lcg Recfg Validation FAILED" + DU_LOG("\nERROR --> SCH : Lcg Recfg Validation FAILED" "LCGID:%d",recfg->u.lcgRecfg.ulRecfg.lcgId); return RFAILED; } @@ -836,7 +725,7 @@ RgSchErrInfo *errInfo; default: { #if(ERRCLASS & ERRCLS_INT_PAR) - RLOG1(L_ERROR,"Should never come here: recfgType %d", recfg->recfgType); + DU_LOG("\nERROR --> SCH : Should never come here: recfgType %d", recfg->recfgType); #endif return RFAILED; } @@ -866,21 +755,7 @@ RgSchErrInfo *errInfo; * -# ROK * -# RFAILED **/ -#ifdef ANSI -static S16 rgSCHGomHndlResetReq -( -RgSchCb *instCb, -SpId spId, -RgrRst *reset, -RgSchErrInfo *errInfo -) -#else -static S16 rgSCHGomHndlResetReq(instCb, spId, reset, errInfo) -RgSchCb *instCb; -SpId spId; -RgrRst *reset; -RgSchErrInfo *errInfo; -#endif +static S16 rgSCHGomHndlResetReq(RgSchCb *instCb,SpId spId,RgrRst *reset,RgSchErrInfo *errInfo) { S16 ret; RgSchCellCb *cell= instCb->rgrSap[spId].cell; @@ -893,7 +768,7 @@ RgSchErrInfo *errInfo; ret = rgSCHCfgVldtRgrUeReset(inst, reset, cell, &ue, errInfo); if (ret != ROK) { - RLOG_ARG1(L_ERROR,DBG_CELLID,reset->cellId,"Rgr UE Reset Validation FAILED" + DU_LOG("\nERROR --> SCH : Rgr UE Reset Validation FAILED" "CRNTI:%d",reset->crnti); return RFAILED; } @@ -901,7 +776,7 @@ RgSchErrInfo *errInfo; ret = rgSCHCfgRgrUeReset(cell, ue, reset, errInfo); if (ret != ROK) { - RLOG_ARG1(L_ERROR,DBG_CELLID,reset->cellId,"Rgr UE Reset FAILED" + DU_LOG("\nERROR --> SCH : Rgr UE Reset FAILED" "CRNTI:%d",reset->crnti); return RFAILED; } @@ -932,34 +807,17 @@ RgSchErrInfo *errInfo; * -# ROK * -# RFAILED **/ -#ifdef ANSI -static S16 rgSCHGomHndlDelReq -( -RgSchCb *instCb, -SpId spId, -RgrDel *del, -RgSchErrInfo *errInfo -) -#else -static S16 rgSCHGomHndlDelReq(instCb, spId, del, errInfo) -RgSchCb *instCb; -SpId spId; -RgrDel *del; -RgSchErrInfo *errInfo; -#endif +static S16 rgSCHGomHndlDelReq(RgSchCb *instCb,SpId spId,RgrDel *del,RgSchErrInfo *errInfo) { S16 ret; -#ifdef DEBUGP - Inst inst = (instCb->rgSchInit.inst); -#endif volatile uint32_t startTime=0; errInfo->errType = RGSCHERR_GOM_DEL_REQ; if(instCb->rgrSap[spId].cell == NULLP) { - RLOG_ARG0(L_ERROR,DBG_INSTID,inst,"Cell doesnt exist"); + DU_LOG("\nERROR --> SCH : Cell doesnt exist"); return RFAILED; } @@ -1007,7 +865,7 @@ RgSchErrInfo *errInfo; default: { #if(ERRCLASS & ERRCLS_INT_PAR) - RLOG1(L_ERROR,"Should never come here: delType %d", del->delType); + DU_LOG("\nERROR --> SCH : Should never come here: delType %d", del->delType); #endif return RFAILED; } @@ -1038,17 +896,7 @@ RgSchErrInfo *errInfo; * File : rg_sch_gom.c * **********************************************************/ -#ifdef ANSI -static S16 rgSCHGomGetCellIdFrmCfgReq -( -RgrCfgReqInfo *rgrCfgReq, -CmLteCellId *cellId -) -#else -static S16 rgSCHGomGetCellIdFrmCfgReq(rgrCfgReq, cellId) -RgrCfgReqInfo *rgrCfgReq; -CmLteCellId *cellId; -#endif +static S16 rgSCHGomGetCellIdFrmCfgReq(RgrCfgReqInfo *rgrCfgReq,CmLteCellId *cellId) { /* Extract CellId depending on the action and Config Type in the Request @@ -1116,44 +964,25 @@ CmLteCellId *cellId; * -# ROK * -# RFAILED **/ -#ifdef ANSI -S16 rgSCHGomHndlSiCfg -( -Region reg, -Pool pool, -RgSchCb *instCb, -SpId spId, -RgrCfgTransId transId, -RgrSiCfgReqInfo *cfgReqInfo -) -#else -S16 rgSCHGomHndlSiCfg(reg, pool, instCb, spId, transId, cfgReqInfo) -Region reg; -Pool pool; -RgSchCb *instCb; -SpId spId; -RgrCfgTransId transId; -RgrSiCfgReqInfo *cfgReqInfo; -#endif +S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTransId transId,RgrSiCfgReqInfo *cfgReqInfo) { S16 ret; RgSchCellCb *cell = instCb->rgrSap[spId].cell; Inst inst = (instCb->rgSchInit.inst ); - RgSchErrInfo errInfo; - uint8_t cfmStatus = RGR_CFG_CFM_NOK; + RgSchErrInfo errInfo; + uint8_t cfmStatus = RGR_CFG_CFM_NOK; MsgLen msgLen = 0, pduLen; S32 tbSz = 0; - uint8_t nPrb = 0; - uint8_t mcs = 0; + uint8_t nPrb = 0; + uint8_t mcs = 0; /* check if cell does not exists */ if (((uint8_t *)cell == NULLP) || (cell->cellId != cfgReqInfo->cellId)) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Cell Control block does not exist" - ); + DU_LOG("\nERROR --> SCH : Cell Control block does not exist"); RGSCH_FREE_MSG(cfgReqInfo->pdu); - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); return RFAILED; @@ -1163,10 +992,10 @@ RgrSiCfgReqInfo *cfgReqInfo; ret = rgSCHCfgVldtRgrSiCfg(inst, cfgReqInfo, cell, &errInfo); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Rgr SI configuration " + DU_LOG("\nERROR --> SCH : Rgr SI configuration " "validation FAILED"); RGSCH_FREE_MSG(cfgReqInfo->pdu); - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); return RFAILED; @@ -1185,7 +1014,7 @@ RgrSiCfgReqInfo *cfgReqInfo; RGSCH_FREE_MSG(cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si); cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si = NULLP; } - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; cfmStatus = RGR_CFG_CFM_OK; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); @@ -1193,7 +1022,7 @@ RgrSiCfgReqInfo *cfgReqInfo; } else { - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); return RFAILED; @@ -1221,11 +1050,12 @@ RgrSiCfgReqInfo *cfgReqInfo; /* need to add padding bytes */ nmPadBytes = (tbSz - (msgLen*8))/8; - if ( SGetSBuf(reg,pool,&padding,nmPadBytes) != ROK) + SCH_ALLOC(padding,nmPadBytes); + if(padding == NULLP) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Rgr SI configuration " - "SGetSBuf failed for padding failed"); - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + DU_LOG("\nERROR --> SCH : Rgr SI configuration " + " failed to allocate memory for padding"); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); @@ -1239,17 +1069,17 @@ RgrSiCfgReqInfo *cfgReqInfo; #endif if ( SAddPstMsgMult((Data*)padding,nmPadBytes,cfgReqInfo->pdu) != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Rgr SI configuration " + DU_LOG("\nERROR --> SCH : Rgr SI configuration " "Failed to add padding bytes"); - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; - SPutSBuf(reg, pool, (Data* )padding,(Size)nmPadBytes); + SCH_FREE(padding,(Size)nmPadBytes); padding = NULLP; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); return RFAILED; } - SPutSBuf(reg, pool, (Data* )padding,(Size)nmPadBytes); + SCH_FREE(padding,(Size)nmPadBytes); padding = NULLP; }/* if (tbSz != ...*/ }/* if (RGR_SI_CFG_TYPE_SI...*/ @@ -1270,10 +1100,10 @@ RgrSiCfgReqInfo *cfgReqInfo; ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,0); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Failed to get MCS and NPRB" + DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB" "value"); RGSCH_FREE_MSG(cfgReqInfo->pdu); - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); @@ -1292,10 +1122,10 @@ RgrSiCfgReqInfo *cfgReqInfo; ret = rgSCHUtlCalMcsAndNPrb(cell, cfgReqInfo->cfgType, pduLen,0); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Failed to get MCS and NPRB" + DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB" "value"); RGSCH_FREE_MSG(cfgReqInfo->pdu); - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); @@ -1313,10 +1143,10 @@ RgrSiCfgReqInfo *cfgReqInfo; cfgReqInfo->siId); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Failed to get MCS and NPRB" + DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB" "value"); RGSCH_FREE_MSG(cfgReqInfo->pdu); - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); @@ -1361,10 +1191,10 @@ RgrSiCfgReqInfo *cfgReqInfo; cfgReqInfo->siId); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Failed to get MCS and NPRB" + DU_LOG("\nERROR --> SCH : Failed to get MCS and NPRB" "value"); RGSCH_FREE_MSG(cfgReqInfo->pdu); - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); @@ -1377,10 +1207,10 @@ RgrSiCfgReqInfo *cfgReqInfo; cell->siCb.siArray[cfgReqInfo->siId-1].isWarningSi = FALSE; break; default: - RLOG_ARG0(L_ERROR,DBG_CELLID,cfgReqInfo->cellId,"Invalid cfgType " + DU_LOG("\nERROR --> SCH : Invalid cfgType " "parameter value"); RGSCH_FREE_MSG(cfgReqInfo->pdu); - SPutSBuf(reg, pool, (Data *)cfgReqInfo, + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, @@ -1388,7 +1218,7 @@ RgrSiCfgReqInfo *cfgReqInfo; return RFAILED; } - SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); + SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); cfgReqInfo = NULLP; cfmStatus = RGR_CFG_CFM_OK; rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); @@ -1418,7 +1248,6 @@ RgrSiCfgReqInfo *cfgReqInfo; * -# ROK * -# RFAILED **/ -#ifdef ANSI S16 rgSCHGomHndlWarningSiCfg ( Region reg, @@ -1428,31 +1257,21 @@ SpId spId, RgrCfgTransId transId, RgrWarningSiCfgReqInfo *warningSiCfgReqInfo ) -#else -S16 rgSCHGomHndlWarningSiCfg(reg, pool, instCb, spId, transId, -warningSiCfgReqInfo) -Region reg; -Pool pool; -RgSchCb *instCb; -SpId spId; -RgrCfgTransId transId; -RgrWarningSiCfgReqInfo *warningSiCfgReqInfo; -#endif { RgSchCellCb *cell = instCb->rgrSap[spId].cell; - uint8_t cfmStatus = RGR_CFG_CFM_NOK; - uint16_t idx; - uint8_t siId = warningSiCfgReqInfo->siId; - uint8_t j, mcs=0, nPrb=0; - RgSchWarningSiSeg *warningSiMsg; - RgSchWarningSiPdu *pduNode; - CmLList *node; - MsgLen msgLen = 0; - Bool freeNodeFound = FALSE; - uint16_t siWinSize = 0; - uint16_t minPeriod = 0; + uint8_t cfmStatus = RGR_CFG_CFM_NOK; + uint16_t idx; + uint8_t siId = warningSiCfgReqInfo->siId; + uint8_t j, mcs=0, nPrb=0; + RgSchWarningSiSeg *warningSiMsg; + RgSchWarningSiPdu *pduNode; + CmLList *node; + MsgLen msgLen = 0; + Bool freeNodeFound = FALSE; + uint16_t siWinSize = 0; + uint16_t minPeriod = 0; #ifdef EMTC_ENABLE - uint8_t isEmtc = warningSiCfgReqInfo->emtcEnable; + uint8_t isEmtc = warningSiCfgReqInfo->emtcEnable; #endif #ifdef EMTC_ENABLE @@ -1472,10 +1291,10 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo; (warningSiCfgReqInfo->siId > ((minPeriod * 10)/siWinSize))) { - RLOG_ARG2(L_ERROR,DBG_CELLID,warningSiCfgReqInfo->cellId,"Warning SI Cfg Failed for siId = %d" + DU_LOG("\nERROR --> SCH : Warning SI Cfg Failed for siId = %d" "warning cellID:%d",warningSiCfgReqInfo->siId,warningSiCfgReqInfo->cellId); rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst); - SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo, + SCH_FREE(warningSiCfgReqInfo, sizeof(RgrWarningSiCfgReqInfo)); warningSiCfgReqInfo = NULLP; rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, siId, transId, @@ -1521,15 +1340,13 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo; #endif { - RGSCHLOGERROR(cell->instIdx,ERRCLS_INT_PAR,ERG011, - (ErrVal)msgLen, - "rgSCHGomHndlWarningSiCfg():msgLen does not match\ + DU_LOG("\nERROR --> SCH : rgSCHGomHndlWarningSiCfg():msgLen does not match\ any valid TB Size."); - RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Warning SI Cfg Failed" + DU_LOG("\nERROR --> SCH : Warning SI Cfg Failed" "for siId = %d", warningSiCfgReqInfo->siId); rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst); - SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo, + SCH_FREE(warningSiCfgReqInfo, sizeof(RgrWarningSiCfgReqInfo)); warningSiCfgReqInfo = NULLP; rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, @@ -1554,7 +1371,7 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo; { node = warningSiCfgReqInfo->siPduLst.first; cmLListDelFrm(&(warningSiCfgReqInfo->siPduLst), node); - SPutSBuf(reg, pool, (Data *)node,sizeof(CmLList)); + SCH_FREE(node,sizeof(CmLList)); node = NULLP; } @@ -1581,9 +1398,9 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo; if (freeNodeFound == FALSE) { - RLOG_ARG0(L_DEBUG,DBG_CELLID,cell->cellId,"No SI Index is free"); + DU_LOG("\nDEBUG --> SCH : No SI Index is free"); rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst); - SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo, + SCH_FREE(warningSiCfgReqInfo, sizeof(RgrWarningSiCfgReqInfo)); warningSiCfgReqInfo = NULLP; rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, siId, transId, @@ -1591,7 +1408,7 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo; return RFAILED; } - SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo, + SCH_FREE(warningSiCfgReqInfo, sizeof(RgrWarningSiCfgReqInfo)); warningSiCfgReqInfo = NULLP; return ROK; @@ -1613,28 +1430,10 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo; * @param[in] SpId siId * @return void **/ -#ifdef ANSI -Void rgSCHGomHndlWarningSiStopReq -( -Region reg, -Pool pool, -RgSchCb *instCb, -uint8_t siId, -RgrCfgTransId transId, -SpId spId -) -#else -Void rgSCHGomHndlWarningSiStopReq(reg, pool, instCb, siId, transId, spId) -Region reg; -Pool pool; -RgSchCb *instCb; -uint8_t siId; -RgrCfgTransId transId; -SpId spId; -#endif +Void rgSCHGomHndlWarningSiStopReq(Region reg,Pool pool,RgSchCb *instCb,uint8_t siId,RgrCfgTransId transId,SpId spId) { RgSchCellCb *cell = instCb->rgrSap[spId].cell; - uint16_t idx; + uint16_t idx; CmLList *node; RgSchWarningSiPdu *warningSiPdu; Buffer *pdu; @@ -1685,20 +1484,7 @@ SpId spId; * @return S16 * **/ -#ifdef ANSI -S16 rgSchUpdtRNTPInfo -( - RgSchCellCb *cell, - RgSchDlSf *sf, - RgrLoadInfReqInfo *loadInfReq - ) -#else -static Void rgSchUpdtRNTPInfo(cell, sf) - RgSchCellCb *cell; - RgSchDlSf *sf; - RgrLoadInfReqInfo *loadInfReq; - -#endif +S16 rgSchUpdtRNTPInfo(RgSchCellCb *cell,RgSchDlSf *sf,RgrLoadInfReqInfo *loadInfReq) { /* Initialise the variables */ RgSchSFRPoolInfo *sfrCCPool; @@ -1750,25 +1536,7 @@ static Void rgSchUpdtRNTPInfo(cell, sf) * -# ROK * -# RFAILED **/ -#ifdef ANSI -S16 rgSCHGomHndlLoadInf -( - Region reg, - Pool pool, - RgSchCb *instCb, - SpId spId, - RgrCfgTransId transId, - RgrLoadInfReqInfo *loadInfReq - ) -#else -S16 rgSCHGomHndlLoadInf(reg, pool, instCb, spId, transId, loadInfReq) - Region reg; - Pool pool; - RgSchCb *instCb; - SpId spId; - RgrCfgTransId transId; - RgrLoadInfReqInfo *loadInfReq; -#endif +S16 rgSCHGomHndlLoadInf(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTransId transId,RgrLoadInfReqInfo *loadInfReq) { S16 ret; RgSchCellCb *cell = instCb->rgrSap[spId].cell; @@ -1779,25 +1547,25 @@ S16 rgSCHGomHndlLoadInf(reg, pool, instCb, spId, transId, loadInfReq) /* check if cell does not exists */ if (((uint8_t *)cell == NULLP) || (cell->cellId != loadInfReq->cellId)) { - RLOG_ARG1(L_ERROR,DBG_CELLID,loadInfReq->cellId,"Cell Control block does not exist" + DU_LOG("\nERROR --> SCH : Cell Control block does not exist" "for load cellId:%d",loadInfReq->cellId); - SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq)); + SCH_FREE(loadInfReq, (Size)sizeof(*loadInfReq)); return RFAILED; } if (cell->lteAdvCb.dsfrCfg.status == RGR_DISABLE) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "rgSCHGomHndlLoadInf(): DSFR Feature not enabled"); - SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq)); + DU_LOG("\nERROR --> SCH : rgSCHGomHndlLoadInf(): DSFR Feature not enabled"); + SCH_FREE(loadInfReq, (Size)sizeof(*loadInfReq)); return RFAILED; } /* Validate the received LOAD INF Configuration */ ret = rgSCHCfgVldtRgrLoadInf(inst, loadInfReq, cell, &errInfo); if (ret != ROK) { - RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Rgr LOAD INF Configuration " + DU_LOG("\nERROR --> SCH : Rgr LOAD INF Configuration " "validation FAILED"); - SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq)); + SCH_FREE(loadInfReq, (Size)sizeof(*loadInfReq)); return RFAILED; } /* Update the RNTP info rcvd in the respective cell centre pool so that Phigh can be @@ -1810,7 +1578,7 @@ S16 rgSCHGomHndlLoadInf(reg, pool, instCb, spId, transId, loadInfReq) } } - SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq)); + SCH_FREE(loadInfReq, (Size)sizeof(*loadInfReq)); return ROK;