o-du/phy
Intel O-RAN/X-RAN Generated Doxygen Documentation
xran_cp_api.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 
28 #ifndef _XRAN_CP_API_H_
29 #define _XRAN_CP_API_H_
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 
36 #include "xran_fh_o_du.h"
37 #include "xran_pkt_cp.h"
38 #include "xran_transport.h"
39 
40 #define XRAN_MAX_SECTIONDB_CTX 2
41 
42 #define XRAN_MAX_NUM_EXTENSIONS XRAN_MAX_PRBS /* Maximum number of extensions in a section [up to 1 ext section per RB]*/
43 #define XRAN_MAX_NUM_UE 16 /* Maximum number of UEs/Lyaers */
44 #define XRAN_MAX_NUM_ANT_BF 64 /* Maximum number of beamforming antenna,
45  * could be defined as XRAN_MAX_ANTENNA_NR */
46 /* Maximum total number of beamforming weights (5.4.7.1.2) */
47 #define XRAN_MAX_BFW_N (XRAN_MAX_NUM_ANT_BF*XRAN_MAX_NUM_UE)
48 #define XRAN_MAX_MODCOMP_ADDPARMS 6 /* max should be even number */
49 
50 #define XRAN_SECTIONEXT_ALIGN 4 /* alignment size in byte for section extension */
51 
52 
62  };
63 
72  };
73 
75 #define XRAN_SLOTID_MAX 16
76 
79  XRAN_FFTSIZE_128 = 7, /* 128 */
80  XRAN_FFTSIZE_256 = 8, /* 256 */
81  XRAN_FFTSIZE_512 = 9, /* 512 */
82  XRAN_FFTSIZE_1024 = 10, /* 1024 */
83  XRAN_FFTSIZE_2048 = 11, /* 2048 */
84  XRAN_FFTSIZE_4096 = 12, /* 4096 */
85  XRAN_FFTSIZE_1536 = 13, /* 1536 */
87  };
88 
90 enum xran_cp_subcarrierspacing { /*3GPP u, SCS, Nslot, Slot len */
91  XRAN_SCS_15KHZ = 0, /* 0, 15kHz, 1, 1ms */
92  XRAN_SCS_30KHZ = 1, /* 1, 30kHz, 2, 500us */
93  XRAN_SCS_60KHZ = 2, /* 2, 60kHz, 4, 250us */
94  XRAN_SCS_120KHZ = 3, /* 3, 120kHz, 8, 125us */
95  XRAN_SCS_240KHZ = 4, /* 4, 240kHz, 16, 62.5us */
96  XRAN_SCS_1P25KHZ = 12, /* NA, 1.25kHz, 1, 1ms */
97  XRAN_SCS_3P75KHZ = 13, /* NA, 3.75kHz, 1, 1ms */
98  XRAN_SCS_5KHZ = 14, /* NA, 5kHz, 1, 1ms */
99  XRAN_SCS_7P5KHZ = 15, /* NA, 7.5kHz, 1, 1ms */
101  };
102 
108  };
109 
115  };
116 
118 #define XRAN_CONVERT_NUMPRBC(x) ((x) > 255 ? 0 : (x))
119 
120 #define XRAN_CONVERT_IQWIDTH(x) ((x) > 15 ? 0 : (x))
121 
123 #define XRAN_SYMBOLNUMBER_MIN 1
124 
125 #define XRAN_SYMBOLNUMBER_MAX 14
126 
127 /* LAA message type 5.4.5.14 Table 5.11, not supported */
128 #define XRAN_LAAMSGTYPE_LBT_PDSCH_REQ 0
129 #define XRAN_LAAMSGTYPE_LBT_DRS_REQ 1
130 #define XRAN_LAAMSGTYPE_LBT_PDSCH_RSP 2
131 #define XRAN_LAAMSGTYPE_LBT_DRS_RSP 3
132 #define XRAN_LAAMSGTYPE_LBT_BUFFER_ERROR 4
133 #define XRAN_LAAMSGTYPE_LBT_CWCONFIG_REQ 5
134 #define XRAN_LAAMSGTYPE_LBT_CWCONFIG_RSP 6
135 
136 #define XRAN_LBTMODE_FULL 0
137 #define XRAN_LBTMODE_PARTIAL25 1
138 #define XRAN_LBTMODE_PARTIAL34 2
139 #define XRAN_LBTMODE_FULLSTOP 3
140 
141 #define XRAN_EF_F_LAST 0
142 #define XRAN_EF_F_ANOTHER_ONE 1
143 
144 
145 
154  XRAN_CP_SECTIONEXTCMD_MAX /* 6~127 reserved for future use */
155  };
156 
158 #define XRAN_CONVERT_BFWIQWIDTH(x) ((x) > 15 ? 0 : (x))
159 
167  XRAN_BFWCOMPMETHOD_MAX /* reserved for future methods */
168  };
169 
180  };
181 
185  uint8_t type; /* type of this section */
186  /* section type bit- */
187  /* 0 1 3 5 6 7 length */
188  uint8_t startSymId; /* X X X X X X 4bits */
189  uint8_t numSymbol; /* X X X X 4bits */
190  uint8_t symInc; /* X X X X X 1bit */
191  uint16_t id; /* X X X X X 12bits */
192  uint16_t reMask; /* X X X X 12bits */
193  uint16_t startPrbc; /* X X X X X 10bits */
194  uint16_t numPrbc; /* X X X X X 8bits */ /* will be converted to zero if >255 */
195  uint8_t rb; /* X X X X X 1bit */
196  uint8_t compMeth; /* X X X 4bits */
197  uint8_t iqWidth; /* X X X 4bits */
198  uint8_t ef; /* X X X X 1bit */
199  int32_t freqOffset; /* X 24bits */
200  uint16_t beamId; /* X X 15bits */
201  uint16_t ueId; /* X X 15bits */
202  uint16_t regFactor; /* X 16bits */
203  uint16_t pad0;
206 };
207 
208 
210  uint16_t rbNumber;
211  uint16_t bfwNumber;
212  uint8_t bfwiqWidth;
213  uint8_t bfwCompMeth;
214  int16_t *p_bfwIQ;
215  int16_t bfwIQ_sz;
216  union {
217  uint8_t exponent;
218  uint8_t blockScaler;
220  uint8_t activeBeamspaceCoeffMask[XRAN_MAX_BFW_N]; /* ceil(N/8)*8, should be multiple of 8 */
221  } bfwCompParam;
222  };
223 
225  uint8_t bfAzPtWidth; /* beamforming zenith beamwidth parameter */
226  uint8_t bfAzPt;
227  uint8_t bfZePtWidth; /* beamforming azimuth beamwidth parameter */
228  uint8_t bfZePt;
229  uint8_t bfAz3ddWidth; /* beamforming zenith pointing parameter */
230  uint8_t bfAz3dd;
231  uint8_t bfZe3ddWidth; /* beamforming azimuth pointing parameter */
232  uint8_t bfZe3dd;
233 
234  uint8_t bfAzSI;
235  uint8_t bfZeSI;
236  };
237 
238 struct xran_sectionext3_info { /* NOT SUPPORTED */
239  uint8_t codebookIdx;
240  uint8_t layerId;
241  uint8_t numLayers;
242  uint8_t txScheme;
243  uint16_t crsReMask;
244  uint8_t crsShift;
245  uint8_t crsSymNum;
246  uint16_t beamIdAP1;
247  uint16_t beamIdAP2;
248  uint16_t beamIdAP3;
249  };
250 
252  uint8_t csf;
253  uint8_t pad0;
254  uint16_t modCompScaler;
255  };
256 
258  uint8_t num_sets;
259  struct {
260  uint16_t csf;
261  uint16_t mcScaleReMask;
262  uint16_t mcScaleOffset;
264  };
265 
267  uint16_t type;
268  uint16_t len;
269  void *data;
270  };
271 
272 
276  // common parameters
277  uint8_t filterIdx;
278  uint8_t frameId;
279  uint8_t subframeId;
280  uint8_t slotId;
281  uint8_t startSymId;
282  /* section type bit- */
283  /* 0 1 3 5 6 7 length */
284  uint8_t fftSize; /* X X 4bits */
285  uint8_t scs; /* X X 4bits */
286  uint8_t iqWidth; /* X X X 4bits */
287  uint8_t compMeth; /* X X X 4bits */
288  uint8_t numUEs; /* X 8bits */
289  uint16_t timeOffset; /* X X 16bits */
290  uint16_t cpLength; /* X X 16bits */
291  };
292 
296  struct xran_section_info info;
298  uint32_t exDataSize;
300  struct {
301  uint16_t type;
302  uint16_t len;
303  void *data;
304  } exData[XRAN_MAX_NUM_EXTENSIONS];
310 };
311 
312 
316  uint8_t dir;
317  uint8_t sectionType;
318  uint16_t numSections;
324  };
325 
330  uint16_t grp_id;
332  uint8_t sym_start;
333  uint8_t sym_num;
335  uint16_t rb_start;
336  uint16_t rb_num;
338  int16_t iq_buff_offset;
339  int16_t iq_buff_len;
341  uint16_t beam_id;
342  uint8_t iqWidth;
343  uint8_t comp_meth;
344  uint8_t pad0;
345  };
346 
347 
348 uint16_t xran_get_cplength(int cpLength);
349 int32_t xran_get_freqoffset(int freqOffset, int scs);
350 
351 int xran_prepare_ctrl_pkt(struct rte_mbuf *mbuf,
352  struct xran_cp_gen_params *params,
353  uint8_t CC_ID, uint8_t Ant_ID,
354  uint8_t seq_id);
355 
356 int xran_parse_cp_pkt(struct rte_mbuf *mbuf,
357  struct xran_cp_gen_params *result,
358  struct xran_recv_packet_info *pkt_info);
359 
360 int xran_cp_init_sectiondb(void *pHandle);
361 int xran_cp_free_sectiondb(void *pHandle);
362 int xran_cp_add_section_info(void *pHandle,
363  uint8_t dir, uint8_t cc_id, uint8_t ruport_id,
364  uint8_t ctx_id, struct xran_section_info *info);
365 int xran_cp_add_multisection_info(void *pHandle,
366  uint8_t cc_id, uint8_t ruport_id, uint8_t ctx_id,
367  struct xran_cp_gen_params *gen_info);
368 struct xran_section_info *xran_cp_find_section_info(void *pHandle,
369  uint8_t dir, uint8_t cc_id, uint8_t ruport_id,
370  uint8_t ctx_id, uint16_t section_id);
371 struct xran_section_info *xran_cp_iterate_section_info(void *pHandle,
372  uint8_t dir, uint8_t cc_id, uint8_t ruport_id,
373  uint8_t ctx_id, uint32_t *next);
374 int xran_cp_getsize_section_info(void *pHandle, uint8_t dir, uint8_t cc_id, uint8_t ruport_id, uint8_t ctx_id);
375 int xran_cp_reset_section_info(void *pHandle, uint8_t dir, uint8_t cc_id, uint8_t ruport_id, uint8_t ctx_id);
376 int32_t xran_cp_populate_section_ext_1(int8_t *p_ext1_dst,
377  uint16_t ext1_dst_len,
378  int16_t *p_bfw_iq_src,
379  uint16_t rbNumber,
380  uint16_t bfwNumber,
381  uint8_t bfwiqWidth,
382  uint8_t bfwCompMeth);
383 #ifdef __cplusplus
384 }
385 #endif
386 
387 #endif /* _XRAN_CP_API_H_ */
int xran_cp_add_section_info(void *pHandle, uint8_t dir, uint8_t cc_id, uint8_t ruport_id, uint8_t ctx_id, struct xran_section_info *info)
Add a section information of C-Plane to dabase.
Definition: xran_cp_api.c:160
This file provides the definition of Control Plane Messages for XRAN Front Haul layer as defined in X...
xran_cp_sectiontype
Definition: xran_cp_api.h:54
int16_t iq_buff_offset
Definition: xran_cp_api.h:338
xran_cp_bfa_bitwidth
Definition: xran_cp_api.h:171
uint8_t bfwCompMeth
Definition: xran_pkt_cp.h:220
int32_t xran_get_freqoffset(int freqOffset, int scs)
int xran_cp_free_sectiondb(void *pHandle)
Release and free section database.
Definition: xran_cp_api.c:89
xran_cp_fftsize
Definition: xran_cp_api.h:78
uint16_t startPrbc
Definition: xran_cp_api.h:193
int xran_parse_cp_pkt(struct rte_mbuf *mbuf, struct xran_cp_gen_params *result, struct xran_recv_packet_info *pkt_info)
Parse a C-Plane packet (for RU emulation) Transport layer fragmentation is not supported.
Definition: xran_cp_api.c:1749
xran_cp_sectionextcmd
Definition: xran_cp_api.h:147
uint16_t regFactor
Definition: xran_cp_api.h:202
xran_cp_symbolnuminc
Definition: xran_cp_api.h:111
int xran_cp_add_multisection_info(void *pHandle, uint8_t cc_id, uint8_t ruport_id, uint8_t ctx_id, struct xran_cp_gen_params *gen_info)
Definition: xran_cp_api.c:187
uint16_t cpLength
Definition: xran_pkt_cp.h:218
#define XRAN_MAX_BFW_N
Definition: xran_cp_api.h:47
struct xran_section_info * xran_cp_iterate_section_info(void *pHandle, uint8_t dir, uint8_t cc_id, uint8_t ruport_id, uint8_t ctx_id, uint32_t *next)
Iterate each section information of C-Plane from the database of eAxC by given information.
Definition: xran_cp_api.c:291
uint16_t xran_get_cplength(int cpLength)
Definition: xran_cp_api.c:542
#define XRAN_MAX_NUM_EXTENSIONS
Definition: xran_cp_api.h:42
int xran_cp_getsize_section_info(void *pHandle, uint8_t dir, uint8_t cc_id, uint8_t ruport_id, uint8_t ctx_id)
Get the size of stored entries for the database of eAxC by given information.
Definition: xran_cp_api.c:334
int xran_cp_reset_section_info(void *pHandle, uint8_t dir, uint8_t cc_id, uint8_t ruport_id, uint8_t ctx_id)
Reset a database of eAxC by given information.
Definition: xran_cp_api.c:366
#define XRAN_NUM_OF_SYMBOL_PER_SLOT
Definition: xran_fh_o_du.h:122
int32_t xran_cp_populate_section_ext_1(int8_t *p_ext1_dst, uint16_t ext1_dst_len, int16_t *p_bfw_iq_src, uint16_t rbNumber, uint16_t bfwNumber, uint8_t bfwiqWidth, uint8_t bfwCompMeth)
Definition: xran_cp_api.c:387
struct xran_cp_radioapp_section_header hdr
Definition: xran_pkt_cp.h:214
int xran_prepare_ctrl_pkt(struct rte_mbuf *mbuf, struct xran_cp_gen_params *params, uint8_t CC_ID, uint8_t Ant_ID, uint8_t seq_id)
Create a C-Plane packet Transport layer fragmentation is not supported.
Definition: xran_cp_api.c:1381
This file provides public interface to xRAN Front Haul layer implementation as defined in the ORAN-WG...
xran_cp_filterindex
Definition: xran_cp_api.h:65
struct xran_section_desc sec_desc[XRAN_NUM_OF_SYMBOL_PER_SLOT]
Definition: xran_cp_api.h:205
xran_cp_subcarrierspacing
Definition: xran_cp_api.h:90
#define XRAN_MAX_MODCOMP_ADDPARMS
Definition: xran_cp_api.h:48
struct xran_section_gen_info * sections
Definition: xran_cp_api.h:322
uint16_t numSections
Definition: xran_cp_api.h:318
xran_cp_rbindicator
Definition: xran_cp_api.h:104
xran_cp_bfw_compression_method
Definition: xran_cp_api.h:161
struct xran_section_info * xran_cp_find_section_info(void *pHandle, uint8_t dir, uint8_t cc_id, uint8_t ruport_id, uint8_t ctx_id, uint16_t section_id)
Find a section information of C-Plane from dabase by given information.
Definition: xran_cp_api.c:242
int xran_cp_init_sectiondb(void *pHandle)
Initialize section database. Allocate required memory space to store section information. Each eAxC allocates dedicated storage and the entry size is the maximum number of sections. Total entry size : number of CC * number of antenna * max number of sections * 2(direction)
Definition: xran_cp_api.c:66
This file provides the definitions for Transport layer (eCPRI) API.