@brief This file implements utility functions for LTE MAC
*/
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_MODULE_ID=4096;
-static int RLOG_FILE_ID=179;
/* header include files (.h) */
-#include "envopt.h" /* environment options */
-#include "envdep.h" /* environment dependent */
-#include "envind.h" /* environment independent */
-
-#include "gen.h" /* general */
-#include "ssi.h" /* system services */
-#include "cm_tkns.h" /* Common Token Defines */
-#include "cm_llist.h" /* Common Link List Defines */
-#include "cm_hash.h" /* Common Hash List Defines */
-#include "cm_mblk.h" /* common memory link list library */
-#include "cm_lte.h" /* Common LTE */
-
+#include "common_def.h"
#include "rg_env.h" /* MAC Environment Defines */
#include "crg.h" /* CRG Interface defines */
#include "rgu.h" /* RGU Interface defines */
#include "rg_err.h" /* MAC error defines */
/* header/extern include files (.x) */
-#include "gen.x" /* general */
-#include "ssi.x" /* system services */
#include "cm5.x" /* Timer */
-#include "cm_tkns.x" /* Common Token Definitions */
-#include "cm_llist.x" /* Common Link List Definitions */
-#include "cm_lib.x" /* Common Library Definitions */
-#include "cm_hash.x" /* Common Hash List Definitions */
-#include "cm_mblk.x" /* common memory link list library */
-#include "cm_lte.x" /* Common LTE */
#include "crg.x" /* CRG Interface includes */
#include "rgu.x" /* RGU Interface includes */
#include "lrg.x" /* LRG Interface includes */
#include "rg_prg.x" /* PRG(MAC-MAC) Interface includes */
+#include "du_app_mac_inf.h"
#include "rg.x" /* MAC includes */
/* local defines */
/* local externs */
/* forward references */
-PRIVATE S16 rgUtlHndlCrntiChng ARGS((
+static S16 rgUtlHndlCrntiChng ARGS((
Inst inst,
RgCellCb *cell,
CmLteRnti rnti,
CmLteRnti newRnti
));
-PRIVATE Void rgUtlHndlCrntiRls ARGS((
+static Void rgUtlHndlCrntiRls ARGS((
RgCellCb *cell,
RgInfRlsRnti *rlsRnti
));
-PUBLIC S16 rgDelUeFrmAllSCell ARGS((
+S16 rgDelUeFrmAllSCell ARGS((
RgCellCb *cell,
RgUeCb *ue
));
#ifdef LTE_ADV
-PRIVATE S16 rgUtlSndCrntiChngReq2AllSMacs ARGS((
+static S16 rgUtlSndCrntiChngReq2AllSMacs ARGS((
RgCellCb *cell,
CmLteRnti rnti,
CmLteRnti newRnti
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC S16 rgAllocShrablSBuf
+S16 rgAllocShrablSBuf
(
Inst inst,
Data **pData, /* Pointer of the data to be returned */
Size size /* size */
)
-#else
-PUBLIC S16 rgAllocShrablSBuf(inst,pData, size)
-Inst inst;
-Data **pData; /* Pointer of the data to be returned */
-Size size; /* size */
-#endif
{
RgUstaDgn dgn; /* Alarm diagnostics structure */
- TRC2(rgAllocShrablSBuf)
-
/* Initialize the param to NULLP */
*pData = NULLP;
if (size == 0)
{
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* allocate buffer */
/* Send an alarm to Layer Manager */
rgLMMStaInd(inst,LCM_CATEGORY_RESOURCE, LCM_EVENT_SMEM_ALLOC_FAIL,
LCM_CAUSE_MEM_ALLOC_FAIL, &dgn);
- RGLOGERROR(inst,ERRCLS_DEBUG, ERG028, 0, "Unable to Allocate Buffer");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Unable to Allocate Buffer");
+ return RFAILED;
}
#ifndef ALIGN_64BIT
- RGDBGINFO(inst,(rgPBuf(inst), "SGetSBuf(Region (%d), Pool (%d), Size (%ld)), Data (0x%p))\n",
- rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, size, *pData));
+ DU_LOG("\nDEBUG --> MAC : SGetSBuf(Region (%d), Pool (%d), Size (%ld)), Data (0x%p))\n",
+ rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, size, *pData);
#else
- RGDBGINFO(inst,(rgPBuf(inst), "SGetSBuf(Region (%d), Pool (%d), Size (%d)), Data (0x%p))\n",
- rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, size, *pData));
+ DU_LOG("\nDEBUG --> MAC : SGetSBuf(Region (%d), Pool (%d), Size (%d)), Data (0x%p))\n",
+ rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, size, *pData);
#endif
/* zero out the allocated memory */
- cmMemset((U8 *)*pData, 0x00, size);
+ memset(*pData, 0x00, size);
- RETVALUE(ROK);
+ return ROK;
} /* end of rgAllocSBuf */
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC S16 rgAllocSBuf
+S16 rgAllocSBuf
(
Inst inst,
Data **pData, /* Pointer of the data to be returned */
Size size /* size */
)
-#else
-PUBLIC S16 rgAllocSBuf(inst,pData, size)
-Inst inst;
-Data **pData; /* Pointer of the data to be returned */
-Size size; /* size */
-#endif
{
RgUstaDgn dgn; /* Alarm diagnostics structure */
- TRC2(rgAllocSBuf)
-
/* Initialize the param to NULLP */
*pData = NULLP;
if (size == 0)
{
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* allocate buffer */
/* Send an alarm to Layer Manager */
rgLMMStaInd(inst,LCM_CATEGORY_RESOURCE, LCM_EVENT_SMEM_ALLOC_FAIL,
LCM_CAUSE_MEM_ALLOC_FAIL, &dgn);
- RGLOGERROR(inst,ERRCLS_DEBUG, ERG028, 0, "Unable to Allocate Buffer");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Unable to Allocate Buffer");
+ return RFAILED;
}
/* zero out the allocated memory */
- cmMemset((U8 *)*pData, 0x00, size);
+ memset(*pData, 0x00, size);
- RETVALUE(ROK);
+ return ROK;
} /* end of rgAllocSBuf */
* previously allocated by rgAllocSBuf() and size. It
* deallocates the memory.
*
-* Ret: RETVOID
+* Ret: void
*
* Notes: ccpu00117052 - MOD- changed the Data parameter from
* pointer to address of pointer so that
*
* File: rg_utl.c
*/
-#ifdef ANSI
-PUBLIC Void rgFreeSharableSBuf
+Void rgFreeSharableSBuf
(
Inst inst,
Data **data, /* address of pointer to data */
Size size /* size */
)
-#else
-PUBLIC Void rgFreeSharableSBuf(inst,data, size)
-Inst inst;
-Data **data; /* address of pointer to data */
-Size size; /* size */
-#endif
{
S16 ret;
- TRC2(rgFreeSharableBuf)
-
if ((data == NULLP) || (*data == NULLP) || (size == 0))
{
- RETVOID;
+ return;
}
/* Deallocate buffer */
if (ret != ROK)
{
- RETVOID;
+ return;
}
*data = NULLP;
- RETVOID;
+ return;
} /* end of rgFreeSharableBuf */
* previously allocated by rgAllocSBuf() and size. It
* deallocates the memory.
*
-* Ret: RETVOID
+* Ret: void
*
* Notes: ccpu00117052 - MOD- changed the Data parameter from
* pointer to address of pointer so that
*
* File: rg_utl.c
*/
-#ifdef ANSI
-PUBLIC Void rgFreeSBuf
+Void rgFreeSBuf
(
Inst inst,
Data **data, /* address of pointer to data */
Size size /* size */
)
-#else
-PUBLIC Void rgFreeSBuf(inst,data, size)
-Inst inst;
-Data **data; /* address of pointer to data */
-Size size; /* size */
-#endif
{
S16 ret;
- TRC2(rgFreeSBuf)
-
if ((data == NULLP) || (*data == NULLP) || (size == 0))
{
- RETVOID;
+ return;
}
if (ret != ROK)
{
- RGLOGERROR(inst,ERRCLS_DEBUG, ERG029, (ErrVal) 0, "rgFreeSBuf failed.\n");
- RETVOID;
+ DU_LOG("\nERROR --> MAC : rgFreeSBuf failed.\n");
+ return;
}
*data = NULLP;
- RETVOID;
+ return;
} /* end of rgFreeSBuf */
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC S16 rgGetMsg
+S16 rgGetMsg
(
Inst inst,
Buffer **mBuf /* Message Buffer pointer be returned */
)
-#else
-PUBLIC S16 rgGetMsg(inst,mBuf)
-Inst inst;
-Buffer **mBuf; /* Message Buffer pointer be returned */
-#endif
{
S16 ret;
- TRC2(rgGetMsg)
-
#ifdef MS_MBUF_CORRUPTION /* Should be enabled when debugging mbuf corruption */
MS_BUF_ADD_ALLOC_CALLER();
#endif /* */
/* Send an alarm to Layer Manager */
rgLMMStaInd(inst,LCM_CATEGORY_RESOURCE, LCM_EVENT_DMEM_ALLOC_FAIL,
LCM_CAUSE_MEM_ALLOC_FAIL, &dgn);
- RGLOGERROR(inst,ERRCLS_DEBUG, ERG030, 0, "Unable to Allocate Buffer");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Unable to Allocate Buffer");
+ return RFAILED;
}
- RETVALUE(ROK);
+ return ROK;
} /* end of rgGetMsg */
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC Void rgFillDgnParams
+Void rgFillDgnParams
(
Inst inst,
RgUstaDgn *dgn,
-U8 dgnType
+uint8_t dgnType
)
-#else
-PUBLIC Void rgFillDgnParams(inst,dgn, dgnType)
-Inst inst;
-RgUstaDgn *dgn;
-U8 dgnType;
-#endif
{
- TRC2(rgFillDgnParams)
-
switch(dgnType)
{
case LRG_USTA_DGNVAL_MEM:
- dgn->type = (U8) LRG_USTA_DGNVAL_MEM;
+ dgn->type = (uint8_t) LRG_USTA_DGNVAL_MEM;
dgn->u.mem.region = rgCb[inst].rgInit.region;
dgn->u.mem.pool = rgCb[inst].rgInit.pool;
break;
break;
}
- RETVOID;
+ return;
} /* end of rgFillDgnParams */
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC Void rgUpdtRguDedSts
+Void rgUpdtRguDedSts
(
Inst inst,
-RgUpSapCb *rguDlSap,
-U8 stsType, /* Statistics type to update */
+RgUpSapCb *rguDlSap,
+uint8_t stsType, /* Statistics type to update */
RgRguDedDatReq *datReq /* DatReq pointer */
)
-#else
-PUBLIC Void rgUpdtRguDedSts(inst,rguDlSap,stsType, datReq)
-Inst inst;
-RgUpSapCb *rguDlSap;
-U8 stsType; /* Statistics type to update */
-RgRguDedDatReq *datReq; /* DatReq pointer */
-#endif
{
- U8 idx1,idx2;
- U32 idx;
-
-
- TRC2(rgUpdtRguDedSts)
-
+ uint8_t idx1,idx2;
+ uint32_t idx;
switch(stsType)
{
break;
}
- RETVOID;
+ return;
} /* rgUpdtRguDedSts */
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC Void rgUpdtRguCmnSts
+Void rgUpdtRguCmnSts
(
Inst inst,
RgUpSapCb *rguDlSap,
-U8 stsType /* Statistics type to update */
+uint8_t stsType /* Statistics type to update */
)
-#else
-PUBLIC Void rgUpdtRguCmnSts(inst,rguDlSap,stsType)
-Inst inst;
-RgUpSapCb *rguDlSap;
-U8 stsType; /* Statistics type to update */
-#endif
{
- TRC2(rgUpdtRguCmnSts)
-
-
switch(stsType)
{
break;
}
- RETVOID;
+ return;
} /* rgUpdtRguCmnSts */
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC Void rgUpdtCellCnt
-(
-Inst inst,
-U8 updtType
-)
-#else
-PUBLIC Void rgUpdtCellCnt(inst,updtType)
-Inst inst;
-U8 updtType;
-#endif
+Void rgUpdtCellCnt(Inst inst,uint8_t updtType)
{
- TRC2(rgUpdtCellCnt);
switch (updtType)
{
break;
}
- RETVOID;
+ return;
} /* rgUpdtCellCnt */
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC Void rgUpdtUeCnt
-(
-Inst inst,
-U8 updtType
-)
-#else
-PUBLIC Void rgUpdtUeCnt (inst,updtType)
-Inst inst;
-U8 updtType;
-#endif
+Void rgUpdtUeCnt(Inst inst,uint8_t updtType)
{
- TRC2(rgUpdtUeCnt);
-
switch (updtType)
{
case RG_CFG_ADD:
default:
break;
}
- RETVOID;
+ return;
} /* rgUpdtUeCnt */
/*
* File: rg_utl.c
*
*/
-#ifdef ANSI
-PUBLIC S16 rgAllocEventMem
+S16 rgAllocEventMem
(
Inst inst,
Ptr *memPtr,
Size memSize
)
-#else
-PUBLIC S16 rgAllocEventMem(inst,memPtr, memSize)
-Inst inst;
-Ptr *memPtr;
-Size memSize;
-#endif
{
- Mem sMem;
- VOLATILE U32 startTime=0;
+ Mem sMem;
+ volatile uint32_t startTime=0;
- TRC2(rgAllocEventMem)
sMem.region = rgCb[inst].rgInit.region;
sMem.pool = rgCb[inst].rgInit.pool;
#if (ERRCLASS & ERRCLS_DEBUG)
if (memSize<= 0)
{
- RGLOGERROR(inst,ERRCLS_INT_PAR, ERG031, memSize,
- "rgAllocEventMem(): memSize invalid\n");
- RETVALUE (RFAILED);
+ DU_LOG("\nERROR --> MAC : rgAllocEventMem(): memSize invalid\n");
+ return (RFAILED);
}
#endif /* ERRCLASS & ERRCLS_DEBUG */
if(ROK != cmAllocEvnt(memSize, TFU_MAX_MEMBLK_SIZE, &sMem, memPtr))
#endif /* */
{
- RLOG0(L_ERROR,"cmAllocEvnt Failed");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : cmAllocEvnt Failed");
+ return RFAILED;
}
/*stoping Task*/
SStopTask(startTime, PID_MACUTL_CMALLCEVT);
- RETVALUE(ROK);
+ return ROK;
} /* end of rgAllocEventMem*/
/*
* File: rg_utl.c
*
*/
-#ifdef ANSI
-PUBLIC S16 rgGetEventMem
+S16 rgGetEventMem
(
Inst inst,
Ptr *ptr,
Size len,
Ptr memCp
)
-#else
-PUBLIC S16 rgGetEventMem(inst,ptr, len, memCp)
-Inst inst;
-Ptr *ptr;
-Size len;
-Ptr memCp;
-#endif
{
S16 ret;
- TRC2(rgGetEventMem)
#ifdef TFU_ALLOC_EVENT_NO_INIT
ret = cmGetMemNoInit(memCp, len, (Ptr *)ptr);
#else
ret = cmGetMem(memCp, len, (Ptr *)ptr);
#endif /* */
- RETVALUE(ret);
+ return (ret);
} /* end of rgGetEventMem*/
/***********************************************************
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC Void rgGetPstToInst
+Void rgGetPstToInst
(
Pst *pst,
Inst srcInst,
Inst dstInst
)
-#else
-PUBLIC Void rgGetPstToInst (pst, srcInst, dstInst)
-Pst *pst;
-Inst srcInst;
-Inst dstInst;
-#endif
{
- TRC2(rgGetPstToInst);
pst->srcEnt = rgCb[srcInst].rgInit.ent;
pst->srcInst = rgCb[srcInst].rgInit.inst;
pst->intfVer = 0;
pst->route = RTESPEC;
- RETVOID;
+ return;
} /* end of rgGetPstToInst */
/***********************************************************
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC S16 RgSchMacLcgRegReq
-(
-Pst *pst,
-RgInfLcgRegReq *lcgRegReq
-)
-#else
-PUBLIC S16 RgSchMacLcgRegReq (pst, lcgRegReq)
-Pst *pst;
-RgInfLcgRegReq *lcgRegReq;
-#endif
+S16 RgSchMacLcgRegReq(Pst *pst,RgInfLcgRegReq *lcgRegReq)
{
Inst inst;
RgCellCb *cell = NULLP;
RgUeCb *ue;
- TRC2(RgSchMacLcgRegReq);
-
RG_IS_INST_VALID(pst->dstInst);
inst = pst->dstInst - RG_INST_START;
cell = rgCb[inst].cell;
(cell->cellId != lcgRegReq->cellId))
{
- RLOG_ARG0(L_ERROR,DBG_CELLID,lcgRegReq->cellId,"Cell does not exist ");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Cell does not exist ");
+ return RFAILED;
}
if ((ue = rgDBMGetUeCb(cell, lcgRegReq->crnti)) == NULLP)
{
- RLOG_ARG1(L_ERROR, DBG_CELLID,cell->cellId,"CRNTI:%d does not exist",
+ DU_LOG("\nERROR --> MAC : CRNTI:%d does not exist",
lcgRegReq->crnti);
- RETVALUE(RFAILED);
+ return RFAILED;
}
ue->ul.lcgArr[lcgRegReq->lcgId].isGbr = lcgRegReq->isGbr;
- RETVALUE(ROK);
+ return ROK;
} /* end of RgSchMacLcgRegReq */
#ifdef LTEMAC_SPS
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC S16 RgSchMacUlSpsResetReq
-(
-Pst *pst,
-RgInfUlSpsReset *ulSpsResetInfo
-)
-#else
-PUBLIC S16 RgSchMacUlSpsResetReq (pst, lcInfo)
-Pst *pst;
-RgInfUlSpsReset *ulSpsResetInfo;
-#endif
+S16 RgSchMacUlSpsResetReq(Pst *pst,RgInfUlSpsReset *ulSpsResetInfo)
{
Inst inst;
RgCellCb *cell = NULLP;
RgUeCb *ue;
- TRC2(RgSchMacUlSpsResetReq);
-
RG_IS_INST_VALID(pst->dstInst);
inst = pst->dstInst - RG_INST_START;
cell = rgCb[inst].cell;
(cell->cellId != ulSpsResetInfo->cellId))
{
- RLOG_ARG0(L_ERROR, DBG_CELLID,ulSpsResetInfo->cellId,"Cell does not exist ");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Cell does not exist ");
+ return RFAILED;
}
if ((ue = rgDBMGetUeCb(cell, ulSpsResetInfo->crnti)) == NULLP)
{
- RLOG_ARG1(L_ERROR, DBG_CELLID,cell->cellId,"CRNTI:%d does not exist",
+ DU_LOG("\nERROR --> MAC : CRNTI:%d does not exist",
ulSpsResetInfo->crnti);
- RETVALUE(RFAILED);
+ return RFAILED;
}
ue->ul.implRelCntr = 0;
ue->ul.explRelCntr = 0;
- RETVALUE(ROK);
+ return ROK;
} /* end of RgSchMacUlSpsResetReq */
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC S16 RgSchMacSpsLcRegReq
-(
-Pst *pst,
-RgInfSpsLcInfo *lcInfo
-)
-#else
-PUBLIC S16 RgSchMacSpsLcRegReq (pst, lcInfo)
-Pst *pst;
-RgInfSpsLcInfo *lcInfo;
-#endif
+S16 RgSchMacSpsLcRegReq(Pst *pst,RgInfSpsLcInfo *lcInfo)
{
Inst inst;
RgCellCb *cell= NULLP;
RgUeCb *ue;
- U8 idx;
-
- TRC2(RgSchMacSpsLcRegReq);
+ uint8_t idx;
RG_IS_INST_VALID(pst->dstInst);
inst = pst->dstInst - RG_INST_START;
(cell->cellId != lcInfo->cellId))
{
- RLOG_ARG0(L_ERROR,DBG_CELLID,lcInfo->cellId, "Cell does not exist ");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Cell does not exist ");
+ return RFAILED;
}
if ((ue = rgDBMGetUeCb(cell, lcInfo->crnti)) == NULLP)
{
- RLOG_ARG1(L_ERROR, DBG_CELLID,cell->cellId,"CRNTI:%d does not exist",
+ DU_LOG("\nERROR --> MAC : CRNTI:%d does not exist",
lcInfo->crnti);
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* Store the sps-rnti and SPS LC information in the UE */
/* Insert the UE into SPS UE List */
if (rgDBMInsSpsUeCb(cell, ue) == RFAILED)
{
- RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
- "Ue insertion into SPS list failed SPS CRNTI:%d", ue->spsRnti);
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Ue insertion into SPS list failed SPS CRNTI:%d", ue->spsRnti);
+ return RFAILED;
}
- RETVALUE(ROK);
+ return ROK;
} /* end of RgSchMacSpsLcRegReq */
* File : rg_utl.c
*
**********************************************************/
-#ifdef ANSI
-PUBLIC S16 RgSchMacSpsLcDeregReq
-(
-Pst *pst,
-CmLteCellId cellId,
-CmLteRnti crnti
-)
-#else
-PUBLIC S16 RgSchMacSpsLcDeregReq (pst, cellId, crnti)
-Pst *pst;
-CmLteCellId cellId;
-CmLteRnti crnti;
-#endif
+S16 RgSchMacSpsLcDeregReq(Pst *pst,CmLteCellId cellId,CmLteRnti crnti)
{
Inst inst;
RgCellCb *cell = NULLP;
RgUeCb *ue;
- TRC2(RgSchMacSpsLcDeregReq);
-
RG_IS_INST_VALID(pst->dstInst);
inst = pst->dstInst - RG_INST_START;
cell = rgCb[inst].cell;
(cell->cellId != cellId))
{
- RLOG_ARG0(L_ERROR,DBG_CELLID,cellId, "Cell does not exist ");
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : Cell does not exist ");
+ return RFAILED;
}
if ((ue = rgDBMGetUeCb(cell, crnti)) == NULLP)
{
- RLOG_ARG1(L_ERROR, DBG_CELLID,cellId,"CRNTI:%d Ue does not exist", crnti);
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : CRNTI:%d Ue does not exist", crnti);
+ return RFAILED;
}
/* No need to reset the SPS LC Ids as they will not be looked at*/
/* Delete UE from the SPS UE List */
rgDBMDelSpsUeCb(cell, ue);
- RETVALUE(ROK);
+ return ROK;
} /* end of RgSchMacSpsLcDeregReq */
#endif /* LTEMAC_SPS */
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
-PRIVATE S16 rgUtlHndlCrntiChng
+static S16 rgUtlHndlCrntiChng
(
Inst inst,
RgCellCb *cell,
CmLteRnti rnti,
CmLteRnti newRnti
)
-#else
-PRIVATE S16 rgUtlHndlCrntiChng(inst,cell, rnti, newRnti)
-Inst inst;
-RgCellCb *cell;
-CmLteRnti rnti;
-CmLteRnti newRnti;
-#endif
{
RgUeCb *ue = NULLP;
RgUeCb *newUe = NULLP;
- TRC3(rgUtlHndlCrntiChng)
-
ue = rgDBMGetUeCb(cell, rnti);
newUe = rgDBMGetUeCbFromRachLst(cell, newRnti);
if ((ue == NULLP) || (newUe == NULLP))
{
- RLOG_ARG4(L_ERROR,DBG_CELLID,cell->cellId,
- "RNTI:%d Failed to get UECB[%lu:%lu] or NEW RNTI:%d",
+ DU_LOG("\nERROR --> MAC : RNTI:%d Failed to get UECB[%lu:%lu] or NEW RNTI:%d",
rnti, ((PTR)ue), ((PTR)newUe), newRnti);
- RETVALUE(RFAILED);
+ return RFAILED;
}
#ifdef XEON_SPECIFIC_CHANGES
- CM_LOG_DEBUG(CM_LOG_ID_MAC, "MAC:UE[%d] id changed to %d\n", rnti, newRnti);
+ DU_LOG("\nDEBUG --> MAC : MAC:UE[%d] id changed to %d\n", rnti, newRnti);
#endif
rgDBMDelUeCb(cell, ue);
ue->ueId = newRnti;
- cmMemcpy((U8*)&(ue->contResId), (U8*)&(newUe->contResId),
+ memcpy(&(ue->contResId), &(newUe->contResId),
sizeof(newUe->contResId));
/* Fix : syed MSG4 might be RETXing need to store the
* HARQ context. */
rgDBMDelUeCbFromRachLst(cell, newUe);
rgFreeSBuf(inst,(Data **)&newUe, sizeof(*newUe));
- RETVALUE(ROK);
+ return ROK;
} /* end of rgUtlHndlCrntiChng */
#ifdef LTE_ADV
* @param[in] RgUeCb *ue
* @return ROK is SUCCESS
**/
-#ifdef ANSI
-PUBLIC S16 rgDelUeFrmAllSCell
-(
-RgCellCb *cell,
-RgUeCb *ue
-)
-#else
-PUBLIC S16 rgDelUeFrmAllSCell(cell, ue)
-RgCellCb *cell;
-RgUeCb *ue;
-#endif
+S16 rgDelUeFrmAllSCell(RgCellCb *cell,RgUeCb *ue)
{
Inst inst = cell->macInst - RG_INST_START;
- U8 idx = 0;
+ uint8_t idx = 0;
Inst sCellInstIdx;
Pst dstInstPst;
RgPrgUeSCellDelInfo ueSCellDelInfo;
- TRC2(rgDelUeFrmAllSCell)
-
/* To Delete the SCells if exisits for that UE */
for(idx = 0; idx < RG_MAX_SCELL_PER_UE ; idx++)
{
} /* loop of if */
} /* loop of for */
- RETVALUE(ROK);
+ return ROK;
} /* rgDelUeFrmAllSCell */
/**
* @return S16
* -# ROK
**/
-#ifdef ANSI
-PUBLIC S16 rgUtlVltdAddSCellCfg
-(
- RgPrgUeSCellCfgInfo *ueSCellCb,
- RgCellCb *cell,
- Inst inst
-)
-#else
-PUBLIC S16 rgUtlVltdAddSCellCfg(ueSCellCb, cell, inst)
- RgPrgUeSCellCfgInfo *ueSCellCb;
- RgCellCb *cell;
- Inst inst;
-#endif
+S16 rgUtlVltdAddSCellCfg(RgPrgUeSCellCfgInfo *ueSCellCb,RgCellCb *cell,Inst inst)
{
S16 ret = ROK;
- TRC3(rgUtlVltdAddSCellCfg)
-
- /* To Validate the CellID presence */
+ /* To Validate the CellID presence */
if((cell == NULLP) ||
(cell->cellId != ueSCellCb->cellId))
{
- RGDBGERRNEW(inst, (rgPBuf(inst),
- "[%d]Sec Cell does not exit %d\n",
- ueSCellCb->ueId, ueSCellCb->cellId));
+ DU_LOG("\nERROR --> MAC : [%d]Sec Cell does not exit %d\n",
+ ueSCellCb->ueId, ueSCellCb->cellId);
ret = RFAILED;
}
#ifdef TENB_MULT_CELL_SUPPRT
if((ueSCellCb->rguDlSapId > rgCb[inst].numRguSaps) ||
(ueSCellCb->rguUlSapId > rgCb[inst].numRguSaps))
{
- RGDBGERRNEW(inst,(rgPBuf(inst), "Invald Sap Id: DL %d UL %d for ueId %d failed\n",
+ DU_LOG("\nERROR --> MAC : Invald Sap Id: DL %d UL %d for ueId %d failed\n",
ueSCellCb->rguDlSapId,
ueSCellCb->rguUlSapId,
- ueSCellCb->cellId));
+ ueSCellCb->cellId);
ret = RFAILED;
}
#endif
- RETVALUE(ret);
+ return (ret);
} /* rgUtlVltdAddSCellCfg */
/**
* @return S16
* -# ROK
**/
-#ifdef ANSI
-PRIVATE S16 rgUtlSndCrntiChngReq2AllSMacs
+static S16 rgUtlSndCrntiChngReq2AllSMacs
(
RgCellCb *cell,
CmLteRnti rnti,
CmLteRnti newRnti
)
-#else
-PRIVATE S16 rgUtlSndCrntiChngReq2AllSMacs(cell, rnti, newRnti)
-RgCellCb *cell;
-CmLteRnti rnti;
-CmLteRnti newRnti;
-#endif
{
Inst inst = cell->macInst - RG_INST_START;
Inst sCellInstIdx;
Pst dstInstPst;
RgPrgUeSCellDelInfo ueIdChngReq;
RgUeCb *ue;
- U8 idx;
+ uint8_t idx;
#ifdef L2_OPTMZ
TfuDelDatReqInfo delDatReq;
#endif
- TRC2(rgUtlSndCrntiChngReq2AllSMacs)
-
/* use newRnti to get UeCb in PMac because rnti is already changed in PMac*/
ue = rgDBMGetUeCb(cell, newRnti);
if (ue == NULLP)
{
- RGDBGERRNEW(inst,(rgPBuf(inst),"[%d]RNTI:Failed to get ueCb \
- newRnti=%d\n", rnti, newRnti));
- RETVALUE(RFAILED);
+ DU_LOG("\nERROR --> MAC : [%d]RNTI:Failed to get ueCb \
+ newRnti=%d\n", rnti, newRnti);
+ return RFAILED;
}
/* For all added SCells, prepare and send ueIdChngReq */
for(idx = 0; idx < RG_MAX_SCELL_PER_UE ; idx++)
} /* loop of if */
} /* loop of for */
- RETVALUE(ROK);
+ return ROK;
} /* rgUtlSndCrntiChngReq2AllSMacs */
#endif /* LTE_ADV */
* @param[in] CmLteRnti rnti
* @return Void
**/
-#ifdef ANSI
-PRIVATE Void rgUtlHndlCrntiRls
-(
-RgCellCb *cell,
-RgInfRlsRnti *rlsRnti
-)
-#else
-PRIVATE Void rgUtlHndlCrntiRls(cell, rlsRnti)
-RgCellCb *cell;
-CmLteRnti *rlsRnti;
-#endif
+static Void rgUtlHndlCrntiRls(RgCellCb *cell,RgInfRlsRnti *rlsRnti)
{
Inst inst = cell->macInst - RG_INST_START;
RgUeCb *ue = NULLP;
RgUeCb *spsUeCb = NULLP;
#endif
- TRC3(rgUtlHndlCrntiRls)
-
if ((ue = rgDBMGetUeCb(cell, rlsRnti->rnti)) == NULLP)
{
/* Check in RachLst */
}
else
{
- RLOG_ARG1(L_WARNING,DBG_CELLID,cell->cellId,
- "RNTI:%d No ueCb found in RachLst",rlsRnti->rnti);
+ DU_LOG("\nERROR --> MAC : RNTI:%d No ueCb found in RachLst",rlsRnti->rnti);
}
}
else
{
if((ue=rgDBMGetUeCbFromRachLst (cell, rlsRnti->rnti)) != NULLP)
{
- RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
- "RNTI:%d STALE UE is still present", rlsRnti->rnti);
+ DU_LOG("\nERROR --> MAC : RNTI:%d STALE UE is still present", rlsRnti->rnti);
}
}
}
- RETVOID;
+ return;
} /* end of rgUtlHndlCrntiRls */
/**
* @return S16
* -# ROK
**/
-#ifdef ANSI
-PUBLIC S16 RgSchMacRlsRntiReq
-(
-Pst *pst,
-RgInfRlsRnti *rlsRnti
-)
-#else
-PUBLIC S16 RgSchMacRlsRntiReq(pst, rlsRnti)
-Pst *pst;
-RgInfRlsRnti *rlsRnti;
-#endif
+S16 RgSchMacRlsRntiReq(Pst *pst,RgInfRlsRnti *rlsRnti)
{
- Pst schPst;
- RgInfUeDelInd ueDelInd;
+// Pst schPst;
+// RgInfUeDelInd ueDelInd;
Inst macInst;
RgCellCb *cell;
#ifdef L2_OPTMZ
TfuDelDatReqInfo delDatReq;
#endif
- TRC3(RgSchMacRlsRntiReq)
-
RG_IS_INST_VALID(pst->dstInst);
macInst = pst->dstInst - RG_INST_START;
cell = rgCb[macInst].cell;
if(NULLP == rlsRnti)
{
- RETVALUE(RFAILED);
+ return RFAILED;
}
if((cell == NULLP) ||
(cell->cellId != rlsRnti->cellId))
{
- RLOG_ARG1(L_ERROR,DBG_CELLID,rlsRnti->cellId,
- "No cellCb found with cellId for RNTI:%d",
+ DU_LOG("\nERROR --> MAC : No cellCb found with cellId for RNTI:%d",
rlsRnti->rnti);
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* Fix : syed Clearing UE context when SCH indicates to do so
* UE DEL from CRG interface is now dummy. */
* is dummy */
if (rgUtlHndlCrntiChng(macInst,cell, rlsRnti->rnti, rlsRnti->newRnti) != ROK)
{
- RLOG_ARG2(L_ERROR,DBG_CELLID,rlsRnti->cellId,
- "CRNTI change failed for RNTI:%d new RNTI:%d",
+ DU_LOG("\nERROR --> MAC : CRNTI change failed for RNTI:%d new RNTI:%d",
rlsRnti->rnti,rlsRnti->newRnti);
- RETVALUE(RFAILED);
+ return RFAILED;
}
#ifdef LTE_ADV
if(rgUtlSndCrntiChngReq2AllSMacs(cell, rlsRnti->rnti, rlsRnti->newRnti) != ROK)
{
/* TODO: do we need to send DelInd to SCH in failure case*/
- RETVALUE(RFAILED);
+ return RFAILED;
}
#endif
#ifdef L2_OPTMZ
if(FALSE == rlsRnti->isUeSCellDel)
#endif
{
+ //TODO: commented for compilation without SCH
+#if 0
ueDelInd.cellSapId = cell->schInstMap.cellSapId;
ueDelInd.cellId = rlsRnti->cellId;
ueDelInd.rnti = rlsRnti->rnti;
rgGetPstToInst(&schPst,macInst, cell->schInstMap.schInst);
RgMacSchUeDel(&schPst, &ueDelInd);
+#endif
}
- RETVALUE(ROK);
+ return ROK;
} /* end of RgSchMacRlsRntiReq */
#ifdef L2_OPTMZ
-#ifdef ANSI
-PUBLIC Bool RgUtlIsTbMuxed
-(
- TfuDatReqTbInfo *tb
-)
-#else
-PUBLIC Bool RgUtlIsTbMuxed()
- TfuDatReqTbInfo *tb
-#endif
+Bool RgUtlIsTbMuxed(TfuDatReqTbInfo *tb)
{
MsgLen len = 0;
SFndLenMsg(tb->macHdr, &len);
- RETVALUE(len?TRUE : FALSE);
+ return (len?TRUE : FALSE);
}
#endif