xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/mvl88w8977/mlinux/moal_shim.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /** @file moal_shim.h
2   *
3   * @brief This file contains declaration referring to
4   * functions defined in moal module
5   *
6   * Copyright (C) 2008-2017, Marvell International Ltd.
7   *
8   * This software file (the "File") is distributed by Marvell International
9   * Ltd. under the terms of the GNU General Public License Version 2, June 1991
10   * (the "License").  You may use, redistribute and/or modify this File in
11   * accordance with the terms and conditions of the License, a copy of which
12   * is available by writing to the Free Software Foundation, Inc.,
13   * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
14   * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
15   *
16   * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
17   * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
18   * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
19   * this warranty disclaimer.
20   *
21   */
22 /*************************************************************
23 Change Log:
24     10/21/2008: initial version
25 ************************************************************/
26 
27 #ifndef _MOAL_H
28 #define _MOAL_H
29 
30 mlan_status moal_get_fw_data(IN t_void *pmoal_handle,
31 			     IN t_u32 offset, IN t_u32 len, OUT t_u8 *pbuf);
32 mlan_status moal_get_hw_spec_complete(IN t_void *pmoal_handle,
33 				      IN mlan_status status,
34 				      IN mlan_hw_info * phw,
35 				      IN pmlan_bss_tbl ptbl);
36 mlan_status moal_init_fw_complete(IN t_void *pmoal_handle,
37 				  IN mlan_status status);
38 mlan_status moal_shutdown_fw_complete(IN t_void *pmoal_handle,
39 				      IN mlan_status status);
40 mlan_status moal_ioctl_complete(IN t_void *pmoal_handle,
41 				IN pmlan_ioctl_req pioctl_req,
42 				IN mlan_status status);
43 mlan_status moal_alloc_mlan_buffer(IN t_void *pmoal_handle, IN t_u32 size,
44 				   OUT pmlan_buffer *pmbuf);
45 mlan_status moal_free_mlan_buffer(IN t_void *pmoal_handle,
46 				  IN pmlan_buffer pmbuf);
47 mlan_status moal_send_packet_complete(IN t_void *pmoal_handle,
48 				      IN pmlan_buffer pmbuf,
49 				      IN mlan_status status);
50 
51 /** moal_write_reg */
52 mlan_status moal_write_reg(IN t_void *pmoal_handle,
53 			   IN t_u32 reg, IN t_u32 data);
54 /** moal_read_reg */
55 mlan_status moal_read_reg(IN t_void *pmoal_handle,
56 			  IN t_u32 reg, OUT t_u32 *data);
57 mlan_status moal_write_data_sync(IN t_void *pmoal_handle,
58 				 IN pmlan_buffer pmbuf,
59 				 IN t_u32 port, IN t_u32 timeout);
60 mlan_status moal_read_data_sync(IN t_void *pmoal_handle,
61 				IN OUT pmlan_buffer pmbuf,
62 				IN t_u32 port, IN t_u32 timeout);
63 mlan_status moal_recv_packet(IN t_void *pmoal_handle, IN pmlan_buffer pmbuf);
64 mlan_status moal_recv_event(IN t_void *pmoal_handle, IN pmlan_event pmevent);
65 mlan_status moal_malloc(IN t_void *pmoal_handle,
66 			IN t_u32 size, IN t_u32 flag, OUT t_u8 **ppbuf);
67 mlan_status moal_mfree(IN t_void *pmoal_handle, IN t_u8 *pbuf);
68 mlan_status moal_vmalloc(IN t_void *pmoal_handle,
69 			 IN t_u32 size, OUT t_u8 **ppbuf);
70 mlan_status moal_vfree(IN t_void *pmoal_handle, IN t_u8 *pbuf);
71 t_void *moal_memset(IN t_void *pmoal_handle,
72 		    IN t_void *pmem, IN t_u8 byte, IN t_u32 num);
73 t_void *moal_memcpy(IN t_void *pmoal_handle,
74 		    IN t_void *pdest, IN const t_void *psrc, IN t_u32 num);
75 t_void *moal_memmove(IN t_void *pmoal_handle,
76 		     IN t_void *pdest, IN const t_void *psrc, IN t_u32 num);
77 t_s32 moal_memcmp(IN t_void *pmoal_handle,
78 		  IN const t_void *pmem1, IN const t_void *pmem2, IN t_u32 num);
79 /** moal_udelay */
80 t_void moal_udelay(IN t_void *pmoal_handle, IN t_u32 udelay);
81 mlan_status moal_get_system_time(IN t_void *pmoal_handle, OUT t_u32 *psec,
82 				 OUT t_u32 *pusec);
83 mlan_status moal_init_lock(IN t_void *pmoal_handle, OUT t_void **pplock);
84 mlan_status moal_free_lock(IN t_void *pmoal_handle, IN t_void *plock);
85 mlan_status moal_spin_lock(IN t_void *pmoal_handle, IN t_void *plock);
86 mlan_status moal_spin_unlock(IN t_void *pmoal_handle, IN t_void *plock);
87 t_void moal_print(IN t_void *pmoal_handle, IN t_u32 level, IN char *pformat,
88 		  IN ...);
89 t_void moal_print_netintf(IN t_void *pmoal_handle, IN t_u32 bss_index,
90 			  IN t_u32 level);
91 t_void moal_assert(IN t_void *pmoal_handle, IN t_u32 cond);
92 t_void moal_hist_data_add(IN t_void *pmoal_handle, IN t_u32 bss_index,
93 			  IN t_u8 rx_rate, IN t_s8 snr, IN t_s8 nflr,
94 			  IN t_u8 antenna);
95 
96 t_void moal_updata_peer_signal(IN t_void *pmoal_handle, IN t_u32 bss_index,
97 			       IN t_u8 *peer_addr, IN t_s8 snr, IN t_s8 nflr);
98 mlan_status moal_get_host_time_ns(OUT t_u64 *time);
99 t_u32 moal_do_div(IN t_u64 num, IN t_u32 base);
100 
101 mlan_status moal_init_timer(IN t_void *pmoal_handle,
102 			    OUT t_void **pptimer,
103 			    IN t_void (*callback) (t_void *pcontext),
104 			    IN t_void *pcontext);
105 mlan_status moal_free_timer(IN t_void *pmoal_handle, IN t_void *ptimer);
106 mlan_status moal_start_timer(IN t_void *pmoal_handle,
107 			     IN t_void *ptimer,
108 			     IN t_u8 periodic, IN t_u32 msec);
109 mlan_status moal_stop_timer(IN t_void *pmoal_handle, IN t_void *ptimer);
110 
111 #endif /*_MOAL_H */
112