xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/mvl88w8977/mlan/esa/hostsa_def.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /** @file hostsa_def.h
2  *
3  *  @brief This file contains data structrue for authenticator/supplicant.
4  *
5  * Copyright (C) 2014-2017, Marvell International Ltd.
6  *
7  * This software file (the "File") is distributed by Marvell International
8  * Ltd. under the terms of the GNU General Public License Version 2, June 1991
9  * (the "License").  You may use, redistribute and/or modify this File in
10  * accordance with the terms and conditions of the License, a copy of which
11  * is available by writing to the Free Software Foundation, Inc.,
12  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
13  * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
14  *
15  * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
17  * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
18  * this warranty disclaimer.
19  */
20 
21 /******************************************************
22 Change log:
23     03/07/2014: Initial version
24 ******************************************************/
25 #ifndef _HOSTSA_DEF_H
26 #define _HOSTSA_DEF_H
27 /* subset of mlan_callbacks data structure */
28 /** hostsa_util_fns data structure */
29 typedef struct _hostsa_util_fns {
30     /** pmoal_handle */
31 	t_void *pmoal_handle;
32     /** moal_malloc */
33 	mlan_status (*moal_malloc) (IN t_void *pmoal_handle,
34 				    IN t_u32 size,
35 				    IN t_u32 flag, OUT t_u8 **ppbuf);
36     /** moal_mfree */
37 	mlan_status (*moal_mfree) (IN t_void *pmoal_handle, IN t_u8 *pbuf);
38     /** moal_memset */
39 	t_void *(*moal_memset) (IN t_void *pmoal_handle,
40 				IN t_void *pmem, IN t_u8 byte, IN t_u32 num);
41     /** moal_memcpy */
42 	t_void *(*moal_memcpy) (IN t_void *pmoal_handle,
43 				IN t_void *pdest,
44 				IN const t_void *psrc, IN t_u32 num);
45     /** moal_memmove */
46 	t_void *(*moal_memmove) (IN t_void *pmoal_handle,
47 				 IN t_void *pdest,
48 				 IN const t_void *psrc, IN t_u32 num);
49     /** moal_memcmp */
50 	t_s32 (*moal_memcmp) (IN t_void *pmoal_handle,
51 			      IN const t_void *pmem1,
52 			      IN const t_void *pmem2, IN t_u32 num);
53     /** moal_udelay */
54 	t_void (*moal_udelay) (IN t_void *pmoal_handle, IN t_u32 udelay);
55     /** moal_get_system_time */
56 	mlan_status (*moal_get_system_time) (IN t_void *pmoal_handle,
57 					     OUT t_u32 *psec, OUT t_u32 *pusec);
58     /** moal_init_timer*/
59 	mlan_status (*moal_init_timer) (IN t_void *pmoal_handle,
60 					OUT t_void **pptimer,
61 					IN t_void (*callback) (t_void
62 							       *pcontext),
63 					IN t_void *pcontext);
64     /** moal_free_timer */
65 	mlan_status (*moal_free_timer) (IN t_void *pmoal_handle,
66 					IN t_void *ptimer);
67     /** moal_start_timer*/
68 	mlan_status (*moal_start_timer) (IN t_void *pmoal_handle,
69 					 IN t_void *ptimer,
70 					 IN t_u8 periodic, IN t_u32 msec);
71     /** moal_stop_timer*/
72 	mlan_status (*moal_stop_timer) (IN t_void *pmoal_handle,
73 					IN t_void *ptimer);
74     /** moal_init_lock */
75 	mlan_status (*moal_init_lock) (IN t_void *pmoal_handle,
76 				       OUT t_void **pplock);
77     /** moal_free_lock */
78 	mlan_status (*moal_free_lock) (IN t_void *pmoal_handle,
79 				       IN t_void *plock);
80     /** moal_spin_lock */
81 	mlan_status (*moal_spin_lock) (IN t_void *pmoal_handle,
82 				       IN t_void *plock);
83     /** moal_spin_unlock */
84 	mlan_status (*moal_spin_unlock) (IN t_void *pmoal_handle,
85 					 IN t_void *plock);
86     /** moal_print */
87 	t_void (*moal_print) (IN t_void *pmoal_handle,
88 			      IN t_u32 level, IN char *pformat, IN ...
89 		);
90     /** moal_print_netintf */
91 	t_void (*moal_print_netintf) (IN t_void *pmoal_handle,
92 				      IN t_u32 bss_index, IN t_u32 level);
93 } hostsa_util_fns, *phostsa_util_fns;
94 /* Required functions from mlan */
95 /** hostsa_mlan_fns data structure */
96 typedef struct _hostsa_mlan_fns {
97     /** pmlan_private */
98 	t_void *pmlan_private;
99     /** pmlan_adapter */
100 	t_void *pmlan_adapter;
101     /** BSS index */
102 	t_u8 bss_index;
103     /** BSS type */
104 	t_u8 bss_type;
105 
106 	pmlan_buffer (*hostsa_alloc_mlan_buffer) (t_void *pmlan_adapter,
107 						  t_u32 data_len,
108 						  t_u32 head_room,
109 						  t_u32 malloc_flag);
110 	void (*hostsa_tx_packet) (t_void *pmlan_private,
111 				  pmlan_buffer pmbuf, t_u16 frameLen);
112 	void (*hostsa_set_encrypt_key) (t_void *pmlan_private,
113 					mlan_ds_encrypt_key *encrypt_key);
114 	void (*hostsa_clr_encrypt_key) (t_void *pmlan_private);
115 	void (*hostsa_SendDeauth) (t_void *pmlan_private,
116 				   t_u8 *addr, t_u16 reason);
117 	void (*Hostsa_DisAssocAllSta) (void *pmlan_private, t_u16 reason);
118 	void (*hostsa_free_mlan_buffer) (t_void *pmlan_adapter,
119 					 mlan_buffer *pmbuf);
120 	void (*Hostsa_get_station_entry) (t_void *pmlan_private,
121 					  t_u8 *mac, t_void **ppconPtr);
122 	void (*Hostsa_set_mgmt_ie) (t_void *pmlan_private,
123 				    t_u8 *pbuf, t_u16 len, t_u8 clearIE);
124 	void (*Hostsa_find_connection) (t_void *pmlan_private,
125 					t_void **ppconPtr, t_void **ppsta_node);
126 	void (*Hostsa_find_next_connection) (t_void *pmlan_private,
127 					     t_void **ppconPtr,
128 					     t_void **ppsta_node);
129 	t_void (*Hostsa_StaControlledPortOpen) (t_void *pmlan_private);
130 	void (*hostsa_StaSendDeauth) (t_void *pmlan_private,
131 				      t_u8 *addr, t_u16 reason);
132 	t_u8 (*Hostsa_get_bss_role) (t_void *pmlan_private);
133 	t_u8 (*Hostsa_get_intf_hr_len) (t_void *pmlan_private);
134 	t_void (*Hostsa_sendEventRsnConnect) (t_void *pmlan_private,
135 					      t_u8 *addr);
136 } hostsa_mlan_fns, *phostsa_mlan_fns;
137 #endif
138