59a08554f87a4cfd50b18f2d66edab42e7ad0a37
[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
36 #define SUCCESS 0
37 #define FAILURE 1
38
39 #define MAX_NUM_LOCATIONS           (50)
40
41 #define MIN_DL_BUF_LOCATIONS        (0)                                             /* Used for stats collection 0-49 */
42 #define MIN_UL_BUF_LOCATIONS        (MIN_DL_BUF_LOCATIONS + MAX_NUM_LOCATIONS)      /* Used for stats collection 50-99 */
43
44 #define MAX_DL_BUF_LOCATIONS        (MIN_DL_BUF_LOCATIONS + MAX_NUM_LOCATIONS)          /* Used for stats collection 0-49 */
45 #define MAX_UL_BUF_LOCATIONS        (MIN_UL_BUF_LOCATIONS + MAX_NUM_LOCATIONS)          /* Used for stats collection 50-99 */
46
47 typedef struct tagZBC_LIST_ITEM
48 {
49     uint64_t pMsg;
50     uint32_t MsgSize;
51 } ZBC_LIST_ITEM, *PZBC_LIST_ITEM;
52
53
54 uint32_t wls_mac_init(char * wls_device_name, uint64_t nWlsMemorySize);
55 void wls_mac_print_thread_info(void);
56 uint32_t wls_mac_destroy(void);
57 void *wls_mac_alloc_buffer(uint32_t size, uint32_t loc);
58 uint32_t wls_mac_send_msg_to_phy(void *data);
59 uint64_t wls_mac_va_to_pa(void *ptr);
60 void *wls_mac_pa_to_va(uint64_t ptr);
61 void wls_mac_free_buffer(void *pMsg, uint32_t loc);
62 void wls_mac_get_time_stats(uint64_t *pTotal, uint64_t *pUsed, uint32_t nClear);
63 void wls_mac_free_list_all(void);
64 int wls_mac_free_list(uint32_t idx);
65 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);
66 void wls_mac_print_recv_list(p_fapi_api_queue_elem_t list, uint32_t i);
67 uint8_t mac_dpdk_init();
68 void *wls_mac_rx_task();
69
70 #ifdef __cplusplus
71 }
72 #endif
73
74
75 #endif /* #ifndef _TESTMAC_WLS_H_ */
76
77