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
[ JIRA Id - ODUHIGH-606 ] Fixing null memory size allocation issue
[o-du/l2.git]
/
src
/
cm
/
common_def.c
diff --git
a/src/cm/common_def.c
b/src/cm/common_def.c
index
444db96
..
c731bad
100644
(file)
--- a/
src/cm/common_def.c
+++ b/
src/cm/common_def.c
@@
-18,6
+18,15
@@
#include "common_def.h"
#include "common_def.h"
+#ifdef MEM_SIZE_CHECK
+#define CM_MEMORY_ALLOC_SIZE_LOG(_line, _func, _size) \
+{\
+ DU_LOG("\nRLC line = %d, func = %s, _size= %d ", _line, _func, _size); \
+}
+#else
+#define CM_MEMORY_ALLOC_SIZE_LOG(_line, _func, _size) {}
+#endif
+
/*Spec 38.104, Table 5.4.2.1-1 ARFCN - FREQ mapping*/
/*{ F_REF(Mhz), ΔF_Global, F_REF-Offs, N_REF-offs, Range of N_REF }*/
uint32_t arfcnFreqTable[3][5] = {
/*Spec 38.104, Table 5.4.2.1-1 ARFCN - FREQ mapping*/
/*{ F_REF(Mhz), ΔF_Global, F_REF-Offs, N_REF-offs, Range of N_REF }*/
uint32_t arfcnFreqTable[3][5] = {
@@
-228,11
+237,11
@@
uint8_t convertScsValToScsEnum(uint32_t num)
}
/*******************************************************************
}
/*******************************************************************
- * @brief convert
scs
periodicity value into the enum value received from O1
+ * @brief convert
SSB
periodicity value into the enum value received from O1
*
* @details
*
*
* @details
*
- * Function : convertS
cs
PeriodicityToEnum
+ * Function : convertS
SB
PeriodicityToEnum
*
* Functionality:
* - convert scs periodicity value
*
* Functionality:
* - convert scs periodicity value
@@
-242,30
+251,30
@@
uint8_t convertScsValToScsEnum(uint32_t num)
* RFAILED - failure
*
* ****************************************************************/
* RFAILED - failure
*
* ****************************************************************/
-uint8_t convertS
cs
PeriodicityToEnum(uint32_t num)
+uint8_t convertS
SB
PeriodicityToEnum(uint32_t num)
{
switch(num)
{
case 5:
{
switch(num)
{
case 5:
- return S
CS
_5MS;
+ return S
SB
_5MS;
case 10:
case 10:
- return S
CS
_10MS;
+ return S
SB
_10MS;
case 20:
case 20:
- return S
CS
_20MS;
+ return S
SB
_20MS;
case 40:
case 40:
- return S
CS
_40MS;
+ return S
SB
_40MS;
case 80:
case 80:
- return S
CS
_80MS;
+ return S
SB
_80MS;
case 160:
case 160:
- return S
CS
_160MS;
+ return S
SB
_160MS;
default:
default:
- return S
CS
_5MS;
+ return S
SB
_5MS;
}
}
/*******************************************************************
}
}
/*******************************************************************
@@
-286,6
+295,7
@@
uint8_t convertScsPeriodicityToEnum(uint32_t num)
* ****************************************************************/
uint8_t SGetSBufNewForDebug(char *file, const char *func, int line, Region region, Pool pool, Data **ptr, Size size)
{
* ****************************************************************/
uint8_t SGetSBufNewForDebug(char *file, const char *func, int line, Region region, Pool pool, Data **ptr, Size size)
{
+ CM_MEMORY_ALLOC_SIZE_LOG(line, func, size);
if(SGetSBuf(region, pool, ptr, size) == ROK)
{
#ifdef ODU_MEMORY_DEBUG_LOG
if(SGetSBuf(region, pool, ptr, size) == ROK)
{
#ifdef ODU_MEMORY_DEBUG_LOG
@@
-354,6
+364,7
@@
uint8_t SPutSBufNewForDebug(char *file, const char *func, int line, Region regio
uint8_t SGetStaticBufNewForDebug(char *file, const char *func, int line, \
Region region, Pool pool, Data **ptr, Size size, uint8_t memType)
{
uint8_t SGetStaticBufNewForDebug(char *file, const char *func, int line, \
Region region, Pool pool, Data **ptr, Size size, uint8_t memType)
{
+ CM_MEMORY_ALLOC_SIZE_LOG(line, func, size);
if(SGetStaticBuffer(region, pool, ptr, size, memType) == ROK)
{
#ifdef ODU_MEMORY_DEBUG_LOG
if(SGetStaticBuffer(region, pool, ptr, size, memType) == ROK)
{
#ifdef ODU_MEMORY_DEBUG_LOG
@@
-447,16
+458,16
@@
uint32_t convertArfcnToFreqKhz(uint32_t arfcn)
uint8_t indexTable = 0;
uint32_t freq = 0;
uint8_t indexTable = 0;
uint32_t freq = 0;
- for(indexTable = 0; indexTable <
4
; indexTable++)
+ for(indexTable = 0; indexTable <
3
; indexTable++)
{
if(arfcn <= arfcnFreqTable[indexTable][4])
{
{
if(arfcn <= arfcnFreqTable[indexTable][4])
{
- freq =
arfcnFreqTable[indexTable][2]
+ (arfcnFreqTable[indexTable][1] * (arfcn - arfcnFreqTable[indexTable][3]));
- return (freq
*1000
);
+ freq =
(arfcnFreqTable[indexTable][2] * 1000)
+ (arfcnFreqTable[indexTable][1] * (arfcn - arfcnFreqTable[indexTable][3]));
+ return (freq);
}
}
DU_LOG("ERROR --> DUAPP: ARFCN vaid range is between 0 and 3279165");
}
}
DU_LOG("ERROR --> DUAPP: ARFCN vaid range is between 0 and 3279165");
- return (freq
*1000
);
+ return (freq);
}
}
@@
-472,7
+483,7
@@
uint32_t convertArfcnToFreqKhz(uint32_t arfcn)
* 3GPP TS 38.104, Table 5.4.2.1-1
* Formula: NREF = NREF-Offs + (FREF – FREF-Offs) / ΔFGlobal
*
* 3GPP TS 38.104, Table 5.4.2.1-1
* Formula: NREF = NREF-Offs + (FREF – FREF-Offs) / ΔFGlobal
*
-* @params[in] uint32_t Freq(
M
HZ)
+* @params[in] uint32_t Freq(
k
HZ)
*
* @return [out] uint32_t ARFCN(number)
*
*
* @return [out] uint32_t ARFCN(number)
*
@@
-482,11
+493,11
@@
uint32_t convertFreqToArfcn(uint32_t freq)
uint8_t indexTable = 0;
uint32_t arfcn = 0;
uint8_t indexTable = 0;
uint32_t arfcn = 0;
- for(indexTable = 0; indexTable <
4
; indexTable++)
+ for(indexTable = 0; indexTable <
3
; indexTable++)
{
{
- if(freq <
arfcnFreqTable[indexTable][0]
)
+ if(freq <
(arfcnFreqTable[indexTable][0] * 1000)
)
{
{
- arfcn = arfcnFreqTable[indexTable][3] + ((freq -
arfcnFreqTable[indexTable][2]
) / (arfcnFreqTable[indexTable][1]));
+ arfcn = arfcnFreqTable[indexTable][3] + ((freq -
(arfcnFreqTable[indexTable][2] * 1000)
) / (arfcnFreqTable[indexTable][1]));
return (arfcn);
}
}
return (arfcn);
}
}