o-du/phy
Intel O-RAN/X-RAN Generated Doxygen Documentation
xran_pkt_up.h
Go to the documentation of this file.
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 
36 #ifndef _XRAN_PKT_UP_H_
37 #define _XRAN_PKT_UP_H_
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #include "xran_pkt.h"
44 
45 #define IQ_PAIR_NUM_IN_RB 12
46 #define MAX_DATA_SECTIONS_NUM 273
47 #define MAX_IQ_BIT_WIDTH 16
48 
49 /* currently library supports I and Q sizes of 8 and 16 bits each */
50 #define IQ_BITS MAX_IQ_BIT_WIDTH
51 
52 /*
53  * Structure holding data section header fields
54  * It is repeated for every section ID in xRAN packet
55  */
56 
68  union {
69  uint32_t all_bits;
70  struct {
71  uint32_t num_prbu:8;
72  uint32_t start_prbu:10;
73  uint32_t sym_inc:1;
74  uint32_t rb:1;
75  uint32_t sect_id:12;
76  };
77  }fields;
78 } __rte_packed;
79 
80 
81 /*
82  ******************************************************************************
83  * @ingroup xran_up_pkt
84  *
85  * @description
86  * Structure holds compression header structure and field reserved for future use.
87  * reserved goes always with udCompHdr in u-plane pkt
88  * U-plane as per 6.3.2 DL/UL Data
89  *****************************************************************************/
91 {
92  struct compression_hdr ud_comp_hdr;
93  uint8_t rsrvd;
98  /* TODO: support for Block Floating Point compression */
99  /* udCompMeth 0000b = no compression absent*/
100 };
101 
102 /*
103  ******************************************************************************
104  * @ingroup xran_up_pkt
105  *
106  * @description
107  * Structure holds the compression parameters by the compression header.
108  * may not be present by udCompMeth in 6.3.3.13
109  *****************************************************************************/
111  struct block_fl_point {
112  uint8_t exponent:4;
113  uint8_t reserved:4;
114  } blockFlPoint;
115  struct block_scaling {
116  uint8_t sblockScaler;
117  } blockScaling;
118  struct u_law {
119  uint8_t compShift:4;
120  uint8_t compBitWidth:4;
121  } uLaw;
122 } __rte_packed;
123 
124 
125 /*
126  ******************************************************************************
127  * @ingroup xran_up_pkt
128  *
129  * @description
130  * Structure holds an IQ sample pair
131  * U-plane as per 6.3.2 DL/UL Data
132  * Each bit field size is defined with IQ_BITS macro
133  * Currently supported I and Q sizes are 8 and 16 bits
134  *****************************************************************************/
135 struct rb_map
136 {
137  int16_t i_sample:IQ_BITS;
138  int16_t q_sample:IQ_BITS;
139 } __rte_packed;
140 
150 {
151  struct xran_ecpri_hdr ecpri_hdr;
152  struct radio_app_common_hdr app_hdr;
153  struct data_section_hdr data_sec_hdr;
154 } __rte_packed;
155 
156 
166 {
167  struct ether_hdr eth_hdr;
168  struct xran_up_pkt_hdr xran_hdr;
169 }__rte_packed;
170 
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 #endif
uint32_t sym_inc
Definition: xran_pkt_up.h:73
int16_t q_sample
Definition: xran_pkt_up.h:138
uint32_t num_prbu
Definition: xran_pkt_up.h:71
uint32_t all_bits
Definition: xran_pkt_up.h:69
#define IQ_BITS
Definition: xran_pkt_up.h:50
uint32_t start_prbu
Definition: xran_pkt_up.h:72
Definitions and support functions to process XRAN packet.
uint32_t sect_id
Definition: xran_pkt_up.h:75
struct data_section_hdr __rte_packed
int16_t i_sample
Definition: xran_pkt_up.h:137
union data_section_hdr::@18 fields