1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
18 /* header include files (.h) */
19 #include "common_def.h"
20 #include "mac_utils.h"
23 uint32_t shortBsrBytesTable[MAX_SHORT_BSR_TABLE_ENTRIES] = { 0, 10, 14, 20, 28, \
24 38, 53, 74, 102, 142, 198, 276, 384, 535, 745, 1038, 1446, 2014, 2806, 3909, \
25 5446, 7587, 10570, 14726, 20516, 28581, 39818, 55474, 77284, 107669, 150000, \
28 /*******************************************************************
30 * @brief Allocates a crnti for new UE
34 * Function : getNewCrnti
36 * Functionality: Allocates a crnti for new UE
38 * @params[in] CRNTI bit map
39 * @return ROK - success
42 * ****************************************************************/
43 uint16_t getNewCrnti(uint8_t *crntiMap)
45 uint8_t bitIdx = 0; /* bit position */
46 uint8_t mask = 1; /* bit mask */
47 uint16_t newCrnti; /* new crnti */
51 /* Find the first unset bit in crntiMap and allocate
52 * this as new crnti */
53 if((*crntiMap & (mask << bitIdx)) == 0)
55 newCrnti = ODU_START_CRNTI + bitIdx;
56 SET_ONE_BIT(bitIdx, *crntiMap);