ba16e575edbf5ce01393ad55a6f4a4b2b58c1770
[o-du/l2.git] / src / intel_fapi / fapi_vendor_extension.h
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
19 #ifndef _FAPI_VENDOR_EXTENSION_H_
20 #define _FAPI_VENDOR_EXTENSION_H_
21
22 #if defined(__cplusplus)
23 extern "C" {
24 #endif
25
26 #define FAPI_VENDOR_MESSAGE                                 0x10
27 #define FAPI_VENDOR_EXT_SHUTDOWN_REQUEST                    0x11
28 #define FAPI_VENDOR_EXT_SHUTDOWN_RESPONSE                   0x12
29
30 #ifdef DEBUG_MODE
31 #define FAPI_VENDOR_EXT_DL_IQ_SAMPLES                       0x13
32 #define FAPI_VENDOR_EXT_UL_IQ_SAMPLES                       0x14
33 #define FAPI_VENDOR_EXT_START_RESPONSE                      0x15
34 #endif
35
36 /* ----- WLS Operation --- */
37 #define FAPI_VENDOR_MSG_HEADER_IND                          0x1A
38
39 // PDSCH Payload
40 #define FAPI_VENDOR_MSG_PHY_ZBC_BLOCK_REQ                   0x1B
41
42 // Linked list header present at the top of all messages
43     typedef struct _fapi_api_queue_elem {
44         struct _fapi_api_queue_elem *p_next;
45         // p_tx_data_elm_list used for TX_DATA.request processing
46         struct _fapi_api_queue_elem *p_tx_data_elm_list;
47         uint8_t msg_type;
48         uint8_t num_message_in_block;
49         uint32_t msg_len;
50         uint32_t align_offset;
51         uint64_t time_stamp;
52     } fapi_api_queue_elem_t,
53     *p_fapi_api_queue_elem_t;
54 /* ----------------------- */
55
56 #ifdef DEBUG_MODE
57 #define FAPI_MAX_IQ_SAMPLE_FILE_SIZE                        576
58 #define FAPI_MAX_IQ_SAMPLE_DL_PORTS                          16
59 #define FAPI_MAX_IQ_SAMPLE_UL_PORTS                           2
60 #define FAPI_MAX_IQ_SAMPLE_UL_VIRTUAL_PORTS                   8
61 #define FAPI_MAX_IQ_SAMPLE_UL_ANTENNA                        64
62 #define FAPI_MAX_IQ_SAMPLE_BUFFER_SIZE                     4096
63 #endif
64
65     typedef struct {
66         uint16_t hopping_id;
67         uint8_t carrier_aggregation_level;
68         uint8_t group_hop_flag;
69         uint8_t sequence_hop_flag;
70         // uint8_t                     nDMRS_type_A_pos;
71         uint8_t pad[3];
72     } fapi_config_req_vendor_msg_t;
73
74     typedef struct {
75         uint16_t sfn;
76         uint16_t slot;
77         uint32_t mode;
78 #ifdef DEBUG_MODE
79         uint32_t count;
80         uint32_t period;
81 #endif
82     } fapi_start_req_vendor_msg_t;
83
84     typedef struct {
85         uint16_t sfn;
86         uint16_t slot;
87     } fapi_stop_req_vendor_msg_t;
88
89     typedef struct {
90         fapi_msg_t header;
91         fapi_config_req_vendor_msg_t config_req_vendor;
92         fapi_start_req_vendor_msg_t start_req_vendor;
93         fapi_stop_req_vendor_msg_t stop_req_vendor;
94     } fapi_vendor_msg_t;
95
96     typedef struct {
97         fapi_msg_t header;
98         uint16_t sfn;
99         uint16_t slot;
100         uint32_t test_type;
101     } fapi_vendor_ext_shutdown_req_t;
102
103     typedef struct {
104         fapi_msg_t header;
105         uint16_t sfn;
106         uint16_t slot;
107         uint32_t nStatus;
108     } fapi_vendor_ext_shutdown_res_t;
109
110 #ifdef DEBUG_MODE
111     typedef struct {
112         uint32_t carrNum;
113         uint32_t numSubframes;
114         uint32_t nIsRadioMode;
115         uint32_t timerModeFreqDomain;
116         uint32_t phaseCompensationEnable;
117         uint32_t startFrameNum;
118         uint32_t startSlotNum;
119         uint32_t startSymNum;
120         char filename_in_ul_iq[FAPI_MAX_IQ_SAMPLE_UL_VIRTUAL_PORTS]
121             [FAPI_MAX_IQ_SAMPLE_FILE_SIZE];
122         char filename_in_prach_iq[FAPI_MAX_IQ_SAMPLE_UL_VIRTUAL_PORTS]
123             [FAPI_MAX_IQ_SAMPLE_FILE_SIZE];
124         char filename_in_srs_iq[FAPI_MAX_IQ_SAMPLE_UL_ANTENNA]
125             [FAPI_MAX_IQ_SAMPLE_FILE_SIZE];
126         char filename_out_dl_iq[FAPI_MAX_IQ_SAMPLE_FILE_SIZE];
127         char filename_out_dl_beam[FAPI_MAX_IQ_SAMPLE_DL_PORTS]
128             [FAPI_MAX_IQ_SAMPLE_FILE_SIZE];
129         char filename_out_ul_beam[FAPI_MAX_IQ_SAMPLE_UL_VIRTUAL_PORTS]
130             [FAPI_MAX_IQ_SAMPLE_FILE_SIZE];
131         uint8_t buffer[FAPI_MAX_IQ_SAMPLE_BUFFER_SIZE];
132     } fapi_vendor_ext_iq_samples_info_t;
133
134     typedef struct {
135         fapi_msg_t header;
136         fapi_vendor_ext_iq_samples_info_t iq_samples_info;
137     } fapi_vendor_ext_iq_samples_req_t;
138
139     typedef struct {
140         fapi_msg_t header;
141     } fapi_vendor_ext_dl_iq_samples_res_t;
142
143     typedef struct {
144         fapi_msg_t header;
145     } fapi_vendor_ext_ul_iq_samples_res_t;
146
147     typedef struct {
148         fapi_msg_t header;
149     } fapi_vendor_ext_start_response_t;
150 #endif
151
152 #if defined(__cplusplus)
153 }
154 #endif
155 #endif                          // FAPI_VENDOR_EXTENSION_H_