Changes in fapi config_request msg as per OAI code base
[o-du/l2.git] / src / intel_fapi / fapi_interface.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2019 Intel.
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 #ifndef _FAPI_INTERFACE_H_
20 #define _FAPI_INTERFACE_H_
21
22 #if defined(__cplusplus)
23 extern "C" {
24 #endif
25
26 #include "stdint.h"
27
28 #define FAPI_PARAM_REQUEST                                                                      0x00
29 #define FAPI_PARAM_RESPONSE                                                                     0x01
30 #define FAPI_CONFIG_REQUEST                                                                     0x02
31 #define FAPI_CONFIG_RESPONSE                                                            0x03
32 #define FAPI_START_REQUEST                                                                      0x04
33 #define FAPI_STOP_REQUEST                                                                       0x05
34 #define FAPI_STOP_INDICATION                                                            0x06
35 #define FAPI_ERROR_INDICATION                               0x07
36 // Reserved 0x08 - 0x0F and 0x02 - 0x7f
37 // 0x01 - 0x1F is used in vendor extension
38
39 #define FAPI_DL_TTI_REQUEST                                                             0x80
40 #define FAPI_UL_TTI_REQUEST                                                             0x81
41 #define FAPI_SLOT_INDICATION                                                            0x82
42 #define FAPI_UL_DCI_REQUEST                                                             0x83
43 #define FAPI_TX_DATA_REQUEST                                                            0x84
44 #define FAPI_RX_DATA_INDICATION                                                         0x85
45 #define FAPI_CRC_INDICATION                                                             0x86
46 #define FAPI_UCI_INDICATION                                                             0x87
47 #define FAPI_SRS_INDICATION                                                             0x88
48 #define FAPI_RACH_INDICATION                                                            0x89
49 // Reserved 0x8a -0xff
50
51 // Tags per 5G FAPI
52 // Cell Parameters
53 #define FAPI_RELEASE_CAPABILITY_TAG                                             0x0001
54 #define FAPI_PHY_STATE_TAG                                                  0x0002
55 #define FAPI_SKIP_BLANK_DL_CONFIG_TAG                                           0x0003
56 #define FAPI_SKIP_BLANK_UL_CONFIG_TAG                                   0x0004
57 #define FAPI_NUM_CONFIG_TLVS_TO_REPORT_TYPE_TAG                         0x0005
58 #define FAPI_CYCLIC_PREFIX_TAG                              0x0006
59 // PDCCH Parameters
60 #define FAPI_SUPPORTED_SUBCARRIER_SPACING_DL_TAG                    0x0007
61 #define FAPI_SUPPORTED_BANDWIDTH_DL_TAG                                     0x0008
62 #define FAPI_SUPPORTED_SUBCARRIER_SPACING_UL_TAG                        0x0009
63 #define FAPI_SUPPORTED_BANDWIDTH_UL_TAG                                         0x000A
64 #define FAPI_CCE_MAPPING_TYPE_TAG                                               0x000B
65 #define FAPI_CORESET_OUTSIDE_FIRST_3_OFDM_SYMS_OF_SLOT_TAG      0x000c
66 #define FAPI_PRECODER_GRANULARITY_CORESET_TAG                           0x000d
67 #define FAPI_PDCCH_MU_MIMO_TAG                                                          0x000e
68 #define FAPI_PDCCH_PRECODER_CYCLING_TAG                                     0x000f
69 #define FAPI_MAX_PDCCHS_PER_SLOT_TAG                                    0x0010
70 // PUCCH Parameters
71 #define FAPI_PUCCH_FORMATS_TAG                                                  0x0011
72 #define FAPI_MAX_PUCCHS_PER_SLOT_TAG                                        0x0012
73 // PDSCH Parameters
74 #define FAPI_PDSCH_MAPPING_TYPE_TAG                                             0x0013
75 #define FAPI_PDSCH_ALLOCATION_TYPES_TAG                         0x0014
76 #define FAPI_PDSCH_VRB_TO_PRB_MAPPING_TAG                                       0x0015
77 #define FAPI_PDSCH_CBG_TAG                                                          0x0016
78 #define FAPI_PDSCH_DMRS_CONFIG_TYPES_TAG                                        0x0017
79 #define FAPI_PDSCH_DMRS_MAX_LENGTH_TAG                                          0x0018
80 #define FAPI_PDSCH_DMRS_ADDITIONAL_POS_TAG                                      0x0019
81 #define FAPI_MAX_PDSCHS_TBS_PER_SLOT_TAG                                        0x001a
82 #define FAPI_MAX_NUMBER_MIMO_LAYERS_PDSCH_TAG                           0x001b
83 #define FAPI_SUPPORTED_MAX_MODULATION_ORDER_DL_TAG                  0x001c
84 #define FAPI_MAX_MU_MIMO_USERS_DL_TAG                                           0x001d
85 #define FAPI_PDSCH_DATA_IN_DMRS_SYMBOLS_TAG                                 0x001e
86 #define FAPI_PREMPTIONSUPPORT_TAG                                                       0x001f
87 #define FAPI_PDSCH_NON_SLOT_SUPPORT_TAG                                     0x0020
88 // PUSCH Parameters
89 #define FAPI_UCI_MUX_ULSCH_IN_PUSCH_TAG                             0x0021
90 #define FAPI_UCI_ONLY_PUSCH_TAG                                         0x0022
91 #define FAPI_PUSCH_FREQUENCY_HOPPING_TAG                                    0x0023
92 #define FAPI_PUSCH_DMRS_CONFIG_TYPES_TAG                                0x0024
93 #define FAPI_PUSCH_DMRS_MAX_LEN_TAG                                             0x0025
94 #define FAPI_PUSCH_DMRS_ADDITIONAL_POS_TAG                                  0x0026
95 #define FAPI_PUSCH_CBG_TAG                                  0x0027
96 #define FAPI_PUSCH_MAPPING_TYPE_TAG                         0x0028
97 #define FAPI_PUSCH_ALLOCATION_TYPES_TAG                     0x0029
98 #define FAPI_PUSCH_VRB_TO_PRB_MAPPING_TAG                   0x002a
99 #define FAPI_PUSCH_MAX_PTRS_PORTS_TAG                       0x002b
100 #define FAPI_MAX_PDUSCHS_TBS_PER_SLOT_TAG                   0x002c
101 #define FAPI_MAX_NUMBER_MIMO_LAYERS_NON_CB_PUSCH_TAG        0x002d
102 #define FAPI_SUPPORTED_MODULATION_ORDER_UL_TAG              0x002e
103 #define FAPI_MAX_MU_MIMO_USERS_UL_TAG                       0x002f
104 #define FAPI_DFTS_OFDM_SUPPORT_TAG                          0x0030
105 #define FAPI_PUSCH_AGGREGATION_FACTOR_TAG                   0x0031
106 // PRACH Parameters
107 #define FAPI_PRACH_LONG_FORMATS_TAG                         0x0032
108 #define FAPI_PRACH_SHORT_FORMATS_TAG                        0x0033
109 #define FAPI_PRACH_RESTRICTED_SETS_TAG                      0x0034
110 #define FAPI_MAX_PRACH_FD_OCCASIONS_IN_A_SLOT_TAG           0x0035
111 // Measurement Parameters
112 #define FAPI_RSSI_MEASUREMENT_SUPPORT_TAG                   0x0036
113
114 // CONFIG TLV TAGS per 5G FAPI
115 // Carrier Configuration
116 #define FAPI_DL_BANDWIDTH_TAG                               0x1001
117 #define FAPI_DL_FREQUENCY_TAG                               0x1002
118 #define FAPI_DL_K0_TAG                                      0x1003
119 #define FAPI_DL_GRIDSIZE_TAG                                0x1004
120 #define FAPI_NUM_TX_ANT_TAG                                 0x1005
121 #define FAPI_UPLINK_BANDWIDTH_TAG                           0x1006
122 #define FAPI_UPLINK_FREQUENCY_TAG                           0x1007
123 #define FAPI_UL_K0_TAG                                      0x1008
124 #define FAPI_UL_GRID_SIZE_TAG                               0x1009
125 #define FAPI_NUM_RX_ANT_TAG                                 0x100a
126 #define FAPI_FREQUENCY_SHIFT_7P5_KHZ_TAG                    0x100b
127 // Cell Configuration
128 #define FAPI_PHY_CELL_ID_TAG                                0x100c
129 #define FAPI_FRAME_DUPLEX_TYPE_TAG                          0x100d
130 // SSB Configuration
131 #define FAPI_SS_PBCH_POWER_TAG                              0x100e
132 #define FAPI_BCH_PAYLOAD_TAG                                0x100f
133 #define FAPI_SCS_COMMON_TAG                                 0x1010
134 // PRACH Configuration
135 #define FAPI_PRACH_SEQUENCE_LENGTH_TAG                      0x1011
136 #define FAPI_PRACH_SUBC_SPACING_TAG                         0x1012
137 #define FAPI_RESTRICTED_SET_CONFIG_TAG                      0x1013
138 #define FAPI_NUM_PRACH_FD_OCCASIONS_TAG                     0x1014
139 #define FAPI_PRACH_ROOT_SEQUENCE_INDEX_TAG                  0x1015
140 #define FAPI_NUM_ROOT_SEQUENCES_TAG                         0x1016
141 #define FAPI_K1_TAG                                         0x1017
142 #define FAPI_PRACH_ZERO_CORR_CONF_TAG                       0x1018
143 #define FAPI_NUM_UNUSED_ROOT_SEQUENCES_TAG                  0x1019
144 #define FAPI_UNUSED_ROOT_SEQUENCES_TAG                      0x101a
145 #define FAPI_SSB_PER_RACH_TAG                               0x101b
146 #define FAPI_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG          0x101c
147 // SSB Table
148 #define FAPI_SSB_OFFSET_POINT_A_TAG                         0x101d
149 #define FAPI_BETA_PSS_TAG                                   0x101e
150 #define FAPI_SSB_PERIOD_TAG                                 0x101f
151 #define FAPI_SSB_SUBCARRIER_OFFSET_TAG                      0x1020
152 #define FAPI_MIB_TAG                                        0x1021
153 #define FAPI_SSB_MASK_TAG                                   0x1022
154 #define FAPI_BEAM_ID_TAG                                    0x1023
155 #define FAPI_SS_PBCH_MULTIPLE_CARRIERS_IN_A_BAND_TAG        0x1024
156 #define FAPI_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG        0x1025
157 // TDD Table
158 #define FAPI_TDD_PERIOD_TAG                                 0x1026
159 #define FAPI_SLOT_CONFIG_TAG                                0x1027
160 // Measurement Configuration
161 #define FAPI_RSSI_MEASUREMENT_TAG                           0x1028
162 // Prach Configuration Index
163 #define FAPI_PRACH_CONFIG_INDEX_TAG                                                     0x1029
164 // DMRS-TypeA Pos
165 #define FAPI_DMRS_TYPE_A_POS_TAG                                                        0x102A
166
167 // Error Codes updated per 5G FAPI Table 3-31
168 #define FAPI_MSG_OK                                                                                     0x0
169 #define FAPI_MSG_INVALID_STATE                                                          0x1
170 #define FAPI_MSG_INVALID_CONFIG                                                         0x2
171 #define FAPI_MSG_SFN_OUT_OF_SYNC                                                        0x3
172 #define FAPI_MSG_SLOT_ERR                                                               0x4
173 #define FAPI_MSG_BCH_MISSING                                                            0x5
174 #define FAPI_MSG_INVALID_SFN                                                            0x6
175 #define FAPI_MSG_UL_DCI_ERR                                                                     0x7
176 #define FAPI_MSG_TX_ERR                                                                         0x8
177
178 // 5G FAPI Definitions
179 #define FAPI_NUMEROLOGIES                                   5
180 #define FAPI_MAX_NUM_UNUSED_ROOT_SEQUENCES                  63  // 38.331 page 383
181 #define FAPI_MAX_NUM_PRACH_FD_OCCASIONS                     64  // 38.331 page 383
182 #define FAPI_MAX_NUM_OF_SYMBOLS_PER_SLOT                    14
183 #define FAPI_MAX_TDD_PERIODICITY                            160 // 38.212 11.1 for u=4 and P=10 ms
184 // m=p*q with p number of panels and q number of TxRU/RxRU per panel,
185 // depends on the RF configuration, currently n=m=4, q=1, p=4 and k=21
186 // (number of beams per pannel). n number of antenna ports
187 #define FAPI_MAX_NUMBER_TX_RUS                              4
188 #define FAPI_MAX_NUMBER_OF_BEAMS                            64  // Intel API Page 27
189 #define FAPI_MAX_NUM_ANT_PORTS                              8   // Based on current RF
190 #define FAPI_MAX_NUM_LAYERS                                 8   // 38.211 Table 7.3.1.3-1
191 #define FAPI_MAX_NUM_TLVS_CELL_PARMS                        1505    // 5G FAPI Table 3-9  (A)
192 #define FAPI_MAX_NUM_TLVS_CARRIER_PARMS                                 27  // 5G FAPI Table 3-10 (B)
193 #define FAPI_MAX_NUM_TLVS_PDCCH_PARMS                       6   // 5G FAPI Table 3-11 (C)
194 #define FAPI_MAX_NUM_TLVS_PUCCH_PARMS                       2   // 5G FAPI Table 3-12 (D)
195 #define FAPI_MAX_NUM_TLVS_PDSCH_PARMS                       14  // 5G FAPI Table 3-13 (E)
196 #define FAPI_MAX_NUM_TLVS_PUSCH_PARMS                       17  // 5G FAPI Table 3-14 (F)
197 #define FAPI_MAX_NUM_TLVS_PRACH_PARMS                       4   // 5G FAPI Table 3-15 (G)
198 #define FAPI_MAX_NUM_TLVS_MEAS_PARMS                        1   // 5G FAPI Table 3-16 (H)
199 #define FAPI_MAX_NUM_TLVS_PARAMS                            1576    //  A+B+C+D+E+F+G+H + Padding
200 // Carrier Table 11 + Cell Config 2 + SSB Config 3 + PRACH Config 414 + SSB
201 // Table 71 + TDD Table  141 + Measurements 1
202 #define FAPI_MAX_NUM_TLVS_CONFIG                                                        1500
203
204 #define FAPI_UL_DCI_REQUEST_PDCCH_PDU                                   0
205
206 #define FAPI_MAX_NUMBER_UNSUPPORTED_TLVS                    74
207 #define FAPI_MAX_NUMBER_OF_INVALID_IDLE_ONLY_TLVS           74
208 #define FAPI_MAX_NUMBER_OF_INVALID_RUNNING_ONLY_TLVS        74
209 #define FAPI_MAX_NUMBER_OF_MISSING_TLVS                     74
210 #define FAPI_MAX_NUM_DIGBFINTERFACES                        4   // Based on RF, 5G FAPI says {0,255}
211 #define FAPI_MAX_NUM_PRGS_PER_TTI                           4   // Based on 38.214 5.1.2.3
212 #define FAPI_DCI_PAYLOAD_BYTE_LEN                           32  // Based on Intel API MAX_DCI_BIT_BYTE_LEN
213 #define FAPI_MAX_NUMBER_DL_DCI                              1   // Based on Intel API MAX_NUM_PDCCH
214 #define FAPI_MAX_NUMBER_OF_CODEWORDS_PER_PDU                2   // Based on MAX_DL_CODEWORD
215 // Based on (MAX_NUM_PDSCH*MAX_DL_CODEWORD + MAX_NUM_PDCCH + MAX_NUM_SRS +
216 // 1 PBCH/SLOT)
217 #define FAPI_MAX_NUMBER_DL_PDUS_PER_TTI                     129
218
219 #define FAPI_MAX_NUMBER_OF_UES_PER_TTI                      16  // Per common_ran_parameters.h
220 // Based on Max Tb size of 1376264 bits + 24 crc over (8848-24) and O/H
221 #define FAPI_MAX_NUM_CB_PER_TTI_IN_BYTES                    192
222
223 #define FAPI_MAX_NUM_PTRS_PORTS                             2   // Per 3GPP 38.212 Table 7.3.1.1.2-21
224 #define FAPI_MAX_NUMBER_OF_GROUPS_PER_TTI                   16  // FlexRAN API Table 33
225 #define FAPI_MAX_NUMBER_UL_PDUS_PER_TTI                     328 // (MAX_NUM_PUSCH+MAX_NUM_PUCCH+MAX_NUM_SRS+MAX_NUM_PRACH_DET)
226 #define FAPI_MAX_NUMBER_DCI_PDUS_PER_TTI                    32  // Based on MAX_NUM_PDCCH
227 #define FAPI_MAX_NUMBER_OF_TLVS_PER_PDU                     1   // one for each codeword
228 #define FAPI_MAX_NUMBER_TX_PDUS_PER_TTI                     129 // Same as FAPI_MAX_NUMBER_DL_PDUS_PER_TTI
229 // Based on 38.214 5.1.3.4, the TBS is 1376264 bits and divided by 8 and
230 // aligned to 64 bytes
231 #define FAPI_MAX_PDU_LENGTH                                 172096
232 #define FAPI_TX_DATA_PAYLOAD                                0x00
233 #define FAPI_TX_DATA_PTR_TO_PAYLOAD_32                      0x01
234 #define FAPI_TX_DATA_OFFSET_TO_PAYLOAD                      0x02
235 #define FAPI_TX_DATA_PTR_TO_PAYLOAD_64                      0x03
236
237 #define FAPI_MAX_NUMBER_OF_PDUS_PER_TTI                     129 // Same as FAPI_MAX_NUMBER_DL_PDUS_PER_TTI
238 #define FAPI_MAX_NUMBER_OF_ULSCH_PDUS_PER_SLOT              64  // NUM_PUSCH_CHAN*FAPI_MAX_NUMBER_OF_CODEWORDS_PER_PDU
239 #define FAPI_MAX_NUMBER_OF_CRCS_PER_SLOT                    32  // Based on MAX_NUM_UL_CHAN
240 #define FAPI_MAX_HARQ_INFO_LEN_BYTES                        214 // Based on 5G FAPI Table 3-70
241 #define FAPI_MAX_CSI_PART1_DATA_BYTES                       214 // Based on 5G FAPI Table 3-71
242 #define FAPI_MAX_CSI_PART2_DATA_BYTES                       214 // Based on 5G FAPI Table 3-72
243 #define FAPI_MAX_NUMBER_OF_HARQS_PER_IND                    2   // Based on 5G FAPI Table 3-68
244 #define FAPI_MAX_SR_PAYLOAD_SIZE                            1   // Based on 5G FAPI Table 3-69
245 #define FAPI_MAX_HARQ_PAYLOAD_SIZE                          214 // Based on 5G FAPI Table 3-70
246 #define FAPI_MAX_NUMBER_UCI_PDUS_PER_SLOT                   200 // Based on MAX_NUM_PUCCH
247 #define FAPI_MAX_NUMBER_RBS                                 273 // Based on MAX_NUM_OF_PRB_IN_FULL_BAND
248 #define FAPI_MAX_NUMBER_OF_REP_SYMBOLS                      4   // Based on 5g FAPI Table 3-73
249 #define FAPI_MAX_NUMBER_SRS_PDUS_PER_SLOT                   32  // Based on MAX_NUM_SRS
250 #define FAPI_MAX_NUM_PREAMBLES_PER_SLOT                     64  // Based on MAX_NUM_PRACH_DET
251 #define FAPI_MAX_NUMBER_RACH_PDUS_PER_SLOT                  64  // Based on MAX_NUM_PRACH_DET
252 #define FAPI_MAX_PDUS_PER_SLOT                                                          64
253 #define FAPI_MAX_NUM_TLVS_START                             3   // Based on Timer Mode requirement.
254 #define FAPI_MAX_NUM_TLVS_SHUTDOWN                          1   // Based on Timer Mode requirement.
255 #define FAPI_MAX_UCI_BIT_BYTE_LEN                           256
256
257     enum ul_tti_pdu_type_e {
258         FAPI_PRACH_PDU_TYPE = 0,
259         FAPI_PUSCH_PDU_TYPE,
260         FAPI_PUCCH_PDU_TYPE,
261         FAPI_SRS_PDU_TYPE,
262         FAPI_UL_TTI_PDU_TYPE_MAX
263     };
264
265     enum dl_tti_pdu_type_e {
266         FAPI_PDCCH_PDU_TYPE = 0,
267         FAPI_PDSCH_PDU_TYPE,
268         FAPI_CSIRS_PDU_TYPE,
269         FAPI_PBCH_PDU_TYPE,
270         FAPI_DL_TTI_PDU_TYPE_MAX
271     };
272
273 //------------------------------------------------------------------------------------------------------------
274 // Updated per 5G FAPI
275     typedef struct {
276         uint8_t num_msg;
277         // Can be used for Phy Id or Carrier Id  5G FAPI Table 3-2
278         uint8_t handle;
279         //uint8_t pad[2];
280     } fapi_msg_header_t,
281     *p_fapi_msg_header_t;
282
283 // Updated per 5G FAPI
284     typedef struct {
285 #ifdef OAI_TESTING 
286         uint8_t numMsg;
287         uint8_t opaque;
288 #endif
289         uint16_t msg_id;
290         uint32_t length;        // Length of the message body in bytes  5G FAPI Table 3-3
291         //uint16_t pad;
292     }fapi_msg_t;
293 // Updated per 5G FAPI
294     typedef struct {
295         uint16_t tag;
296         uint16_t length;        // 5G FAPI Table 3-7 Fixed part
297     } fapi_tl_t;
298 // Updated per 5G FAPI
299     typedef struct {
300         fapi_tl_t tl;
301         uint8_t value;          // TLV with byte value
302         uint8_t rsv[3];         // Per 5g FAPI 3.3.1.4 the lenght of the value parameter must be 32 bits
303     } fapi_uint8_tlv_t;
304     typedef struct {
305         fapi_tl_t tl;
306         uint8_t *value;         // TLV with unsigned 32 bit value
307     } fapi_uint8_ptr_tlv_t;
308 // Updated per 5G FAPI
309     typedef struct {
310         fapi_tl_t tl;
311         uint16_t value;         // TLV with unsigned 16 bit value
312         uint8_t rsv[2];         // Per 5g FAPI 3.3.1.4 the lenght of the value parameter must be 32 bits
313     } fapi_uint16_tlv_t;
314 // Updated per 5G FAPI
315     typedef struct {
316         fapi_tl_t tl;
317         int16_t value;          // TLV with signed 16 bit value
318         uint8_t rsv[2];         // Per 5g FAPI 3.3.1.4 the lenght of the value parameter must be 32 bits
319     } fapi_int16_tlv_t;
320 // Updated per 5G FAPI
321     typedef struct {
322         fapi_tl_t tl;
323         uint32_t value;         // TLV with unsigned 32 bit value
324     } fapi_uint32_tlv_t;
325 // Updated per 5G FAPI
326     typedef struct {
327         uint16_t tag;           // In 5G FAPI for Cell Params inside Table 3-9 under NumConfigTLVsToReport Loop
328         uint8_t length;
329         uint8_t value;
330     } fapi_config_tlv_t;
331
332     typedef struct {
333         fapi_tl_t tl;
334         uint16_t value[FAPI_NUMEROLOGIES];
335         uint16_t rsv;           // To be 32-bit aligned, if FAPI_NUMEROLOGIES changes to some other value than 5 please ensure 32 bit alignment
336     } fapi_config_num_tlv_t;
337
338 // Updated per 5G FAPI
339     typedef struct {
340         fapi_msg_t header;      // For PARAM.req message length in fapi_msg_t is zero per 5G FAPI 3.3.1.1
341     } fapi_param_req_t;
342
343 // Updated per 5G FAPI
344     typedef struct {
345         fapi_uint16_tlv_t releaseCapability;
346         fapi_uint16_tlv_t phyState;
347         fapi_uint8_tlv_t skipBlankDlConfig;
348         fapi_uint8_tlv_t skipBlankUlConfig;
349         fapi_uint16_tlv_t numTlvsToReport;
350         fapi_config_tlv_t tlvStatus[FAPI_MAX_NUM_TLVS_CONFIG];  // 5G FAPI Table 3-9
351     } fapi_cell_parms_t;
352
353 // Updated per 5G FAPI
354     typedef struct {
355         fapi_uint8_tlv_t cyclicPrefix;
356         fapi_uint8_tlv_t supportedSubcarrierSpacingDl;
357         fapi_uint16_tlv_t supportedBandwidthDl;
358         fapi_uint8_tlv_t supportedSubcarrierSpecingsUl;
359         fapi_uint16_tlv_t supportedBandwidthUl; // 5G FAPI Table 3-10
360     } fapi_carrier_parms_t;
361
362 // Updated per 5G FAPI    
363     typedef struct {
364         fapi_uint8_tlv_t cceMappingType;
365         fapi_uint8_tlv_t coresetOutsideFirst3OfdmSymsOfSlot;
366         fapi_uint8_tlv_t precoderGranularityCoreset;
367         fapi_uint8_tlv_t pdcchMuMimo;
368         fapi_uint8_tlv_t pdcchPrecoderCycling;
369         fapi_uint8_tlv_t maxPdcchsPerSlot;  // 5G FAPI Table 3-11
370     } fapi_pdcch_parms_t;
371
372 // Updated per 5G FAPI
373     typedef struct {
374         fapi_uint8_tlv_t pucchFormats;
375         fapi_uint8_tlv_t maxPucchsPerSlot;  // 5G FAPI Table 3-12
376     } fapi_pucch_parms_t;
377
378 // Updated per 5G FAPI
379     typedef struct {
380         fapi_uint8_tlv_t pdschMappingType;
381         fapi_uint8_tlv_t pdschAllocationTypes;
382         fapi_uint8_tlv_t pdschVrbToPrbMapping;
383         fapi_uint8_tlv_t pdschCbg;
384         fapi_uint8_tlv_t pdschDmrsConfigTypes;
385         fapi_uint8_tlv_t pdschDmrsMaxLength;
386         fapi_uint8_tlv_t pdschDmrsAdditionalPos;
387         fapi_uint8_tlv_t maxPdschsTBsPerSlot;
388         fapi_uint8_tlv_t maxNumberMimoLayersPdsch;
389         fapi_uint8_tlv_t supportedMaxModulationOrderDl;
390         fapi_uint8_tlv_t maxMuMimoUsersDl;
391         fapi_uint8_tlv_t pdschDataInDmrsSymbols;
392         fapi_uint8_tlv_t premptionSupport;
393         fapi_uint8_tlv_t pdschNonSlotSupport;   // 5G FAPI Table 3-13
394     } fapi_pdsch_parms_t;
395
396 // Updated per 5G FAPI
397     typedef struct {
398         fapi_uint8_tlv_t uciMuxUlschInPusch;
399         fapi_uint8_tlv_t uciOnlyPusch;
400         fapi_uint8_tlv_t puschFrequencyHopping;
401         fapi_uint8_tlv_t puschDmrsConfigTypes;
402         fapi_uint8_tlv_t puschDmrsMaxLen;
403         fapi_uint8_tlv_t puschDmrsAdditionalPos;
404         fapi_uint8_tlv_t puschCbg;
405         fapi_uint8_tlv_t puschMappingType;
406         fapi_uint8_tlv_t puschAllocationTypes;
407         fapi_uint8_tlv_t puschVrbToPrbMapping;
408         fapi_uint8_tlv_t puschMaxPtrsPorts;
409         fapi_uint8_tlv_t maxPduschsTBsPerSlot;
410         fapi_uint8_tlv_t maxNumberMimoLayersNonCbPusch;
411         fapi_uint8_tlv_t supportedModulationOrderUl;
412         fapi_uint8_tlv_t maxMuMimoUsersUl;
413         fapi_uint8_tlv_t dftsOfdmSupport;
414         fapi_uint8_tlv_t puschAggregationFactor;    // 5G FAPI Table 3-14
415     } fapi_pusch_parms_t;
416
417 // Updated per 5G FAPI
418     typedef struct {
419         fapi_uint8_tlv_t prachLongFormats;
420         fapi_uint16_tlv_t prachShortFormats;
421         fapi_uint8_tlv_t prachRestrictedSets;
422         fapi_uint8_tlv_t maxPrachFdOccasionsInASlot;    // 5G FAPI Table 3-15
423     } fapi_prach_parms_t;
424
425 // Updated per 5G FAPI
426     typedef struct {
427         fapi_uint8_tlv_t rssiMeasurementSupport;    // 5G FAPI Table 3-16
428     } fapi_meas_parms_t;
429
430 // Updated per 5G FAPI
431     typedef struct {
432         fapi_cell_parms_t cell_parms;
433         fapi_carrier_parms_t carr_parms;
434         fapi_pdcch_parms_t pdcch_parms;
435         fapi_pucch_parms_t pucch_parms;
436         fapi_pdsch_parms_t pdsch_parms;
437         fapi_pusch_parms_t pusch_parms;
438         fapi_prach_parms_t prach_parms;
439         fapi_meas_parms_t meas_parms;   // 5G FAPI Table 3-8
440     } fapi_params_t;
441
442 // Updated per 5G FAPI
443     typedef struct {
444         fapi_msg_t header;
445         uint8_t error_code;
446         uint8_t number_of_tlvs;
447         //uint8_t pad[2];
448         fapi_uint16_tlv_t tlvs[FAPI_MAX_NUM_TLVS_PARAMS];   // 5G FAPI Table 3-5
449     } fapi_param_resp_t;
450
451 // Updated per 5G FAPI
452     typedef struct {
453         fapi_uint16_tlv_t dlBandwidth;
454         fapi_uint32_tlv_t dlFrequency;
455         fapi_config_num_tlv_t dlk0;
456         fapi_config_num_tlv_t dlGridSize;
457         fapi_uint16_tlv_t numTxAnt;
458         fapi_uint16_tlv_t uplinkBandwidth;
459         fapi_uint32_tlv_t uplinkFrequency;
460         fapi_config_num_tlv_t ulk0;
461         fapi_config_num_tlv_t ulGridSize;
462         fapi_uint16_tlv_t numRxAnt;
463         fapi_uint8_tlv_t frequencyShift7p5KHz;  // 5G FAPI Table 3-21
464     } fapi_carrier_config_t;
465
466 // Updated per 5G FAPI
467     typedef struct {
468         fapi_uint8_tlv_t phyCellId;
469         fapi_uint8_tlv_t frameDuplexType;   // 5G FAPI Table 3-22
470     } fapi_cell_config_t;
471
472 // Updated per 5G FAPI
473     typedef struct {
474         fapi_uint32_tlv_t ssPbchPower;
475         fapi_uint8_tlv_t bchPayload;
476         fapi_uint8_tlv_t scsCommon; // 5G FAPI Table 3-23
477     } fapi_ssb_config_t;
478
479 // Updated per 5G FAPI
480     typedef struct {
481         fapi_uint16_tlv_t prachRootSequenceIndex;
482         fapi_uint8_tlv_t numRootSequences;
483         fapi_uint16_tlv_t k1;
484         fapi_uint8_tlv_t prachZeroCorrConf;
485         fapi_uint16_tlv_t numUnusedRootSequences;   // 5G FAPI Table 3-24 Subset
486         fapi_uint16_tlv_t
487             unusedRootSequences[FAPI_MAX_NUM_UNUSED_ROOT_SEQUENCES];
488     } fapi_prachFdOccasion_t;
489
490 // Updated per 5G FAPI_
491     typedef struct {
492         fapi_uint8_tlv_t prachSequenceLength;
493         fapi_uint8_tlv_t prachSubCSpacing;
494         fapi_uint8_tlv_t restrictedSetConfig;
495         fapi_uint8_tlv_t numPrachFdOccasions;
496         fapi_uint8_tlv_t prachConfigIndex;
497         fapi_prachFdOccasion_t prachFdOccasion[FAPI_MAX_NUM_PRACH_FD_OCCASIONS];
498         fapi_uint8_tlv_t ssbPerRach;
499         fapi_uint8_tlv_t prachMultipleCarriersInABand;  // 5G FAPI Table 3-24
500     } fapi_prach_configuration_t;
501
502 //Updated per 5G FAPI
503     typedef struct {
504         fapi_uint16_tlv_t ssbOffsetPointA;
505         fapi_uint8_tlv_t betaPss;
506         fapi_uint8_tlv_t ssbPeriod;
507         fapi_uint8_tlv_t ssbSubCarrierOffset;
508         fapi_uint32_tlv_t mib;
509         fapi_uint32_tlv_t ssbMask[2];
510         fapi_uint8_tlv_t beamId[64];
511         fapi_uint8_tlv_t ssPbchMultipleCarriersInABand;
512         fapi_uint8_tlv_t multipleCellsSsPbchInACarrier; // 5G FAPI Table 3-25
513     } fapi_ssb_table_t;
514
515 // Updated per 5G FAPI
516     typedef struct {
517         fapi_uint8_tlv_t slotConfig[FAPI_MAX_NUM_OF_SYMBOLS_PER_SLOT];  // 5G FAPI Table 3-26 Subset
518     } fapi_slotconfig_t;
519
520 // Updated per 5G FAPI
521     typedef struct {
522         fapi_uint8_tlv_t tddPeriod;
523         fapi_slotconfig_t slotConfig[FAPI_MAX_TDD_PERIODICITY]; // 5G FAPI Table 3-26
524     } fapi_tdd_table_t;
525
526 // Updated per 5G FAPI
527     typedef struct {
528         fapi_uint8_tlv_t rssiMeasurement;   // 5G FAPI Table 3-27
529     } fapi_meas_config_t;
530
531 // Updated per 5G FAPI
532     typedef struct {
533         int16_t digBeamWeightRe;
534         int16_t digBeamWeightIm;    // 5G FAPI Table 3-32 Subset
535     } fapi_dig_beam_weight_t;
536
537 // Updated per 5G FAPI
538     typedef struct {
539         uint16_t beamIdx;
540         fapi_dig_beam_weight_t digBeamWeight[FAPI_MAX_NUMBER_TX_RUS];   // 5G FAPI Table 3-32 Subset
541     } fapi_dig_beam_config_t;
542
543 // Updated per 5G FAPI
544     typedef struct {
545         uint16_t numDigBeams;
546         uint16_t numTxRus;
547         fapi_dig_beam_config_t digBeam[FAPI_MAX_NUMBER_OF_BEAMS];   // 5G FAPI Table 3-32
548     } fapi_beamforming_table_t;
549
550 // Updated per 5G FAPI
551     typedef struct {
552         int16_t preCoderWeightRe;
553         int16_t preCoderWeightIm;   // 5G FAPI Table 3-33 Subset
554     } fapi_precoderWeight_t;
555
556 // Updated per 5G FAPI
557     typedef struct {
558         fapi_precoderWeight_t precoder_weight[FAPI_MAX_NUM_ANT_PORTS];  // 5G FAPI Table 3-33 Subset
559     } fapi_precoder_weight_t;
560
561 // Updated per 5G FAPI
562     typedef struct {
563         uint16_t pmIdx;
564         uint16_t numLayers;
565         uint16_t numAntPorts;
566         //uint16_t pad[1];
567         fapi_precoder_weight_t precoderWeight[FAPI_MAX_NUM_LAYERS]; // 5G FAPI Table 3-33
568     } fapi_precoding_table_t;
569
570 // Updated per 5G FAPI
571     typedef struct {
572         fapi_carrier_config_t carrierConfig;
573         fapi_cell_config_t cellConfig;
574         fapi_ssb_config_t ssbConfig;
575         fapi_prach_configuration_t prachConfig;
576         fapi_ssb_table_t ssbTable;
577         fapi_tdd_table_t tddTable;
578         fapi_meas_config_t measConfig;
579         fapi_beamforming_table_t beamformingTable;
580         fapi_precoding_table_t precodingTable;  // 5G FAPI Table 3-20
581     } fapi_config_t;
582
583 // Updated per 5G FAPI 
584     typedef struct {
585         fapi_msg_t header;
586         uint8_t number_of_tlvs;
587         //uint8_t pad[3];
588         fapi_uint32_tlv_t tlvs[FAPI_MAX_NUM_TLVS_CONFIG];   // 5G FAPI Table 3-17
589     } __attribute__((packed))  fapi_config_req_t;
590
591 // Updated per 5G FAPI
592     typedef struct {
593         fapi_msg_t header;
594         uint8_t error_code;
595         uint8_t number_of_invalid_tlvs;
596         uint8_t number_of_inv_tlvs_idle_only;
597         uint8_t number_of_inv_tlvs_running_only;
598         uint8_t number_of_missing_tlvs;
599         //uint8_t pad[3];
600         fapi_uint16_tlv_t tlvs[4 * FAPI_MAX_NUM_TLVS_CONFIG];   // 5G FAPI Table 3-18
601         //   fapi_uint16_tlv_t unsupported_or_invalid_tlvs[FAPI_MAX_NUMBER_UNSUPPORTED_TLVS];
602         //   fapi_uint16_tlv_t invalid_idle_only_tlvs[FAPI_MAX_NUMBER_OF_INVALID_IDLE_ONLY_TLVS];
603         //   fapi_uint16_tlv_t invalid_running_only_tlvs[FAPI_MAX_NUMBER_OF_INVALID_RUNNING_ONLY_TLVS];
604         //   fapi_uint16_tlv_t missing_tlvs[FAPI_MAX_NUMBER_OF_MISSING_TLVS];            
605     } fapi_config_resp_t;
606
607 // Updated per 5G FAPI
608     typedef struct {
609         fapi_msg_t header;
610     } fapi_start_req_t;
611
612 // Updated per 5G FAPI
613     typedef struct {
614         fapi_msg_t header;      // Message Length is zero for STOP.request
615     } fapi_stop_req_t;
616
617 // Updated per 5G FAPI
618     typedef struct {
619         fapi_msg_t header;      // Message Length is zero for STOP.indication
620     } fapi_stop_ind_t;
621
622 // Updated per 5G FAPI
623     typedef struct {
624         fapi_msg_t header;
625         uint16_t sfn;
626         uint16_t slot;
627         uint8_t message_id;
628         uint8_t error_code;     // 5G FAPI Table 3-30
629         //uint8_t pad[2];
630     } fapi_error_ind_t;
631
632 // Updated per 5G FAPI
633     typedef struct {
634         fapi_msg_t header;
635         uint16_t sfn;
636         uint16_t slot;          // 5G FAPI Table 3-34
637     } fapi_slot_ind_t;
638
639 // Updated per 5G FAPI
640     typedef struct {
641         uint16_t beamidx;       // 5G FAPI Table 3-43 subset
642     } fapi_bmi_t;
643
644 // Updated per 5G FAPI
645     typedef struct {
646         uint16_t pmIdx;
647         //uint8_t pad[2];
648         fapi_bmi_t beamIdx[FAPI_MAX_NUM_DIGBFINTERFACES];   // 5G FAPI Table 3-43 subset
649     } fapi_pmi_bfi_t;
650
651 // Updated per 5G FAPI
652     typedef struct {
653         uint16_t numPrgs;
654         uint16_t prgSize;
655         uint8_t digBfInterfaces;
656         //uint8_t pad[3];
657         fapi_pmi_bfi_t pmi_bfi[FAPI_MAX_NUM_PRGS_PER_TTI];  // 5G FAPI Table 3-43
658     } fapi_precoding_bmform_t;
659
660 // Updated per 5G FAPI
661     typedef struct {
662         uint16_t rnti;
663         uint16_t scramblingId;
664         uint16_t scramblingRnti;
665         uint8_t cceIndex;
666         uint8_t aggregationLevel;
667         fapi_precoding_bmform_t pc_and_bform;
668         uint8_t beta_pdcch_1_0;
669         uint8_t powerControlOffsetSS;
670         uint16_t payloadSizeBits;
671         uint8_t payload[FAPI_DCI_PAYLOAD_BYTE_LEN]; // 5G FAPI Table 3-37
672     } fapi_dl_dci_t;
673
674 // Updated per 5G FAPI
675     typedef struct {
676         uint16_t bwpSize;
677         uint16_t bwpStart;
678         uint8_t subCarrierSpacing;
679         uint8_t cyclicPrefix;
680         uint8_t startSymbolIndex;
681         uint8_t durationSymbols;
682         uint8_t freqDomainResource[6];
683         uint8_t cceRegMappingType;
684         uint8_t regBundleSize;
685         uint8_t interleaverSize;
686         uint8_t coreSetType;
687         uint16_t shiftIndex;
688         uint8_t precoderGranularity;
689         //uint8_t pad;
690         uint16_t numDlDci;      // 5G FAPI Table 3-36
691         fapi_dl_dci_t dlDci[FAPI_MAX_NUMBER_DL_DCI];
692     } fapi_dl_pdcch_pdu_t;
693
694     // Updated per 5G FAPI
695     typedef struct {
696         uint16_t targetCodeRate;
697         uint8_t qamModOrder;
698         uint8_t mcsIndex;
699         uint8_t mcsTable;
700         uint8_t rvIndex;
701         //uint8_t pad[2];
702         uint32_t tbSize;        // 5G FAPI Table 3-38 Subset
703     } fapi_codeword_pdu_t;
704
705     // Updated per 5G FAPI
706     typedef struct {
707         uint16_t pduBitMap;
708         uint16_t rnti;
709         uint16_t pdu_index;
710         uint16_t bwpSize;
711         uint16_t bwpStart;
712         uint8_t subCarrierSpacing;
713         uint8_t cyclicPrefix;
714         uint8_t nrOfCodeWords;
715         //uint8_t pad[3];
716         fapi_codeword_pdu_t cwInfo[FAPI_MAX_NUMBER_OF_CODEWORDS_PER_PDU];
717         uint16_t dataScramblingId;
718         uint8_t nrOfLayers;
719         uint8_t transmissionScheme;
720         uint8_t refPoint;
721         uint8_t dmrsConfigType;
722         uint16_t dlDmrsSymbPos;
723         uint8_t scid;
724         uint8_t numDmrsCdmGrpsNoData;
725         uint8_t resourceAlloc;
726         //uint8_t pad1;
727         uint16_t dlDmrsScramblingId;
728         uint16_t dmrsPorts;
729         uint16_t rbStart;
730         uint16_t rbSize;
731         uint8_t rbBitmap[36];
732         uint8_t vrbToPrbMapping;
733         uint8_t startSymbIndex;
734         uint8_t nrOfSymbols;
735         uint8_t ptrsPortIndex;
736         uint8_t ptrsTimeDensity;
737         uint8_t ptrsFreqDensity;
738         uint8_t ptrsReOffset;
739         uint8_t nEpreRatioOfPdschToPtrs;
740         fapi_precoding_bmform_t preCodingAndBeamforming;
741         uint8_t powerControlOffset;
742         uint8_t powerControlOffsetSS;
743         uint8_t isLastCbPresent;
744         uint8_t isInlineTbCrc;
745         uint32_t dlTbCrc;       // 5G FAPI Table 3-38
746         uint8_t mappingType;
747         uint8_t nrOfDmrsSymbols;
748         uint8_t dmrsAddPos;
749         //uint8_t pad2;
750     } fapi_dl_pdsch_pdu_t;
751
752     // Updated per 5G FAPI
753     typedef struct {
754         uint16_t bwpSize;
755         uint16_t bwpStart;
756         uint8_t subCarrierSpacing;
757         uint8_t cyclicPrefix;
758         uint16_t startRb;
759         uint16_t nrOfRbs;
760         uint8_t csiType;
761         uint8_t row;
762         uint16_t freqDomain;
763         uint8_t symbL0;
764         uint8_t symbL1;
765         uint8_t cdmType;
766         uint8_t freqDensity;
767         uint16_t scramId;
768         uint8_t powerControlOffset;
769         uint8_t powerControlOffsetSs;
770         //uint8_t pad[2];
771         fapi_precoding_bmform_t preCodingAndBeamforming;    // 5G FAPI Table 3-39
772     } fapi_dl_csi_rs_pdu_t;
773
774 // Updated per 5G FAPI 
775     typedef struct {
776         uint8_t dmrsTypeAPosition;
777         uint8_t pdcchConfigSib1;
778         uint8_t cellBarred;
779         uint8_t intraFreqReselection;   // 5G FAPI Table 3-42
780     } fapi_phy_mib_pdu_t;
781
782 // Updated per 5G FAPI 
783     typedef struct {
784         union {
785             uint32_t bchPayload;
786             fapi_phy_mib_pdu_t phyMibPdu;   // 5G FAPI Table 3-40 Subset
787         };
788     } fapi_bch_payload_t;
789
790     // Updated per 5G FAPI
791     typedef struct {
792         uint16_t physCellId;
793         uint8_t betaPss;
794         uint8_t ssbBlockIndex;
795         uint8_t ssbSubCarrierOffset;
796         uint8_t bchPayloadFlag;
797         uint16_t ssbOffsetPointA;
798         fapi_bch_payload_t bchPayload;
799         fapi_precoding_bmform_t preCodingAndBeamforming;    // 5G FAPI Table 3-40
800     } fapi_dl_ssb_pdu_t;
801
802 // Updated per 5G FAPI
803     typedef struct {
804         uint16_t pduType;
805         uint16_t pduSize;
806         union {
807             fapi_dl_pdcch_pdu_t pdcch_pdu;
808             fapi_dl_pdsch_pdu_t pdsch_pdu;
809             fapi_dl_csi_rs_pdu_t csi_rs_pdu;
810             fapi_dl_ssb_pdu_t ssb_pdu;  // 5G FAPI Table 3-35 Subset
811         } pdu;
812     } fapi_dl_tti_req_pdu_t;
813
814 // Updated per 5G FAPI
815     typedef struct {
816         uint8_t nUe;
817         //uint8_t pad[3];
818         uint8_t pduIdx[FAPI_MAX_NUMBER_OF_UES_PER_TTI]; // 5G FAPI Subset Table 3-35 and Table 3-44
819     } fapi_ue_info_t;
820
821 // Updated per 5G FAPI
822     typedef struct {
823         fapi_msg_t header;
824         uint16_t sfn;
825         uint16_t slot;
826         uint8_t nPdus;
827         uint8_t nGroup;
828         //uint8_t pad[2];
829         fapi_dl_tti_req_pdu_t pdus[FAPI_MAX_PDUS_PER_SLOT]; // 5G FAPI Table 3-35
830         fapi_ue_info_t ue_grp_info[FAPI_MAX_NUMBER_OF_GROUPS_PER_TTI];
831     } fapi_dl_tti_req_t;
832
833 // Updated per 5G FAPI
834     typedef struct {
835         uint8_t rvIndex;
836         uint8_t harqProcessId;
837         uint8_t newDataIndicator;
838         //uint8_t pad;
839         uint32_t tbSize;
840         uint16_t numCb;         // 5G FAPI Table 3-47
841         uint8_t cbPresentAndPosition[2];    // Since the maximum number of Code Blocks per TCB in a CBG is 8 for 1 CW or 4 for 2CW and this is a bit field with pading to align to 32 bits
842     } fapi_pusch_data_t;
843
844 // Updated per 5G FAPI
845     typedef struct {
846         uint16_t harqAckBitLength;
847         uint16_t csiPart1BitLength;
848         uint16_t csiPart2BitLength;
849         uint8_t alphaScaling;
850         uint8_t betaOffsetHarqAck;
851         uint8_t betaOffsetCsi1;
852         uint8_t betaOffsetCsi2; // 5G FAPI Table 3-48
853         //uint8_t pad[2];
854     } fapi_pusch_uci_t;
855
856 // Updated per 5G FAPI
857     typedef struct {
858         uint16_t ptrsPortIndex;
859         uint8_t ptrsDmrsPort;
860         uint8_t ptrsReOffset;   // 5G FAPI Table 3-49 Subset
861     } fapi_ptrs_info_t;
862
863 // Updated per 5G FAPI
864     typedef struct {
865         uint8_t numPtrsPorts;
866         uint8_t ptrsTimeDensity;
867         uint8_t ptrsFreqDensity;    // 5G FAPI Table 3-49 Subset
868         uint8_t ulPtrsPower;
869         fapi_ptrs_info_t ptrsInfo[FAPI_MAX_NUM_PTRS_PORTS];
870     } fapi_pusch_ptrs_t;
871
872 // Updated per 5G FAPI
873     typedef struct {
874         uint16_t lowPaprSequenceNumber;
875         uint8_t lowPaprGroupNumber;
876         uint8_t ulPtrsSampleDensity;
877         uint8_t ulPtrsTimeDensityTransformPrecoding;
878         //uint8_t pad;            // 5G FAPI Table 3-50
879     } fapi_dfts_ofdm_t;
880
881 // Updated per 5G FAPI
882     typedef struct {
883         fapi_bmi_t beamIdx[FAPI_MAX_NUM_DIGBFINTERFACES];
884     } fapi_rx_bfi_t;
885
886 // Updated per 5G FAPI
887     typedef struct {
888         uint16_t numPrgs;
889         uint16_t prgSize;
890         uint8_t digBfInterface;
891         //uint8_t pad[3];
892         fapi_rx_bfi_t rx_bfi[FAPI_MAX_NUM_PRGS_PER_TTI];    // 5G FAPI Table 3-53
893     } fapi_ul_rx_bmform_pdu_t;
894
895 // Updated per 5G FAPI
896     typedef struct {
897         uint16_t physCellId;
898         uint8_t numPrachOcas;
899         uint8_t prachFormat;
900         uint8_t numRa;
901         uint8_t prachStartSymbol;
902         uint16_t numCs;
903         fapi_ul_rx_bmform_pdu_t beamforming;
904     } fapi_ul_prach_pdu_t;      // 5G FAPI Table 3-45
905
906 // Updated per 5G FAPI
907     typedef struct {
908         uint16_t pduBitMap;
909         uint16_t rnti;
910         uint32_t handle;
911         uint16_t bwpSize;
912         uint16_t bwpStart;
913         uint8_t subCarrierSpacing;
914         uint8_t cyclicPrefix;
915         uint8_t mcsIndex;
916         uint8_t mcsTable;
917         uint16_t targetCodeRate;
918         uint8_t qamModOrder;
919         uint8_t transformPrecoding;
920         uint16_t dataScramblingId;
921         uint8_t nrOfLayers;
922         uint8_t dmrsConfigType;
923         uint16_t ulDmrsSymbPos;
924         uint16_t ulDmrsScramblingId;
925         uint8_t scid;
926         uint8_t numDmrsCdmGrpsNoData;
927         uint16_t dmrsPorts;
928         uint16_t nTpPuschId;
929         uint16_t tpPi2Bpsk;
930         uint8_t rbBitmap[36];
931         uint16_t rbStart;
932         uint16_t rbSize;
933         uint8_t vrbToPrbMapping;
934         uint8_t frequencyHopping;
935         uint16_t txDirectCurrentLocation;
936         uint8_t resourceAlloc;
937         uint8_t uplinkFrequencyShift7p5khz;
938         uint8_t startSymbIndex;
939         uint8_t nrOfSymbols;
940         uint8_t mappingType;
941         uint8_t nrOfDmrsSymbols;
942         uint8_t dmrsAddPos;
943         //uint8_t pad;
944
945         fapi_pusch_data_t puschData;
946         fapi_pusch_uci_t puschUci;
947         fapi_pusch_ptrs_t puschPtrs;
948         fapi_dfts_ofdm_t dftsOfdm;
949         fapi_ul_rx_bmform_pdu_t beamforming;    // 5G FAPI Table 3-46
950     } fapi_ul_pusch_pdu_t;
951
952 // Updated per 5G FAPI
953     typedef struct {
954         uint16_t rnti;
955         //uint8_t pad1[2];
956         uint32_t handle;
957         uint16_t bwpSize;
958         uint16_t bwpStart;
959         uint8_t subCarrierSpacing;
960         uint8_t cyclicPrefix;
961         uint8_t formatType;
962         uint8_t multiSlotTxIndicator;
963         uint8_t pi2Bpsk;
964         //uint8_t pad2;
965         uint16_t prbStart;
966         uint16_t prbSize;
967         uint8_t startSymbolIndex;
968         uint8_t nrOfSymbols;
969         uint8_t freqHopFlag;
970         uint8_t groupHopFlag;
971         uint8_t sequenceHopFlag;
972         //uint8_t pad3;
973         uint16_t secondHopPrb;
974         uint16_t hoppingId;
975         uint16_t initialCyclicShift;
976         uint16_t dataScramblingId;
977         uint8_t timeDomainOccIdx;
978         uint8_t preDftOccIdx;
979         uint8_t preDftOccLen;
980         uint8_t addDmrsFlag;
981         uint16_t dmrsScramblingId;
982         uint8_t dmrsCyclicShift;
983         uint8_t srFlag;
984         uint16_t bitLenHarq;
985         //uint8_t pad4[2];
986         uint16_t bitLenCsiPart1;
987         uint16_t bitLenCsiPart2;
988         fapi_ul_rx_bmform_pdu_t beamforming;    // 5G FAPI Table 3-51
989     } fapi_ul_pucch_pdu_t;
990
991 // Updated per 5G FAPI
992     typedef struct {
993         uint16_t rnti;
994         //uint8_t pad[2];
995         uint32_t handle;
996         uint16_t bwpSize;
997         uint16_t bwpStart;
998         uint8_t subCarrierSpacing;
999         uint8_t cyclicPrefix;
1000         uint8_t numAntPorts;
1001         uint8_t numSymbols;
1002         uint8_t numRepetitions;
1003         uint8_t timeStartPosition;
1004         uint8_t configIndex;
1005         uint8_t bandwidthIndex;
1006         uint16_t sequenceId;
1007         uint8_t combSize;
1008         uint8_t combOffset;
1009         uint8_t cyclicShift;
1010         uint8_t frequencyPosition;
1011         uint16_t frequencyShift;
1012         uint8_t frequencyHopping;
1013         uint8_t groupOrSequenceHopping;
1014         uint8_t resourceType;
1015         //uint8_t pad1[2];
1016         uint16_t tSrs;
1017         uint16_t tOffset;
1018         fapi_ul_rx_bmform_pdu_t beamforming;    // 5G FAPI Table 3-52
1019     } fapi_ul_srs_pdu_t;
1020
1021 // Updated per 5G FAPI
1022     typedef struct {
1023         uint16_t pduType;
1024         uint16_t pduSize;
1025         union {
1026             fapi_ul_prach_pdu_t prach_pdu;
1027             fapi_ul_pusch_pdu_t pusch_pdu;
1028             fapi_ul_pucch_pdu_t pucch_pdu;
1029             fapi_ul_srs_pdu_t srs_pdu;
1030         } pdu;
1031     } fapi_ul_tti_req_pdu_t;    // 5G FAPI Subset Table 3-44
1032
1033 // Updated per 5G FAPI
1034     typedef struct {
1035         fapi_msg_t header;
1036         uint16_t sfn;
1037         uint16_t slot;
1038         uint8_t nPdus;
1039         uint8_t rachPresent;
1040         uint8_t nUlsch;
1041         uint8_t nUlcch;
1042         uint8_t nGroup;
1043         //uint8_t pad[3];
1044         fapi_ul_tti_req_pdu_t pdus[FAPI_MAX_NUMBER_UL_PDUS_PER_TTI];    // 5G FAPI Table 3-44
1045         fapi_ue_info_t ueGrpInfo[FAPI_MAX_NUMBER_OF_GROUPS_PER_TTI];
1046     } fapi_ul_tti_req_t;
1047
1048 // Updated per 5G FAPI
1049     typedef struct {
1050         uint16_t pduType;
1051         uint16_t pduSize;
1052         fapi_dl_pdcch_pdu_t pdcchPduConfig; // 5G FAPI Table 3-54 Subset
1053     } fapi_dci_pdu_t;
1054
1055     // Updated per 5G FAPI
1056     typedef struct {
1057         fapi_msg_t header;
1058         uint16_t sfn;
1059         uint16_t slot;
1060         uint8_t numPdus;
1061         //uint8_t pad[3];
1062         fapi_dci_pdu_t pdus[FAPI_MAX_NUMBER_UCI_PDUS_PER_SLOT]; // 5G FAPI Table 3-54
1063     } fapi_ul_dci_req_t;
1064
1065 // Updated per 5G FAPI
1066     typedef struct {
1067         uint32_t pdu_length;
1068         uint16_t pdu_index;
1069         uint16_t num_tlvs;
1070         fapi_uint8_ptr_tlv_t tlvs[FAPI_MAX_NUMBER_OF_TLVS_PER_PDU]; // 5G FAPI Table 3-58 Subset
1071     } fapi_tx_pdu_desc_t;
1072
1073 // Updated per 5G FAPI
1074     typedef struct {
1075         fapi_msg_t header;
1076         uint16_t sfn;
1077         uint16_t slot;
1078         uint16_t num_pdus;
1079         //uint8_t pad[2];
1080         fapi_tx_pdu_desc_t pdu_desc[FAPI_MAX_NUMBER_DL_PDUS_PER_TTI];   // 5G FAPI Table 3-58
1081     } fapi_tx_data_req_t;
1082
1083 // Updated per 5G FAPI
1084     typedef struct {
1085         uint32_t handle;
1086         uint16_t rnti;
1087         uint8_t harqId;
1088         uint8_t ul_cqi;
1089         uint16_t timingAdvance;
1090         uint16_t rssi;
1091         uint16_t pdu_length;
1092         //uint8_t pad[2];
1093         void *pduData;          // 5G FAPI Table 3-61 Subset
1094     } fapi_pdu_ind_info_t;
1095
1096     // Updated per 5G FAPI
1097     typedef struct {
1098         fapi_msg_t header;
1099         uint16_t sfn;
1100         uint16_t slot;
1101         uint16_t numPdus;
1102         //uint8_t pad[2];
1103         fapi_pdu_ind_info_t pdus[FAPI_MAX_NUMBER_OF_ULSCH_PDUS_PER_SLOT];   // 5G FAPI Table 3-61
1104     } fapi_rx_data_indication_t;
1105
1106 // Updated per 5G FAPI
1107     typedef struct {
1108         uint32_t handle;
1109         uint16_t rnti;
1110         uint8_t harqId;
1111         uint8_t tbCrcStatus;
1112         uint8_t ul_cqi;
1113         //uint8_t pad;
1114         uint16_t numCb;
1115         uint16_t timingAdvance;
1116         uint16_t rssi;
1117         uint8_t cbCrcStatus[FAPI_MAX_NUM_CB_PER_TTI_IN_BYTES];  // 5G FAPI Table 3-62 subset
1118     } fapi_crc_ind_info_t;
1119
1120 // Updated per 5G FAPI
1121     typedef struct {
1122         fapi_msg_t header;
1123         uint16_t sfn;
1124         uint16_t slot;
1125         uint16_t numCrcs;
1126         //uint8_t pad[2];
1127         fapi_crc_ind_info_t crc[FAPI_MAX_NUMBER_OF_CRCS_PER_SLOT];  // 5G FAPI Table 3-62
1128     } fapi_crc_ind_t;
1129
1130 // Updated per 5G FAPI
1131     typedef struct {
1132         uint8_t harqCrc;
1133         //uint8_t pad;
1134         uint16_t harqBitLen;
1135         uint8_t harqPayload[FAPI_MAX_HARQ_INFO_LEN_BYTES];  // 5G FAPI Table 3-70
1136     } fapi_harq_info_t;
1137
1138 // Updated per 5G FAPI
1139     typedef struct {
1140         uint8_t csiPart1Crc;
1141         //uint8_t pad;
1142         uint16_t csiPart1BitLen;
1143         uint8_t csiPart1Payload[FAPI_MAX_CSI_PART1_DATA_BYTES]; // 5G FAPI Table 3-71
1144     } fapi_csi_p1_info_t;
1145
1146 // Updated per 5G FAPI
1147     typedef struct {
1148         uint8_t csiPart2Crc;
1149         //uint8_t pad;
1150         uint16_t csiPart2BitLen;
1151         uint8_t csiPart2Payload[FAPI_MAX_CSI_PART2_DATA_BYTES]; // 5G FAPI Table 3-72
1152     } fapi_csi_p2_info_t;
1153
1154 // Updated per 5G FAPI
1155     typedef struct {
1156
1157         uint32_t handle;
1158         uint8_t pduBitmap;
1159         uint8_t ul_cqi;
1160         uint16_t rnti;
1161         uint16_t timingAdvance;
1162         uint16_t rssi;          // 5G FAPI Table 3-64
1163         fapi_harq_info_t harqInfo;  // This is included if indicated by the pduBitmap
1164         fapi_csi_p1_info_t csiPart1info;    // This is included if indicated by the pduBitmap
1165         fapi_csi_p2_info_t csiPart2info;    // This is included if indicated by the pduBitmap
1166     } fapi_uci_o_pusch_t;
1167
1168 // Updated per 5G FAPI
1169     typedef struct {
1170         uint8_t srIndication;
1171         uint8_t srConfidenceLevel;  // 5G FAPI Table 3-67
1172         //uint8_t pad[2];
1173     } fapi_sr_f0f1_info_t;
1174
1175 // Updated per 5G FAPI
1176     typedef struct {
1177         uint8_t numHarq;
1178         uint8_t harqConfidenceLevel;
1179         uint8_t harqValue[FAPI_MAX_NUMBER_OF_HARQS_PER_IND];    // 5G FAPI Table 3-68
1180     } fapi_harq_f0f1_info_t;
1181
1182 // Updated per 5G FAPI
1183     typedef struct {
1184         uint16_t srBitlen;
1185         uint8_t srPayload[FAPI_MAX_SR_PAYLOAD_SIZE + 1];    // 5G FAPI Table 3-69
1186     } fapi_sr_f2f3f4_info_t;
1187
1188 // Updated per 5G FAPI
1189     typedef struct {
1190         uint8_t harqCrc;
1191         //uint8_t pad;
1192         uint16_t harqBitLen;
1193         uint8_t harqPayload[FAPI_MAX_HARQ_PAYLOAD_SIZE + 2];    // 5G FAPI Table 3-70
1194     } fapi_harq_f2f3f4_info_t;
1195
1196 // Updated per 5G FAPI
1197     typedef struct {
1198         uint32_t handle;
1199         uint8_t pduBitmap;
1200         uint8_t pucchFormat;
1201         uint8_t ul_cqi;
1202         //uint8_t pad;
1203         uint16_t rnti;
1204         uint16_t timingAdvance;
1205         uint16_t rssi;          // 5G FAPI Table 3-66
1206         uint16_t num_uci_bits;
1207         uint8_t uciBits[FAPI_MAX_UCI_BIT_BYTE_LEN];
1208     } fapi_uci_o_pucch_f2f3f4_t;
1209
1210 // Updated per 5G FAPI
1211     typedef struct {
1212         uint32_t handle;
1213         uint8_t pduBitmap;
1214         uint8_t pucchFormat;
1215         uint8_t ul_cqi;
1216         //uint8_t pad;
1217         uint16_t rnti;
1218         uint16_t timingAdvance;
1219         uint16_t rssi;          // 5G FAPI Table 3-65
1220         //uint8_t pad1[2];
1221         fapi_sr_f0f1_info_t srInfo; // This is included if indicated by the pduBitmap
1222         fapi_harq_f0f1_info_t harqInfo; // This is included if indicated by the pduBitmap
1223     } fapi_uci_o_pucch_f0f1_t;
1224
1225 // Updated per 5G FAPI
1226     typedef struct {
1227         uint16_t pduType;
1228         uint16_t pduSize;
1229         union {
1230             fapi_uci_o_pusch_t uciPusch;
1231             fapi_uci_o_pucch_f0f1_t uciPucchF0F1;
1232             fapi_uci_o_pucch_f2f3f4_t uciPucchF2F3F4;   // 5G FAPI Table 3-63 subset
1233         } uci;
1234     } fapi_uci_pdu_info_t;
1235
1236 // Updated per 5G FAPI
1237     typedef struct {
1238         fapi_msg_t header;
1239         uint16_t sfn;
1240         uint16_t slot;
1241         uint16_t numUcis;       // 5G FAPI Table 3-63
1242         //uint8_t pad[2];
1243         fapi_uci_pdu_info_t uciPdu[FAPI_MAX_NUMBER_UCI_PDUS_PER_SLOT];
1244     } fapi_uci_indication_t;
1245
1246 // Updated per 5G FAPI
1247     typedef struct {
1248         uint16_t numRbs;
1249         //uint8_t pad[2];
1250         uint8_t rbSNR[FAPI_MAX_NUMBER_RBS]; // 5G FAPI Table 3-73 Subset
1251     } fapi_symb_snr_t;
1252
1253 // Updated per 5G FAPI
1254     typedef struct {
1255         uint32_t handle;
1256         uint16_t rnti;
1257         uint16_t timingAdvance;
1258         uint8_t numSymbols;
1259         uint8_t wideBandSnr;
1260         uint8_t numReportedSymbols;
1261         //uint8_t pad;
1262         fapi_symb_snr_t symbSnr[FAPI_MAX_NUMBER_OF_REP_SYMBOLS];    // 5G FAPI Table 3-73 subset
1263     } fapi_srs_pdu_t;
1264
1265 // Updated per 5G FAPI
1266     typedef struct {
1267         fapi_msg_t header;
1268         uint16_t sfn;
1269         uint16_t slot;
1270         uint8_t numPdus;
1271         //uint8_t pad[3];
1272         fapi_srs_pdu_t srsPdus[FAPI_MAX_NUMBER_SRS_PDUS_PER_SLOT];  // 5G FAPI Table 3-73
1273     } fapi_srs_indication_t;
1274
1275 // Updated per 5G FAPI
1276     typedef struct {
1277         uint8_t preambleIndex;
1278         //uint8_t pad;
1279         uint16_t timingAdvance;
1280         uint32_t preamblePwr;   // 5G FAPI Table 3-74 Subset
1281     } fapi_preamble_info_t;
1282
1283 // Updated per 5G FAPI
1284     typedef struct {
1285         uint16_t phyCellId;
1286         uint8_t symbolIndex;
1287         uint8_t slotIndex;
1288         uint8_t freqIndex;
1289         uint8_t avgRssi;
1290         uint8_t avgSnr;
1291         uint8_t numPreamble;
1292         fapi_preamble_info_t preambleInfo[FAPI_MAX_NUM_PREAMBLES_PER_SLOT]; // 5G FAPI Table 3-74 Subset
1293     } fapi_rach_pdu_t;
1294
1295 // Updated per 5G FAPI
1296     typedef struct {
1297         fapi_msg_t header;
1298         uint16_t sfn;
1299         uint16_t slot;
1300         uint8_t numPdus;
1301         //uint8_t pad[3];
1302         fapi_rach_pdu_t rachPdu[FAPI_MAX_NUMBER_RACH_PDUS_PER_SLOT];    // 5G FAPI Table 3-74
1303     } fapi_rach_indication_t;
1304
1305 //------------------------------------------------------------------------------
1306
1307 #if defined(__cplusplus)
1308 }
1309 #endif
1310 #endif