* INTC Contribution to the O-RAN F Release for O-DU Low
[o-du/phy.git] / fhi_lib / lib / api / xran_pkt_cp.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2020 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 /**
20  * @brief This file provides the definition of Control Plane Messages
21  *      for XRAN Front Haul layer as defined in XRAN-FH.CUS.0-v02.01.
22  *
23  * @file xran_pkt_cp.h
24  * @ingroup group_lte_source_xran
25  * @author Intel Corporation
26  *
27  **/
28
29 #ifndef _XRAN_PKT_CP_H_
30 #define _XRAN_PKT_CP_H_
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36
37 /**********************************************************************
38  * Common structures for C/U-plane
39  **********************************************************************/
40 /**
41  * @ingroup xran_cp_pkt
42  *
43  * @description
44  *      user data compression header defined in 5.4.4.10 / 6.3.3.13
45  */
46 struct xran_radioapp_udComp_header {
47     uint8_t     udCompMeth:4;           /**< Compression method, XRAN_COMPMETHOD_xxxx */
48     uint8_t     udIqWidth:4;            /**< IQ bit width, 1 ~ 16 */
49     } __attribute__((__packed__));
50
51
52 /**********************************************************************
53  * Definition of C-Plane Protocol 5.4
54  **********************************************************************/
55 /**
56  * @ingroup xran_cp_pkt
57  *
58  * @description
59  *      Common Radio Application Header for C-Plane
60  */
61 struct xran_cp_radioapp_common_header {     /* 6bytes, first 4bytes need the conversion for byte order */
62     union {
63         uint32_t all_bits;
64         struct {
65     uint32_t    startSymbolId:6;        /**< 5.4.4.7 start symbol identifier */
66     uint32_t    slotId:6;               /**< 5.4.4.6 slot identifier */
67     uint32_t    subframeId:4;           /**< 5.4.4.5 subframe identifier */
68     uint32_t    frameId:8;              /**< 5.4.4.4 frame identifier */
69     uint32_t    filterIndex:4;          /**< 5.4.4.3 filter index, XRAN_FILTERINDEX_xxxx */
70     uint32_t    payloadVer:3;           /**< 5.4.4.2 payload version, should be 1 */
71     uint32_t    dataDirection:1;        /**< 5.4.4.1 data direction (gNB Tx/Rx) */
72         };
73     } field;
74     uint8_t     numOfSections;          /**< 5.4.4.8 number of sections */
75     uint8_t     sectionType;            /**< 5.4.4.9 section type */
76     } __attribute__((__packed__));
77
78 #define xran_cp_radioapp_cmn_hdr_bitwidth_StartSymId      0
79 #define xran_cp_radioapp_cmn_hdr_bitwidth_SlotId          6
80 #define xran_cp_radioapp_cmn_hdr_bitwidth_SubFrameId      12
81 #define xran_cp_radioapp_cmn_hdr_bitwidth_FrameId         16
82 #define xran_cp_radioapp_cmn_hdr_bitwidth_FilterIdex      24
83 #define xran_cp_radioapp_cmn_hdr_bitwidth_PayLoadVer      28
84 #define xran_cp_radioapp_cmn_hdr_bitwidth_DataDir         31
85
86
87
88 /**
89  * @ingroup xran_cp_pkt
90  *
91  * @description
92  *      frame structure defined in 5.4.4.13
93  */
94 struct xran_cp_radioapp_frameStructure {
95     uint8_t     uScs:4;                 /**< sub-carrier spacing, XRAN_SCS_xxx */
96     uint8_t     fftSize:4;              /**< FFT size,  XRAN_FFTSIZE_xxx */
97     } __attribute__((__packed__));
98
99 /**
100  * @ingroup xran_cp_pkt
101  *
102  * @description
103  *      Section headers definition for C-Plane.
104  *      Section type 6 and 7 are not present since those have different fields.
105  */
106 struct xran_cp_radioapp_section_header {    /* 8bytes, need the conversion for byte order */
107     union {
108         uint32_t first_4byte;
109         struct {
110             uint32_t    reserved:16;
111             uint32_t    numSymbol:4;    /**< 5.4.5.7 number of symbols */
112             uint32_t    reMask:12;      /**< 5.4.5.5 resource element mask */
113             } s0;
114         struct {
115             uint32_t     beamId:15;     /**< 5.4.5.9 beam identifier */
116             uint32_t     ef:1;          /**< 5.4.5.8 extension flag */
117             uint32_t     numSymbol:4;   /**< 5.4.5.7 number of symbols */
118             uint32_t     reMask:12;     /**< 5.4.5.5 resource element mask */
119             } s1;
120         struct {
121             uint32_t    beamId:15;      /**< 5.4.5.9 beam identifier */
122             uint32_t    ef:1;           /**< 5.4.5.8 extension flag */
123             uint32_t    numSymbol:4;    /**< 5.4.5.7 number of symbols */
124             uint32_t    reMask:12;      /**< 5.4.5.5 resource element mask */
125             } s3;
126         struct {
127             uint32_t    ueId:15;        /**< 5.4.5.10 UE identifier */
128             uint32_t    ef:1;           /**< 5.4.5.8 extension flag */
129             uint32_t    numSymbol:4;    /**< 5.4.5.7 number of symbols */
130             uint32_t    reMask:12;      /**< 5.4.5.5 resource element mask */
131             } s5;
132         } u;
133     union {
134         uint32_t second_4byte;
135         struct {
136     uint32_t    numPrbc:8;              /**< 5.4.5.6 number of contiguous PRBs per control section  0000 0000b = all PRBs */
137     uint32_t    startPrbc:10;           /**< 5.4.5.4 starting PRB of control section */
138     uint32_t    symInc:1;               /**< 5.4.5.3 symbol number increment command XRAN_SYMBOLNUMBER_xxxx */
139     uint32_t    rb:1;                   /**< 5.4.5.2 resource block indicator, XRAN_RBIND_xxx */
140     uint32_t    sectionId:12;           /**< 5.4.5.1 section identifier */
141             } common;
142         } u1;
143     } __attribute__((__packed__));
144
145 #define xran_cp_radioapp_sec_hdr_sc_BeamID       0
146 #define xran_cp_radioapp_sec_hdr_sc_Ef           15
147 #define xran_cp_radioapp_sec_hdr_sc_NumSym       16
148 #define xran_cp_radioapp_sec_hdr_sc_ReMask       20
149
150 #define xran_cp_radioapp_sec_hdr_c_NumPrbc       0
151 #define xran_cp_radioapp_sec_hdr_c_StartPrbc     8
152 #define xran_cp_radioapp_sec_hdr_c_SymInc        18
153 #define xran_cp_radioapp_sec_hdr_c_RB            19
154 #define xran_cp_radioapp_sec_hdr_c_SecId         20
155
156 struct xran_cp_radioapp_section_ext_hdr {
157     /* 12 bytes, need to convert byte order for two parts respectively
158      *  - 2 and 8 bytes, reserved1 would be OK if it is zero
159      */
160     uint16_t     extLen:8;          /**< 5.4.6.3 extension length, in 32bits words */
161     uint16_t     extType:7;         /**< 5.4.6.1 extension type */
162     uint16_t     ef:1;              /**< 5.4.6.2 extension flag */
163     } __attribute__((__packed__));
164
165 /**
166  * @ingroup xran_cp_pkt
167  *
168  * @description
169  *      Beamforming Weights Extension Type(ExtType 1) defined in 5.4.7.1
170  *      The structure is reordered for byte order conversion.
171  */
172 struct xran_cp_radioapp_section_ext1 {
173     /* variable length, need to be careful to convert byte order
174      *   - does not need to convert first 3 bytes */
175     uint8_t     extType:7;          /**< 5.4.6.1 extension type */
176     uint8_t     ef:1;               /**< 5.4.6.2 extension flag */
177     uint8_t     extLen;             /**< 5.4.6.3 extension length, in 32bits words */
178     /* bfwCompHdr */
179     uint8_t     bfwCompMeth:4;      /**< 5.4.7.1.1 Beamforming weight Compression method */
180     uint8_t     bfwIqWidth:4;       /**< 5.4.7.1.1 Beamforming weight IQ bit width */
181
182     /*
183      *
184      *
185      * bfwCompParam
186      * (bfwI,  bfwQ)+
187      *    ......
188      * zero padding for 4-byte alignment
189      */
190     } __attribute__((__packed__));
191
192 /**
193  * @ingroup xran_cp_pkt
194  *
195  * @description
196  *      Beamforming Attributes Extension Type(ExtType 2) defined in 5.4.7.2
197  *      The structure is reordered for byte order conversion.
198  */
199 struct xran_cp_radioapp_section_ext2 {
200     /* variable length, need to be careful to convert byte order
201      *   - first 4 bytes can be converted at once
202      */
203     uint32_t    bfZe3ddWidth:3;     /**< 5.4.7.2.1 beamforming zenith beamwidth parameter bitwidth, Table 5-21 */
204     uint32_t    bfAz3ddWidth:3;     /**< 5.4.7.2.1 beamforming azimuth beamwidth parameter bitwidth, Table 5-20 */
205     uint32_t    bfaCompResv1:2;
206     uint32_t    bfZePtWidth:3;      /**< 5.4.7.2.1 beamforming zenith pointing parameter bitwidth, Table 5-19 */
207     uint32_t    bfAzPtWidth:3;      /**< 5.4.7.2.1 beamforming azimuth pointing parameter bitwidth, Table 5-18 */
208     uint32_t    bfaCompResv0:2;
209     uint32_t    extLen:8;           /**< 5.4.6.3 extension length, in 32bits words */
210     uint32_t    extType:7;          /**< 5.4.6.1 extension type */
211     uint32_t    ef:1;               /**< 5.4.6.2 extension flag */
212
213     /*
214      * would be better to use bit manipulation directly to add these parameters
215      *
216      * bfAzPt: var by bfAzPtWidth
217      * bfZePt: var by bfZePtWidth
218      * bfAz3dd: var by bfAz3ddWidth
219      * bfZe3dd: var by bfZe3ddWidth
220      * bfAzSI:5 (including zero-padding for unused bits)
221      * bfZeSI:3
222      * padding for 4-byte alignment
223      *
224      */
225     } __attribute__((__packed__));
226
227 /**
228  * @ingroup xran_cp_pkt
229  *
230  * @description
231  *      DL Precoding Extension Type(ExtType 3) for first data layer.
232  *      Defined in 5.4.7.3 Table 5-22.
233  *      Only be used for LTE TM2-4 and not for other LTE TMs nor NR.
234  *      The structure is reordered for byte order conversion.
235  */
236 union xran_cp_radioapp_section_ext3_first {
237     /* 16 bytes, need to convert byte order for two parts - 8/8 bytes */
238     struct{
239     uint64_t    reserved1:8;
240     uint64_t    crsSymNum:4;        /**< 5.4.7.3.6 CRS symbol number indication */
241     uint64_t    reserved0:3;
242     uint64_t    crsShift:1;         /**< 5.4.7.3.7 CRS shift used for DL transmission */
243     uint64_t    crsReMask:12;       /**< 5.4.7.3.5 CRS resource element mask */
244     uint64_t    txScheme:4;         /**< 5.4.7.3.3 transmission scheme */
245     uint64_t    numLayers:4;        /**< 5.4.7.3.4 number of layers used for DL transmission */
246     uint64_t    layerId:4;          /**< 5.4.7.3.2 Layer ID for DL transmission */
247     uint64_t    codebookIndex:8;    /**< 5.4.7.3.1 precoder codebook used for transmission */
248     uint64_t    extLen:8;           /**< 5.4.6.3 extension length, in 32bits words */
249     uint64_t    extType:7;          /**< 5.4.6.1 extension type */
250     uint64_t    ef:1;               /**< 5.4.6.2 extension flag */
251
252     uint64_t    beamIdAP1:16;       /**< 5.4.7.3.8 beam id to be used for antenna port 1 */
253     uint64_t    beamIdAP2:16;       /**< 5.4.7.3.9 beam id to be used for antenna port 2 */
254     uint64_t    beamIdAP3:16;       /**< 5.4.7.3.10 beam id to be used for antenna port 3 */
255     uint64_t    reserved2:16;
256     }all_bits;
257
258     struct{
259         __m128i     data_field1;
260     }data_field;
261     } __attribute__((__packed__));
262
263 #define xran_cp_radioapp_sec_ext3_Res1           0
264 #define xran_cp_radioapp_sec_ext3_CrcSymNum      8
265 #define xran_cp_radioapp_sec_ext3_Res0           12
266 #define xran_cp_radioapp_sec_ext3_CrcShift       15
267 #define xran_cp_radioapp_sec_ext3_CrcReMask      16
268 #define xran_cp_radioapp_sec_ext3_TxScheme       28
269
270 #define xran_cp_radioapp_sec_ext3_NumLayers      0
271 #define xran_cp_radioapp_sec_ext3_LayerId        4
272 #define xran_cp_radioapp_sec_ext3_CodebookIdx    8
273 #define xran_cp_radioapp_sec_ext3_ExtLen         16
274 #define xran_cp_radioapp_sec_ext3_ExtType        24
275 #define xran_cp_radioapp_sec_ext3_EF             31
276
277
278 /**
279  * @ingroup xran_cp_pkt
280  *
281  * @description
282  *      DL Precoding Extension Type(ExtType 3) for non-first data layer.
283  *      Defined in 5.4.7.3 Table 5-23.
284  *      Only be used for LTE TM2-4 and not for other LTE TMs nor NR.
285  *      The structure is reordered for byte order conversion.
286  */
287 union xran_cp_radioapp_section_ext3_non_first {
288     uint32_t data_field;
289     struct {
290     /* 4 bytes, need to convert byte order at once */
291     uint32_t    numLayers:4;        /**< 5.4.7.3.4 number of layers used for DL transmission */
292     uint32_t    layerId:4;          /**< 5.4.7.3.2 Layer ID for DL transmission */
293     uint32_t    codebookIndex:8;    /**< 5.4.7.3.1 precoder codebook used for transmission */
294
295     uint32_t    extLen:8;           /**< 5.4.6.3 extension length, in 32bits words */
296     uint32_t    extType:7;          /**< 5.4.6.1 extension type */
297     uint32_t    ef:1;               /**< 5.4.6.2 extension flag */
298     }all_bits;
299     } __attribute__((__packed__));
300
301 /**
302  * @ingroup xran_cp_pkt
303  *
304  * @description
305  *      Modulation Compression Parameter Extension Type(ExtType 4), 5.4.7.4
306  *      Only applies to section type 1 and 3.
307  *      The structure is reordered for byte order conversion.
308  */
309 struct xran_cp_radioapp_section_ext4 {
310     /* 4 bytes, need to convert byte order at once */
311     uint32_t    modCompScaler:15;   /**< 5.4.7.4.2 modulation compression scaler value */
312     uint32_t    csf:1;              /**< 5.4.7.4.1 constellation shift flag */
313
314     uint32_t    extLen:8;           /**< 5.4.6.3 extension length, in 32bits words */
315     uint32_t    extType:7;          /**< 5.4.6.1 extension type */
316     uint32_t    ef:1;               /**< 5.4.6.2 extension flag */
317     } __attribute__((__packed__));
318
319 /**
320  * @ingroup xran_cp_pkt
321  *
322  * @description
323  *      Modulation Compression Additional Parameter Extension Type(ExtType 5) for one scaler value.
324  *      Defined in 5.4.7.5 Table 5-26 and Table 5-27.
325  *      Only applies to section type 1 3, and 5.
326  *      The structure is reordered for byte order conversion.
327  */
328 struct xran_cp_radioapp_section_ext5 {
329     uint32_t    reserved0:8;
330     uint32_t    mcScaleOffset2:15;  /**< 5.4.7.5.3 scaling value for modulation compression */
331     uint32_t    csf2:1;             /**< 5.4.7.5.2 constellation shift flag */
332     uint32_t    mcScaleReMask2:12;  /**< 5.4.7.5.1 modulation compression power scale RE mask */
333     uint32_t    mcScaleOffset1:15;  /**< 5.4.7.5.3 scaling value for modulation compression */
334     uint32_t    csf1:1;             /**< 5.4.7.5.2 constellation shift flag */
335     uint32_t    mcScaleReMask1:12;  /**< 5.4.7.5.1 modulation compression power scale RE mask */
336     } __attribute__((__packed__));
337
338 /**
339  * @ingroup xran_cp_pkt
340  *
341  * @description
342  *      Non-contiguous PRB allocation in time and frequency domain.
343  *      ExtType 6, Defined in 5.4.7.6 Table 5-28
344  *      Only applies to section type 1 3, and 5.
345  *      The structure is reordered for byte order conversion.
346  */
347 union xran_cp_radioapp_section_ext6 {
348     struct {
349         uint64_t    symbolMask:14;      /**< 5.4.7.6.3 symbol bit mask */
350         uint64_t    reserved1:2;
351         uint64_t    rbgMask:28;         /**< 5.4.7.6.2 resource block group bit mask */
352         uint64_t    rbgSize:3;          /**< 5.4.7.6.1 resource block group size */
353         uint64_t    reserved0:1;
354         uint64_t    extLen:8;           /**< 5.4.6.3 extension length, in 32bits words */
355         uint64_t    extType:7;          /**< 5.4.6.1 extension type */
356         uint64_t    ef:1;               /**< 5.4.6.2 extension flag */
357     }all_bits;
358
359     struct{
360         uint64_t     data_field1;
361     }data_field;
362 } __attribute__((__packed__));
363
364 /**
365  * @ingroup xran_cp_pkt
366  *
367  * @description
368  *      eAxC Mask Selection Extension (ExtType 7)
369  *      Defined in 5.4.7.7 Table 5-29
370  *      applies to section type 0
371  *      The structure is reordered for byte order conversion.
372  */
373 struct xran_cp_radioapp_section_ext7 {
374     uint32_t    eAxCmask:16;        /**< 5.4.7.7.1 eAxC Mask */
375     uint32_t    extLen:8;           /**< 5.4.6.3 extension length, in 32bits words */
376     uint32_t    extType:7;          /**< 5.4.6.1 extension type */
377     uint32_t    ef:1;               /**< 5.4.6.2 extension flag */
378     } __attribute__((__packed__));
379
380 /**
381  * @ingroup xran_cp_pkt
382  *
383  * @description
384  *      Regularization factor (ExtType 8), defined in 5.4.7.8 Table 5-30
385  *      applies to section type 5 instead of sending section type 6
386  *      The structure is reordered for byte order conversion.
387  */
388 struct xran_cp_radioapp_section_ext8 {
389     uint32_t    regularizationFactor:16; /**< 5.4.7.8.1 eAxC Mask */
390     uint32_t    extLen:8;           /**< 5.4.6.3 extension length, in 32bits words */
391     uint32_t    extType:7;          /**< 5.4.6.1 extension type */
392     uint32_t    ef:1;               /**< 5.4.6.2 extension flag */
393     } __attribute__((__packed__));
394
395 /**
396  * @ingroup xran_cp_pkt
397  *
398  * @description
399  *      Dynamic Spectrum Sharing parameters (ExtType 9)
400  *      Defined in 5.4.7.9 Table 5-31
401  *      The structure does not need the conversion of byte order.
402  */
403 struct xran_cp_radioapp_section_ext9 {
404     uint8_t     reserved;
405     uint8_t     technology;         /**< 5.4.7.9.1 technology (interface name) */
406     uint8_t     extLen;             /**< 5.4.6.3 extension length, in 32bits words */
407     uint8_t     extType:7;          /**< 5.4.6.1 extension type */
408     uint8_t     ef:1;               /**< 5.4.6.2 extension flag */
409     } __attribute__((__packed__));
410
411 /**
412  * @ingroup xran_cp_pkt
413  *
414  * @description
415  *      Section description for group configuration of multiple ports
416  *      ExtType 10, Defined in 5.4.7.10 Table 5-32 and Table 5-33
417  *      Applies to section type 1 3, and 5.
418  *      The structure does not need the conversion of byte order.
419  */
420 union xran_cp_radioapp_section_ext10 {
421     uint32_t data_field;
422     struct{
423         uint8_t     extType:7;          /**< 5.4.6.1 extension type */
424         uint8_t     ef:1;               /**< 5.4.6.2 extension flag */
425         uint8_t     extLen;             /**< 5.4.6.3 extension length, in 32bits words */
426         uint8_t     numPortc:6;         /**< 5.4.7.10.2 the number of eAxC ports */
427         uint8_t     beamGroupType:2;    /**< 5.4.7.10.1 the type of beam grouping */
428         uint8_t     reserved;           /**< beam IDs start from here for group type 2 */
429         }all_bits;
430     } __attribute__((__packed__));
431
432
433 #define xran_cp_radioapp_sec_ext10_ExtType        0
434 #define xran_cp_radioapp_sec_ext10_EF             7
435 #define xran_cp_radioapp_sec_ext10_ExtLen         8
436 #define xran_cp_radioapp_sec_ext10_NumPortc       16
437 #define xran_cp_radioapp_sec_ext10_BeamGroupType  22
438 #define xran_cp_radioapp_sec_ext10_Res0           24
439
440
441 /**
442  * @ingroup xran_cp_pkt
443  *
444  * @description
445  *      Flexible Beamforming Weights Extension Type (ExtType 11)
446  *      Defined in 5.4.7.11 Table 5-35
447  *      The structure is reordered for network byte order.
448  */
449 union xran_cp_radioapp_section_ext11 {
450     struct {
451         uint32_t    reserved:6;
452         uint32_t    RAD:1;              /**< 5.4.7.11.8 Reset After PRB Discontinuity */
453         uint32_t    disableBFWs:1;      /**< 5.4.7.11.6 disable beamforming weights */
454         uint32_t    extLen:16;          /**< extension length in 32bits words - 2bytes */
455         uint32_t    extType:7;          /**< 5.4.6.1 extension type */
456         uint32_t    ef:1;               /**< 5.4.6.2 extension flag */
457         uint8_t     numBundPrb;         /**< 5.4.7.11.3 Number of bundled PRBs per beamforming weights */
458         uint8_t     bfwCompMeth:4;      /**< 5.4.7.11.1 Beamforming weight Compression method (5.4.7.1.1) */
459         uint8_t     bfwIqWidth:4;       /**< 5.4.7.11.1 Beamforming weight IQ bit width (5.4.7.1.1) */
460     } __attribute__((__packed__)) all_bits;
461     struct{
462         uint32_t    data_field1;
463         uint16_t    data_field2;
464     } __attribute__((__packed__)) data_field;
465     /*
466      *   bfwCompParam               5.4.7.11.2 beamforming weight compression parameter for PRB bundle
467      *   beamId                     beam ID for PRB bundle (15bits)
468      *   bfwI / bfwQ .......        beamforming weights for PRB bundle
469      *     .....
470      * repeat until PRB bundle L
471      *
472      *   zero pad (4-byte boundary)
473      */
474     } __attribute__((__packed__));
475
476 #define xran_cp_radioapp_sec_ext11_bitfield_REV             0
477 #define xran_cp_radioapp_sec_ext11_bitfield_RAD             6
478 #define xran_cp_radioapp_sec_ext11_bitfield_DisBFWs         7
479 #define xran_cp_radioapp_sec_ext11_bitfield_ExtLen          8
480 #define xran_cp_radioapp_sec_ext11_bitfield_ExtType         24
481 #define xran_cp_radioapp_sec_ext11_bitfield_Ef              31
482 #define xran_cp_radioapp_sec_ext11_bitfield_NumPrb          0
483 #define xran_cp_radioapp_sec_ext11_bitfield_BFWCompMeth     8
484 #define xran_cp_radioapp_sec_ext11_bitfield_BFWIQWidth      12
485
486
487 /**********************************************************
488  * Scheduling and Beam-forming Commands 5.4.2
489  **********************************************************/
490 /**
491  * @ingroup xran_cp_pkt
492  *
493  * @description
494  *      Section header definition for type 0
495  */
496 struct xran_cp_radioapp_section0_header {   // 12bytes (6+2+1+2+1)
497     struct xran_cp_radioapp_common_header cmnhdr;
498     uint16_t    timeOffset;             /**< 5.4.4.12 time offset */
499
500     struct xran_cp_radioapp_frameStructure  frameStructure;
501     uint16_t    cpLength;               /**< 5.4.4.14 cyclic prefix length */
502     uint8_t     reserved;
503     } __attribute__((__packed__));
504
505 /**
506  * @ingroup xran_cp_pkt
507  *
508  * @description
509  *      Section definition for type 0: Unused RB or Symbols in DL or UL (Table 5-2)
510  *      Not supported in this release
511  */
512 struct xran_cp_radioapp_section0 {          // 8bytes (4+4)
513     struct xran_cp_radioapp_section_header hdr;
514     } __attribute__((__packed__));
515
516 /**
517  * @ingroup xran_cp_pkt
518  *
519  * @description
520  *      Section header definition for type 1
521  */
522 struct xran_cp_radioapp_section1_header {   // 8bytes (6+1+1)
523     struct xran_cp_radioapp_common_header cmnhdr;
524     struct xran_radioapp_udComp_header udComp;
525     uint8_t     reserved;
526     } __attribute__((__packed__));
527
528 /**
529  * @ingroup xran_cp_pkt
530  *
531  * @description
532  *      Section definition for type 1: Most DL/UL Radio Channels (Table 5-3)
533  */
534 struct xran_cp_radioapp_section1 {          // 8bytes (4+4)
535     struct xran_cp_radioapp_section_header hdr;
536
537     // section extensions               // 5.4.6 & 5.4.7
538     //  .........
539     } __attribute__((__packed__));
540
541 /**
542  * @ingroup xran_cp_pkt
543  *
544  * @description
545  *      Section header definition for type 3
546  */
547 struct xran_cp_radioapp_section3_header {   // 12bytes (6+2+1+2+1)
548     struct xran_cp_radioapp_common_header cmnhdr;
549     uint16_t    timeOffset;             /**< 5.4.4.12 time offset */
550
551     struct xran_cp_radioapp_frameStructure  frameStructure;
552     uint16_t    cpLength;               /**< 5.4.4.14 cyclic prefix length */
553     struct xran_radioapp_udComp_header udComp;
554     } __attribute__((__packed__));
555
556 /**
557  * @ingroup xran_cp_pkt
558  *
559  * @description
560  *      Section definition for type 3: PRACH and Mixed-numerology Channels (Table 5-4)
561  */
562 struct xran_cp_radioapp_section3 {          // 12bytes (4+4+4)
563     struct xran_cp_radioapp_section_header hdr;
564     uint32_t    freqOffset:24;          /**< 5.4.5.11 frequency offset */
565     uint32_t    reserved:8;
566
567     // section extensions               // 5.4.6 & 5.4.7
568     //  .........
569     } __attribute__((__packed__));
570
571 /**
572  * @ingroup xran_cp_pkt
573  *
574  * @description
575  *      Section header definition for type 5
576  */
577 struct xran_cp_radioapp_section5_header {   // 8bytes (6+1+1)
578     struct xran_cp_radioapp_common_header cmnhdr;
579     struct xran_radioapp_udComp_header udComp;
580     uint8_t     reserved;
581     } __attribute__((__packed__));
582
583 /**
584  * @ingroup xran_cp_pkt
585  *
586  * @description
587  *      Section definition for type 5: UE scheduling information (Table 5-5)
588  *      Not supported in this release
589  */
590 struct xran_cp_radioapp_section5 {
591     struct xran_cp_radioapp_section_header hdr;
592
593     // section extensions               // 5.4.6 & 5.4.7
594     //  .........
595     } __attribute__((__packed__));
596
597 /**
598  * @ingroup xran_cp_pkt
599  *
600  * @description
601  *      Section header definition for type 6
602  */
603 struct xran_cp_radioapp_section6_header {   // 8bytes (6+1+1)
604     struct xran_cp_radioapp_common_header cmnhdr;
605     uint8_t     numberOfUEs;            /**< 5.4.4.11 number of UEs */
606     uint8_t     reserved;
607     } __attribute__((__packed__));
608
609 /**
610  * @ingroup xran_cp_pkt
611  *
612  * @description
613  *      Section definition for type 6: Channel Information (Table 5-6)
614  *      Not supported in this release
615  */
616 struct xran_cp_radioapp_section6 {
617     uint32_t    regularizationFactor:16;/**< 5.4.5.12 regularization Factor */
618     uint32_t    ueId:15;                /**< 5.4.5.10 UE identifier */
619     uint32_t    ef:1;                   /**< 5.4.5.8 extension flag */
620     uint8_t     startPrbch:2;           /**< 5.4.5.4 starting PRB of control section */
621     uint8_t     symInc:1;               /**< 5.4.5.3 symbol number increment command XRAN_SYMBOLNUMBER_xxxx */
622     uint8_t     rb:1;                   /**< 5.4.5.2 resource block indicator, XRAN_RBIND_xxx */
623     uint8_t     reserved:4;
624     uint8_t     startPrbcl:8;           /**< 5.4.5.4 starting PRB of control section */
625     uint8_t     numPrbc:8;              /**< 5.4.5.6 number of contiguous PRBs per control section */
626
627     // ciIQsamples start from here      // 5.4.5.13 channel information I and Q values
628     //  .........
629     //
630     // section extensions               // 5.4.6 & 5.4.7
631     //  .........
632     } __attribute__((__packed__));
633
634 /**
635  * @ingroup xran_cp_pkt
636  *
637  * @description
638  *      Section header definition for type 7: LAA
639  *      Not supported in this release
640  */
641 struct xran_cp_radioapp_section7_header {
642     struct xran_cp_radioapp_common_header cmnhdr;
643     uint16_t    reserved;
644     uint8_t     laaMsgLen:4;            /**< 5.4.5.15 LAA message length */
645     uint8_t     laaMsgType:4;           /**< 5.4.5.14 LAA message type */
646
647     // Payload start from here          // 5.4.5.16 ~ 5.4.5.32
648     } __attribute__((__packed__));
649
650 #ifdef __cplusplus
651 }
652 #endif
653
654 #endif  /* _XRAN_PKT_CP_H_ */