1 /** @file moal_shim.h 2 * 3 * @brief This file contains declaration referring to 4 * functions defined in moal module 5 * 6 * 7 * Copyright 2008-2021 NXP 8 * 9 * This software file (the File) is distributed by NXP 10 * under the terms of the GNU General Public License Version 2, June 1991 11 * (the License). You may use, redistribute and/or modify the File in 12 * accordance with the terms and conditions of the License, a copy of which 13 * is available by writing to the Free Software Foundation, Inc., 14 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the 15 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 16 * 17 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE 18 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 19 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about 20 * this warranty disclaimer. 21 * 22 */ 23 /************************************************************* 24 * Change Log: 25 * 10/21/2008: initial version 26 ************************************************************/ 27 28 #ifndef _MOAL_H 29 #define _MOAL_H 30 31 mlan_status moal_get_fw_data(t_void *pmoal, t_u32 offset, t_u32 len, 32 t_u8 *pbuf); 33 mlan_status moal_get_vdll_data(t_void *pmoal, t_u32 len, t_u8 *pbuf); 34 mlan_status moal_get_hw_spec_complete(t_void *pmoal, mlan_status status, 35 mlan_hw_info *phw, pmlan_bss_tbl ptbl); 36 mlan_status moal_init_fw_complete(t_void *pmoal, mlan_status status); 37 mlan_status moal_shutdown_fw_complete(t_void *pmoal, mlan_status status); 38 mlan_status moal_ioctl_complete(t_void *pmoal, pmlan_ioctl_req pioctl_req, 39 mlan_status status); 40 mlan_status moal_alloc_mlan_buffer(t_void *pmoal, t_u32 size, 41 pmlan_buffer *pmbuf); 42 mlan_status moal_free_mlan_buffer(t_void *pmoal, pmlan_buffer pmbuf); 43 mlan_status moal_send_packet_complete(t_void *pmoal, pmlan_buffer pmbuf, 44 mlan_status status); 45 #ifdef USB 46 mlan_status moal_recv_complete(t_void *pmoal, pmlan_buffer pmbuf, t_u32 port, 47 mlan_status status); 48 mlan_status moal_write_data_async(t_void *pmoal, pmlan_buffer pmbuf, 49 t_u32 port); 50 #endif 51 52 #if defined(SDIO) || defined(PCIE) 53 /** moal_write_reg */ 54 mlan_status moal_write_reg(t_void *pmoal, t_u32 reg, t_u32 data); 55 /** moal_read_reg */ 56 mlan_status moal_read_reg(t_void *pmoal, t_u32 reg, t_u32 *data); 57 #endif /* SDIO || PCIE */ 58 mlan_status moal_write_data_sync(t_void *pmoal, pmlan_buffer pmbuf, t_u32 port, 59 t_u32 timeout); 60 mlan_status moal_read_data_sync(t_void *pmoal, pmlan_buffer pmbuf, t_u32 port, 61 t_u32 timeout); 62 mlan_status moal_recv_amsdu_packet(t_void *pmoal, pmlan_buffer pmbuf); 63 mlan_status moal_recv_packet(t_void *pmoal, pmlan_buffer pmbuf); 64 mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent); 65 mlan_status moal_malloc(t_void *pmoal, t_u32 size, t_u32 flag, t_u8 **ppbuf); 66 mlan_status moal_mfree(t_void *pmoal, t_u8 *pbuf); 67 mlan_status moal_vmalloc(t_void *pmoal, t_u32 size, t_u8 **ppbuf); 68 mlan_status moal_vfree(t_void *pmoal, t_u8 *pbuf); 69 #ifdef PCIE 70 mlan_status moal_malloc_consistent(t_void *pmoal, t_u32 size, t_u8 **ppbuf, 71 t_pu64 pbuf_pa); 72 mlan_status moal_mfree_consistent(t_void *pmoal, t_u32 size, t_u8 *pbuf, 73 t_u64 buf_pa); 74 mlan_status moal_map_memory(t_void *pmoal, t_u8 *pbuf, t_u64 *pbuf_pa, 75 t_u32 size, t_u32 flag); 76 mlan_status moal_unmap_memory(t_void *pmoal, t_u8 *pbuf, t_u64 buf_pa, 77 t_u32 size, t_u32 flag); 78 #endif /* PCIE */ 79 t_void *moal_memset(t_void *pmoal, t_void *pmem, t_u8 byte, t_u32 num); 80 t_void *moal_memcpy(t_void *pmoal, t_void *pdest, const t_void *psrc, 81 t_u32 num); 82 t_void *moal_memcpy_ext(t_void *pmoal, t_void *pdest, const t_void *psrc, 83 t_u32 num, t_u32 dest_size); 84 85 t_void *moal_memmove(t_void *pmoal, t_void *pdest, const t_void *psrc, 86 t_u32 num); 87 t_s32 moal_memcmp(t_void *pmoal, const t_void *pmem1, const t_void *pmem2, 88 t_u32 num); 89 /** moal_udelay */ 90 t_void moal_udelay(t_void *pmoal, t_u32 udelay); 91 t_void moal_usleep_range(t_void *pmoal, t_u32 min_delay, t_u32 max_delay); 92 mlan_status moal_get_boot_ktime(t_void *pmoal, t_u64 *pnsec); 93 mlan_status moal_get_system_time(t_void *pmoal, t_u32 *psec, t_u32 *pusec); 94 mlan_status moal_init_lock(t_void *pmoal, t_void **pplock); 95 mlan_status moal_free_lock(t_void *pmoal, t_void *plock); 96 mlan_status moal_spin_lock(t_void *pmoal, t_void *plock); 97 mlan_status moal_spin_unlock(t_void *pmoal, t_void *plock); 98 #if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT) 99 mlan_status moal_wait_hostcmd_complete(t_void *pmoal, t_u32 bss_index); 100 mlan_status moal_notify_hostcmd_complete(t_void *pmoal, t_u32 bss_index); 101 #endif 102 t_void moal_print(t_void *pmoal, t_u32 level, char *pformat, IN...); 103 t_void moal_print_netintf(t_void *pmoal, t_u32 bss_index, t_u32 level); 104 t_void moal_assert(t_void *pmoal, t_u32 cond); 105 t_void moal_hist_data_add(t_void *pmoal, t_u32 bss_index, t_u16 rx_rate, 106 t_s8 snr, t_s8 nflr, t_u8 antenna); 107 108 t_void moal_updata_peer_signal(t_void *pmoal, t_u32 bss_index, t_u8 *peer_addr, 109 t_s8 snr, t_s8 nflr); 110 t_u64 moal_do_div(t_u64 num, t_u32 base); 111 112 mlan_status moal_init_timer(t_void *pmoal, t_void **pptimer, 113 IN t_void (*callback)(t_void *pcontext), 114 t_void *pcontext); 115 mlan_status moal_free_timer(t_void *pmoal, t_void *ptimer); 116 mlan_status moal_start_timer(t_void *pmoal, t_void *ptimer, t_u8 periodic, 117 t_u32 msec); 118 mlan_status moal_stop_timer(t_void *pmoal, t_void *ptimer); 119 void moal_tp_accounting(t_void *pmoal, void *buf, t_u32 drop_point); 120 void moal_tp_accounting_rx_param(t_void *pmoal, unsigned int type, 121 unsigned int rsvd1); 122 void moal_amsdu_tp_accounting(t_void *pmoal, t_s32 amsdu_process_delay, 123 t_s32 amsdu_copy_delay); 124 125 void moal_connection_status_check_pmqos(t_void *pmoal); 126 #if defined(PCIE) || defined(SDIO) 127 /* pmqos busfreq add request handler*/ 128 void woal_request_busfreq_pmqos_add(t_void *pmhandle); 129 /* pmqos busfreq remove handler*/ 130 void woal_release_busfreq_pmqos_remove(t_void *pmhandle); 131 #endif 132 133 #endif /*_MOAL_H */ 134