* INTC Contribution to the O-RAN F Release for O-DU Low
[o-du/phy.git] / fhi_lib / lib / src / xran_tx_proc.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2020 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 /**
20  * @brief XRAN TX header file
21  * @file xran_tx_proc.h
22  * @ingroup group_source_xran
23  * @author Intel Corporation
24  **/
25
26 #ifndef _XRAN_TX_PROC_H_
27 #define _XRAN_TX_PROC_H_
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #include <stdio.h>
34 #include <unistd.h>
35 #include <sys/param.h>
36 #include <sys/queue.h>
37
38 #include <rte_common.h>
39 #include <rte_mbuf.h>
40 #include <rte_timer.h>
41
42 #include "xran_fh_o_du.h"
43 #include "xran_prach_cfg.h"
44 #include "xran_up_api.h"
45 #include "xran_cp_api.h"
46
47 struct cp_up_tx_desc {
48     struct rte_mbuf * mb;
49     void *pHandle;
50     uint8_t ctx_id;
51     uint32_t tti;
52     int32_t start_cc;
53     int32_t cc_num;
54     int32_t start_ant;
55     int32_t ant_num;
56     uint32_t frame_id;
57     uint32_t subframe_id;
58     uint32_t slot_id;
59     uint32_t sym_id;
60     uint32_t compType;
61     uint32_t direction;
62     uint16_t xran_port_id;
63     void     *p_sec_db;
64 };
65
66 int32_t xran_process_tx_sym(void *arg);
67
68 struct cp_up_tx_desc * xran_pkt_gen_desc_alloc(void);
69 int32_t xran_pkt_gen_desc_free(struct cp_up_tx_desc *p_desc);
70 uint16_t xran_getSfnSecStart(void);
71
72 int32_t xran_process_tx_sym_cp_on_dispatch(void *pHandle, uint8_t ctx_id, uint32_t tti, int32_t start_cc, int32_t cc_id, int32_t start_ant, int32_t ant_id, uint32_t frame_id, uint32_t subframe_id,
73     uint32_t slot_id, uint32_t sym_id);
74 int32_t xran_process_tx_sym_cp_on(void *pHandle, uint8_t ctx_id, uint32_t tti, int32_t start_cc,  int32_t cc_id, int32_t start_ant, int32_t ant_id, uint32_t frame_id, uint32_t subframe_id,
75     uint32_t slot_id, uint32_t sym_id);
76 int32_t xran_process_tx_sym_cp_on_dispatch(void *pHandle, uint8_t ctx_id, uint32_t tti, int32_t start_cc, int32_t cc_id, int32_t start_ant, int32_t ant_id, uint32_t frame_id, uint32_t subframe_id,
77     uint32_t slot_id, uint32_t sym_id);
78 int32_t xran_process_tx_sym_cp_on_dispatch_opt(void* pHandle, uint8_t ctx_id, uint32_t tti,  int32_t start_cc, int32_t num_cc, int32_t start_ant, int32_t num_ant, uint32_t frame_id,
79     uint32_t subframe_id, uint32_t slot_id, uint32_t sym_id, enum xran_comp_hdr_type compType, enum xran_pkt_dir direction,
80     uint16_t xran_port_id, PSECTION_DB_TYPE p_sec_db);
81
82 int32_t xran_process_tx_sym_cp_on_opt(void* pHandle, uint8_t ctx_id, uint32_t tti, int32_t start_cc, int32_t num_cc, int32_t start_ant,  int32_t num_ant, uint32_t frame_id,
83     uint32_t subframe_id, uint32_t slot_id, uint32_t sym_id, enum xran_comp_hdr_type compType, enum xran_pkt_dir direction,
84     uint16_t xran_port_id, PSECTION_DB_TYPE p_sec_db);
85
86 int32_t xran_process_tx_sym_cp_on_ring(void* pHandle, uint8_t ctx_id, uint32_t tti, int32_t start_cc, int32_t num_cc, int32_t start_ant,  int32_t num_ant, uint32_t frame_id,
87     uint32_t subframe_id, uint32_t slot_id, uint32_t sym_id, enum xran_comp_hdr_type compType, enum xran_pkt_dir direction,
88     uint16_t xran_port_id, PSECTION_DB_TYPE p_sec_db);
89
90 extern int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr* mac_addr);
91
92 extern PSECTION_DB_TYPE p_sectiondb[XRAN_PORTS_NUM];
93
94 #ifdef __cplusplus
95 }
96 #endif
97
98 #endif /* _XRAN_TX_PROC_H_ */