X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Flwr_mac_util.c;h=0a926913cc95673a0629298eb6ad723e6d53b0fb;hb=b5a77f556b20a2acd7d653367fdcac030461f85b;hp=7071432acbf1ed3df59b61414ac2118ad3315fca;hpb=483d527d19566ecca87eee46a198bab6c890c6bb;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_util.c b/src/5gnrmac/lwr_mac_util.c index 7071432ac..0a926913c 100644 --- a/src/5gnrmac/lwr_mac_util.c +++ b/src/5gnrmac/lwr_mac_util.c @@ -18,16 +18,7 @@ /* This file contains all utility functions for MAC CL */ -#include "stdio.h" -#include "envopt.h" -#include "envdep.h" -#include "envind.h" -#include "gen.h" -#include "ssi.h" -#include "cm_hash.h" -#include "gen.x" -#include "ssi.x" -#include "cm_hash.x" +#include "common_def.h" #include "lwr_mac.h" /******************************************************************* @@ -46,22 +37,22 @@ * NULLP - failure * * ****************************************************************/ -PUBLIC ClCellCb * rgClUtlGetCellCb +LwrMacCellCb * lwrMacGetCellCb ( - U16 cellId + uint16_t cellId ) { - ClCellCb *cellCb; + LwrMacCellCb *cellCb; - if(cellId >= MAX_NUM_CELL_SUPP) + if(cellId >= MAX_NUM_CELL) { - printf("\n Invalid Cell Id [%d]. rgClUtlGetCellCb failed.", cellId); - RETVALUE(NULLP); + DU_LOG("\nERROR --> Invalid Cell Id [%d]. rgClUtlGetCellCb failed.", cellId); + return NULLP; } - - cmHashListFind((CmHashListCp *)&clGlobalCp.cellCbLst, (U8 *)&cellId, sizeof(U16), 0, (PTR *)&cellCb); - RETVALUE(cellCb); + cellCb = &lwrMacCb.cellCb[cellId -1]; + + return cellCb; } /******************************************************************* @@ -83,11 +74,11 @@ PUBLIC ClCellCb * rgClUtlGetCellCb uint32_t reverseBits(uint32_t num, uint8_t numBits) { uint32_t reverse_num = 0; - int i; - for (i = 0; i < numBits; i++) + uint8_t bitIdx; + for (bitIdx = 0; bitIdx < numBits; bitIdx++) { - if((num & (1 << i))) - reverse_num |= 1 << ((numBits - 1) - i); + if((num & (1 << bitIdx))) + reverse_num |= 1 << ((numBits - 1) - bitIdx); } return reverse_num; } @@ -113,7 +104,7 @@ uint32_t reverseBits(uint32_t num, uint8_t numBits) * ****************************************************************/ void fillDlDciPayload(uint8_t *buf, uint8_t *bytePos, uint8_t *bitPos,\ - uint32_t val, uint8_t valSize) + uint32_t val, uint8_t valSize) { uint8_t temp; uint8_t bytePart1; @@ -147,5 +138,5 @@ void fillDlDciPayload(uint8_t *buf, uint8_t *bytePos, uint8_t *bitPos,\ /********************************************************************** - End of file -**********************************************************************/ + End of file + **********************************************************************/