1 /******************************************************************************
3 * Copyright (c) 2019 Intel.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 *******************************************************************************/
20 * @brief This file has Shared Memory interface functions between MAC and PHY
22 * @ingroup group_testmac
23 * @author Intel Corporation
26 #ifndef _TESTMAC_WLS_H_
27 #define _TESTMAC_WLS_H_
33 //#include "common_typedef.h"
34 #include "fapi_interface.h"
35 #include "fapi_vendor_extension.h"
40 #define MAX_NUM_LOCATIONS (50)
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 */
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 */
48 typedef struct tagZBC_LIST_ITEM
52 } ZBC_LIST_ITEM, *PZBC_LIST_ITEM;
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();
76 #endif /* #ifndef _TESTMAC_WLS_H_ */