O-RAN E Maintenance Release contribution for ODULOW
[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 cc_id;
53     int32_t ant_id;
54     uint32_t frame_id;
55     uint32_t subframe_id;
56     uint32_t slot_id;
57     uint32_t sym_id;
58     uint32_t compType;
59     uint32_t direction;
60     uint16_t xran_port_id;
61     void     *p_sec_db;
62 };
63
64 int32_t xran_process_tx_sym(void *arg);
65
66 struct cp_up_tx_desc * xran_pkt_gen_desc_alloc(void);
67 int32_t xran_pkt_gen_desc_free(struct cp_up_tx_desc *p_desc);
68 uint16_t xran_getSfnSecStart(void);
69
70 int32_t xran_process_tx_sym_cp_on_dispatch(void *pHandle, uint8_t ctx_id, uint32_t tti, int32_t cc_id, int32_t ant_id, uint32_t frame_id, uint32_t subframe_id,
71     uint32_t slot_id, uint32_t sym_id);
72 int32_t xran_process_tx_sym_cp_on(void *pHandle, uint8_t ctx_id, uint32_t tti, int32_t cc_id, 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_dispatch(void *pHandle, uint8_t ctx_id, uint32_t tti, int32_t cc_id, 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_opt(void* pHandle, uint8_t ctx_id, uint32_t tti, int32_t num_cc, int32_t num_ant, uint32_t frame_id,
77     uint32_t subframe_id, uint32_t slot_id, uint32_t sym_id, enum xran_comp_hdr_type compType, enum xran_pkt_dir direction,
78     uint16_t xran_port_id, PSECTION_DB_TYPE p_sec_db);
79
80 int32_t xran_process_tx_sym_cp_on_opt(void* pHandle, uint8_t ctx_id, uint32_t tti, int32_t num_cc, int32_t num_ant, uint32_t frame_id, uint32_t subframe_id,
81     uint32_t slot_id, uint32_t sym_id, enum xran_comp_hdr_type compType, enum xran_pkt_dir direction, uint16_t xran_port_id, PSECTION_DB_TYPE p_sec_db);
82 extern int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr* mac_addr);
83
84 extern PSECTION_DB_TYPE p_sectiondb[XRAN_PORTS_NUM];
85
86 #ifdef __cplusplus
87 }
88 #endif
89
90 #endif /* _XRAN_TX_PROC_H_ */