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 "rg.x"
#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 */
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
-PUBLIC S16 rgCOMCfgReq
+S16 rgCOMCfgReq
(
Inst inst,
CrgCfgTransId transId,
CrgCfgReqInfo *crgCfgReq
)
-#else
-PUBLIC 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)
{
}
default:
{
- RLOG1(L_ERROR, "Invalid configuration action %d",
- crgCfgReq->action);
+ DU_LOG("\nERROR --> MAC : Invalid configuration action %d",
+ crgCfgReq->action);
ret = RFAILED;
}
#ifdef LTE_ADV
}
#endif
- RGDBGINFO(inst,(rgPBuf(inst), "CRG Configuration request processed\n"));
- RETVALUE(ret);
+ DU_LOG("\nINFO --> MAC : CRG Configuration request processed\n");
+ return (ret);
} /* rgCOMCfgReq */
/**
* @brief Handler for processing Cell/Ue/Logical channel configuration request
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
-PRIVATE S16 rgCOMHndlCfgReq
+static S16 rgCOMHndlCfgReq
(
Inst inst,
CrgCfg *cfg,
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 */
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");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Cell configuration validation FAILED\n");
+ return RFAILED;
}
ret = rgCFGCrgCellCfg(inst,&cfg->u.cellCfg, errInfo);
break;
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");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : UE configuration validation FAILED\n");
+ return RFAILED;
}
ret = rgCFGCrgUeCfg(inst,cell, &cfg->u.ueCfg, errInfo);
}
if (ret != ROK)
{
- RLOG_ARG1(L_ERROR,DBG_CELLID,cfg->u.cellCfg.cellId,
- "LC configuration validation FAILED: LC %d\n", cfg->u.lchCfg.lcId);
- RETVALUE(RFAILED);
+ 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);
break;
}
default:
{
- RLOG1(L_ERROR, "Should never come here: cfgType %d",cfg->cfgType);
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Should never come here: cfgType %d",cfg->cfgType);
+ return RFAILED;
}
}
- RETVALUE(ret);
+ return (ret);
} /* rgCOMHndlCfgReq */
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
-PRIVATE S16 rgCOMHndlRecfgReq
+static S16 rgCOMHndlRecfgReq
(
Inst inst,
CrgRecfg *recfg,
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 */
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");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Cell Recfg Validation FAILED");
+ return RFAILED;
}
ret = rgCFGCrgCellRecfg(inst,cell, &recfg->u.cellRecfg, errInfo);
break;
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));
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : [%d]UE SCell configuration FAILED for inst [%d]\n",
+ recfg->u.ueRecfg.oldCrnti, inst);
+ return RFAILED;
}
}
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);
- RETVALUE(RFAILED);
+ return RFAILED;
}
ret = rgCFGCrgUeRecfg(inst,cell, ue, &recfg->u.ueRecfg, errInfo);
}
&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);
- 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,
}
default:
{
- RLOG1(L_ERROR, "Should never come here: recfgType %d",
+ DU_LOG("\nERROR --> MAC : Should never come here: recfgType %d",
recfg->recfgType);
- RETVALUE(RFAILED);
+ return RFAILED;
}
}
- RETVALUE(ret);
+ return (ret);
} /* rgCOMHndlRecfgReq */
/*Start: LTEMAC_2.1_DEV_CFG */
* -# 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"));
- RETVALUE(ROK);
+ DU_LOG("\nINFO --> MAC : CRG UE Reset processed \n");
+ return ROK;
} /* rgCOMHndlResetReq */
/*End: LTEMAC_2.1_DEV_CFG */
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
-PRIVATE S16 rgCOMHndlDelReq
+static S16 rgCOMHndlDelReq
(
Inst inst,
CrgDel *del,
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 */
/*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);
}
default:
{
- RLOG1(L_ERROR, "Should never come here: delType %d",
+ DU_LOG("\nERROR --> MAC : Should never come here: delType %d",
del->delType);
- RETVALUE(RFAILED);
+ return RFAILED;
}
}
- RETVALUE(ret);
+ return (ret);
} /* rgCOMHndlDelReq */
#ifdef LTE_ADV
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
-PUBLIC S16 RgPrgPMacSMacUeSCellCfgReq
+S16 RgPrgPMacSMacUeSCellCfgReq
(
Pst *pst,
RgPrgUeSCellCfgInfo *ueSCellCb
)
-#else
-PUBLIC S16 RgPrgPMacSMacUeSCellCfgReq(pst, ueSCellCb)
-Pst *pst;
-RgPrgUeSCellCfgInfo *ueSCellCb;
-#endif
{
RgPrgCfgCfmInfo cfgCfm;
Inst inst = pst->dstInst;
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;
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;
}
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);
- RETVALUE(ROK);
+ return ROK;
} /* RgPrgPMacSMacUeSCellCfgReq */
/**
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
-PUBLIC S16 RgPrgSMacPMacCfgCfm
+S16 RgPrgSMacPMacCfgCfm
(
Pst *pst,
RgPrgCfgCfmInfo *cfgCfm
)
-#else
-PUBLIC 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));
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : [%d]UE does not exist\n", cfgCfm->ueId);
+ return RFAILED;
}
switch(cfgCfm->event)
{
/* 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;
/* 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);
- RETVALUE(RFAILED);
+ return RFAILED;
}
}
- RETVALUE(ROK);
+ return ROK;
} /* RgPrgSMacPMacCfgCfm */
/**
* @param[in] RgPrgUeSCellDelInfo *ueSCellDelInfo
* @return ROK is SUCCESS
**/
-#ifdef ANSI
-PUBLIC S16 RgPrgPMacSMacUeSCellDelReq
+S16 RgPrgPMacSMacUeSCellDelReq
(
Pst *pst,
RgPrgUeSCellDelInfo *ueSCellDelInfo
)
-#else
-PUBLIC 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)
{
- 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);
+ DU_LOG("\nERROR --> MAC : [%d]UE:does not exist in sCell(%d)\n",
+ ueSCellDelInfo->ueId, sCell->cellId);
+ return RFAILED;
}
/*PMAC_Reest: ueId and newRnti is different that means its a UeId change
/* 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));
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : [%d]UE:UE context already exist in\
+ sCell(%d)",ueSCellDelInfo->newRnti, sCell->cellId);
+ return RFAILED;
}
rgDBMDelUeCb(sCell, sCellUe);
rgCFGFreeUeCb(sCell, sCellUe);
}
- RETVALUE(ROK);
+ return ROK;
} /* RgPrgPMacSMacUeSCellDelReq */
#endif /*LTE_ADV */
/**********************************************************************