o-du/phy
Intel O-RAN/X-RAN Generated Doxygen Documentation
xran_pkt_cp.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 
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  **********************************************************************/
47  uint8_t udCompMeth:4;
48  uint8_t udIqWidth:4;
49  } __attribute__((__packed__));
50 
51 
52 /**********************************************************************
53  * Definition of C-Plane Protocol 5.4
54  **********************************************************************/
61 struct xran_cp_radioapp_common_header { /* 6bytes, first 4bytes need the conversion for byte order */
62  uint32_t startSymbolId:6;
63  uint32_t slotId:6;
64  uint32_t subframeId:4;
65  uint32_t frameId:8;
66  uint32_t filterIndex:4;
67  uint32_t payloadVer:3;
68  uint32_t dataDirection:1;
69  uint8_t numOfSections;
70  uint8_t sectionType;
71  } __attribute__((__packed__));
72 
80  uint8_t uScs:4;
81  uint8_t fftSize:4;
82  } __attribute__((__packed__));
83 
91 struct xran_cp_radioapp_section_header { /* 8bytes, need the conversion for byte order */
92  union {
93  struct {
94  uint32_t reserved:16;
95  uint32_t numSymbol:4;
96  uint32_t reMask:12;
97  } s0;
98  struct {
99  uint32_t beamId:15;
100  uint32_t ef:1;
101  uint32_t numSymbol:4;
102  uint32_t reMask:12;
103  } s1;
104  struct {
105  uint32_t beamId:15;
106  uint32_t ef:1;
107  uint32_t numSymbol:4;
108  uint32_t reMask:12;
109  } s3;
110  struct {
111  uint32_t ueId:15;
112  uint32_t ef:1;
113  uint32_t numSymbol:4;
114  uint32_t reMask:12;
115  } s5;
116  } u;
117 
118  uint32_t numPrbc:8;
119  uint32_t startPrbc:10;
120  uint32_t symInc:1;
121  uint32_t rb:1;
122  uint32_t sectionId:12;
123  } __attribute__((__packed__));
124 
125 
127  /* 12 bytes, need to convert byte order for two parts respectively
128  * - 2 and 8 bytes, reserved1 would be OK if it is zero
129  */
130  uint16_t extLen:8;
131  uint16_t extType:7;
132  uint16_t ef:1;
133  } __attribute__((__packed__));
134 
143  /* variable length, need to be careful to convert byte order
144  * - does not need to convert first 3 bytes */
145  uint8_t extType:7;
146  uint8_t ef:1;
147  uint8_t extLen;
148  /* bfwCompHdr */
149  uint8_t bfwCompMeth:4;
150  uint8_t bfwIqWidth:4;
152  /*
153  *
154  *
155  * bfwCompParam
156  * (bfwI, bfwQ)+
157  * ......
158  * zero padding for 4-byte alignment
159  */
160  } __attribute__((__packed__));
161 
170  /* variable length, need to be careful to convert byte order
171  * - first 4 bytes can be converted at once
172  */
173  uint32_t bfZe3ddWidth:3;
174  uint32_t bfAz3ddWidth:3;
175  uint32_t bfaCompResv1:2;
176  uint32_t bfZePtWidth:3;
177  uint32_t bfAzPtWidth:3;
178  uint32_t bfaCompResv0:2;
179  uint32_t extLen:8;
180  uint32_t extType:7;
181  uint32_t ef:1;
183  /*
184  * would be better to use bit manipulation directly to add these parameters
185  *
186  * bfAzPt: var by bfAzPtWidth
187  * bfZePt: var by bfZePtWidth
188  * bfAz3dd: var by bfAz3ddWidth
189  * bfZe3dd: var by bfZe3ddWidth
190  * bfAzSI:5 (including zero-padding for unused bits)
191  * bfZeSI:3
192  * padding for 4-byte alignment
193  *
194  */
195  } __attribute__((__packed__));
196 
207  /* 16 bytes, need to convert byte order for two parts
208  * - 8 / 8 bytes
209  */
210  uint32_t reserved1:8;
211  uint32_t crsSymNum:4;
212  uint32_t reserved0:3;
213  uint32_t crsShift:1;
214  uint32_t crsReMask:12;
215  uint32_t txScheme:4;
216  uint32_t numLayers:4;
217  uint32_t layerId:4;
218  uint32_t codebookIndex:8;
219  uint32_t extLen:8;
220  uint32_t extType:7;
221  uint32_t ef:1;
223  uint16_t beamIdAP3;
224  uint16_t beamIdAP2;
225  uint16_t beamIdAP1;
226  uint16_t reserved2;
227  } __attribute__((__packed__));
228 
239  /* 4 bytes, need to convert byte order at once */
240  uint32_t numLayers:4;
241  uint32_t layerId:4;
242  uint32_t codebookIndex:8;
244  uint32_t extLen:8;
245  uint32_t extType:7;
246  uint32_t ef:1;
247  } __attribute__((__packed__));
248 
258  /* 4 bytes, need to convert byte order at once */
259  uint32_t modCompScaler:15;
260  uint32_t csf:1;
262  uint32_t extLen:8;
263  uint32_t extType:7;
264  uint32_t ef:1;
265  } __attribute__((__packed__));
266 
267 #if 0
268 
277 struct xran_cp_radioapp_section_ext5_1 {
278  /* 8 bytes, need to convert byte order at once */
279  uint32_t reserved:20;
280  uint32_t mcScaleOffset:15;
281  uint32_t csf:1;
282  uint32_t mcScaleReMask:12;
284  uint32_t extLen:8;
285  uint32_t extType:7;
286  uint32_t ef:1;
287  } __attribute__((__packed__));
288 
298 struct xran_cp_radioapp_section_ext5_2 {
299  /* 12 bytes, need to convert byte order for two parts respectively
300  * - 2 and 8 bytes, reserved1 would be OK if it is zero
301  */
302  uint16_t extLen:8;
303  uint16_t extType:7;
304  uint16_t ef:1;
306  uint32_t reserved0:8;
307  uint32_t mcScaleOffset2:15;
308  uint32_t csf2:1;
309  uint32_t mcScaleReMask2:12;
310  uint32_t mcScaleOffset1:15;
311  uint32_t csf1:1;
312  uint32_t mcScaleReMask1:12;
314  uint16_t reserved1;
315  } __attribute__((__packed__));
316 #endif
317 
319  uint32_t reserved0:8;
320  uint32_t mcScaleOffset2:15;
321  uint32_t csf2:1;
322  uint32_t mcScaleReMask2:12;
323  uint32_t mcScaleOffset1:15;
324  uint32_t csf1:1;
325  uint32_t mcScaleReMask1:12;
326  } __attribute__((__packed__));
327 
328 /**********************************************************
329  * Scheduling and Beam-forming Commands 5.4.2
330  **********************************************************/
337 struct xran_cp_radioapp_section0_header { // 12bytes (6+2+1+2+1)
339  uint16_t timeOffset;
342  uint16_t cpLength;
343  uint8_t reserved;
344  } __attribute__((__packed__));
345 
353 struct xran_cp_radioapp_section0 { // 8bytes (4+4)
355  } __attribute__((__packed__));
356 
363 struct xran_cp_radioapp_section1_header { // 8bytes (6+1+1)
366  uint8_t reserved;
367  } __attribute__((__packed__));
368 
375 struct xran_cp_radioapp_section1 { // 8bytes (4+4)
377 
378  // section extensions // 5.4.6 & 5.4.7
379  // .........
380  } __attribute__((__packed__));
381 
388 struct xran_cp_radioapp_section3_header { // 12bytes (6+2+1+2+1)
390  uint16_t timeOffset;
393  uint16_t cpLength;
395  } __attribute__((__packed__));
396 
403 struct xran_cp_radioapp_section3 { // 12bytes (4+4+4)
405  uint32_t freqOffset:24;
406  uint32_t reserved:8;
407 
408  // section extensions // 5.4.6 & 5.4.7
409  // .........
410  } __attribute__((__packed__));
411 
418 struct xran_cp_radioapp_section5_header { // 8bytes (6+1+1)
421  uint8_t reserved;
422  } __attribute__((__packed__));
423 
433 
434  // section extensions // 5.4.6 & 5.4.7
435  // .........
436  } __attribute__((__packed__));
437 
444 struct xran_cp_radioapp_section6_header { // 8bytes (6+1+1)
446  uint8_t numberOfUEs;
447  uint8_t reserved;
448  } __attribute__((__packed__));
449 
458  uint32_t regularizationFactor:16;
459  uint32_t ueId:15;
460  uint32_t ef:1;
461  uint8_t startPrbch:2;
462  uint8_t symInc:1;
463  uint8_t rb:1;
464  uint8_t reserved:4;
465  uint8_t startPrbcl:8;
466  uint8_t numPrbc:8;
468  // ciIQsamples start from here // 5.4.5.13 channel information I and Q values
469  // .........
470  //
471  // section extensions // 5.4.6 & 5.4.7
472  // .........
473  } __attribute__((__packed__));
474 
484  uint16_t reserved;
485  uint8_t laaMsgLen:4;
486  uint8_t laaMsgType:4;
488  // Payload start from here // 5.4.5.16 ~ 5.4.5.32
489  } __attribute__((__packed__));
490 
491 #ifdef __cplusplus
492 }
493 #endif
494 
495 #endif /* _XRAN_PKT_CP_H_ */
uint32_t numLayers
Definition: xran_pkt_cp.h:223
uint32_t mcScaleReMask2
Definition: xran_pkt_cp.h:217
uint16_t beamIdAP2
Definition: xran_pkt_cp.h:231
uint32_t txScheme
Definition: xran_pkt_cp.h:222
uint32_t reMask
Definition: xran_pkt_cp.h:218
uint32_t reserved0
Definition: xran_pkt_cp.h:219
struct xran_radioapp_udComp_header __attribute__((__packed__))
struct xran_radioapp_udComp_header udComp
Definition: xran_pkt_cp.h:215
uint32_t mcScaleOffset2
Definition: xran_pkt_cp.h:215
uint32_t csf
Definition: xran_pkt_cp.h:216
uint32_t codebookIndex
Definition: xran_pkt_cp.h:225
uint16_t extType
Definition: xran_pkt_cp.h:218
uint16_t beamIdAP1
Definition: xran_pkt_cp.h:232
struct xran_cp_radioapp_common_header cmnhdr
Definition: xran_pkt_cp.h:214
uint32_t mcScaleOffset1
Definition: xran_pkt_cp.h:218
uint16_t beamIdAP3
Definition: xran_pkt_cp.h:230
uint32_t beamId
Definition: xran_pkt_cp.h:221
uint32_t ef
Definition: xran_pkt_cp.h:222
union @13 u
struct xran_cp_radioapp_frameStructure frameStructure
Definition: xran_pkt_cp.h:217
struct @13::@15 s1
struct @13::@17 s5
struct @13::@16 s3
uint32_t csf1
Definition: xran_pkt_cp.h:219
uint32_t numSymbol
Definition: xran_pkt_cp.h:217
uint32_t crsReMask
Definition: xran_pkt_cp.h:221
struct xran_cp_radioapp_section_header hdr
Definition: xran_pkt_cp.h:214
struct @13::@14 s0
uint32_t mcScaleReMask1
Definition: xran_pkt_cp.h:220
uint32_t csf2
Definition: xran_pkt_cp.h:216
uint32_t reserved
Definition: xran_pkt_cp.h:216
uint32_t reserved1
Definition: xran_pkt_cp.h:217
uint32_t layerId
Definition: xran_pkt_cp.h:224
uint16_t extLen
Definition: xran_pkt_cp.h:217