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 *******************************************************************************/
19 /************************************************************************
25 Desc: C source code for scheduler utilities
29 **********************************************************************/
32 @brief This file implements the schedulers util functions.
36 #include "sch_utils.h"
38 /* spec-38.213 Table 13-1 */
39 int8_t coresetIdxTable[MAX_CORESET_INDEX][4] = {
40 { 1, 24, 2, 0}, /* index 0 */
41 { 1, 24, 2, 2}, /* index 1 */
42 { 1, 24, 2, 4}, /* index 2 */
43 { 1, 24, 3, 0}, /* index 3 */
44 { 1, 24, 3, 2}, /* index 4 */
45 { 1, 24, 3, 4}, /* index 5 */
46 { 1, 48, 1, 12}, /* index 6 */
47 { 1, 48, 1, 16}, /* index 7 */
48 { 1, 48, 2, 12}, /* index 8 */
49 { 1, 48, 2, 16}, /* index 9 */
50 { 1, 48, 3, 12}, /* index 10 */
51 { 1, 48, 3, 16}, /* index 11 */
52 { 1, 96, 1, 38}, /* index 12 */
53 { 1, 96, 2, 38}, /* index 13 */
54 { 1, 96, 3, 38}, /* index 14 */
55 { 0, 0, 0, 0}, /* index 15 */
58 /* spec-38.213 Table 13-11 */
59 /* m value is scaled to 2, when using it in formula, divide by 2 */
60 /* firstSymbol will vary depends on i, hence not filled */
61 int8_t searchSpaceIdxTable[MAX_SEARCH_SPACE_INDEX][4] = {
62 { 0, 1, 2, 0}, /* index 0 */
63 { 0, 2, 1, 0}, /* index 1 */
64 { 2, 1, 2, 0}, /* index 2 */
65 { 2, 2, 1, 0}, /* index 3 */
66 { 5, 1, 2, 0}, /* index 4 */
67 { 5, 2, 1, 0}, /* index 5 */
68 { 7, 1, 2, 0}, /* index 6 */
69 { 7, 2, 1, 0}, /* index 7 */
70 { 0, 1, 4, 0}, /* index 8 */
71 { 5, 1, 4, 0}, /* index 9 */
72 { 0, 1, 2, 0}, /* index 10 */
73 { 0, 1, 2, 0}, /* index 11 */
74 { 2, 1, 2, 0}, /* index 12 */
75 { 2, 1, 2, 0}, /* index 13 */
76 { 5, 1, 2, 0}, /* index 14 */
77 { 5, 1, 2, 0}, /* index 15 */
82 /* spec-38.211 Table 6.3.3.2-1 */
83 /* Lra, delFRa, delF, numRb, k' */
84 uint16_t numRbForPrachTable[MAX_RACH_NUM_RB_IDX][5] = {
85 { 839, 1.25, 15, 6, 7 }, /* index 0 */
86 { 839, 1.25, 30, 3, 1 }, /* index 1 */
87 { 839, 1.25, 60, 2, 133 }, /* index 2 */
88 { 839, 5, 15, 24, 12 }, /* index 3 */
89 { 839, 5, 30, 12, 10 }, /* index 4 */
90 { 839, 5, 60, 6, 7 }, /* index 5 */
91 { 139, 15, 15, 12, 2 }, /* index 6 */
92 { 139, 15, 30, 6, 2 }, /* index 7 */
93 { 139, 15, 60, 3, 2 }, /* index 8 */
94 { 139, 30, 15, 24, 2 }, /* index 9 */
95 { 139, 30, 30, 12, 2 }, /* index 10 */
96 { 139, 30, 60, 6, 2 }, /* index 11 */
97 { 139, 60, 60, 12, 2 }, /* index 12 */
98 { 139, 60, 120, 6, 2 }, /* index 13 */
99 { 139, 120, 60, 24, 2 }, /* index 14 */
100 { 139, 120, 120, 12, 2 }, /* index 15 */
103 /* prach config index Table 6.3.3.2-2 spec 38.211
104 * PRACH format given as follows:
119 * Subframe num is represented considering 0-9 bits and
120 * value 1 corresponds to the subframe that is valid
123 uint16_t prachCfgIdxTable[MAX_PRACH_CONFIG_IDX][8] = {
124 { 0, 16, 1, 2, 0, 0, 0, 0 }, /* index 0 */
125 { 0, 16, 1, 16, 0, 0, 0, 0 }, /* index 1 */
126 { 0, 16, 1, 128, 0, 0, 0, 0 }, /* index 2 */
127 { 0, 16, 1, 512, 0, 0, 0, 0 }, /* index 3 */
128 { 0, 8, 1, 2, 0, 0, 0, 0 }, /* index 4 */
129 { 0, 8, 1, 16, 0, 0, 0, 0 }, /* index 5 */
130 { 0, 8, 1, 128, 0, 0, 0, 0 }, /* index 6 */
131 { 0, 8, 1, 512, 0, 0, 0, 0 }, /* index 7 */
132 { 0, 4, 1, 2, 0, 0, 0, 0 }, /* index 8 */
133 { 0, 4, 1, 16, 0, 0, 0, 0 }, /* index 9 */
134 { 0, 4, 1, 128, 0, 0, 0, 0 }, /* index 10 */
135 { 0, 4, 1, 512, 0, 0, 0, 0 }, /* index 11 */
136 { 0, 2, 1, 2, 0, 0, 0, 0 }, /* index 12 */
137 { 0, 2, 1, 16, 0, 0, 0, 0 }, /* index 13 */
138 { 0, 2, 1, 128, 0, 0, 0, 0 }, /* index 14 */
139 { 0, 2, 1, 512, 0, 0, 0, 0 }, /* index 15 */
140 { 0, 1, 0, 2, 0, 0, 0, 0 }, /* index 16 */
141 { 0, 1, 0, 16, 0, 0, 0, 0 }, /* index 17 */
142 { 0, 1, 0, 128, 0, 0, 0, 0 }, /* index 18 */
143 { 0, 1, 0, 66, 0, 0, 0, 0 }, /* index 19 */
144 { 0, 1, 0, 132, 0, 0, 0, 0 }, /* index 20 */
145 { 0, 1, 0, 264, 0, 0, 0, 0 }, /* index 21 */
146 { 0, 1, 0, 146, 0, 0, 0, 0 }, /* index 22 */
147 { 0, 1, 0, 292, 0, 0, 0, 0 }, /* index 23 */
148 { 0, 1, 0, 584, 0, 0, 0, 0 }, /* index 24 */
149 { 0, 1, 0, 341, 0, 0, 0, 0 }, /* index 25 */
150 { 0, 1, 0, 682, 0, 0, 0, 0 }, /* index 26 */
151 { 0, 1, 0, 1023, 0, 0, 0, 0 }, /* index 27 */
152 { 1, 16, 1, 2, 0, 0, 0, 0 }, /* index 28 */
153 { 1, 16, 1, 16, 0, 0, 0, 0 }, /* index 29 */
154 { 1, 16, 1, 128, 0, 0, 0, 0 }, /* index 30 */
155 { 1, 16, 1, 512, 0, 0, 0, 0 }, /* index 31 */
156 { 1, 8, 1, 2, 0, 0, 0, 0 }, /* index 32 */
157 { 1, 8, 1, 16, 0, 0, 0, 0 }, /* index 33 */
158 { 1, 8, 1, 128, 0, 0, 0, 0 }, /* index 34 */
159 { 1, 8, 1, 512, 0, 0, 0, 0 }, /* index 35 */
160 { 1, 4, 1, 2, 0, 0, 0, 0 }, /* index 36 */
161 { 1, 4, 1, 16, 0, 0, 0, 0 }, /* index 37 */
162 { 1, 4, 1, 128, 0, 0, 0, 0 }, /* index 38 */
163 { 1, 4, 1, 512, 0, 0, 0, 0 }, /* index 39 */
164 { 1, 2, 1, 2, 0, 0, 0, 0 }, /* index 40 */
165 { 1, 2, 1, 16, 0, 0, 0, 0 }, /* index 41 */
166 { 1, 2, 1, 128, 0, 0, 0, 0 }, /* index 42 */
167 { 1, 2, 1, 512, 0, 0, 0, 0 }, /* index 43 */
168 { 1, 1, 0, 2, 0, 0, 0, 0 }, /* index 44 */
169 { 1, 1, 0, 16, 0, 0, 0, 0 }, /* index 45 */
170 { 1, 1, 0, 128, 0, 0, 0, 0 }, /* index 46 */
171 { 1, 1, 0, 64, 0, 0, 0, 0 }, /* index 47 */
172 { 1, 1, 0, 132, 0, 0, 0, 0 }, /* index 48 */
173 { 1, 1, 0, 264, 0, 0, 0, 0 }, /* index 49 */
174 { 1, 1, 0, 146, 0, 0, 0, 0 }, /* index 50 */
175 { 1, 1, 0, 292, 0, 0, 0, 0 }, /* index 51 */
176 { 1, 1, 0, 584, 0, 0, 0, 0 }, /* index 52 */
177 { 2, 16, 1, 2, 0, 0, 0, 0 }, /* index 53 */
178 { 2, 8, 1, 2, 0, 0, 0, 0 }, /* index 54 */
179 { 2, 4, 0, 2, 0, 0, 0, 0 }, /* index 55 */
180 { 2, 2, 0, 2, 0, 0, 0, 0 }, /* index 56 */
181 { 2, 2, 0, 32, 0, 0, 0, 0 }, /* index 57 */
182 { 2, 1, 0, 2, 0, 0, 0, 0 }, /* index 58 */
183 { 2, 1, 0, 32, 0, 0, 0, 0 }, /* index 59 */
184 { 3, 16, 1, 2, 0, 0, 0, 0 }, /* index 60 */
185 { 3, 16, 1, 16, 0, 0, 0, 0 }, /* index 61 */
186 { 3, 16, 1, 128, 0, 0, 0, 0 }, /* index 62 */
187 { 3, 16, 1, 512, 0, 0, 0, 0 }, /* index 63 */
188 { 3, 8, 1, 2, 0, 0, 0, 0 }, /* index 64 */
189 { 3, 8, 1, 16, 0, 0, 0, 0 }, /* index 65 */
190 { 3, 8, 1, 128, 0, 0, 0, 0 }, /* index 66 */
191 { 3, 4, 1, 2, 0, 0, 0, 0 }, /* index 67 */
192 { 3, 4, 1, 16, 0, 0, 0, 0 }, /* index 68 */
193 { 3, 4, 1, 128, 0, 0, 0, 0 }, /* index 69 */
194 { 3, 4, 1, 512, 0, 0, 0, 0 }, /* index 70 */
195 { 3, 2, 1, 2, 0, 0, 0, 0 }, /* index 71 */
196 { 3, 2, 1, 16, 0, 0, 0, 0 }, /* index 72 */
197 { 3, 2, 1, 128, 0, 0, 0, 0 }, /* index 73 */
198 { 3, 2, 1, 512, 0, 0, 0, 0 }, /* index 74 */
199 { 3, 1, 0, 2, 0, 0, 0, 0 }, /* index 75 */
200 { 3, 1, 0, 16, 0, 0, 0, 0 }, /* index 76 */
201 { 3, 1, 0, 128, 0, 0, 0, 0 }, /* index 77 */
202 { 3, 1, 0, 66, 0, 0, 0, 0 }, /* index 78 */
203 { 3, 1, 0, 132, 0, 0, 0, 0 }, /* index 79 */
204 { 3, 1, 0, 264, 0, 0, 0, 0 }, /* index 80 */
205 { 3, 1, 0, 146, 0, 0, 0, 0 }, /* index 81 */
206 { 3, 1, 0, 292, 0, 0, 0, 0 }, /* index 82 */
207 { 3, 1, 0, 584, 0, 0, 0, 0 }, /* index 83 */
208 { 3, 1, 0, 341, 0, 0, 0, 0 }, /* index 84 */
209 { 3, 1, 0, 682, 0, 0, 0, 0 }, /* index 85 */
210 { 3, 1, 0, 1023, 0, 0, 0, 0 }, /* index 86 */
211 { 4, 16, 0, 528, 0, 1, 6, 2 }, /* index 87 */
212 { 4, 16, 1, 16, 0, 2, 6, 2 }, /* index 88 */
213 { 4, 8, 0, 528, 0, 1, 6, 2 }, /* index 89 */
214 { 4, 8, 1, 16, 0, 2, 6, 2 }, /* index 90 */
215 { 4, 4, 0, 528, 0, 1, 6, 2 }, /* index 91 */
216 { 4, 4, 1, 528, 0, 1, 6, 2 }, /* index 92 */
217 { 4, 4, 0, 16, 0, 2, 6, 2 }, /* index 93 */
218 { 4, 2, 0, 528, 0, 1, 6, 2 }, /* index 94 */
219 { 4, 2, 0, 2, 0, 2, 6, 2 }, /* index 95 */
220 { 4, 2, 0, 16, 0, 2, 6, 2 }, /* index 96 */
221 { 4, 2, 0, 128, 0, 2, 6, 2 }, /* index 97 */
222 { 4, 1, 0, 16, 0, 1, 6, 2 }, /* index 98 */
223 { 4, 1, 0, 66, 0, 1, 6, 2 }, /* index 99 */
224 { 4, 1, 0, 528, 0, 1, 6, 2 }, /* index 100 */
225 { 4, 1, 0, 2, 0, 2, 6, 2 }, /* index 101 */
226 { 4, 1, 0, 128, 0, 2, 6, 2 }, /* index 102 */
227 { 4, 1, 0, 132, 0, 2, 6, 2 }, /* index 103 */
228 { 4, 1, 0, 146, 0, 2, 6, 2 }, /* index 104 */
229 { 4, 1, 0, 341, 0, 2, 6, 2 }, /* index 105 */
230 { 4, 1, 0, 1023, 0, 2, 6, 2 }, /* index 106 */
231 { 4, 1, 0, 682, 0, 2, 6, 2 }, /* index 107 */
232 {11, 2, 0, 528, 0, 1, 7, 2 }, /* index 108 */
233 {11, 2, 0, 16, 0, 2, 7, 2 }, /* index 109 */
234 {11, 1, 0, 16, 0, 1, 7, 2 }, /* index 110 */
235 {11, 1, 0, 66, 0, 1, 7, 2 }, /* index 111 */
236 {11, 1, 0, 528, 0, 1, 7, 2 }, /* index 112 */
237 {11, 1, 0, 2, 0, 2, 7, 2 }, /* index 113 */
238 {11, 1, 0, 128, 0, 2, 7, 2 }, /* index 114 */
239 {11, 1, 0, 146, 0, 2, 7, 2 }, /* index 115 */
240 {11, 1, 0, 341, 0, 2, 7, 2 }, /* index 116 */
241 { 5, 16, 1, 580, 0, 1, 3, 4 }, /* index 117 */
242 { 5, 16, 1, 16, 0, 2, 3, 4 }, /* index 118 */
243 { 5, 8, 1, 580, 0, 1, 3, 4 }, /* index 119 */
244 { 5, 8, 1, 16, 0, 2, 3, 4 }, /* index 120 */
245 { 5, 4, 0, 580, 0, 1, 3, 4 }, /* index 121 */
246 { 5, 4, 0, 16, 0, 2, 3, 4 }, /* index 122 */
247 { 5, 2, 1, 580, 0, 1, 3, 4 }, /* index 123 */
248 { 5, 2, 0, 2, 0, 2, 3, 4 }, /* index 124 */
249 { 5, 2, 0, 16, 0, 2, 3, 4 }, /* index 125 */
250 { 5, 2, 0, 128, 0, 2, 3, 4 }, /* index 126 */
251 { 5, 1, 0, 16, 0, 1, 3, 4 }, /* index 127 */
252 { 5, 1, 0, 66, 0, 1, 3, 4 }, /* index 128 */
253 { 5, 1, 0, 528, 0, 1, 3, 4 }, /* index 129 */
254 { 5, 1, 0, 2, 0, 2, 3, 4 }, /* index 130 */
255 { 5, 1, 0, 128, 0, 2, 3, 4 }, /* index 131 */
256 { 5, 1, 0, 132, 0, 2, 3, 4 }, /* index 132 */
257 { 5, 1, 0, 146, 0, 2, 3, 4 }, /* index 133 */
258 { 5, 1, 0, 341, 0, 2, 3, 4 }, /* index 134 */
259 { 5, 1, 0, 1023, 0, 2, 3, 4 }, /* index 135 */
260 { 5, 1, 0, 682, 0, 2, 3, 4 }, /* index 136 */
261 {12, 2, 1, 580, 0, 1, 3, 4 }, /* index 137 */
262 {12, 2, 2, 16, 0, 1, 3, 4 }, /* index 138 */
263 {12, 2, 1, 16, 0, 1, 3, 4 }, /* index 139 */
264 {12, 2, 1, 66, 0, 1, 3, 4 }, /* index 140 */
265 {12, 2, 1, 528, 0, 1, 3, 4 }, /* index 141 */
266 {12, 2, 1, 2, 0, 1, 3, 4 }, /* index 142 */
267 {12, 2, 1, 128, 0, 1, 3, 4 }, /* index 143 */
268 {12, 2, 1, 146, 0, 1, 3, 4 }, /* index 144 */
269 {12, 2, 1, 341, 0, 1, 3, 4 }, /* index 145 */
270 {12, 2, 1, 1023, 0, 1, 3, 4 }, /* index 146 */
271 { 6, 16, 1, 528, 0, 1, 2, 6 }, /* index 147 */
272 { 6, 16, 1, 16, 0, 2, 2, 6 }, /* index 148 */
273 { 6, 8, 1, 528, 0, 1, 2, 6 }, /* index 149 */
274 { 6, 8, 1, 16, 0, 2, 2, 6 }, /* index 150 */
275 { 6, 4, 0, 528, 0, 1, 2, 6 }, /* index 151 */
276 { 6, 4, 0, 16, 0, 2, 2, 6 }, /* index 152 */
277 { 6, 2, 1, 580, 0, 2, 2, 6 }, /* index 153 */
278 { 6, 2, 0, 2, 0, 2, 2, 6 }, /* index 154 */
279 { 6, 2, 0, 16, 0, 2, 2, 6 }, /* index 155 */
280 { 6, 2, 0, 128, 0, 2, 2, 6 }, /* index 156 */
281 { 6, 1, 0, 16, 0, 1, 2, 6 }, /* index 157 */
282 { 6, 1, 0, 66, 0, 1, 2, 6 }, /* index 158 */
283 { 6, 1, 0, 528, 0, 1, 2, 6 }, /* index 159 */
284 { 6, 1, 0, 2, 0, 2, 2, 6 }, /* index 160 */
285 { 6, 1, 0, 128, 0, 2, 2, 6 }, /* index 161 */
286 { 6, 1, 0, 132, 0, 2, 2, 6 }, /* index 162 */
287 { 6, 1, 0, 146, 0, 2, 2, 6 }, /* index 163 */
288 { 6, 1, 0, 341, 0, 2, 2, 6 }, /* index 164 */
289 { 6, 1, 0, 1023, 0, 2, 2, 6 }, /* index 165 */
290 { 6, 1, 0, 682, 0, 2, 2, 6 }, /* index 166 */
291 {13, 2, 1, 580, 0, 2, 2, 6 }, /* index 167 */
292 {13, 2, 2, 16, 0, 2, 2, 6 }, /* index 168 */
293 {13, 2, 1, 16, 0, 1, 2, 6 }, /* index 169 */
294 {13, 2, 1, 66, 0, 1, 2, 6 }, /* index 170 */
295 {13, 2, 1, 528, 0, 1, 2, 6 }, /* index 171 */
296 {13, 2, 1, 2, 0, 2, 2, 6 }, /* index 172 */
297 {13, 2, 1, 128, 0, 2, 2, 6 }, /* index 173 */
298 {13, 2, 1, 146, 0, 2, 2, 6 }, /* index 174 */
299 {13, 2, 1, 341, 0, 2, 2, 6 }, /* index 175 */
300 {13, 2, 1, 1023, 0, 2, 2, 6 }, /* index 176 */
301 { 7, 16, 0, 528, 0, 1, 7, 2 }, /* index 177 */
302 { 7, 16, 1, 16, 0, 2, 7, 2 }, /* index 178 */
303 { 7, 8, 0, 528, 0, 1, 7, 2 }, /* index 179 */
304 { 7, 8, 1, 16, 0, 2, 7, 2 }, /* index 180 */
305 { 7, 4, 0, 528, 0, 1, 7, 2 }, /* index 181 */
306 { 7, 4, 1, 528, 0, 1, 7, 2 }, /* index 182 */
307 { 7, 4, 0, 16, 0, 2, 7, 2 }, /* index 183 */
308 { 7, 2, 0, 528, 0, 1, 7, 2 }, /* index 184 */
309 { 7, 2, 0, 2, 0, 2, 7, 2 }, /* index 185 */
310 { 7, 2, 0, 16, 0, 2, 7, 2 }, /* index 186 */
311 { 7, 2, 0, 128, 0, 2, 7, 2 }, /* index 187 */
312 { 7, 1, 0, 16, 0, 1, 7, 2 }, /* index 188 */
313 { 7, 1, 0, 66, 0, 1, 7, 2 }, /* index 189 */
314 { 7, 1, 0, 528, 0, 1, 7, 2 }, /* index 190 */
315 { 7, 1, 0, 2, 0, 2, 7, 2 }, /* index 191 */
316 { 7, 1, 0, 128, 0, 2, 7, 2 }, /* index 192 */
317 { 7, 1, 0, 132, 0, 2, 7, 2 }, /* index 193 */
318 { 7, 1, 0, 146, 0, 2, 7, 2 }, /* index 194 */
319 { 7, 1, 0, 341, 0, 2, 7, 2 }, /* index 195 */
320 { 7, 1, 0, 1023, 0, 2, 7, 2 }, /* index 196 */
321 { 7, 1, 0, 682, 0, 2, 7, 2 }, /* index 197 */
322 { 8, 16, 0, 528, 0, 2, 1, 12 }, /* index 198 */
323 { 8, 16, 1, 16, 0, 2, 1, 12 }, /* index 199 */
324 { 8, 8, 0, 528, 0, 2, 1, 12 }, /* index 200 */
325 { 8, 8, 1, 16, 0, 2, 1, 12 }, /* index 201 */
326 { 8, 4, 0, 528, 0, 2, 1, 12 }, /* index 202 */
327 { 8, 4, 0, 16, 0, 2, 1, 12 }, /* index 203 */
328 { 8, 4, 1, 528, 0, 2, 1, 12 }, /* index 204 */
329 { 8, 2, 0, 528, 0, 2, 1, 12 }, /* index 205 */
330 { 8, 2, 0, 2, 0, 2, 1, 12 }, /* index 206 */
331 { 8, 2, 0, 16, 0, 2, 1, 12 }, /* index 207 */
332 { 8, 2, 0, 128, 0, 2, 1, 12 }, /* index 208 */
333 { 8, 1, 0, 2, 0, 2, 1, 12 }, /* index 209 */
334 { 8, 1, 0, 16, 0, 2, 1, 12 }, /* index 210 */
335 { 8, 1, 0, 128, 0, 2, 1, 12 }, /* index 211 */
336 { 8, 1, 0, 66, 0, 2, 1, 12 }, /* index 212 */
337 { 8, 1, 0, 132, 0, 2, 1, 12 }, /* index 213 */
338 { 8, 1, 0, 528, 0, 2, 1, 12 }, /* index 214 */
339 { 8, 1, 0, 146, 0, 2, 1, 12 }, /* index 215 */
340 { 8, 1, 0, 341, 0, 2, 1, 12 }, /* index 216 */
341 { 8, 1, 0, 1023, 0, 2, 1, 12 }, /* index 217 */
342 { 8, 1, 0, 682, 0, 2, 1, 12 }, /* index 218 */
343 { 9, 8, 1, 16, 0, 2, 7, 2 }, /* index 219 */
344 { 9, 4, 1, 528, 0, 1, 7, 2 }, /* index 220 */
345 { 9, 4, 0, 16, 0, 2, 7, 2 }, /* index 221 */
346 { 9, 2, 0, 528, 0, 1, 7, 2 }, /* index 222 */
347 { 9, 2, 0, 2, 0, 2, 7, 2 }, /* index 223 */
348 { 9, 2, 0, 16, 0, 2, 7, 2 }, /* index 224 */
349 { 9, 2, 0, 128, 0, 2, 7, 2 }, /* index 225 */
350 { 9, 1, 0, 16, 0, 1, 7, 2 }, /* index 226 */
351 { 9, 1, 0, 66, 0, 1, 7, 2 }, /* index 227 */
352 { 9, 1, 0, 528, 0, 1, 7, 2 }, /* index 228 */
353 { 9, 1, 0, 2, 0, 2, 7, 2 }, /* index 229 */
354 { 9, 1, 0, 128, 0, 2, 7, 2 }, /* index 230 */
355 { 9, 1, 0, 132, 0, 2, 7, 2 }, /* index 231 */
356 { 9, 1, 0, 146, 0, 2, 7, 2 }, /* index 232 */
357 { 9, 1, 0, 341, 0, 2, 7, 2 }, /* index 233 */
358 { 9, 1, 0, 1023, 0, 2, 7, 2 }, /* index 234 */
359 { 9, 1, 0, 682, 0, 2, 7, 2 }, /* index 235 */
360 {10, 16, 1, 528, 0, 1, 2, 6 }, /* index 236 */
361 {10, 16, 1, 16, 0, 2, 2, 6 }, /* index 237 */
362 {10, 8, 1, 528, 0, 1, 2, 6 }, /* index 238 */
363 {10, 8, 1, 16, 0, 2, 2, 6 }, /* index 239 */
364 {10, 4, 0, 528, 0, 1, 2, 6 }, /* index 240 */
365 {10, 4, 0, 16, 0, 2, 2, 6 }, /* index 241 */
366 {10, 2, 1, 580, 0, 2, 2, 6 }, /* index 242 */
367 {10, 2, 0, 2, 0, 2, 2, 6 }, /* index 243 */
368 {10, 2, 0, 16, 0, 2, 2, 6 }, /* index 244 */
369 {10, 2, 0, 128, 0, 2, 2, 6 }, /* index 245 */
370 {10, 1, 0, 16, 0, 1, 2, 6 }, /* index 246 */
371 {10, 1, 0, 66, 0, 1, 2, 6 }, /* index 247 */
372 {10, 1, 0, 528, 0, 1, 2, 6 }, /* index 248 */
373 {10, 1, 0, 1, 0, 2, 2, 6 }, /* index 249 */
374 {10, 1, 0, 128, 0, 2, 2, 6 }, /* index 250 */
375 {10, 1, 0, 132, 0, 2, 2, 6 }, /* index 251 */
376 {10, 1, 0, 146, 0, 2, 2, 6 }, /* index 252 */
377 {10, 1, 0, 341, 0, 2, 2, 6 }, /* index 253 */
378 {10, 1, 0, 1023, 0, 2, 2, 6 }, /* index 254 */
379 {10, 1, 0, 682, 0, 2, 2, 6 } /* index 255 */
382 /* Defintion of delta value Table 6.1.2.1.1-5 spec 38.214 */
383 uint8_t puschDeltaTable[MAX_MU_PUSCH] = { 2, 3, 4, 6 };
386 * @brief frequency domain allocation function.
390 * Function: canclulatePRB
392 * This function does allocation in frequency domain resource. using
393 * bitwise operator, the bits are set for the PRBs.
395 * @param[in] startPrb - start PRB from where the freq alloc starts.
396 * @param[in] prbSize - number of PRBs to be allocted.
397 * @param[in] freqDomain - 6 bytes of info, each bit represents a group of 6 PRB.
400 void calculatePRB(uint16_t startPrb, uint16_t prbSize, uint8_t *freqDomain)
402 uint8_t remBits = prbSize; /* each bit represents 6 PRBs */
403 uint8_t firstByte = 1;
404 uint8_t numBits,startBit,byteCount = 0;
408 /* when the startPrb is not in this byteCount */
416 /* max bytecount is 6 nearly equal to 45 bits*/
420 /* when we are filling the second byte, then the start should be equal to 0 */
426 /* calculate the number of bits to be set in this byte */
427 if((remBits+startPrb) <= 8)
430 numBits = 8 - startBit;
432 /* bit operation to set the bits */
433 SET_BITS((startBit % 8),numBits,freqDomain[byteCount])
436 /* the ramaining bits should be subtracted with the numBits set in this byte */
442 /**********************************************************************
444 **********************************************************************/