1 /******************************************************************************
3 * Copyright (c) 2019 Intel.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 *******************************************************************************/
20 * @brief Definitions and support functions to process XRAN packet
22 * @ingroup group_source_xran
23 * @author Intel Corporation
27 *****************************************************************************
30 * @defgroup xran_up_pkt U-Plane XRAN Packet definitions and functions
34 * Structures relevant to U-plane packets only (data now only)
35 *****************************************************************************/
36 #ifndef _XRAN_PKT_UP_H_
37 #define _XRAN_PKT_UP_H_
45 #define IQ_PAIR_NUM_IN_RB 12
46 #define MAX_DATA_SECTIONS_NUM 273
47 #define MAX_IQ_BIT_WIDTH 16
49 /* currently library supports I and Q sizes of 8 and 16 bits each */
50 #define IQ_BITS MAX_IQ_BIT_WIDTH
53 * Structure holding data section header fields
54 * It is repeated for every section ID in xRAN packet
58 ******************************************************************************
59 * @ingroup xran_up_pkt
62 * Structure holding data section header fields
63 * It is repeated for every section ID in xRAN packet
64 * 5.4.5 Coding of Information Elements - Application Layer, Sections
65 * for U-plane as per 6.3.2 DL/UL Data
66 *****************************************************************************/
67 struct data_section_hdr {
71 uint32_t num_prbu:8; /**< 5.4.5.6 number of contiguous PRBs per control section */
72 uint32_t start_prbu:10; /**< 5.4.5.4 starting PRB of control section */
73 uint32_t sym_inc:1; /**< 5.4.5.3 symbol number increment command XRAN_SYMBOLNUMBER_xxxx */
74 uint32_t rb:1; /**< 5.4.5.2 resource block indicator, XRAN_RBIND_xxx */
75 uint32_t sect_id:12; /**< 5.4.5.1 section identifier */
82 ******************************************************************************
83 * @ingroup xran_up_pkt
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 *****************************************************************************/
90 struct data_section_compression_hdr
92 struct compression_hdr ud_comp_hdr;
93 uint8_t rsrvd; /**< This parameter provides 1 byte for future definition,
94 should be set to all zeros by the sender and ignored by the receiver.
95 This field is only present when udCompHdr is present, and is absent when
96 the static IQ format and compression method is configured via the M-Plane */
98 /* TODO: support for Block Floating Point compression */
99 /* udCompMeth 0000b = no compression absent*/
103 ******************************************************************************
104 * @ingroup xran_up_pkt
107 * Structure holds the compression parameters by the compression header.
108 * may not be present by udCompMeth in 6.3.3.13
109 *****************************************************************************/
110 union compression_params {
111 struct block_fl_point {
115 struct block_scaling {
116 uint8_t sblockScaler;
120 uint8_t compBitWidth:4;
126 ******************************************************************************
127 * @ingroup xran_up_pkt
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 *****************************************************************************/
137 int16_t i_sample:IQ_BITS; /**< This parameter is the In-phase sample value */
138 int16_t q_sample:IQ_BITS; /**< This parameter is the Quadrature sample value */
142 ******************************************************************************
143 * @ingroup xran_common_pkt
146 * Structure holds complete xran u-plane packet header
147 * 3.1.1 Ethernet Encapsulation
148 *****************************************************************************/
149 struct xran_up_pkt_hdr
151 struct xran_ecpri_hdr ecpri_hdr; /**< eCPRI Transport Header */
152 struct radio_app_common_hdr app_hdr; /**< eCPRI Transport Header */
153 struct data_section_hdr data_sec_hdr;
158 ******************************************************************************
159 * @ingroup xran_common_pkt
162 * Structure holds complete ethernet and xran u-plane packet header
163 * 3.1.1 Ethernet Encapsulation
164 *****************************************************************************/
165 struct eth_xran_up_pkt_hdr
167 struct ether_hdr eth_hdr;
168 struct xran_up_pkt_hdr xran_hdr;