Update to odulow per maintenance bronze
[o-du/phy.git] / wls_lib / test / mac / mac_wls.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 /**
20  * @brief This file has Shared Memory interface functions between MAC and PHY
21  * @file testmac_wls.h
22  * @ingroup group_testmac
23  * @author Intel Corporation
24  **/
25
26 #ifndef _TESTMAC_WLS_H_
27 #define _TESTMAC_WLS_H_
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 //#include "common_typedef.h"
34 #include "fapi_interface.h"
35 #include "fapi_vendor_extension.h"
36
37 #define SUCCESS 0
38 #define FAILURE 1
39
40 #define MAX_NUM_LOCATIONS           (50)
41
42 #define MIN_DL_BUF_LOCATIONS        (0)                                             /* Used for stats collection 0-49 */
43 #define MIN_UL_BUF_LOCATIONS        (MIN_DL_BUF_LOCATIONS + MAX_NUM_LOCATIONS)      /* Used for stats collection 50-99 */
44
45 #define MAX_DL_BUF_LOCATIONS        (MIN_DL_BUF_LOCATIONS + MAX_NUM_LOCATIONS)          /* Used for stats collection 0-49 */
46 #define MAX_UL_BUF_LOCATIONS        (MIN_UL_BUF_LOCATIONS + MAX_NUM_LOCATIONS)          /* Used for stats collection 50-99 */
47
48 typedef struct tagZBC_LIST_ITEM
49 {
50     uint64_t pMsg;
51     uint32_t MsgSize;
52 } ZBC_LIST_ITEM, *PZBC_LIST_ITEM;
53
54
55 uint32_t wls_mac_init(char * wls_device_name, uint64_t nWlsMemorySize);
56 void wls_mac_print_thread_info(void);
57 uint32_t wls_mac_destroy(void);
58 void *wls_mac_alloc_buffer(uint32_t size, uint32_t loc);
59 uint32_t wls_mac_send_msg_to_phy(void *data);
60 uint64_t wls_mac_va_to_pa(void *ptr);
61 void *wls_mac_pa_to_va(uint64_t ptr);
62 void wls_mac_free_buffer(void *pMsg, uint32_t loc);
63 void wls_mac_get_time_stats(uint64_t *pTotal, uint64_t *pUsed, uint32_t nClear);
64 void wls_mac_free_list_all(void);
65 int wls_mac_free_list(uint32_t idx);
66 p_fapi_api_queue_elem_t wls_mac_create_elem(uint16_t num_msg, uint32_t align_offset, uint32_t msg_type, uint32_t n_loc);
67 void wls_mac_print_recv_list(p_fapi_api_queue_elem_t list, uint32_t i);
68 uint8_t mac_dpdk_init();
69 void *wls_mac_rx_task();
70
71 #ifdef __cplusplus
72 }
73 #endif
74
75
76 #endif /* #ifndef _TESTMAC_WLS_H_ */
77
78