X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Frg_sch_pwr.c;h=3bf2a65c8b5fa0dfd2da2328a8f23bed71fdf96b;hb=9076bc05cb36d3ed99890b2e3f57f6d06f4a7e93;hp=497f7500af648997d5e8d66ff9e4cd58a74c53ba;hpb=3235ecfc7414aa0b72d0ad50db63ae8b5626045b;p=o-du%2Fl2.git diff --git a/src/5gnrsch/rg_sch_pwr.c b/src/5gnrsch/rg_sch_pwr.c index 497f7500a..3bf2a65c8 100755 --- a/src/5gnrsch/rg_sch_pwr.c +++ b/src/5gnrsch/rg_sch_pwr.c @@ -36,16 +36,7 @@ static const char* RLOG_MODULE_NAME="MAC"; static int RLOG_MODULE_ID=4096; static int RLOG_FILE_ID=188; /* 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_llist.h" /* common linked list library */ -#include "cm_err.h" /* common error */ -#include "cm_lte.h" /* common LTE */ -#include "cm_math.h" /* common MATH functions */ +#include "common_def.h" #include "lrg.h" #include "rgr.h" #include "rgm.h" @@ -57,16 +48,6 @@ static int RLOG_FILE_ID=188; #include "rg_sch_cmn.h" /* header/extern include files (.x) */ -#include "gen.x" /* general layer typedefs */ -#include "ssi.x" /* system services typedefs */ -#include "cm5.x" /* common timers */ -#include "cm_hash.x" /* common hash list */ -#include "cm_lib.x" /* common library */ -#include "cm_llist.x" /* common linked list */ -#include "cm_mblk.x" /* memory management */ -#include "cm_tkns.x" /* common tokens */ -#include "cm_lte.x" /* common tokens */ -#include "cm_math.x" /* common MATH functions */ #include "tfu.x" /* RGU types */ #include "lrg.x" /* layer management typedefs for MAC */ #include "rgr.x" /* layer management typedefs for MAC */ @@ -388,12 +369,12 @@ PRIVATE S8 rgSCHPwrGetPCMaxValFromPCMax ARGS(( * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrInit +Void rgSCHPwrInit ( Void ) #else -PUBLIC Void rgSCHPwrInit() +Void rgSCHPwrInit() #endif { U8 idx; @@ -433,7 +414,7 @@ U8 cqi; { TRC2(rgSCHPwrGetCqiPwr); - RETVALUE(rgSchPwrCqiToPwrTbl[cqi]); + return (rgSchPwrCqiToPwrTbl[cqi]); } /* rgSCHPwrGetCqiPwr */ /*********************************************************** @@ -469,9 +450,9 @@ U8 cqi; if (!uePwr->deltaMcsEnbld) { - RETVALUE(0); + return (0); } - RETVALUE(rgSCHPwrGetCqiPwr(cqi)); + return (rgSCHPwrGetCqiPwr(cqi)); } /* rgSCHPwrGetCqiPwrForUe */ /*********************************************************** @@ -503,8 +484,8 @@ U32 eff; TRC2(rgSCHPwrCalcEfficncyPwr); if (tmp <= 0) - RETVALUE(0); - RETVALUE((S8)(10 * cmLog10(tmp))); + return (0); + return ((S8)(10 * cmLog10(tmp))); } /* rgSCHPwrCalcEfficncyPwr */ @@ -531,13 +512,13 @@ U32 eff; * @return U8 **/ #ifdef ANSI -PUBLIC U8 rgSCHPwrPuschTpcForUe +U8 rgSCHPwrPuschTpcForUe ( RgSchCellCb *cell, RgSchUeCb *ue ) #else -PUBLIC U8 rgSCHPwrPuschTpcForUe(cell, ue) +U8 rgSCHPwrPuschTpcForUe(cell, ue) RgSchCellCb *cell; RgSchUeCb *ue; #endif @@ -548,7 +529,7 @@ RgSchUeCb *ue; TRC2(rgSCHPwrPuschTpcForUe); rgSCHPwrOnSchedPuschTpc(cell, ue); - RETVALUE(uePwr->puschTpc); + return (uePwr->puschTpc); } /** @@ -574,13 +555,13 @@ RgSchUeCb *ue; * @return Void **/ #ifdef ANSI -PUBLIC U8 rgSCHPwrGetMaxUlRb +U8 rgSCHPwrGetMaxUlRb ( RgSchCellCb *cell, RgSchUeCb *ue ) #else -PUBLIC U8 rgSCHPwrGetMaxUlRb(cell, ue) +U8 rgSCHPwrGetMaxUlRb(cell, ue) RgSchCellCb *cell; RgSchUeCb *ue; #endif @@ -590,7 +571,7 @@ RgSchUeCb *ue; rgSCHPwrPuschCntrl(cell, ue); /* This stores tpc, delta and maxRb * in uePwr */ - RETVALUE(uePwr->maxUlRbs); + return (uePwr->maxUlRbs); } /** @@ -725,13 +706,13 @@ RgSchUeCb *ue; * @return U8 **/ #ifdef ANSI -PUBLIC U8 rgSCHPwrPucchTpcForUe +U8 rgSCHPwrPucchTpcForUe ( RgSchCellCb *cell, RgSchUeCb *ue ) #else -PUBLIC U8 rgSCHPwrPucchTpcForUe(cell, ue) +U8 rgSCHPwrPucchTpcForUe(cell, ue) RgSchCellCb *cell; RgSchUeCb *ue; #endif @@ -740,7 +721,7 @@ RgSchUeCb *ue; TRC2(rgSCHPwrPucchTpcForUe); rgSCHPwrPucchCntrl(cell, ue); - RETVALUE(uePwr->pucchTpc); + return (uePwr->pucchTpc); } /*********************************************************** @@ -791,9 +772,9 @@ RgSchCellCb *cell; if (uePwr->maxPwrDeltaByPhr < 0 && (trgCqi - crntCqi) * RG_SCH_UL_CQI_DB_STEP_2 > 0) { - RETVALUE(0); + return (0); } - RETVALUE(RGSCH_MIN(uePwr->maxPwrDeltaByPhr, + return (RGSCH_MIN(uePwr->maxPwrDeltaByPhr, (trgCqi - crntCqi) * RG_SCH_UL_CQI_DB_STEP_2)); } /* rgSCHPwrGetDelta2FrmCqi */ @@ -884,13 +865,13 @@ S8 pwr; /* Give 4 RBS so that UE can report changed power status*/ /* [ccpu00119916] Mod -return 0th index of rgSchPwrToRbTbl when pwr <=0 * Change the Macros from RGSCH_MAX_DL_BW to RGSCH_MAX_UL_BW*/ - RETVALUE(rgSchPwrToRbTbl[0]); + return (rgSchPwrToRbTbl[0]); } if (pwr > rgSchPwrRbToPwrTbl[cellUl->maxUlBwPerUe]) { - RETVALUE(cellUl->maxUlBwPerUe); + return (cellUl->maxUlBwPerUe); } - RETVALUE(RGSCH_MIN(cellUl->maxUlBwPerUe,rgSchPwrToRbTbl[(U8)pwr])); + return (RGSCH_MIN(cellUl->maxUlBwPerUe,rgSchPwrToRbTbl[(U8)pwr])); } /* rgSCHPwrGetMaxRb */ /*********************************************************** @@ -929,7 +910,7 @@ U8 numRb; numRb = cellUl->maxUlBwPerUe; } #endif - RETVALUE(rgSchPwrRbToPwrTbl[numRb]); + return (rgSchPwrRbToPwrTbl[numRb]); } /* rgSCHPwrRbToPwr */ @@ -1018,13 +999,13 @@ RgSchUeCb *ue; * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrGrpCntrlPucch +Void rgSCHPwrGrpCntrlPucch ( RgSchCellCb *cell, RgSchDlSf *dlSf ) #else -PUBLIC Void rgSCHPwrGrpCntrlPucch(cell, dlSf) +Void rgSCHPwrGrpCntrlPucch(cell, dlSf) RgSchCellCb *cell; RgSchDlSf *dlSf; #endif @@ -1101,14 +1082,14 @@ RgSchDlSf *dlSf; * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrGrpCntrlPusch +Void rgSCHPwrGrpCntrlPusch ( RgSchCellCb *cell, RgSchDlSf *dlSf, RgSchUlSf *ulSf ) #else -PUBLIC Void rgSCHPwrGrpCntrlPusch(cell, dlSf, ulSf) +Void rgSCHPwrGrpCntrlPusch(cell, dlSf, ulSf) RgSchCellCb *cell; RgSchDlSf *dlSf; RgSchUlSf *ulSf; @@ -1867,7 +1848,7 @@ RgSchDlSf *sf; if (proc == NULLP) { - RETVALUE(FALSE); + return (FALSE); } /* @@ -1880,8 +1861,8 @@ RgSchDlSf *sf; * 10 subframes, which would have otherwise caused * the check to succeed for a possibly older process. */ - if ((proc->tbInfo[0].timingInfo.subframe == sf->sfNum) || - (proc->tbInfo[1].timingInfo.subframe == sf->sfNum)) + if ((proc->tbInfo[0].timingInfo.slot == sf->sfNum) || + (proc->tbInfo[1].timingInfo.slot == sf->sfNum)) { /* * Later, if a proc can be scheduled without having an @@ -1892,11 +1873,11 @@ RgSchDlSf *sf; * Checking for PDCCH would have to be in common proc * the way things are now. */ - RETVALUE(TRUE); + return (TRUE); } else { - RETVALUE(FALSE); + return (FALSE); } } /* rgSCHPwrIsDlUeSched */ @@ -1937,17 +1918,17 @@ RgSchUlSf *sf; #if (ERRCLASS & ERRCLS_DEBUG) if( proc == NULLP ) { - RETVALUE (FALSE); + return (FALSE); } #endif if (proc->alloc) { - RETVALUE(TRUE); + return (TRUE); } else { - RETVALUE(FALSE); + return (FALSE); } } /* rgSCHPwrIsUlUeSched */ @@ -1987,14 +1968,14 @@ RgSchUlSf *sf; * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrPucchDeltaInd +Void rgSCHPwrPucchDeltaInd ( RgSchCellCb *cell, RgSchUeCb *ue, S8 pwrDelta ) #else -PUBLIC Void rgSCHPwrPucchDeltaInd(cell, ue, pwrDelta) +Void rgSCHPwrPucchDeltaInd(cell, ue, pwrDelta) RgSchCellCb *cell; RgSchUeCb *ue; S8 pwrDelta; @@ -2180,7 +2161,7 @@ RgSchUeCb *ue; * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrUpdExtPhr +Void rgSCHPwrUpdExtPhr ( RgSchCellCb *cell, RgSchUeCb *ue, @@ -2188,7 +2169,7 @@ RgInfExtPhrCEInfo *extPhr, RgSchCmnAllocRecord *allocInfo ) #else -PUBLIC Void rgSCHPwrUpdExtPhr(cell, ue, extPhr, allocInfo) +Void rgSCHPwrUpdExtPhr(cell, ue, extPhr, allocInfo) RgSchCellCb *cell; RgSchUeCb *ue; RgInfExtPhrCEInfo *extPhr; @@ -2257,7 +2238,7 @@ RgSchCmnAllocRecord *allocInfo; * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrUpdPhr +Void rgSCHPwrUpdPhr ( RgSchCellCb *cell, RgSchUeCb *ue, @@ -2266,7 +2247,7 @@ RgSchCmnAllocRecord *allocInfo, S8 maxUePwr ) #else -PUBLIC Void rgSCHPwrUpdPhr(cell, ue, phr, allocInfo, maxUePwr) +Void rgSCHPwrUpdPhr(cell, ue, phr, allocInfo, maxUePwr) RgSchCellCb *cell; RgSchUeCb *ue; U8 phr; @@ -2335,13 +2316,13 @@ S8 maxUePwr; * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrUlCqiInd +Void rgSCHPwrUlCqiInd ( RgSchCellCb *cell, RgSchUeCb *ue ) #else -PUBLIC Void rgSCHPwrUlCqiInd(cell, ue) +Void rgSCHPwrUlCqiInd(cell, ue) RgSchCellCb *cell; RgSchUeCb *ue; #endif @@ -2416,14 +2397,14 @@ RgSchUeCb *ue; * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrRecordRbAlloc +Void rgSCHPwrRecordRbAlloc ( RgSchCellCb *cell, RgSchUeCb *ue, U8 numRb ) #else -PUBLIC Void rgSCHPwrRecordRbAlloc(cell, ue, numRb) +Void rgSCHPwrRecordRbAlloc(cell, ue, numRb) RgSchCellCb *cell; RgSchUeCb *ue; U8 numRb; @@ -2470,13 +2451,13 @@ U8 numRb; * -# RFAILED **/ #ifdef ANSI -PUBLIC S16 rgSCHPwrCellCfg +S16 rgSCHPwrCellCfg ( RgSchCellCb *cell, RgrCellCfg *cfg ) #else -PUBLIC S16 rgSCHPwrCellCfg(cell, cfg) +S16 rgSCHPwrCellCfg(cell, cfg) RgSchCellCb *cell; RgrCellCfg *cfg; #endif @@ -2502,7 +2483,7 @@ RgrCellCfg *cfg; || (cfg->pwrCfg.puschPwrFmt3.size + cfg->pwrCfg.puschPwrFmt3a.size > RG_SCH_CMN_MAX_NUM_TPC_PUSCH_RNTI)) { - RETVALUE(RFAILED); + return RFAILED; } /* Now initialise TPC RNTIs */ @@ -2543,7 +2524,7 @@ RgrCellCfg *cfg; rgSCHPwrAddRntiToPuschRntiLst(cell, rnti, isFmt3a); } - RETVALUE(ROK); + return ROK; } /** @@ -2562,13 +2543,13 @@ RgrCellCfg *cfg; * -# ROK **/ #ifdef ANSI -PUBLIC S16 rgSCHPwrCellRecfg +S16 rgSCHPwrCellRecfg ( RgSchCellCb *cell, RgrCellRecfg *recfg ) #else -PUBLIC S16 rgSCHPwrCellRecfg(cell, recfg) +S16 rgSCHPwrCellRecfg(cell, recfg) RgSchCellCb *cell; RgrCellRecfg *recfg; #endif @@ -2579,7 +2560,7 @@ RgrCellRecfg *recfg; /* Not doing anything for power reconfig, so such structure * in RGR */ - RETVALUE(ROK); + return ROK; } /** @@ -2596,12 +2577,12 @@ RgrCellRecfg *recfg; * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrCellDel +Void rgSCHPwrCellDel ( RgSchCellCb *cell ) #else -PUBLIC Void rgSCHPwrCellDel(cell) +Void rgSCHPwrCellDel(cell) RgSchCellCb *cell; #endif { @@ -2629,14 +2610,14 @@ RgSchCellCb *cell; * -# RFAILED **/ #ifdef ANSI -PUBLIC S16 rgSCHPwrUeSCellCfg +S16 rgSCHPwrUeSCellCfg ( RgSchCellCb *cell, RgSchUeCb *ue, RgrUeSecCellCfg *sCellInfoCfg ) #else -PUBLIC S16 rgSCHPwrUeSCellCfg(cell, ue, sCellInfoCfg) +S16 rgSCHPwrUeSCellCfg(cell, ue, sCellInfoCfg) RgSchCellCb *cell; RgSchUeCb *ue; RgrUeSecCellCfg *sCellInfoCfg; @@ -2677,7 +2658,7 @@ RgrUeSecCellCfg *sCellInfoCfg; } uePwr->p0UePusch = sCellInfoCfg->ueSCellUlDedPwrCfg.p0UePusch; - RETVALUE(ROK); + return ROK; } #endif @@ -2718,14 +2699,14 @@ RgrUeSecCellCfg *sCellInfoCfg; * -# RFAILED **/ #ifdef ANSI -PUBLIC S16 rgSCHPwrUeCfg +S16 rgSCHPwrUeCfg ( RgSchCellCb *cell, RgSchUeCb *ue, RgrUeCfg *cfg ) #else -PUBLIC S16 rgSCHPwrUeCfg(cell, ue, cfg) +S16 rgSCHPwrUeCfg(cell, ue, cfg) RgSchCellCb *cell; RgSchUeCb *ue; RgrUeCfg *cfg; @@ -2752,7 +2733,7 @@ RgrUeCfg *cfg; * config happens in the function below */ ret = rgSCHPwrApplyUePwrCfg(cell, ue, &cfg->ueUlPwrCfg); - RETVALUE(ret); + return (ret); } /** @@ -2781,14 +2762,14 @@ RgrUeCfg *cfg; * -# RFAILED **/ #ifdef ANSI -PUBLIC S16 rgSCHPwrUeRecfg +S16 rgSCHPwrUeRecfg ( RgSchCellCb *cell, RgSchUeCb *ue, RgrUeRecfg *recfg ) #else -PUBLIC S16 rgSCHPwrUeRecfg(cell, ue, recfg) +S16 rgSCHPwrUeRecfg(cell, ue, recfg) RgSchCellCb *cell; RgSchUeCb *ue; RgrUeRecfg *recfg; @@ -2810,7 +2791,7 @@ RgrUeRecfg *recfg; } ret = rgSCHPwrApplyUePwrCfg(cell, ue, &recfg->ueUlPwrRecfg); - RETVALUE(ret); + return (ret); } /*********************************************************** @@ -2857,13 +2838,13 @@ RgrUeUlPwrCfg *pwrCfg; rgSCHPwrGetPucchRntiCb(cell, pwrCfg->uePucchPwr.tpcRnti); if (pucchRntiCb == NULLP) { - RETVALUE(RFAILED); + return RFAILED; } pucchIdx = pwrCfg->uePucchPwr.idx; ret = rgSCHPwrChkPucchTpcRntiIdx(pucchRntiCb, pucchIdx); if (ret != ROK) { - RETVALUE(ret); + return (ret); } } @@ -2874,13 +2855,13 @@ RgrUeUlPwrCfg *pwrCfg; rgSCHPwrGetPuschRntiCb(cell, pwrCfg->uePuschPwr.tpcRnti); if (puschRntiCb == NULLP) { - RETVALUE(RFAILED); + return RFAILED; } puschIdx = pwrCfg->uePuschPwr.idx; ret = rgSCHPwrChkPuschTpcRntiIdx(puschRntiCb, puschIdx); if (ret != ROK) { - RETVALUE(ret); + return (ret); } } @@ -2960,7 +2941,7 @@ RgrUeUlPwrCfg *pwrCfg; uePwr->p0UePusch = pwrCfg->p0UePusch; uePwr->p0UePucch = pwrCfg->p0UePucch; - RETVALUE(ROK); + return ROK; } @@ -2991,13 +2972,13 @@ RgrUeUlPwrCfg *pwrCfg; * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrUeDel +Void rgSCHPwrUeDel ( RgSchCellCb *cell, RgSchUeCb *ue ) #else -PUBLIC Void rgSCHPwrUeDel(cell, ue) +Void rgSCHPwrUeDel(cell, ue) RgSchCellCb *cell; RgSchUeCb *ue; #endif @@ -3037,13 +3018,13 @@ RgSchUeCb *ue; * @return Void **/ #ifdef ANSI -PUBLIC Void rgSCHPwrUeReset +Void rgSCHPwrUeReset ( RgSchCellCb *cell, RgSchUeCb *ue ) #else -PUBLIC Void rgSCHPwrUeReset(cell, ue) +Void rgSCHPwrUeReset(cell, ue) RgSchCellCb *cell; RgSchUeCb *ue; #endif @@ -3345,16 +3326,16 @@ CmLteRnti tpcRnti; if (!cellPwr->tpcPucchRntiCnt) { - RETVALUE(NULLP); + return (NULLP); } for (idx = 0; idx < cellPwr->tpcPucchRntiCnt; ++idx) { if (cellPwr->tpcPucchRntiLst[idx].tpcRnti == tpcRnti) { - RETVALUE(&cellPwr->tpcPucchRntiLst[idx]); + return (&cellPwr->tpcPucchRntiLst[idx]); } } - RETVALUE(NULLP); + return (NULLP); } /*********************************************************** @@ -3390,16 +3371,16 @@ CmLteRnti tpcRnti; if (!cellPwr->tpcPuschRntiCnt) { - RETVALUE(NULLP); + return (NULLP); } for (idx = 0; idx < cellPwr->tpcPuschRntiCnt; ++idx) { if (cellPwr->tpcPuschRntiLst[idx].tpcRnti == tpcRnti) { - RETVALUE(&cellPwr->tpcPuschRntiLst[idx]); + return (&cellPwr->tpcPuschRntiLst[idx]); } } - RETVALUE(NULLP); + return (NULLP); } @@ -3987,13 +3968,13 @@ U8 idx; if (rgSCHPwrChkTpcRntiIdx(cb, idx) != ROK) { - RETVALUE(RFAILED); + return RFAILED; } if (rgSCHPwrChkUniqPucchTpcRntiIdx(cb, idx) != ROK) { - RETVALUE(RFAILED); + return RFAILED; } - RETVALUE(ROK); + return ROK; } /*********************************************************** @@ -4027,13 +4008,13 @@ U8 idx; if (rgSCHPwrChkTpcRntiIdx(cb, idx) != ROK) { - RETVALUE(RFAILED); + return RFAILED; } if (rgSCHPwrChkUniqPuschTpcRntiIdx(cb, idx) != ROK) { - RETVALUE(RFAILED); + return RFAILED; } - RETVALUE(ROK); + return ROK; } /*********************************************************** @@ -4070,10 +4051,10 @@ U8 idx; RgSchCmnUeUlPwrCb *uePwr = RG_SCH_PWR_GETUEPWR(ue, ue->cell); if (uePwr->pucchIdx == idx) { - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ROK); + return ROK; } /*********************************************************** @@ -4110,10 +4091,10 @@ U8 idx; RgSchCmnUeUlPwrCb *uePwr = RG_SCH_PWR_GETUEPWR(ue, ue->cell); if (uePwr->puschIdx == idx) { - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ROK); + return ROK; } /*********************************************************** @@ -4147,17 +4128,17 @@ U8 idx; { if (idx >= TFU_MAX_1BIT_TPC) { - RETVALUE(RFAILED); + return RFAILED; } } else { if (idx >= TFU_MAX_2BIT_TPC) { - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ROK); + return ROK; } /* Warning Fix: Commenting out as not used */ @@ -4187,7 +4168,7 @@ U8 pCMax; #endif { TRC2(rgSCHPwrGetPCMaxValFromPCMax); - RETVALUE((pCMax & 63) - 30); + return ((pCMax & 63) - 30); } @@ -4218,7 +4199,7 @@ U8 phr; #endif { TRC2(rgSCHPwrGetPhValFromPhr); - RETVALUE((phr & 63) - 23); + return ((phr & 63) - 23); }