CRC and Rx Data Indication
[o-du/l2.git] / src / cm / tfu.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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
19 /**********************************************************************
20      Name:    Lower layer interface - TFU
21
22      Type:    C header file
23
24      Desc:    Constants needed for TFU interface
25
26      File:    tfu.h
27
28 *********************************************************************21*/
29
30 /**
31   @file tfu.h
32   @brief Defines for TFU interface.
33   */
34
35 #ifndef __TFU_H__
36 #define __TFU_H__
37
38 /* Define for the block size for memory allocation */
39 /** @name TFU_TDD */
40 /** @{ */
41 #define TFU_MAX_HQ_RES        4     /*!< n^1 Pucch resources for
42                                                     HARQ feedback */
43
44 #ifdef TFU_5GTF
45 #define TFU_RIV_324        324     /*!<  RV value 324 */
46 #define TFU_RIV_325        325     /*!<  RV value 325 */
47 #define TFU_RIV_326        326     /*!<  RV value 326 */
48 #endif
49
50 #ifdef TFU_TDD
51 #define TFU_BLKSZ                 2048  /*!< Block size for memory allocations. */
52 #else
53 /* tfu_h_001.main_3  Changing from 4096 to 1500 to align with max bucket-max 
54  * packet sizes - optimization*/
55 #define TFU_BLKSZ                 1500  /*!< Block size for memory allocations. */
56 #endif
57 /* tfu_h_001.main_6. Added changes of TFU_UPGRADE */
58 #ifdef TFU_UPGRADE
59 #define TFU_MAX_UL_RB             110   /*!< Maximum number of RBs in UL */
60 #define TFU_MAX_CQI_BYTES         9     /*!< Maximum number of CQI Bytes length */
61 #define TFU_MAX_PHY_ANTENNA       4     /*!<  Maximum number of Physical Antennas */
62 #endif /* TFU_UPGRADE */
63
64 #define TFU_MAX_RAPID_IN_SUBFRAME 64    /*!< Maximum number of Random access preambes in a subframe. */
65 #define TFU_MAX_UL_SUBBAND        110   /*!< Maxiumum number of Uplink Subbands.*/
66 #define TFU_MAX_DL_SUBBAND        110   /*!< Maxiumum number of Downlink Subbands.*/
67 #define TFU_MAX_TB                2    /*!< Maximum number of Transport blocks per UE. */
68 #ifdef L2_OPTMZ
69 #define TFU_MAX_PDU               8    /*!< This No is mapped to RGU_MAX_PDU*/
70 #define TFU_MAX_LC                10    /*!< This No is mapped to RGU_MAX_LC*/
71 #endif
72 #define TFU_MAX_M                 4    /*!< Maximum value of "M" for HARQ Feedback multiplexing. */
73 #define TFU_MAX_2BIT_TPC          16   /*!< Maximum number of 2 bit TPC commands. */
74 #define TFU_MAX_1BIT_TPC          32   /*!< Maximum number of 1 bit TPC commands. */
75 /*tfu_h_001.main_5 - Added support for SPS*/
76 /* Tunable parameter */
77 #define TFU_MAX_MEMBLK_SIZE       1500 /* tfu_h_001.main_3 Changing from 2048 to 1500 
78                                           for alignment and optimization */
79
80 #define TFU_UBNDREQ_MNGMT         1    /*!< TFU sap unbind reason */
81
82 #ifdef LTE_ADV
83 #define TFU_MAX_FDD_HARQ_FDBKS       10 
84 #define TFU_MAX_HARQ_FDBKS       20 /*For Rel10 UE
85                                      Considering 10 bit requirement of PUCCH Format 3*/
86 #else
87 #define TFU_MAX_HARQ_FDBKS       TFU_MAX_TB /*For Rel8/Rel9 UE*/
88 #endif/*LTE_ADV*/
89
90 /* Selector */
91 #define MAC_SELECTOR_LC   0
92 #define MAC_SELECTOR_TC   1
93 #define MAC_SELECTOR_LWLC 2
94
95 /* Event corresponding to each primitive at this interface */
96 #define EVTTFUBNDREQ            1     /*!< Bind Request */
97 #define EVTTFUBNDCFM            2     /*!< Bind Confirm */
98 #define EVTTFUUBNDREQ           3     /*!< Unbind Request */
99 #define EVTTFUSCHBNDREQ         4     /*!< Bind Request */
100 #define EVTTFUSCHBNDCFM         5     /*!< Bind Confirm */
101 #define EVTTFUSCHUBNDREQ        6     /*!< Unbind Request */
102 #define EVTTFURAREQIND          7     /*!< Random access request indication. */
103 #define EVTTFURECPREQ           8     /*!< Reception Request. */
104 #define EVTTFUULCQIIND          9     /*!< Uplink CQI indication.*/
105 #define EVTTFUHQIND             10    /*!< HARQ Feedback indication. */
106 #define EVTTFUDLCQIIND          11    /*!< Downlink CQI indication. */
107 #define EVTTFUSRIND             12    /*!< Scheduling Request indication.*/
108 #define EVTTFUDATIND            13    /*!< Data indication.*/
109 #define EVTTFUCRCIND            14    /*!< CRC indication. */
110 #define EVTTFUTIMINGADVIND      15    /*!< Timing advance indication.*/
111 #define EVTTFUDATREQ            16    /*!< Data Request.*/
112 #define EVENT_SLOT_IND_TO_MAC   17    /*!< TTI indication.*/
113 #define EVENT_SLOT_IND_TO_SCH   18    /*!< TTI indication for scheduler.*/
114 #define EVTTFUCNTRLREQ          19    /*!< Control Request.*/
115 #define EVTTFUPUCCHDELPWR       20    /*!< PUCCH Delta power. */
116 #define EVTTFUDOAIND            21    /*!< PUCCH Delta power. */
117 /* tfu_h_001.main_6. Added changes of TFU_UPGRADE */
118 #ifdef TFU_UPGRADE
119 #define EVTTFURAWCQIIND         22
120 #define EVTTFUSRSIND            23
121 #endif
122 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
123 #define EVTTFUNONRTIND          24    /*!< Non-RT indication.*/
124 #endif
125 #define EVTTFUERRIND            25    /*!< TFU Error Indication */
126 #define EVENT_RACH_IND_TO_MAC   26
127 #define EVENT_RACH_IND_TO_SCH   27
128 #define EVENT_CRC_IND_TO_MAC    28
129 #define EVENT_CRC_IND_TO_SCH    29
130 #define EVENT_RX_DATA_IND_TO_MAC 30
131 /** @} */
132
133 #define MAX_PREAM_PER_SLOT      1    /* Max number of preamble per slot */
134 #define MAX_RACH_PDU_PER_SLOT   1    /* Max number of rach pdu per slot */
135 #define MAX_CRCS_PER_SLOT       1
136 #define MAX_CB_PER_TTI_IN_BYTES 1
137 #define MAX_ULSCH_PDUS_PER_TTI  1
138
139 /* selector(coupling) values */
140 #define TFU_SEL_TC              1    /*!< Selector for Tight coupling. */
141 #define TFU_SEL_LC              0    /*!< Selector for Loose coupling. */
142 #define TFU_SEL_LWLC            2    /*!< Selector for Light-weight loose coupling. */
143 #define TFU_MAX_ALLOC_BYTES     4
144 /* pack unpack error code */
145 #define ETFUXXX                 0
146 #define ERRTFU                  0
147 /* tfu_h_001.main_2 - ccpu00110457 DTX Changes Start */
148 #define TFU_HQFDB_NACK          FALSE
149 #define TFU_HQFDB_ACK           TRUE
150 /* tfu_h_001.main_6. Added changes of TFU_UPGRADE */
151 #define TFU_HQFDB_DTX           4
152 #define TFU_HQFDB_INVALID       0xFF
153
154 /*tfu_h_001.main_7 - DEL - ERR Codes*/
155 #define   ETFU001      (ERRTFU +    1)    /*        tfu.c: 162 */
156 #define   ETFU002      (ERRTFU +    2)    /*        tfu.c: 170 */
157 #define   ETFU003      (ERRTFU +    3)    /*        tfu.c: 179 */
158 #define   ETFU004      (ERRTFU +    4)    /*        tfu.c: 232 */
159 #define   ETFU005      (ERRTFU +    5)    /*        tfu.c: 241 */
160 #define   ETFU006      (ERRTFU +    6)    /*        tfu.c: 290 */
161 #define   ETFU007      (ERRTFU +    7)    /*        tfu.c: 298 */
162 #define   ETFU008      (ERRTFU +    8)    /*        tfu.c: 307 */
163 #define   ETFU009      (ERRTFU +    9)    /*        tfu.c: 360 */
164 #define   ETFU010      (ERRTFU +   10)    /*        tfu.c: 369 */
165 #define   ETFU011      (ERRTFU +   11)    /*        tfu.c: 418 */
166 #define   ETFU012      (ERRTFU +   12)    /*        tfu.c: 426 */
167 #define   ETFU013      (ERRTFU +   13)    /*        tfu.c: 435 */
168 #define   ETFU014      (ERRTFU +   14)    /*        tfu.c: 488 */
169 #define   ETFU015      (ERRTFU +   15)    /*        tfu.c: 497 */
170 #define   ETFU016      (ERRTFU +   16)    /*        tfu.c: 546 */
171 #define   ETFU017      (ERRTFU +   17)    /*        tfu.c: 554 */
172 #define   ETFU018      (ERRTFU +   18)    /*        tfu.c: 563 */
173 #define   ETFU019      (ERRTFU +   19)    /*        tfu.c: 616 */
174 #define   ETFU020      (ERRTFU +   20)    /*        tfu.c: 625 */
175 #define   ETFU021      (ERRTFU +   21)    /*        tfu.c: 674 */
176 #define   ETFU022      (ERRTFU +   22)    /*        tfu.c: 682 */
177 #define   ETFU023      (ERRTFU +   23)    /*        tfu.c: 691 */
178 #define   ETFU024      (ERRTFU +   24)    /*        tfu.c: 744 */
179 #define   ETFU025      (ERRTFU +   25)    /*        tfu.c: 753 */
180 #define   ETFU026      (ERRTFU +   26)    /*        tfu.c: 802 */
181 #define   ETFU027      (ERRTFU +   27)    /*        tfu.c: 810 */
182 #define   ETFU028      (ERRTFU +   28)    /*        tfu.c: 819 */
183 #define   ETFU029      (ERRTFU +   29)    /*        tfu.c: 872 */
184 #define   ETFU030      (ERRTFU +   30)    /*        tfu.c: 881 */
185 #define   ETFU031      (ERRTFU +   31)    /*        tfu.c: 934 */
186 #define   ETFU032      (ERRTFU +   32)    /*        tfu.c: 944 */
187 #define   ETFU033      (ERRTFU +   33)    /*        tfu.c: 956 */
188 #define   ETFU034      (ERRTFU +   34)    /*        tfu.c:1018 */
189 #define   ETFU035      (ERRTFU +   35)    /*        tfu.c:1030 */
190 #define   ETFU036      (ERRTFU +   36)    /*        tfu.c:1045 */
191 #define   ETFU037      (ERRTFU +   37)    /*        tfu.c:1108 */
192 #define   ETFU038      (ERRTFU +   38)    /*        tfu.c:1118 */
193 #define   ETFU039      (ERRTFU +   39)    /*        tfu.c:1130 */
194 #define   ETFU040      (ERRTFU +   40)    /*        tfu.c:1202 */
195 #define   ETFU041      (ERRTFU +   41)    /*        tfu.c:1214 */
196 #define   ETFU042      (ERRTFU +   42)    /*        tfu.c:1229 */
197 #define   ETFU043      (ERRTFU +   43)    /*        tfu.c:1283 */
198 #define   ETFU044      (ERRTFU +   44)    /*        tfu.c:1293 */
199 #define   ETFU045      (ERRTFU +   45)    /*        tfu.c:1305 */
200 #define   ETFU046      (ERRTFU +   46)    /*        tfu.c:1368 */
201 #define   ETFU047      (ERRTFU +   47)    /*        tfu.c:1380 */
202 #define   ETFU048      (ERRTFU +   48)    /*        tfu.c:1396 */
203 #define   ETFU049      (ERRTFU +   49)    /*        tfu.c:1450 */
204 #define   ETFU050      (ERRTFU +   50)    /*        tfu.c:1460 */
205 #define   ETFU051      (ERRTFU +   51)    /*        tfu.c:1472 */
206 #define   ETFU052      (ERRTFU +   52)    /*        tfu.c:1534 */
207 #define   ETFU053      (ERRTFU +   53)    /*        tfu.c:1546 */
208 #define   ETFU054      (ERRTFU +   54)    /*        tfu.c:1562 */
209 #define   ETFU055      (ERRTFU +   55)    /*        tfu.c:1615 */
210 #define   ETFU056      (ERRTFU +   56)    /*        tfu.c:1625 */
211 #define   ETFU057      (ERRTFU +   57)    /*        tfu.c:1637 */
212 #define   ETFU058      (ERRTFU +   58)    /*        tfu.c:1698 */
213 #define   ETFU059      (ERRTFU +   59)    /*        tfu.c:1710 */
214 #define   ETFU060      (ERRTFU +   60)    /*        tfu.c:1726 */
215 #define   ETFU061      (ERRTFU +   61)    /*        tfu.c:1777 */
216 #define   ETFU062      (ERRTFU +   62)    /*        tfu.c:1787 */
217 #define   ETFU063      (ERRTFU +   63)    /*        tfu.c:1799 */
218 #define   ETFU064      (ERRTFU +   64)    /*        tfu.c:1857 */
219 #define   ETFU065      (ERRTFU +   65)    /*        tfu.c:1869 */
220 #define   ETFU066      (ERRTFU +   66)    /*        tfu.c:1885 */
221 #define   ETFU067      (ERRTFU +   67)    /*        tfu.c:1944 */
222 #define   ETFU068      (ERRTFU +   68)    /*        tfu.c:1954 */
223 #define   ETFU069      (ERRTFU +   69)    /*        tfu.c:2014 */
224 #define   ETFU070      (ERRTFU +   70)    /*        tfu.c:2026 */
225 #define   ETFU071      (ERRTFU +   71)    /*        tfu.c:2082 */
226 #define   ETFU072      (ERRTFU +   72)    /*        tfu.c:2092 */
227 #define   ETFU073      (ERRTFU +   73)    /*        tfu.c:2151 */
228 #define   ETFU074      (ERRTFU +   74)    /*        tfu.c:2163 */
229 #define   ETFU075      (ERRTFU +   75)    /*        tfu.c:2221 */
230 #define   ETFU076      (ERRTFU +   76)    /*        tfu.c:2231 */
231 #define   ETFU077      (ERRTFU +   77)    /*        tfu.c:2243 */
232 #define   ETFU078      (ERRTFU +   78)    /*        tfu.c:2304 */
233 #define   ETFU079      (ERRTFU +   79)    /*        tfu.c:2316 */
234 #define   ETFU080      (ERRTFU +   80)    /*        tfu.c:2332 */
235 #define   ETFU081      (ERRTFU +   81)    /*        tfu.c:2389 */
236 #define   ETFU082      (ERRTFU +   82)    /*        tfu.c:2399 */
237 #define   ETFU083      (ERRTFU +   83)    /*        tfu.c:2411 */
238 #define   ETFU084      (ERRTFU +   84)    /*        tfu.c:2476 */
239 #define   ETFU085      (ERRTFU +   85)    /*        tfu.c:2488 */
240 #define   ETFU086      (ERRTFU +   86)    /*        tfu.c:2504 */
241 #define   ETFU087      (ERRTFU +   87)    /*        tfu.c:2558 */
242 #define   ETFU088      (ERRTFU +   88)    /*        tfu.c:2568 */
243 #define   ETFU089      (ERRTFU +   89)    /*        tfu.c:2580 */
244 #define   ETFU090      (ERRTFU +   90)    /*        tfu.c:2642 */
245 #define   ETFU091      (ERRTFU +   91)    /*        tfu.c:2654 */
246 #define   ETFU092      (ERRTFU +   92)    /*        tfu.c:2670 */
247 #define   ETFU093      (ERRTFU +   93)    /*        tfu.c:2726 */
248 #define   ETFU094      (ERRTFU +   94)    /*        tfu.c:2736 */
249 #define   ETFU095      (ERRTFU +   95)    /*        tfu.c:2748 */
250 #define   ETFU096      (ERRTFU +   96)    /*        tfu.c:2812 */
251 #define   ETFU097      (ERRTFU +   97)    /*        tfu.c:2824 */
252 #define   ETFU098      (ERRTFU +   98)    /*        tfu.c:2840 */
253 #define   ETFU099      (ERRTFU +   99)    /*        tfu.c:2897 */
254 #define   ETFU100      (ERRTFU +  100)    /*        tfu.c:2907 */
255 #define   ETFU101      (ERRTFU +  101)    /*        tfu.c:2919 */
256 #define   ETFU102      (ERRTFU +  102)    /*        tfu.c:2984 */
257 #define   ETFU103      (ERRTFU +  103)    /*        tfu.c:2996 */
258 #define   ETFU104      (ERRTFU +  104)    /*        tfu.c:3012 */
259 #define   ETFU105      (ERRTFU +  105)    /*        tfu.c:3065 */
260 #define   ETFU106      (ERRTFU +  106)    /*        tfu.c:3075 */
261 #define   ETFU107      (ERRTFU +  107)    /*        tfu.c:3087 */
262 #define   ETFU108      (ERRTFU +  108)    /*        tfu.c:3098 */
263 #define   ETFU109      (ERRTFU +  109)    /*        tfu.c:3155 */
264 #define   ETFU110      (ERRTFU +  110)    /*        tfu.c:3164 */
265 #define   ETFU111      (ERRTFU +  111)    /*        tfu.c:3179 */
266 #define   ETFU112      (ERRTFU +  112)    /*        tfu.c:3231 */
267 #define   ETFU113      (ERRTFU +  113)    /*        tfu.c:3241 */
268 #define   ETFU114      (ERRTFU +  114)    /*        tfu.c:3253 */
269 #define   ETFU115      (ERRTFU +  115)    /*        tfu.c:3264 */
270 #define   ETFU116      (ERRTFU +  116)    /*        tfu.c:3320 */
271 #define   ETFU117      (ERRTFU +  117)    /*        tfu.c:3329 */
272 #define   ETFU118      (ERRTFU +  118)    /*        tfu.c:3344 */
273 #define   ETFU119      (ERRTFU +  119)    /*        tfu.c:3396 */
274 #define   ETFU120      (ERRTFU +  120)    /*        tfu.c:3406 */
275 #define   ETFU121      (ERRTFU +  121)    /*        tfu.c:3418 */
276 #define   ETFU122      (ERRTFU +  122)    /*        tfu.c:3477 */
277 #define   ETFU123      (ERRTFU +  123)    /*        tfu.c:3489 */
278 #define   ETFU124      (ERRTFU +  124)    /*        tfu.c:3504 */
279 #define   ETFU125      (ERRTFU +  125)    /*        tfu.c:10783 */
280 #define   ETFU126      (ERRTFU +  126)    /*        tfu.c:10793 */
281 #define   ETFU127      (ERRTFU +  127)    /*        tfu.c:10850 */
282 #define   ETFU128      (ERRTFU +  128)    /*        tfu.c:10862 */
283
284 #define TFU_PERIODIC_CQI_TYPE  0
285 #define TFU_APERIODIC_CQI_TYPE 1
286
287 #define TFU_FREE_MSG(_buf)\
288 {\
289    if (NULLP != (_buf)) \
290    { \
291       SPutMsg((_buf)); \
292       _buf = NULLP; \
293    } \
294 }
295
296 #define TFU_FREE_MEM(_mem)\
297 {\
298    if (NULLP != (_mem)) \
299    { \
300       cmFreeMem((_mem)); \
301       _mem = NULLP; \
302    } \
303 }
304
305
306 #endif /* __TFU_H__ */
307
308 /********************************************************************30**
309
310          End of file
311 **********************************************************************/