* INTC Contribution to the O-RAN F Release for O-DU Low
[o-du/phy.git] / fapi_5g / include / fapi_interface.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2021 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 #define FAPI_RB_BITMAP_SIZE                                 36  // Based on 5G FAPI Table 3-38
257
258     enum ul_tti_pdu_type_e {
259         FAPI_PRACH_PDU_TYPE = 0,
260         FAPI_PUSCH_PDU_TYPE,
261         FAPI_PUCCH_PDU_TYPE,
262         FAPI_SRS_PDU_TYPE,
263         FAPI_UL_TTI_PDU_TYPE_MAX
264     };
265
266     enum dl_tti_pdu_type_e {
267         FAPI_PDCCH_PDU_TYPE = 0,
268         FAPI_PDSCH_PDU_TYPE,
269         FAPI_CSIRS_PDU_TYPE,
270         FAPI_PBCH_PDU_TYPE,
271         FAPI_DL_TTI_PDU_TYPE_MAX
272     };
273
274     enum dl_resource_alloc_type_e { // Based on 5G FAPI Table 3-38
275         FAPI_DL_RESOURCE_ALLOC_TYPE_0 = 0,
276         FAPI_DL_RESOURCE_ALLOC_TYPE_1 = 1
277     };
278
279     enum ul_resource_alloc_type_e { // Based on 5G FAPI Table 3-38
280         FAPI_UL_RESOURCE_ALLOC_TYPE_0 = 0,
281         FAPI_UL_RESOURCE_ALLOC_TYPE_1 = 1
282     };
283
284 //------------------------------------------------------------------------------------------------------------
285 // Updated per 5G FAPI
286     typedef struct {
287         uint8_t num_msg;
288         // Can be used for Phy Id or Carrier Id  5G FAPI Table 3-2
289         uint8_t handle;
290         uint8_t pad[2];
291     } fapi_msg_header_t,
292     *p_fapi_msg_header_t;
293
294 // Updated per 5G FAPI
295     typedef struct {
296         uint16_t msg_id;
297         uint16_t pad;
298         uint32_t length;        // Length of the message body in bytes  5G FAPI Table 3-3
299     } fapi_msg_t;
300 // Updated per 5G FAPI
301     typedef struct {
302         uint16_t tag;
303         uint16_t length;        // 5G FAPI Table 3-7 Fixed part
304     } fapi_tl_t;
305 // Updated per 5G FAPI
306     typedef struct {
307         fapi_tl_t tl;
308         uint8_t value;          // TLV with byte value
309         uint8_t rsv[3];         // Per 5g FAPI 3.3.1.4 the lenght of the value parameter must be 32 bits
310     } fapi_uint8_tlv_t;
311     typedef struct {
312         fapi_tl_t tl;
313         uint8_t *value;         // TLV with unsigned 32 bit value
314     } fapi_uint8_ptr_tlv_t;
315 // Updated per 5G FAPI
316     typedef struct {
317         fapi_tl_t tl;
318         uint16_t value;         // TLV with unsigned 16 bit value
319         uint8_t rsv[2];         // Per 5g FAPI 3.3.1.4 the lenght of the value parameter must be 32 bits
320     } fapi_uint16_tlv_t;
321 // Updated per 5G FAPI
322     typedef struct {
323         fapi_tl_t tl;
324         int16_t value;          // TLV with signed 16 bit value
325         uint8_t rsv[2];         // Per 5g FAPI 3.3.1.4 the lenght of the value parameter must be 32 bits
326     } fapi_int16_tlv_t;
327 // Updated per 5G FAPI
328     typedef struct {
329         fapi_tl_t tl;
330         uint32_t value;         // TLV with unsigned 32 bit value
331     } fapi_uint32_tlv_t;
332 // Updated per 5G FAPI
333     typedef struct {
334         uint16_t tag;           // In 5G FAPI for Cell Params inside Table 3-9 under NumConfigTLVsToReport Loop
335         uint8_t length;
336         uint8_t value;
337     } fapi_config_tlv_t;
338
339     typedef struct {
340         fapi_tl_t tl;
341         uint16_t value[FAPI_NUMEROLOGIES];
342         uint16_t rsv;           // To be 32-bit aligned, if FAPI_NUMEROLOGIES changes to some other value than 5 please ensure 32 bit alignment
343     } fapi_config_num_tlv_t;
344
345 // Updated per 5G FAPI
346     typedef struct {
347         fapi_msg_t header;      // For PARAM.req message length in fapi_msg_t is zero per 5G FAPI 3.3.1.1
348     } fapi_param_req_t;
349
350 // Updated per 5G FAPI
351     typedef struct {
352         fapi_uint16_tlv_t releaseCapability;
353         fapi_uint16_tlv_t phyState;
354         fapi_uint8_tlv_t skipBlankDlConfig;
355         fapi_uint8_tlv_t skipBlankUlConfig;
356         fapi_uint16_tlv_t numTlvsToReport;
357         fapi_config_tlv_t tlvStatus[FAPI_MAX_NUM_TLVS_CONFIG];  // 5G FAPI Table 3-9
358     } fapi_cell_parms_t;
359
360 // Updated per 5G FAPI
361     typedef struct {
362         fapi_uint8_tlv_t cyclicPrefix;
363         fapi_uint8_tlv_t supportedSubcarrierSpacingDl;
364         fapi_uint16_tlv_t supportedBandwidthDl;
365         fapi_uint8_tlv_t supportedSubcarrierSpecingsUl;
366         fapi_uint16_tlv_t supportedBandwidthUl; // 5G FAPI Table 3-10
367     } fapi_carrier_parms_t;
368
369 // Updated per 5G FAPI    
370     typedef struct {
371         fapi_uint8_tlv_t cceMappingType;
372         fapi_uint8_tlv_t coresetOutsideFirst3OfdmSymsOfSlot;
373         fapi_uint8_tlv_t precoderGranularityCoreset;
374         fapi_uint8_tlv_t pdcchMuMimo;
375         fapi_uint8_tlv_t pdcchPrecoderCycling;
376         fapi_uint8_tlv_t maxPdcchsPerSlot;  // 5G FAPI Table 3-11
377     } fapi_pdcch_parms_t;
378
379 // Updated per 5G FAPI
380     typedef struct {
381         fapi_uint8_tlv_t pucchFormats;
382         fapi_uint8_tlv_t maxPucchsPerSlot;  // 5G FAPI Table 3-12
383     } fapi_pucch_parms_t;
384
385 // Updated per 5G FAPI
386     typedef struct {
387         fapi_uint8_tlv_t pdschMappingType;
388         fapi_uint8_tlv_t pdschAllocationTypes;
389         fapi_uint8_tlv_t pdschVrbToPrbMapping;
390         fapi_uint8_tlv_t pdschCbg;
391         fapi_uint8_tlv_t pdschDmrsConfigTypes;
392         fapi_uint8_tlv_t pdschDmrsMaxLength;
393         fapi_uint8_tlv_t pdschDmrsAdditionalPos;
394         fapi_uint8_tlv_t maxPdschsTBsPerSlot;
395         fapi_uint8_tlv_t maxNumberMimoLayersPdsch;
396         fapi_uint8_tlv_t supportedMaxModulationOrderDl;
397         fapi_uint8_tlv_t maxMuMimoUsersDl;
398         fapi_uint8_tlv_t pdschDataInDmrsSymbols;
399         fapi_uint8_tlv_t premptionSupport;
400         fapi_uint8_tlv_t pdschNonSlotSupport;   // 5G FAPI Table 3-13
401     } fapi_pdsch_parms_t;
402
403 // Updated per 5G FAPI
404     typedef struct {
405         fapi_uint8_tlv_t uciMuxUlschInPusch;
406         fapi_uint8_tlv_t uciOnlyPusch;
407         fapi_uint8_tlv_t puschFrequencyHopping;
408         fapi_uint8_tlv_t puschDmrsConfigTypes;
409         fapi_uint8_tlv_t puschDmrsMaxLen;
410         fapi_uint8_tlv_t puschDmrsAdditionalPos;
411         fapi_uint8_tlv_t puschCbg;
412         fapi_uint8_tlv_t puschMappingType;
413         fapi_uint8_tlv_t puschAllocationTypes;
414         fapi_uint8_tlv_t puschVrbToPrbMapping;
415         fapi_uint8_tlv_t puschMaxPtrsPorts;
416         fapi_uint8_tlv_t maxPduschsTBsPerSlot;
417         fapi_uint8_tlv_t maxNumberMimoLayersNonCbPusch;
418         fapi_uint8_tlv_t supportedModulationOrderUl;
419         fapi_uint8_tlv_t maxMuMimoUsersUl;
420         fapi_uint8_tlv_t dftsOfdmSupport;
421         fapi_uint8_tlv_t puschAggregationFactor;    // 5G FAPI Table 3-14
422     } fapi_pusch_parms_t;
423
424 // Updated per 5G FAPI
425     typedef struct {
426         fapi_uint8_tlv_t prachLongFormats;
427         fapi_uint16_tlv_t prachShortFormats;
428         fapi_uint8_tlv_t prachRestrictedSets;
429         fapi_uint8_tlv_t maxPrachFdOccasionsInASlot;    // 5G FAPI Table 3-15
430     } fapi_prach_parms_t;
431
432 // Updated per 5G FAPI
433     typedef struct {
434         fapi_uint8_tlv_t rssiMeasurementSupport;    // 5G FAPI Table 3-16
435     } fapi_meas_parms_t;
436
437 // Updated per 5G FAPI
438     typedef struct {
439         fapi_cell_parms_t cell_parms;
440         fapi_carrier_parms_t carr_parms;
441         fapi_pdcch_parms_t pdcch_parms;
442         fapi_pucch_parms_t pucch_parms;
443         fapi_pdsch_parms_t pdsch_parms;
444         fapi_pusch_parms_t pusch_parms;
445         fapi_prach_parms_t prach_parms;
446         fapi_meas_parms_t meas_parms;   // 5G FAPI Table 3-8
447     } fapi_params_t;
448
449 // Updated per 5G FAPI
450     typedef struct {
451         fapi_msg_t header;
452         uint8_t error_code;
453         uint8_t number_of_tlvs;
454         uint8_t pad[2];
455         fapi_uint16_tlv_t tlvs[FAPI_MAX_NUM_TLVS_PARAMS];   // 5G FAPI Table 3-5
456     } fapi_param_resp_t;
457
458 // Updated per 5G FAPI
459     typedef struct {
460         fapi_uint16_tlv_t dlBandwidth;
461         fapi_uint32_tlv_t dlFrequency;
462         fapi_config_num_tlv_t dlk0;
463         fapi_config_num_tlv_t dlGridSize;
464         fapi_uint16_tlv_t numTxAnt;
465         fapi_uint16_tlv_t uplinkBandwidth;
466         fapi_uint32_tlv_t uplinkFrequency;
467         fapi_config_num_tlv_t ulk0;
468         fapi_config_num_tlv_t ulGridSize;
469         fapi_uint16_tlv_t numRxAnt;
470         fapi_uint8_tlv_t frequencyShift7p5KHz;  // 5G FAPI Table 3-21
471     } fapi_carrier_config_t;
472
473 // Updated per 5G FAPI
474     typedef struct {
475         fapi_uint8_tlv_t phyCellId;
476         fapi_uint8_tlv_t frameDuplexType;   // 5G FAPI Table 3-22
477     } fapi_cell_config_t;
478
479 // Updated per 5G FAPI
480     typedef struct {
481         fapi_uint32_tlv_t ssPbchPower;
482         fapi_uint8_tlv_t bchPayload;
483         fapi_uint8_tlv_t scsCommon; // 5G FAPI Table 3-23
484     } fapi_ssb_config_t;
485
486 // Updated per 5G FAPI
487     typedef struct {
488         fapi_uint16_tlv_t prachRootSequenceIndex;
489         fapi_uint8_tlv_t numRootSequences;
490         fapi_uint16_tlv_t k1;
491         fapi_uint8_tlv_t prachZeroCorrConf;
492         fapi_uint16_tlv_t numUnusedRootSequences;   // 5G FAPI Table 3-24 Subset
493         fapi_uint16_tlv_t
494             unusedRootSequences[FAPI_MAX_NUM_UNUSED_ROOT_SEQUENCES];
495     } fapi_prachFdOccasion_t;
496
497 // Updated per 5G FAPI_
498     typedef struct {
499         fapi_uint8_tlv_t prachSequenceLength;
500         fapi_uint8_tlv_t prachSubCSpacing;
501         fapi_uint8_tlv_t restrictedSetConfig;
502         fapi_uint8_tlv_t numPrachFdOccasions;
503         fapi_uint8_tlv_t prachConfigIndex;
504         fapi_prachFdOccasion_t prachFdOccasion[FAPI_MAX_NUM_PRACH_FD_OCCASIONS];
505         fapi_uint8_tlv_t ssbPerRach;
506         fapi_uint8_tlv_t prachMultipleCarriersInABand;  // 5G FAPI Table 3-24
507     } fapi_prach_configuration_t;
508
509 //Updated per 5G FAPI
510     typedef struct {
511         fapi_uint16_tlv_t ssbOffsetPointA;
512         fapi_uint8_tlv_t betaPss;
513         fapi_uint8_tlv_t ssbPeriod;
514         fapi_uint8_tlv_t ssbSubCarrierOffset;
515         fapi_uint32_tlv_t mib;
516         fapi_uint32_tlv_t ssbMask[2];
517         fapi_uint8_tlv_t beamId[64];
518         fapi_uint8_tlv_t ssPbchMultipleCarriersInABand;
519         fapi_uint8_tlv_t multipleCellsSsPbchInACarrier; // 5G FAPI Table 3-25
520     } fapi_ssb_table_t;
521
522 // Updated per 5G FAPI
523     typedef struct {
524         fapi_uint8_tlv_t slotConfig[FAPI_MAX_NUM_OF_SYMBOLS_PER_SLOT];  // 5G FAPI Table 3-26 Subset
525     } fapi_slotconfig_t;
526
527 // Updated per 5G FAPI
528     typedef struct {
529         fapi_uint8_tlv_t tddPeriod;
530         fapi_slotconfig_t slotConfig[FAPI_MAX_TDD_PERIODICITY]; // 5G FAPI Table 3-26
531     } fapi_tdd_table_t;
532
533 // Updated per 5G FAPI
534     typedef struct {
535         fapi_uint8_tlv_t rssiMeasurement;   // 5G FAPI Table 3-27
536     } fapi_meas_config_t;
537
538 // Updated per 5G FAPI
539     typedef struct {
540         int16_t digBeamWeightRe;
541         int16_t digBeamWeightIm;    // 5G FAPI Table 3-32 Subset
542     } fapi_dig_beam_weight_t;
543
544 // Updated per 5G FAPI
545     typedef struct {
546         uint16_t beamIdx;
547         fapi_dig_beam_weight_t digBeamWeight[FAPI_MAX_NUMBER_TX_RUS];   // 5G FAPI Table 3-32 Subset
548     } fapi_dig_beam_config_t;
549
550 // Updated per 5G FAPI
551     typedef struct {
552         uint16_t numDigBeams;
553         uint16_t numTxRus;
554         fapi_dig_beam_config_t digBeam[FAPI_MAX_NUMBER_OF_BEAMS];   // 5G FAPI Table 3-32
555     } fapi_beamforming_table_t;
556
557 // Updated per 5G FAPI
558     typedef struct {
559         int16_t preCoderWeightRe;
560         int16_t preCoderWeightIm;   // 5G FAPI Table 3-33 Subset
561     } fapi_precoderWeight_t;
562
563 // Updated per 5G FAPI
564     typedef struct {
565         fapi_precoderWeight_t precoder_weight[FAPI_MAX_NUM_ANT_PORTS];  // 5G FAPI Table 3-33 Subset
566     } fapi_precoder_weight_t;
567
568 // Updated per 5G FAPI
569     typedef struct {
570         uint16_t pmIdx;
571         uint16_t numLayers;
572         uint16_t numAntPorts;
573         uint16_t pad[1];
574         fapi_precoder_weight_t precoderWeight[FAPI_MAX_NUM_LAYERS]; // 5G FAPI Table 3-33
575     } fapi_precoding_table_t;
576
577 // Updated per 5G FAPI
578     typedef struct {
579         fapi_carrier_config_t carrierConfig;
580         fapi_cell_config_t cellConfig;
581         fapi_ssb_config_t ssbConfig;
582         fapi_prach_configuration_t prachConfig;
583         fapi_ssb_table_t ssbTable;
584         fapi_tdd_table_t tddTable;
585         fapi_meas_config_t measConfig;
586         fapi_beamforming_table_t beamformingTable;
587         fapi_precoding_table_t precodingTable;  // 5G FAPI Table 3-20
588     } fapi_config_t;
589
590 // Updated per 5G FAPI 
591     typedef struct {
592         fapi_msg_t header;
593         uint8_t number_of_tlvs;
594         uint8_t pad[3];
595         fapi_uint32_tlv_t tlvs[FAPI_MAX_NUM_TLVS_CONFIG];   // 5G FAPI Table 3-17
596     } fapi_config_req_t;
597
598 // Updated per 5G FAPI
599     typedef struct {
600         fapi_msg_t header;
601         uint8_t error_code;
602         uint8_t number_of_invalid_tlvs;
603         uint8_t number_of_inv_tlvs_idle_only;
604         uint8_t number_of_inv_tlvs_running_only;
605         uint8_t number_of_missing_tlvs;
606         uint8_t pad[3];
607         fapi_uint16_tlv_t tlvs[4 * FAPI_MAX_NUM_TLVS_CONFIG];   // 5G FAPI Table 3-18
608         //   fapi_uint16_tlv_t unsupported_or_invalid_tlvs[FAPI_MAX_NUMBER_UNSUPPORTED_TLVS];
609         //   fapi_uint16_tlv_t invalid_idle_only_tlvs[FAPI_MAX_NUMBER_OF_INVALID_IDLE_ONLY_TLVS];
610         //   fapi_uint16_tlv_t invalid_running_only_tlvs[FAPI_MAX_NUMBER_OF_INVALID_RUNNING_ONLY_TLVS];
611         //   fapi_uint16_tlv_t missing_tlvs[FAPI_MAX_NUMBER_OF_MISSING_TLVS];            
612     } fapi_config_resp_t;
613
614 // Updated per 5G FAPI
615     typedef struct {
616         fapi_msg_t header;
617     } fapi_start_req_t;
618
619 // Updated per 5G FAPI
620     typedef struct {
621         fapi_msg_t header;      // Message Length is zero for STOP.request
622     } fapi_stop_req_t;
623
624 // Updated per 5G FAPI
625     typedef struct {
626         fapi_msg_t header;      // Message Length is zero for STOP.indication
627     } fapi_stop_ind_t;
628
629 // Updated per 5G FAPI
630     typedef struct {
631         fapi_msg_t header;
632         uint16_t sfn;
633         uint16_t slot;
634         uint8_t message_id;
635         uint8_t error_code;     // 5G FAPI Table 3-30
636         uint8_t pad[2];
637     } fapi_error_ind_t;
638
639 // Updated per 5G FAPI
640     typedef struct {
641         fapi_msg_t header;
642         uint16_t sfn;
643         uint16_t slot;          // 5G FAPI Table 3-34
644     } fapi_slot_ind_t;
645
646 // Updated per 5G FAPI
647     typedef struct {
648         uint16_t beamidx;       // 5G FAPI Table 3-43 subset
649     } fapi_bmi_t;
650
651 // Updated per 5G FAPI
652     typedef struct {
653         uint16_t pmIdx;
654         uint8_t pad[2];
655         fapi_bmi_t beamIdx[FAPI_MAX_NUM_DIGBFINTERFACES];   // 5G FAPI Table 3-43 subset
656     } fapi_pmi_bfi_t;
657
658 // Updated per 5G FAPI
659     typedef struct {
660         uint16_t numPrgs;
661         uint16_t prgSize;
662         uint8_t digBfInterfaces;
663         uint8_t pad[3];
664         fapi_pmi_bfi_t pmi_bfi[FAPI_MAX_NUM_PRGS_PER_TTI];  // 5G FAPI Table 3-43
665     } fapi_precoding_bmform_t;
666
667 // Updated per 5G FAPI
668     typedef struct {
669         uint16_t rnti;
670         uint16_t scramblingId;
671         uint16_t scramblingRnti;
672         uint8_t cceIndex;
673         uint8_t aggregationLevel;
674         fapi_precoding_bmform_t pc_and_bform;
675         uint8_t beta_pdcch_1_0;
676         uint8_t powerControlOffsetSS;
677         uint16_t payloadSizeBits;
678         uint8_t payload[FAPI_DCI_PAYLOAD_BYTE_LEN]; // 5G FAPI Table 3-37
679     } fapi_dl_dci_t;
680
681 // Updated per 5G FAPI
682     typedef struct {
683         uint16_t bwpSize;
684         uint16_t bwpStart;
685         uint8_t subCarrierSpacing;
686         uint8_t cyclicPrefix;
687         uint8_t startSymbolIndex;
688         uint8_t durationSymbols;
689         uint8_t freqDomainResource[6];
690         uint8_t cceRegMappingType;
691         uint8_t regBundleSize;
692         uint8_t interleaverSize;
693         uint8_t coreSetType;
694         uint16_t shiftIndex;
695         uint8_t precoderGranularity;
696         uint8_t pad;
697         uint16_t numDlDci;      // 5G FAPI Table 3-36
698         fapi_dl_dci_t dlDci[FAPI_MAX_NUMBER_DL_DCI];
699     } fapi_dl_pdcch_pdu_t;
700
701     // Updated per 5G FAPI
702     typedef struct {
703         uint16_t targetCodeRate;
704         uint8_t qamModOrder;
705         uint8_t mcsIndex;
706         uint8_t mcsTable;
707         uint8_t rvIndex;
708         uint8_t pad[2];
709         uint32_t tbSize;        // 5G FAPI Table 3-38 Subset
710     } fapi_codeword_pdu_t;
711
712     // Updated per 5G FAPI
713     typedef struct {
714         uint16_t pduBitMap;
715         uint16_t rnti;
716         uint16_t pdu_index;
717         uint16_t bwpSize;
718         uint16_t bwpStart;
719         uint8_t subCarrierSpacing;
720         uint8_t cyclicPrefix;
721         uint8_t nrOfCodeWords;
722         uint8_t pad[3];
723         fapi_codeword_pdu_t cwInfo[FAPI_MAX_NUMBER_OF_CODEWORDS_PER_PDU];
724         uint16_t dataScramblingId;
725         uint8_t nrOfLayers;
726         uint8_t transmissionScheme;
727         uint8_t refPoint;
728         uint8_t dmrsConfigType;
729         uint16_t dlDmrsSymbPos;
730         uint8_t scid;
731         uint8_t numDmrsCdmGrpsNoData;
732         uint8_t resourceAlloc;
733         uint8_t pad1;
734         uint16_t dlDmrsScramblingId;
735         uint16_t dmrsPorts;
736         uint16_t rbStart;
737         uint16_t rbSize;
738         uint8_t rbBitmap[FAPI_RB_BITMAP_SIZE];
739         uint8_t vrbToPrbMapping;
740         uint8_t startSymbIndex;
741         uint8_t nrOfSymbols;
742         uint8_t ptrsPortIndex;
743         uint8_t ptrsTimeDensity;
744         uint8_t ptrsFreqDensity;
745         uint8_t ptrsReOffset;
746         uint8_t nEpreRatioOfPdschToPtrs;
747         fapi_precoding_bmform_t preCodingAndBeamforming;
748         uint8_t powerControlOffset;
749         uint8_t powerControlOffsetSS;
750         uint8_t isLastCbPresent;
751         uint8_t isInlineTbCrc;
752         uint32_t dlTbCrc;       // 5G FAPI Table 3-38
753         uint8_t mappingType;
754         uint8_t nrOfDmrsSymbols;
755         uint8_t dmrsAddPos;
756         uint8_t pad2;
757     } fapi_dl_pdsch_pdu_t;
758
759     // Updated per 5G FAPI
760     typedef struct {
761         uint16_t bwpSize;
762         uint16_t bwpStart;
763         uint8_t subCarrierSpacing;
764         uint8_t cyclicPrefix;
765         uint16_t startRb;
766         uint16_t nrOfRbs;
767         uint8_t csiType;
768         uint8_t row;
769         uint16_t freqDomain;
770         uint8_t symbL0;
771         uint8_t symbL1;
772         uint8_t cdmType;
773         uint8_t freqDensity;
774         uint16_t scramId;
775         uint8_t powerControlOffset;
776         uint8_t powerControlOffsetSs;
777         uint8_t pad[2];
778         fapi_precoding_bmform_t preCodingAndBeamforming;    // 5G FAPI Table 3-39
779     } fapi_dl_csi_rs_pdu_t;
780
781 // Updated per 5G FAPI 
782     typedef struct {
783         uint8_t dmrsTypeAPosition;
784         uint8_t pdcchConfigSib1;
785         uint8_t cellBarred;
786         uint8_t intraFreqReselection;   // 5G FAPI Table 3-42
787     } fapi_phy_mib_pdu_t;
788
789 // Updated per 5G FAPI 
790     typedef struct {
791         union {
792             uint32_t bchPayload;
793             fapi_phy_mib_pdu_t phyMibPdu;   // 5G FAPI Table 3-40 Subset
794         };
795     } fapi_bch_payload_t;
796
797     // Updated per 5G FAPI
798     typedef struct {
799         uint16_t physCellId;
800         uint8_t betaPss;
801         uint8_t ssbBlockIndex;
802         uint8_t ssbSubCarrierOffset;
803         uint8_t bchPayloadFlag;
804         uint16_t ssbOffsetPointA;
805         fapi_bch_payload_t bchPayload;
806         fapi_precoding_bmform_t preCodingAndBeamforming;    // 5G FAPI Table 3-40
807     } fapi_dl_ssb_pdu_t;
808
809 // Updated per 5G FAPI
810     typedef struct {
811         uint16_t pduType;
812         uint16_t pduSize;
813         union {
814             fapi_dl_pdcch_pdu_t pdcch_pdu;
815             fapi_dl_pdsch_pdu_t pdsch_pdu;
816             fapi_dl_csi_rs_pdu_t csi_rs_pdu;
817             fapi_dl_ssb_pdu_t ssb_pdu;  // 5G FAPI Table 3-35 Subset
818         } pdu;
819     } fapi_dl_tti_req_pdu_t;
820
821 // Updated per 5G FAPI
822     typedef struct {
823         uint8_t nUe;
824         uint8_t pad[3];
825         uint8_t pduIdx[FAPI_MAX_NUMBER_OF_UES_PER_TTI]; // 5G FAPI Subset Table 3-35 and Table 3-44
826     } fapi_ue_info_t;
827
828 // Updated per 5G FAPI
829     typedef struct {
830         fapi_msg_t header;
831         uint16_t sfn;
832         uint16_t slot;
833         uint8_t nPdus;
834         uint8_t nGroup;
835         uint8_t pad[2];
836         fapi_dl_tti_req_pdu_t pdus[FAPI_MAX_PDUS_PER_SLOT]; // 5G FAPI Table 3-35
837         fapi_ue_info_t ue_grp_info[FAPI_MAX_NUMBER_OF_GROUPS_PER_TTI];
838     } fapi_dl_tti_req_t;
839
840 // Updated per 5G FAPI
841     typedef struct {
842         uint8_t rvIndex;
843         uint8_t harqProcessId;
844         uint8_t newDataIndicator;
845         uint8_t pad;
846         uint32_t tbSize;
847         uint16_t numCb;         // 5G FAPI Table 3-47
848         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
849     } fapi_pusch_data_t;
850
851 // Updated per 5G FAPI
852     typedef struct {
853         uint16_t harqAckBitLength;
854         uint16_t csiPart1BitLength;
855         uint16_t csiPart2BitLength;
856         uint8_t alphaScaling;
857         uint8_t betaOffsetHarqAck;
858         uint8_t betaOffsetCsi1;
859         uint8_t betaOffsetCsi2; // 5G FAPI Table 3-48
860         uint8_t pad[2];
861     } fapi_pusch_uci_t;
862
863 // Updated per 5G FAPI
864     typedef struct {
865         uint16_t ptrsPortIndex;
866         uint8_t ptrsDmrsPort;
867         uint8_t ptrsReOffset;   // 5G FAPI Table 3-49 Subset
868     } fapi_ptrs_info_t;
869
870 // Updated per 5G FAPI
871     typedef struct {
872         uint8_t numPtrsPorts;
873         uint8_t ptrsTimeDensity;
874         uint8_t ptrsFreqDensity;    // 5G FAPI Table 3-49 Subset
875         uint8_t ulPtrsPower;
876         fapi_ptrs_info_t ptrsInfo[FAPI_MAX_NUM_PTRS_PORTS];
877     } fapi_pusch_ptrs_t;
878
879 // Updated per 5G FAPI
880     typedef struct {
881         uint16_t lowPaprSequenceNumber;
882         uint8_t lowPaprGroupNumber;
883         uint8_t ulPtrsSampleDensity;
884         uint8_t ulPtrsTimeDensityTransformPrecoding;
885         uint8_t pad;            // 5G FAPI Table 3-50
886     } fapi_dfts_ofdm_t;
887
888 // Updated per 5G FAPI
889     typedef struct {
890         fapi_bmi_t beamIdx[FAPI_MAX_NUM_DIGBFINTERFACES];
891     } fapi_rx_bfi_t;
892
893 // Updated per 5G FAPI
894     typedef struct {
895         uint16_t numPrgs;
896         uint16_t prgSize;
897         uint8_t digBfInterface;
898         uint8_t pad[3];
899         fapi_rx_bfi_t rx_bfi[FAPI_MAX_NUM_PRGS_PER_TTI];    // 5G FAPI Table 3-53
900     } fapi_ul_rx_bmform_pdu_t;
901
902 // Updated per 5G FAPI
903     typedef struct {
904         uint16_t physCellId;
905         uint8_t numPrachOcas;
906         uint8_t prachFormat;
907         uint8_t numRa;
908         uint8_t prachStartSymbol;
909         uint16_t numCs;
910         fapi_ul_rx_bmform_pdu_t beamforming;
911     } fapi_ul_prach_pdu_t;      // 5G FAPI Table 3-45
912
913 // Updated per 5G FAPI
914     typedef struct {
915         uint16_t pduBitMap;
916         uint16_t rnti;
917         uint32_t handle;
918         uint16_t bwpSize;
919         uint16_t bwpStart;
920         uint8_t subCarrierSpacing;
921         uint8_t cyclicPrefix;
922         uint8_t mcsIndex;
923         uint8_t mcsTable;
924         uint16_t targetCodeRate;
925         uint8_t qamModOrder;
926         uint8_t transformPrecoding;
927         uint16_t dataScramblingId;
928         uint8_t nrOfLayers;
929         uint8_t dmrsConfigType;
930         uint16_t ulDmrsSymbPos;
931         uint16_t ulDmrsScramblingId;
932         uint8_t scid;
933         uint8_t numDmrsCdmGrpsNoData;
934         uint16_t dmrsPorts;
935         uint16_t nTpPuschId;
936         uint16_t tpPi2Bpsk;
937         uint8_t rbBitmap[FAPI_RB_BITMAP_SIZE];
938         uint16_t rbStart;
939         uint16_t rbSize;
940         uint8_t vrbToPrbMapping;
941         uint8_t frequencyHopping;
942         uint16_t txDirectCurrentLocation;
943         uint8_t resourceAlloc;
944         uint8_t uplinkFrequencyShift7p5khz;
945         uint8_t startSymbIndex;
946         uint8_t nrOfSymbols;
947         uint8_t mappingType;
948         uint8_t nrOfDmrsSymbols;
949         uint8_t dmrsAddPos;
950         uint8_t pad;
951
952         fapi_pusch_data_t puschData;
953         fapi_pusch_uci_t puschUci;
954         fapi_pusch_ptrs_t puschPtrs;
955         fapi_dfts_ofdm_t dftsOfdm;
956         fapi_ul_rx_bmform_pdu_t beamforming;    // 5G FAPI Table 3-46
957     } fapi_ul_pusch_pdu_t;
958
959 // Updated per 5G FAPI
960     typedef struct {
961         uint16_t rnti;
962         uint8_t pad1[2];
963         uint32_t handle;
964         uint16_t bwpSize;
965         uint16_t bwpStart;
966         uint8_t subCarrierSpacing;
967         uint8_t cyclicPrefix;
968         uint8_t formatType;
969         uint8_t multiSlotTxIndicator;
970         uint8_t pi2Bpsk;
971         uint8_t pad2;
972         uint16_t prbStart;
973         uint16_t prbSize;
974         uint8_t startSymbolIndex;
975         uint8_t nrOfSymbols;
976         uint8_t freqHopFlag;
977         uint8_t groupHopFlag;
978         uint8_t sequenceHopFlag;
979         uint8_t pad3;
980         uint16_t secondHopPrb;
981         uint16_t hoppingId;
982         uint16_t initialCyclicShift;
983         uint16_t dataScramblingId;
984         uint8_t timeDomainOccIdx;
985         uint8_t preDftOccIdx;
986         uint8_t preDftOccLen;
987         uint8_t addDmrsFlag;
988         uint16_t dmrsScramblingId;
989         uint8_t dmrsCyclicShift;
990         uint8_t srFlag;
991         uint16_t bitLenHarq;
992         uint8_t pad4[2];
993         uint16_t bitLenCsiPart1;
994         uint16_t bitLenCsiPart2;
995         fapi_ul_rx_bmform_pdu_t beamforming;    // 5G FAPI Table 3-51
996     } fapi_ul_pucch_pdu_t;
997
998 // Updated per 5G FAPI
999     typedef struct {
1000         uint16_t rnti;
1001         uint8_t pad[2];
1002         uint32_t handle;
1003         uint16_t bwpSize;
1004         uint16_t bwpStart;
1005         uint8_t subCarrierSpacing;
1006         uint8_t cyclicPrefix;
1007         uint8_t numAntPorts;
1008         uint8_t numSymbols;
1009         uint8_t numRepetitions;
1010         uint8_t timeStartPosition;
1011         uint8_t configIndex;
1012         uint8_t bandwidthIndex;
1013         uint16_t sequenceId;
1014         uint8_t combSize;
1015         uint8_t combOffset;
1016         uint8_t cyclicShift;
1017         uint8_t frequencyPosition;
1018         uint16_t frequencyShift;
1019         uint8_t frequencyHopping;
1020         uint8_t groupOrSequenceHopping;
1021         uint8_t resourceType;
1022         uint8_t pad1[2];
1023         uint16_t tSrs;
1024         uint16_t tOffset;
1025         fapi_ul_rx_bmform_pdu_t beamforming;    // 5G FAPI Table 3-52
1026     } fapi_ul_srs_pdu_t;
1027
1028 // Updated per 5G FAPI
1029     typedef struct {
1030         uint16_t pduType;
1031         uint16_t pduSize;
1032         union {
1033             fapi_ul_prach_pdu_t prach_pdu;
1034             fapi_ul_pusch_pdu_t pusch_pdu;
1035             fapi_ul_pucch_pdu_t pucch_pdu;
1036             fapi_ul_srs_pdu_t srs_pdu;
1037         } pdu;
1038     } fapi_ul_tti_req_pdu_t;    // 5G FAPI Subset Table 3-44
1039
1040 // Updated per 5G FAPI
1041     typedef struct {
1042         fapi_msg_t header;
1043         uint16_t sfn;
1044         uint16_t slot;
1045         uint8_t nPdus;
1046         uint8_t rachPresent;
1047         uint8_t nUlsch;
1048         uint8_t nUlcch;
1049         uint8_t nGroup;
1050         uint8_t pad[3];
1051         fapi_ul_tti_req_pdu_t pdus[FAPI_MAX_NUMBER_UL_PDUS_PER_TTI];    // 5G FAPI Table 3-44
1052         fapi_ue_info_t ueGrpInfo[FAPI_MAX_NUMBER_OF_GROUPS_PER_TTI];
1053     } fapi_ul_tti_req_t;
1054
1055 // Updated per 5G FAPI
1056     typedef struct {
1057         uint16_t pduType;
1058         uint16_t pduSize;
1059         fapi_dl_pdcch_pdu_t pdcchPduConfig; // 5G FAPI Table 3-54 Subset
1060     } fapi_dci_pdu_t;
1061
1062     // Updated per 5G FAPI
1063     typedef struct {
1064         fapi_msg_t header;
1065         uint16_t sfn;
1066         uint16_t slot;
1067         uint8_t numPdus;
1068         uint8_t pad[3];
1069         fapi_dci_pdu_t pdus[FAPI_MAX_NUMBER_UCI_PDUS_PER_SLOT]; // 5G FAPI Table 3-54
1070     } fapi_ul_dci_req_t;
1071
1072 // Updated per 5G FAPI
1073     typedef struct {
1074         uint32_t pdu_length;
1075         uint16_t pdu_index;
1076         uint16_t num_tlvs;
1077         fapi_uint8_ptr_tlv_t tlvs[FAPI_MAX_NUMBER_OF_TLVS_PER_PDU]; // 5G FAPI Table 3-58 Subset
1078     } fapi_tx_pdu_desc_t;
1079
1080 // Updated per 5G FAPI
1081     typedef struct {
1082         fapi_msg_t header;
1083         uint16_t sfn;
1084         uint16_t slot;
1085         uint16_t num_pdus;
1086         uint8_t pad[2];
1087         fapi_tx_pdu_desc_t pdu_desc[FAPI_MAX_NUMBER_DL_PDUS_PER_TTI];   // 5G FAPI Table 3-58
1088     } fapi_tx_data_req_t;
1089
1090 // Updated per 5G FAPI
1091     typedef struct {
1092         uint32_t handle;
1093         uint16_t rnti;
1094         uint8_t harqId;
1095         uint8_t ul_cqi;
1096         uint16_t timingAdvance;
1097         uint16_t rssi;
1098         uint16_t pdu_length;
1099         uint8_t pad[2];
1100         void *pduData;          // 5G FAPI Table 3-61 Subset
1101     } fapi_pdu_ind_info_t;
1102
1103     // Updated per 5G FAPI
1104     typedef struct {
1105         fapi_msg_t header;
1106         uint16_t sfn;
1107         uint16_t slot;
1108         uint16_t numPdus;
1109         uint8_t pad[2];
1110         fapi_pdu_ind_info_t pdus[FAPI_MAX_NUMBER_OF_ULSCH_PDUS_PER_SLOT];   // 5G FAPI Table 3-61
1111     } fapi_rx_data_indication_t;
1112
1113 // Updated per 5G FAPI
1114     typedef struct {
1115         uint32_t handle;
1116         uint16_t rnti;
1117         uint8_t harqId;
1118         uint8_t tbCrcStatus;
1119         uint8_t ul_cqi;
1120         uint8_t pad;
1121         uint16_t numCb;
1122         uint16_t timingAdvance;
1123         uint16_t rssi;
1124         uint8_t cbCrcStatus[FAPI_MAX_NUM_CB_PER_TTI_IN_BYTES];  // 5G FAPI Table 3-62 subset
1125     } fapi_crc_ind_info_t;
1126
1127 // Updated per 5G FAPI
1128     typedef struct {
1129         fapi_msg_t header;
1130         uint16_t sfn;
1131         uint16_t slot;
1132         uint16_t numCrcs;
1133         uint8_t pad[2];
1134         fapi_crc_ind_info_t crc[FAPI_MAX_NUMBER_OF_CRCS_PER_SLOT];  // 5G FAPI Table 3-62
1135     } fapi_crc_ind_t;
1136
1137 // Updated per 5G FAPI
1138     typedef struct {
1139         uint8_t harqCrc;
1140         uint8_t pad;
1141         uint16_t harqBitLen;
1142         uint8_t harqPayload[FAPI_MAX_HARQ_INFO_LEN_BYTES];  // 5G FAPI Table 3-70
1143     } fapi_harq_info_t;
1144
1145 // Updated per 5G FAPI
1146     typedef struct {
1147         uint8_t csiPart1Crc;
1148         uint8_t pad;
1149         uint16_t csiPart1BitLen;
1150         uint8_t csiPart1Payload[FAPI_MAX_CSI_PART1_DATA_BYTES]; // 5G FAPI Table 3-71
1151     } fapi_csi_p1_info_t;
1152
1153 // Updated per 5G FAPI
1154     typedef struct {
1155         uint8_t csiPart2Crc;
1156         uint8_t pad;
1157         uint16_t csiPart2BitLen;
1158         uint8_t csiPart2Payload[FAPI_MAX_CSI_PART2_DATA_BYTES]; // 5G FAPI Table 3-72
1159     } fapi_csi_p2_info_t;
1160
1161 // Updated per 5G FAPI
1162     typedef struct {
1163
1164         uint32_t handle;
1165         uint8_t pduBitmap;
1166         uint8_t ul_cqi;
1167         uint16_t rnti;
1168         uint16_t timingAdvance;
1169         uint16_t rssi;          // 5G FAPI Table 3-64
1170         fapi_harq_info_t harqInfo;  // This is included if indicated by the pduBitmap
1171         fapi_csi_p1_info_t csiPart1info;    // This is included if indicated by the pduBitmap
1172         fapi_csi_p2_info_t csiPart2info;    // This is included if indicated by the pduBitmap
1173     } fapi_uci_o_pusch_t;
1174
1175 // Updated per 5G FAPI
1176     typedef struct {
1177         uint8_t srIndication;
1178         uint8_t srConfidenceLevel;  // 5G FAPI Table 3-67
1179         uint8_t pad[2];
1180     } fapi_sr_f0f1_info_t;
1181
1182 // Updated per 5G FAPI
1183     typedef struct {
1184         uint8_t numHarq;
1185         uint8_t harqConfidenceLevel;
1186         uint8_t harqValue[FAPI_MAX_NUMBER_OF_HARQS_PER_IND];    // 5G FAPI Table 3-68
1187     } fapi_harq_f0f1_info_t;
1188
1189 // Updated per 5G FAPI
1190     typedef struct {
1191         uint16_t srBitlen;
1192         uint8_t srPayload[FAPI_MAX_SR_PAYLOAD_SIZE + 1];    // 5G FAPI Table 3-69
1193     } fapi_sr_f2f3f4_info_t;
1194
1195 // Updated per 5G FAPI
1196     typedef struct {
1197         uint8_t harqCrc;
1198         uint8_t pad;
1199         uint16_t harqBitLen;
1200         uint8_t harqPayload[FAPI_MAX_HARQ_PAYLOAD_SIZE + 2];    // 5G FAPI Table 3-70
1201     } fapi_harq_f2f3f4_info_t;
1202
1203 // Updated per 5G FAPI
1204     typedef struct {
1205         uint32_t handle;
1206         uint8_t pduBitmap;
1207         uint8_t pucchFormat;
1208         uint8_t ul_cqi;
1209         uint8_t pad;
1210         uint16_t rnti;
1211         uint16_t timingAdvance;
1212         uint16_t rssi;          // 5G FAPI Table 3-66
1213         uint16_t num_uci_bits;
1214         uint8_t uciBits[FAPI_MAX_UCI_BIT_BYTE_LEN];
1215     } fapi_uci_o_pucch_f2f3f4_t;
1216
1217 // Updated per 5G FAPI
1218     typedef struct {
1219         uint32_t handle;
1220         uint8_t pduBitmap;
1221         uint8_t pucchFormat;
1222         uint8_t ul_cqi;
1223         uint8_t pad;
1224         uint16_t rnti;
1225         uint16_t timingAdvance;
1226         uint16_t rssi;          // 5G FAPI Table 3-65
1227         uint8_t pad1[2];
1228         fapi_sr_f0f1_info_t srInfo; // This is included if indicated by the pduBitmap
1229         fapi_harq_f0f1_info_t harqInfo; // This is included if indicated by the pduBitmap
1230     } fapi_uci_o_pucch_f0f1_t;
1231
1232 // Updated per 5G FAPI
1233     typedef struct {
1234         uint16_t pduType;
1235         uint16_t pduSize;
1236         union {
1237             fapi_uci_o_pusch_t uciPusch;
1238             fapi_uci_o_pucch_f0f1_t uciPucchF0F1;
1239             fapi_uci_o_pucch_f2f3f4_t uciPucchF2F3F4;   // 5G FAPI Table 3-63 subset
1240         } uci;
1241     } fapi_uci_pdu_info_t;
1242
1243 // Updated per 5G FAPI
1244     typedef struct {
1245         fapi_msg_t header;
1246         uint16_t sfn;
1247         uint16_t slot;
1248         uint16_t numUcis;       // 5G FAPI Table 3-63
1249         uint8_t pad[2];
1250         fapi_uci_pdu_info_t uciPdu[FAPI_MAX_NUMBER_UCI_PDUS_PER_SLOT];
1251     } fapi_uci_indication_t;
1252
1253 // Updated per 5G FAPI
1254     typedef struct {
1255         uint16_t numRbs;
1256         uint8_t pad[2];
1257         uint8_t rbSNR[FAPI_MAX_NUMBER_RBS]; // 5G FAPI Table 3-73 Subset
1258     } fapi_symb_snr_t;
1259
1260 // Updated per 5G FAPI
1261     typedef struct {
1262         uint32_t handle;
1263         uint16_t rnti;
1264         uint16_t timingAdvance;
1265         uint8_t numSymbols;
1266         uint8_t wideBandSnr;
1267         uint8_t numReportedSymbols;
1268         uint8_t pad;
1269         fapi_symb_snr_t symbSnr[FAPI_MAX_NUMBER_OF_REP_SYMBOLS];    // 5G FAPI Table 3-73 subset
1270     } fapi_srs_pdu_t;
1271
1272 // Updated per 5G FAPI
1273     typedef struct {
1274         fapi_msg_t header;
1275         uint16_t sfn;
1276         uint16_t slot;
1277         uint8_t numPdus;
1278         uint8_t pad[3];
1279         fapi_srs_pdu_t srsPdus[FAPI_MAX_NUMBER_SRS_PDUS_PER_SLOT];  // 5G FAPI Table 3-73
1280     } fapi_srs_indication_t;
1281
1282 // Updated per 5G FAPI
1283     typedef struct {
1284         uint8_t preambleIndex;
1285         uint8_t pad;
1286         uint16_t timingAdvance;
1287         uint32_t preamblePwr;   // 5G FAPI Table 3-74 Subset
1288     } fapi_preamble_info_t;
1289
1290 // Updated per 5G FAPI
1291     typedef struct {
1292         uint16_t phyCellId;
1293         uint8_t symbolIndex;
1294         uint8_t slotIndex;
1295         uint8_t freqIndex;
1296         uint8_t avgRssi;
1297         uint8_t avgSnr;
1298         uint8_t numPreamble;
1299         fapi_preamble_info_t preambleInfo[FAPI_MAX_NUM_PREAMBLES_PER_SLOT]; // 5G FAPI Table 3-74 Subset
1300     } fapi_rach_pdu_t;
1301
1302 // Updated per 5G FAPI
1303     typedef struct {
1304         fapi_msg_t header;
1305         uint16_t sfn;
1306         uint16_t slot;
1307         uint8_t numPdus;
1308         uint8_t pad[3];
1309         fapi_rach_pdu_t rachPdu[FAPI_MAX_NUMBER_RACH_PDUS_PER_SLOT];    // 5G FAPI Table 3-74
1310     } fapi_rach_indication_t;
1311
1312 //------------------------------------------------------------------------------
1313
1314 #if defined(__cplusplus)
1315 }
1316 #endif
1317 #endif