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 *******************************************************************************/
21 * @brief Definitions and support functions to process XRAN packet
23 * @ingroup group_source_xran
24 * @author Intel Corporation
28 *****************************************************************************
31 * @defgroup xran_up_pkt U-Plane XRAN Packet definitions and functions
35 * Structures relevant to U-plane packets only (data now only)
36 *****************************************************************************/
37 #ifndef _XRAN_PKT_UP_H_
38 #define _XRAN_PKT_UP_H_
42 #define IQ_PAIR_NUM_IN_RB 12
43 #define MAX_DATA_SECTIONS_NUM 273
44 #define MAX_IQ_BIT_WIDTH 16
46 /* currently library supports I and Q sizes of 8 and 16 bits each */
47 #define IQ_BITS MAX_IQ_BIT_WIDTH
50 * Structure holding data section header fields
51 * It is repeated for every section ID in xRAN packet
55 ******************************************************************************
56 * @ingroup xran_up_pkt
59 * Structure holding data section header fields
60 * It is repeated for every section ID in xRAN packet
61 * 5.4.5 Coding of Information Elements - Application Layer, Sections
62 * for U-plane as per 6.3.2 DL/UL Data
63 *****************************************************************************/
64 struct data_section_hdr {
68 uint32_t num_prbu:8; /**< 5.4.5.6 number of contiguous PRBs per control section */
69 uint32_t start_prbu:10; /**< 5.4.5.4 starting PRB of control section */
70 uint32_t sym_inc:1; /**< 5.4.5.3 symbol number increment command XRAN_SYMBOLNUMBER_xxxx */
71 uint32_t rb:1; /**< 5.4.5.2 resource block indicator, XRAN_RBIND_xxx */
72 uint32_t sect_id:12; /**< 5.4.5.1 section identifier */
75 } __attribute__((__packed__));
79 ******************************************************************************
80 * @ingroup xran_up_pkt
83 * Structure holds compression header structure and field reserved for future use.
84 * reserved goes always with udCompHdr in u-plane pkt
85 * U-plane as per 6.3.2 DL/UL Data
86 *****************************************************************************/
87 struct data_section_compression_hdr
89 struct compression_hdr ud_comp_hdr;
90 uint8_t rsrvd; /**< This parameter provides 1 byte for future definition,
91 should be set to all zeros by the sender and ignored by the receiver.
92 This field is only present when udCompHdr is present, and is absent when
93 the static IQ format and compression method is configured via the M-Plane */
95 /* TODO: support for Block Floating Point compression */
96 /* udCompMeth 0000b = no compression absent*/
100 ******************************************************************************
101 * @ingroup xran_up_pkt
104 * Structure holds the compression parameters by the compression header.
105 * may not be present by udCompMeth in 6.3.3.13
106 *****************************************************************************/
107 union compression_params {
108 struct block_fl_point {
112 struct block_scaling {
113 uint8_t sblockScaler;
117 uint8_t compBitWidth:4;
119 } __attribute__((__packed__));
123 ******************************************************************************
124 * @ingroup xran_up_pkt
127 * Structure holds an IQ sample pair
128 * U-plane as per 6.3.2 DL/UL Data
129 * Each bit field size is defined with IQ_BITS macro
130 * Currently supported I and Q sizes are 8 and 16 bits
131 *****************************************************************************/
134 int16_t i_sample:IQ_BITS; /**< This parameter is the In-phase sample value */
135 int16_t q_sample:IQ_BITS; /**< This parameter is the Quadrature sample value */