Code Review
/
o-du
/
l2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
new review to be raise
[o-du/l2.git]
/
src
/
5gnrmac
/
rg_dhm.c
diff --git
a/src/5gnrmac/rg_dhm.c
b/src/5gnrmac/rg_dhm.c
index
e8cdacf
..
3c648e4
100755
(executable)
--- a/
src/5gnrmac/rg_dhm.c
+++ b/
src/5gnrmac/rg_dhm.c
@@
-68,23
+68,23
@@
static int RLOG_MODULE_ID=4096;
#include "ss_task.x"
#include "ss_msg.x" /* MAC includes */
/* local defines */
#include "ss_task.x"
#include "ss_msg.x" /* MAC includes */
/* local defines */
-//
EXTERN
S16 ssGetDBufOfSize(Region region,Size size,Buffer **dBuf);
+// S16 ssGetDBufOfSize(Region region,Size size,Buffer **dBuf);
//void prc_trace_format_string(UINT32 group_mask, UINT16 level, const char *format, ...);
#endif
/* local typedefs */
/* local externs */
//void prc_trace_format_string(UINT32 group_mask, UINT16 level, const char *format, ...);
#endif
/* local typedefs */
/* local externs */
-
EXTERN
S16 SIncMsgRef(Buffer *srcBuf,Region dstRegion, Pool dstPool,Buffer **dstBuf);
+S16 SIncMsgRef(Buffer *srcBuf,Region dstRegion, Pool dstPool,Buffer **dstBuf);
-
PRIVATE
Void rgDHMBldTfuDatReq ARGS((RgCellCb *cellCb, RgDlSf *dlSf, RgDlHqProcCb *hqP,
+
static
Void rgDHMBldTfuDatReq ARGS((RgCellCb *cellCb, RgDlSf *dlSf, RgDlHqProcCb *hqP,
RgTfuDatReqPduInfo *datReq));
#ifdef L2_OPTMZ
S16 rgDHMFreeHqProcTB
(
RgTfuDatReqPduInfo *datReq));
#ifdef L2_OPTMZ
S16 rgDHMFreeHqProcTB
(
-RgDlHqProcCb
*hqP,
-
U8
tbIndex
+RgDlHqProcCb *hqP,
+
uint8_t
tbIndex
);
#endif
);
#endif
@@
-111,21
+111,9
@@
U8 tbIndex
* -# RFAILED
*
**/
* -# RFAILED
*
**/
-#ifdef ANSI
-S16 rgDHMHqEntInit
-(
-Inst inst,
-RgDlHqEnt *hqE,
-U8 maxHqProcs
-)
-#else
-S16 rgDHMHqEntInit(inst,hqE, maxHqProcs)
-Inst inst,
-RgDlHqEnt *hqE;
-U8 maxHqProcs;
-#endif
+S16 rgDHMHqEntInit(Inst inst, RgDlHqEnt *hqE, uint8_t maxHqProcs)
{
{
-
U8
idx1,idx2;
+
uint8_t
idx1,idx2;
#ifdef L2_OPTMZ
Buffer *hdrDBuf = NULLP;
Buffer *ceDBuf = NULLP;
#ifdef L2_OPTMZ
Buffer *hdrDBuf = NULLP;
Buffer *ceDBuf = NULLP;
@@
-195,19
+183,9
@@
U8 maxHqProcs;
* @return Void
*
**/
* @return Void
*
**/
-#ifdef ANSI
-Void rgDHMUeReset
-(
-RgCellCb *cell,
-RgDlHqEnt *hqE
-)
-#else
-Void rgDHMUeReset(cell, hqE)
-RgCellCb *cell;
-RgDlHqEnt *hqE;
-#endif
+Void rgDHMUeReset(RgCellCb *cell, RgDlHqEnt *hqE)
{
{
-
U8
i = 0;
+
uint8_t
i = 0;
if(hqE->procs[0])
{
if(hqE->procs[0])
{
@@
-222,7
+200,7
@@
RgDlHqEnt *hqE;
#endif
}
}
#endif
}
}
-
RETVOID
;
+
return
;
} /* rgDHMUeReset*/
/**
} /* rgDHMUeReset*/
/**
@@
-241,16
+219,7
@@
RgDlHqEnt *hqE;
* @return Void
*
**/
* @return Void
*
**/
-#ifdef ANSI
-Void rgDHMHdlBufFree
-(
-Inst inst,
-Buffer **mBuf
-)
-#else
Void rgDHMHdlBufFree(Inst inst, Buffer **mBuf)
Void rgDHMHdlBufFree(Inst inst, Buffer **mBuf)
-Inst inst;
-#endif
{
RgCb *rgCbP = &rgCb[inst];
{
RgCb *rgCbP = &rgCb[inst];
@@
-267,7
+236,7
@@
Inst inst;
{
RG_FREE_MSG(*mBuf);
}
{
RG_FREE_MSG(*mBuf);
}
-
RETVOID
;
+
return
;
}
/**
* @brief This function is called to release the
}
/**
* @brief This function is called to release the
@@
-287,19
+256,11
@@
Inst inst;
* @return Void
*
**/
* @return Void
*
**/
-#ifdef ANSI
-Void rgDHMFreeTbBufs
-(
-Inst inst
-)
-#else
-Void rgDHMFreeTbBufs(inst)
-Inst inst;
-#endif
+Void rgDHMFreeTbBufs(Inst inst)
{
RgCb *rgCbP = &rgCb[inst];
{
RgCb *rgCbP = &rgCb[inst];
-
U8
start = rgCbP->bufCnt;
-
U8
end = 0;
+
uint8_t
start = rgCbP->bufCnt;
+
uint8_t
end = 0;
if (rgCbP->bufCnt < RG_MAX_FREE_BUFS_PERTTI)
{
if (rgCbP->bufCnt < RG_MAX_FREE_BUFS_PERTTI)
{
@@
-315,22
+276,14
@@
Inst inst;
SPutMsg(rgCbP->bufToFree[start]);
}
rgCbP->bufCnt = end;
SPutMsg(rgCbP->bufToFree[start]);
}
rgCbP->bufCnt = end;
-
RETVOID
;
+
return
;
} /* rgDHMFreeTbBufs */
} /* rgDHMFreeTbBufs */
-#ifdef ANSI
-Void rgDHMFreeAllTbBufs
-(
-Inst inst
-)
-#else
-Void rgDHMFreeAllTbBufs(inst)
-Inst inst;
-#endif
+Void rgDHMFreeAllTbBufs(Inst inst)
{
RgCb *rgCbP = &rgCb[inst];
{
RgCb *rgCbP = &rgCb[inst];
-
U8
start = rgCbP->bufCnt;
-
U8
end = 0;
+
uint8_t
start = rgCbP->bufCnt;
+
uint8_t
end = 0;
while (start != end)
{
while (start != end)
{
@@
-338,7
+291,7
@@
Inst inst;
SPutMsg(rgCbP->bufToFree[start]);
}
rgCbP->bufCnt = end;
SPutMsg(rgCbP->bufToFree[start]);
}
rgCbP->bufCnt = end;
-
RETVOID
;
+
return
;
} /* rgDHMFreeTbBufs */
} /* rgDHMFreeTbBufs */
@@
-358,24
+311,12
@@
Inst inst;
* @return Void
*
**/
* @return Void
*
**/
-#ifdef ANSI
-S16 rgDHMRlsHqProcTB
-(
-RgCellCb *cell,
-RgDlHqProcCb *hqP,
-U8 tbIndex
-)
-#else
-S16 rgDHMRlsHqProcTB(cell, hqP, tbIndex)
-RgCellCb *cell;
-RgDlHqProcCb *hqP;
-U8 tbIndex;
-#endif
+S16 rgDHMRlsHqProcTB(RgCellCb *cell, RgDlHqProcCb *hqP, uint8_t tbIndex)
{
{
-
U8
idx;
+
uint8_t
idx;
#ifdef L2_OPTMZ
RgTfuDatReqTbInfo *tb; /* TB to be sent to CL/PHY*/
#ifdef L2_OPTMZ
RgTfuDatReqTbInfo *tb; /* TB to be sent to CL/PHY*/
- //
U32
lchIdx, pduIdx;
+ //
uint32_t
lchIdx, pduIdx;
#endif
if((tbIndex > RG_MAX_TB_PER_UE) ||
#endif
if((tbIndex > RG_MAX_TB_PER_UE) ||
@@
-440,26
+381,14
@@
U8 tbIndex;
* Invoked by: ROM
*
* @param[in] RgUeCb *ue
* Invoked by: ROM
*
* @param[in] RgUeCb *ue
- * @param[in]
U8
idx
+ * @param[in]
uint8_t
idx
* @param[in] RgDlHqProc **hqP
* @return S16
* -# ROK if successful
* -# RFAILED otherwise
*
**/
* @param[in] RgDlHqProc **hqP
* @return S16
* -# ROK if successful
* -# RFAILED otherwise
*
**/
-#ifdef ANSI
-S16 rgDHMGetHqProcFrmId
-(
-RgUeCb *ue,
-U8 idx,
-RgDlHqProcCb **hqP
-)
-#else
-S16 rgDHMGetHqProcFrmId(ue, idx, hqP)
-RgUeCb *ue;
-U8 idx;
-RgDlHqProcCb **hqP;
-#endif
+S16 rgDHMGetHqProcFrmId(RgUeCb *ue, uint8_t idx, RgDlHqProcCb **hqP)
{
/* Pick the proc based on the index provided */
*hqP = (ue->dl.hqEnt.procs[idx]);
{
/* Pick the proc based on the index provided */
*hqP = (ue->dl.hqEnt.procs[idx]);
@@
-467,7
+396,7
@@
RgDlHqProcCb **hqP;
return ROK;
} /* rgDHMGetHqProcFrmId */
return ROK;
} /* rgDHMGetHqProcFrmId */
-/*
PRIVATE U32
dataAvl; */
+/*
static uint32_t
dataAvl; */
/**
* @brief Handler for sending data to PHY
*
/**
* @brief Handler for sending data to PHY
*
@@
-487,7
+416,6
@@
RgDlHqProcCb **hqP;
* -#ROK
* -#RFAILED
**/
* -#ROK
* -#RFAILED
**/
-#ifdef ANSI
S16 rgDHMSndDatReq
(
RgCellCb *cellCb,
S16 rgDHMSndDatReq
(
RgCellCb *cellCb,
@@
-496,17
+424,9
@@
RgTfuDatReqInfo *datInfo,
RgDlHqProcCb *hqP,
RgErrInfo *err
)
RgDlHqProcCb *hqP,
RgErrInfo *err
)
-#else
-S16 rgDHMSndDatReq(cellCb, dlSf, datInfo, hqP, err)
-RgCellCb *cellCb;
-RgDlSf *dlSf;
-RgTfuDatReqInfo *datInfo;
-RgDlHqProcCb *hqP;
-RgErrInfo *err;
-#endif
{
{
-
U8
i;
- Inst
inst = cellCb->macInst - RG_INST_START;
+
uint8_t
i;
+ Inst inst = cellCb->macInst - RG_INST_START;
RgTfuDatReqPduInfo *datReq;
RgBldPduInfo bldPdu;
/*Added this variable to figure out that whether this UE data
RgTfuDatReqPduInfo *datReq;
RgBldPduInfo bldPdu;
/*Added this variable to figure out that whether this UE data
@@
-670,7
+590,6
@@
RgErrInfo *err;
* -# ROK
* -# RFAILED
**/
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
S16 rgDHMHndlDedDatReq
(
Inst inst,
S16 rgDHMHndlDedDatReq
(
Inst inst,
@@
-679,25
+598,18
@@
RgRguDDatReqPerUe *datReq,
RgDlSf *dlSf,
RgErrInfo *err
)
RgDlSf *dlSf,
RgErrInfo *err
)
-#else
-S16 rgDHMHndlDedDatReq(inst,hqProc, datReq, dlSf, err)
-Inst inst;
-RgDlHqProcCb *hqProc;
-RgRguDDatReqPerUe *datReq;
-RgDlSf *dlSf;
-RgErrInfo *err;
-#endif
{
{
-//
U32
len;
-
U8
i;
-
U8
j;
+//
uint32_t
len;
+
uint8_t
i;
+
uint8_t
j;
RgBldPduInfo bldPdu;
RgBldPduInfo bldPdu;
-
U8
tbIndex;
+
uint8_t
tbIndex;
#ifdef L2_OPTMZ
RgTfuDatReqTbInfo *tb;
#endif
#ifdef L2_OPTMZ
RgTfuDatReqTbInfo *tb;
#endif
- tbIndex = (U8)(datReq->transId & 0x03);
+
+ tbIndex = (uint8_t)(datReq->transId & 0x03);
/* Accept all the data requests even if delayed in case nothing
* has been sent earlier on the harq proc.
*/
/* Accept all the data requests even if delayed in case nothing
* has been sent earlier on the harq proc.
*/
@@
-711,7
+623,7
@@
RgErrInfo *err;
{
j++;
}
{
j++;
}
- rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (
U8
)(j+1));
+ rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (
uint8_t
)(j+1));
}
return RFAILED;
}
}
return RFAILED;
}
@@
-734,7
+646,7
@@
RgErrInfo *err;
{
j++;
}
{
j++;
}
- rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (
U8
)(j+1));
+ rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (
uint8_t
)(j+1));
printf("\nrgDHMHndlDedDatReq:: hqP %p \n", (Void *)hqProc);
}
return RFAILED;
printf("\nrgDHMHndlDedDatReq:: hqP %p \n", (Void *)hqProc);
}
return RFAILED;
@@
-783,7
+695,7
@@
RgErrInfo *err;
{
j++;
}
{
j++;
}
- rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (
U8
)(j+1));
+ rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (
uint8_t
)(j+1));
}
return RFAILED;
}
}
return RFAILED;
}
@@
-814,7
+726,6
@@
RgErrInfo *err;
* -# ROK
* -# RFAILED
**/
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
S16 rgDHMHndlCmnDatReq
(
Inst inst,
S16 rgDHMHndlCmnDatReq
(
Inst inst,
@@
-822,13
+733,6
@@
RgDlHqProcCb *hqProc,
RgRguCmnDatReq *datReq,
RgErrInfo *err
)
RgRguCmnDatReq *datReq,
RgErrInfo *err
)
-#else
-S16 rgDHMHndlCmnDatReq(inst,hqProc, datReq, err)
-Inst inst;
-RgDlHqProcCb *hqProc;
-RgRguCmnDatReq *datReq;
-RgErrInfo *err;
-#endif
{
RgUstaDgn dgn;
RgBldPduInfo bldPdu;
{
RgUstaDgn dgn;
RgBldPduInfo bldPdu;
@@
-895,7
+799,6
@@
RgErrInfo *err;
* -# RFAILED
**/
RgUeCb *gUe =NULLP;
* -# RFAILED
**/
RgUeCb *gUe =NULLP;
-#ifdef ANSI
S16 rgDHMSndConsolidatedStaInd
(
RgCellCb *cell,
S16 rgDHMSndConsolidatedStaInd
(
RgCellCb *cell,
@@
-903,19
+806,12
@@
RgInfUeInfo *ueInfo,
CmLteTimingInfo timingInfo,
RgErrInfo *err
)
CmLteTimingInfo timingInfo,
RgErrInfo *err
)
-#else
-S16 rgDHMSndConsolidatedStaInd(cell, ueInfo, timingInfo, err)
-RgCellCb *cell;
-RgInfUeInfo *ueInfo;
-CmLteTimingInfo timingInfo;
-RgErrInfo *err;
-#endif
{
SuId rguDlSpId;/*need to use spID instead of suID*/
{
SuId rguDlSpId;/*need to use spID instead of suID*/
-
U8
idx;
-
U8
ueIdx;
-
U8
lcIdx;
-
U8
tbIndex=0,idx1;
+
uint8_t
idx;
+
uint8_t
ueIdx;
+
uint8_t
lcIdx;
+
uint8_t
tbIndex=0,idx1;
RgDlSf *dlSf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
Inst inst = cell->macInst - RG_INST_START;
// Bool isDStaReqrd = FALSE;
RgDlSf *dlSf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
Inst inst = cell->macInst - RG_INST_START;
// Bool isDStaReqrd = FALSE;
@@
-926,8
+822,8
@@
RgErrInfo *err;
RgUeCb *ue;
RgDlHqProcCb *hqP;
RgInfUeAlloc *allocInfo;
RgUeCb *ue;
RgDlHqProcCb *hqP;
RgInfUeAlloc *allocInfo;
-
U8
activeSapCnt = 0;
-
U8
staIndCnt = 0;
+
uint8_t
activeSapCnt = 0;
+
uint8_t
staIndCnt = 0;
#ifdef LTE_ADV
Bool hqPAdded = FALSE;
#endif
#ifdef LTE_ADV
Bool hqPAdded = FALSE;
#endif
@@
-1260,22
+1156,14
@@
RgErrInfo *err;
* @return Void
* None
**/
* @return Void
* None
**/
-//U8 crashFlag = 0;
-#ifdef ANSI
-PRIVATE Void rgDHMBldTfuDatReq
+//uint8_t crashFlag = 0;
+static Void rgDHMBldTfuDatReq
(
RgCellCb *cellCb,
RgDlSf *dlSf,
RgDlHqProcCb *hqP,
RgTfuDatReqPduInfo *datReq
)
(
RgCellCb *cellCb,
RgDlSf *dlSf,
RgDlHqProcCb *hqP,
RgTfuDatReqPduInfo *datReq
)
-#else
-PRIVATE Void rgDHMBldTfuDatReq(cellCb, dlSf, hqP, datReq)
-RgCellCb *cellCb;
-RgDlSf *dlSf;
-RgDlHqProcCb *hqP;
-RgTfuDatReqPduInfo *datReq;
-#endif
{
#ifndef L2_OPTMZ
{
#ifndef L2_OPTMZ
@@
-1286,10
+1174,10
@@
RgTfuDatReqPduInfo *datReq;
#endif
#endif
#endif
#endif
-
U8
i;
+
uint8_t
i;
#ifdef L2_OPTMZ
#ifdef L2_OPTMZ
-
U32
lchIdx, pduIdx;
+
uint32_t
lchIdx, pduIdx;
#endif
datReq->nmbOfTBs = 0;
#endif
datReq->nmbOfTBs = 0;
@@
-1409,7
+1297,7
@@
RgTfuDatReqPduInfo *datReq;
datReq->nmbOfTBs++;
}
}
datReq->nmbOfTBs++;
}
}
-
RETVOID
;
+
return
;
} /* rgDHMBldTfuDatReq */
} /* rgDHMBldTfuDatReq */
@@
-1430,20
+1318,10
@@
RgTfuDatReqPduInfo *datReq;
* @return Void
*
**/
* @return Void
*
**/
-#ifdef ANSI
-S16 rgDHMFreeHqProcTB
-(
-RgDlHqProcCb *hqP,
-U8 tbIndex
-)
-#else
-S16 rgDHMFreeHqProcTB(hqP, tbIndex)
-RgDlHqProcCb *hqP;
-U8 tbIndex;
-#endif
+S16 rgDHMFreeHqProcTB(RgDlHqProcCb *hqP, uint8_t tbIndex)
{
RgTfuDatReqTbInfo *tb; /* TB to be sent to CL/PHY*/
{
RgTfuDatReqTbInfo *tb; /* TB to be sent to CL/PHY*/
-
U8
idx;
+
uint8_t
idx;
if((tbIndex > RG_MAX_TB_PER_UE) ||
(tbIndex == 0))
if((tbIndex > RG_MAX_TB_PER_UE) ||
(tbIndex == 0))
@@
-1487,19
+1365,9
@@
U8 tbIndex;
* @return None.
*
**/
* @return None.
*
**/
-#ifdef ANSI
-Void rgDHMFreeUe
-(
-Inst inst,
-RgDlHqEnt *hqE
-)
-#else
-Void rgDHMFreeUe(inst,hqE)
-Inst inst;
-RgDlHqEnt *hqE;
-#endif
+Void rgDHMFreeUe(Inst inst, RgDlHqEnt *hqE)
{
{
-
U8
i;
+
uint8_t
i;
if(hqE->procs)
{
if(hqE->procs)
{
@@
-1524,7
+1392,7
@@
RgDlHqEnt *hqE;
assignment */
}
assignment */
}
-
RETVOID
;
+
return
;
} /* rgDHMFreeUe */
/**
} /* rgDHMFreeUe */
/**
@@
-1544,17
+1412,7
@@
RgDlHqEnt *hqE;
* @return S16
* -# ROK
**/
* @return S16
* -# ROK
**/
-#ifdef ANSI
-S16 RgSchMacRstHqEntReq
-(
-Pst* pst,
-RgInfResetHqEnt* hqEntInfo
-)
-#else
-S16 RgSchMacRstHqEntReq(pst, hqEntInfo)
-Pst* pst;
-RgInfResetHqEnt* hqEntInfo;
-#endif
+S16 RgSchMacRstHqEntReq(Pst* pst, RgInfResetHqEnt* hqEntInfo)
{
Inst inst;
RgCellCb *cell;
{
Inst inst;
RgCellCb *cell;
@@
-1581,7
+1439,7
@@
RgInfResetHqEnt* hqEntInfo;
return ROK;
}
return ROK;
}
-
U32
gSaveVal;
+
uint32_t
gSaveVal;
\f
/**
* @brief Function for handling RaResp request received from scheduler to MAC
\f
/**
* @brief Function for handling RaResp request received from scheduler to MAC
@@
-1602,29
+1460,19
@@
U32 gSaveVal;
* @return S16
* -# ROK
**/
* @return S16
* -# ROK
**/
-#ifdef ANSI
-S16 RgSchMacRlsHqReq
-(
-Pst *pst,
-RgInfRlsHqInfo *rlshqUeInfo
-)
-#else
-S16 RgSchMacRlsHqReq(pst, rlshqUeInfo)
-Pst *pst;
-RgInfRlsHqInfo *rlshqUeInfo;
-#endif
+S16 RgSchMacRlsHqReq(Pst *pst, RgInfRlsHqInfo *rlshqUeInfo)
{
Inst inst;
RgCellCb *cell = NULLP;
RgUeCb *ue;
RgDlHqProcCb *hqP;
{
Inst inst;
RgCellCb *cell = NULLP;
RgUeCb *ue;
RgDlHqProcCb *hqP;
-
U8
idx1,idx2;
+
uint8_t
idx1,idx2;
#ifdef LTE_L2_MEAS
#ifdef LTE_L2_MEAS
-
U8
tbId;
+
uint8_t
tbId;
RguHarqStatusInd hqStaInd;
Bool isValidTbId = FALSE;
#endif
RguHarqStatusInd hqStaInd;
Bool isValidTbId = FALSE;
#endif
-
U32
startTime=0;
+
uint32_t
startTime=0;
RG_IS_INST_VALID(pst->dstInst);
inst = pst->dstInst - RG_INST_START;
RG_IS_INST_VALID(pst->dstInst);
inst = pst->dstInst - RG_INST_START;