blob: 5d8bce0f58db79d7f9ac747289b6e7c1de406751 [file] [log] [blame]
Larry Finger4218e5b2013-08-21 22:34:10 -05001/******************************************************************************
2 *
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
Larry Finger4218e5b2013-08-21 22:34:10 -050014 ******************************************************************************/
15#ifndef __RTW_MLME_H_
16#define __RTW_MLME_H_
17
18#include <osdep_service.h>
19#include <mlme_osdep.h>
20#include <drv_types.h>
21#include <wlan_bssdef.h>
22
23#define MAX_BSS_CNT 128
24#define MAX_JOIN_TIMEOUT 6500
25
26/* Increase the scanning timeout because of increasing the SURVEY_TO value. */
27
28#define SCANNING_TIMEOUT 8000
29
30#define SCAN_INTERVAL (30) /* unit:2sec, 30*2=60sec */
31
32#define SCANQUEUE_LIFETIME 20 /* unit:sec */
33
34#define WIFI_NULL_STATE 0x00000000
35
36#define WIFI_ASOC_STATE 0x00000001 /* Under Linked state */
37#define WIFI_REASOC_STATE 0x00000002
38#define WIFI_SLEEP_STATE 0x00000004
39#define WIFI_STATION_STATE 0x00000008
40
41#define WIFI_AP_STATE 0x00000010
42#define WIFI_ADHOC_STATE 0x00000020
43#define WIFI_ADHOC_MASTER_STATE 0x00000040
44#define WIFI_UNDER_LINKING 0x00000080
45
46#define WIFI_UNDER_WPS 0x00000100
47#define WIFI_STA_ALIVE_CHK_STATE 0x00000400
48#define WIFI_SITE_MONITOR 0x00000800 /* to indicate the station is under site surveying */
49
50#define WIFI_MP_STATE 0x00010000
Masanari Iidaf7bba922013-09-27 00:11:43 +090051#define WIFI_MP_CTX_BACKGROUND 0x00020000 /* in continuous tx background */
52#define WIFI_MP_CTX_ST 0x00040000 /* in continuous tx with single-tone */
53#define WIFI_MP_CTX_BACKGROUND_PENDING 0x00080000 /* pending in continuous tx background due to out of skb */
54#define WIFI_MP_CTX_CCK_HW 0x00100000 /* in continuous tx */
55#define WIFI_MP_CTX_CCK_CS 0x00200000 /* in continuous tx with carrier suppression */
Larry Finger4218e5b2013-08-21 22:34:10 -050056#define WIFI_MP_LPBK_STATE 0x00400000
57
58#define _FW_UNDER_LINKING WIFI_UNDER_LINKING
59#define _FW_LINKED WIFI_ASOC_STATE
60#define _FW_UNDER_SURVEY WIFI_SITE_MONITOR
61
62enum dot11AuthAlgrthmNum {
Luca Ceresoli2ff4e792015-04-16 23:28:03 +020063 dot11AuthAlgrthm_Open = 0, /* open system */
Larry Finger4218e5b2013-08-21 22:34:10 -050064 dot11AuthAlgrthm_Shared,
65 dot11AuthAlgrthm_8021X,
66 dot11AuthAlgrthm_Auto,
67 dot11AuthAlgrthm_WAPI,
68 dot11AuthAlgrthm_MaxNum
69};
70
71/* Scan type including active and passive scan. */
72enum rt_scan_type {
73 SCAN_PASSIVE,
74 SCAN_ACTIVE,
75 SCAN_MIX,
76};
77
78enum SCAN_RESULT_TYPE {
79 SCAN_RESULT_P2P_ONLY = 0, /* Will return all the P2P devices. */
80 SCAN_RESULT_ALL = 1, /* Will return all the scanned device,
81 * include AP. */
82 SCAN_RESULT_WFD_TYPE = 2 /* Will just return the correct WFD
83 * device. */
84 /* If this device is Miracast sink
85 * device, it will just return all the
86 * Miracast source devices. */
87};
88
89/*
90there are several "locks" in mlme_priv,
91since mlme_priv is a shared resource between many threads,
92like ISR/Call-Back functions, the OID handlers, and even timer functions.
93
94Each _queue has its own locks, already.
95Other items are protected by mlme_priv.lock.
96
97To avoid possible dead lock, any thread trying to modifiying mlme_priv
98SHALL not lock up more than one lock at a time!
99*/
100
101#define traffic_threshold 10
102#define traffic_scan_period 500
103
Larry Finger4218e5b2013-08-21 22:34:10 -0500104struct rt_link_detect {
105 u32 NumTxOkInPeriod;
106 u32 NumRxOkInPeriod;
107 u32 NumRxUnicastOkInPeriod;
108 bool bBusyTraffic;
109 bool bTxBusyTraffic;
110 bool bRxBusyTraffic;
111 bool bHigherBusyTraffic; /* For interrupt migration purpose. */
112 bool bHigherBusyRxTraffic; /* We may disable Tx interrupt according
113 * to Rx traffic. */
114 bool bHigherBusyTxTraffic; /* We may disable Tx interrupt according
115 * to Tx traffic. */
116};
117
118struct profile_info {
119 u8 ssidlen;
Tim Jester-Pfadt1f4c0952014-01-10 23:57:59 +0100120 u8 ssid[WLAN_SSID_MAXLEN];
121 u8 peermac[ETH_ALEN];
Larry Finger4218e5b2013-08-21 22:34:10 -0500122};
123
124struct tx_invite_req_info {
125 u8 token;
126 u8 benable;
Tim Jester-Pfadt1f4c0952014-01-10 23:57:59 +0100127 u8 go_ssid[WLAN_SSID_MAXLEN];
Larry Finger4218e5b2013-08-21 22:34:10 -0500128 u8 ssidlen;
Tim Jester-Pfadt1f4c0952014-01-10 23:57:59 +0100129 u8 go_bssid[ETH_ALEN];
130 u8 peer_macaddr[ETH_ALEN];
Larry Finger4218e5b2013-08-21 22:34:10 -0500131 u8 operating_ch; /* This information will be set by using the
132 * p2p_set op_ch=x */
133 u8 peer_ch; /* The listen channel for peer P2P device */
134};
135
136struct tx_invite_resp_info {
137 u8 token; /* Used to record the dialog token of p2p invitation
138 * request frame. */
139};
140
141struct tx_provdisc_req_info {
142 u16 wps_config_method_request; /* Used when sending the
143 * provisioning request frame*/
144 u16 peer_channel_num[2]; /* The channel number which the
145 * receiver stands. */
146 struct ndis_802_11_ssid ssid;
147 u8 peerDevAddr[ETH_ALEN]; /* Peer device address */
148 u8 peerIFAddr[ETH_ALEN]; /* Peer interface address */
149 u8 benable; /* This provision discovery
150 * request frame is trigger
151 * to send or not */
152};
153
154/* When peer device issue prov_disc_req first, we should store the following
155 * information */
156/* The UI must know this information to know which config method the
157 * remote p2p device needs. */
158struct rx_provdisc_req_info {
159 u8 peerDevAddr[ETH_ALEN]; /* Peer device address */
160 u8 strconfig_method_desc_of_prov_disc_req[4]; /* description
161 * for the config method located in the provisioning
162 * discovery request frame. */
163};
164
165struct tx_nego_req_info {
166 u16 peer_channel_num[2]; /* The channel number. */
167 u8 peerDevAddr[ETH_ALEN]; /* Peer device address */
168 u8 benable; /* This negotiation request frame is
169 * trigger to send or not */
170};
171
172struct group_id_info {
Tim Jester-Pfadt1f4c0952014-01-10 23:57:59 +0100173 u8 go_device_addr[ETH_ALEN]; /* The GO's device address of
Larry Finger4218e5b2013-08-21 22:34:10 -0500174 * this P2P group */
Tim Jester-Pfadt1f4c0952014-01-10 23:57:59 +0100175 u8 ssid[WLAN_SSID_MAXLEN]; /* The SSID of this P2P group */
Larry Finger4218e5b2013-08-21 22:34:10 -0500176};
177
178struct scan_limit_info {
179 u8 scan_op_ch_only; /* When this flag is set, the driver
180 * should only scan the op. channel */
181 u8 operation_ch[2]; /* Store the op. chan of invitation */
182};
183
184struct wifidirect_info {
185 struct adapter *padapter;
186 struct timer_list find_phase_timer;
187 struct timer_list restore_p2p_state_timer;
188
189 /* Used to do the scanning. After confirming the peer is availalble,
190 * the driver transmits the P2P frame to peer. */
191 struct timer_list pre_tx_scan_timer;
192 struct timer_list reset_ch_sitesurvey;
193 struct timer_list reset_ch_sitesurvey2; /* Just for resetting the scan
194 * limit function by using p2p nego */
195 struct tx_provdisc_req_info tx_prov_disc_info;
196 struct rx_provdisc_req_info rx_prov_disc_info;
197 struct tx_invite_req_info invitereq_info;
198 /* Store the profile information of persistent group */
199 struct profile_info profileinfo[P2P_MAX_PERSISTENT_GROUP_NUM];
200 struct tx_invite_resp_info inviteresp_info;
201 struct tx_nego_req_info nego_req_info;
202 /* Store the group id info when doing the group negot handshake. */
203 struct group_id_info groupid_info;
204 /* Used for get the limit scan channel from the Invitation procedure */
205 struct scan_limit_info rx_invitereq_info;
206 /* Used for get the limit scan chan from the P2P negotiation handshake*/
207 struct scan_limit_info p2p_info;
208 enum P2P_ROLE role;
209 enum P2P_STATE pre_p2p_state;
210 enum P2P_STATE p2p_state;
211 /* The device address should be the mac address of this device. */
212 u8 device_addr[ETH_ALEN];
213 u8 interface_addr[ETH_ALEN];
214 u8 social_chan[4];
215 u8 listen_channel;
216 u8 operating_channel;
217 u8 listen_dwell; /* This value should be between 1 and 3 */
218 u8 support_rate[8];
219 u8 p2p_wildcard_ssid[P2P_WILDCARD_SSID_LEN];
220 u8 intent; /* should only include the intent value. */
221 u8 p2p_peer_interface_addr[ETH_ALEN];
222 u8 p2p_peer_device_addr[ETH_ALEN];
223 u8 peer_intent; /* Included the intent value and tie breaker value. */
224 /* Device name for displaying on searching device screen */
225 u8 device_name[WPS_MAX_DEVICE_NAME_LEN];
226 u8 device_name_len;
227 u8 profileindex; /* Used to point to the index of profileinfo array */
228 u8 peer_operating_ch;
229 u8 find_phase_state_exchange_cnt;
Masanari Iidaf7bba922013-09-27 00:11:43 +0900230 /* The device password ID for group negotiation */
Larry Finger4218e5b2013-08-21 22:34:10 -0500231 u16 device_password_id_for_nego;
232 u8 negotiation_dialog_token;
233 /* SSID information for group negotitation */
234 u8 nego_ssid[WLAN_SSID_MAXLEN];
235 u8 nego_ssidlen;
236 u8 p2p_group_ssid[WLAN_SSID_MAXLEN];
237 u8 p2p_group_ssid_len;
238 /* Flag to know if the persistent function should be supported or not.*/
239 u8 persistent_supported;
240 /* In the Sigma test, the Sigma will provide this enable from the
241 * sta_set_p2p CAPI. */
242 /* 0: disable */
243 /* 1: enable */
244 u8 session_available; /* Flag to set the WFD session available to
245 * enable or disable "by Sigma" */
246 /* In the Sigma test, the Sigma will disable the session available
247 * by using the sta_preset CAPI. */
248 /* 0: disable */
249 /* 1: enable */
250 u8 wfd_tdls_enable; /* Flag to enable or disable the TDLS by WFD Sigma*/
251 /* 0: disable */
252 /* 1: enable */
253 u8 wfd_tdls_weaksec; /* Flag to enable or disable the weak security
254 * function for TDLS by WFD Sigma */
255 /* 0: disable */
256 /* In this case, the driver can't issue the tdsl
257 * setup request frame. */
258 /* 1: enable */
259 /* In this case, the driver can issue the tdls
260 * setup request frame */
261 /* even the current security is weak security. */
262
263 /* This field will store the WPS value (PIN value or PBC) that UI had
264 * got from the user. */
265 enum P2P_WPSINFO ui_got_wps_info;
266 u16 supported_wps_cm; /* This field describes the WPS config method
267 * which this driver supported. */
268 /* The value should be the combination of config
269 * method defined in page104 of WPS v2.0 spec.*/
270 /* This field will contain the length of body of P2P Channel List
271 * attribute of group negotiation response frame. */
272 uint channel_list_attr_len;
273 /* This field will contain the body of P2P Channel List attribute of
274 * group negotitation response frame. */
275 /* We will use the channel_cnt and channel_list fields when constructing
276 * the group negotiation confirm frame. */
277 u8 channel_list_attr[100];
278 enum P2P_PS_MODE p2p_ps_mode; /* indicate p2p ps mode */
279 enum P2P_PS_STATE p2p_ps_state; /* indicate p2p ps state */
280 u8 noa_index; /* Identifies and instance of Notice of Absence timing. */
281 u8 ctwindow; /* Client traffic window. A period of time in TU after TBTT. */
282 u8 opp_ps; /* opportunistic power save. */
283 u8 noa_num; /* number of NoA descriptor in P2P IE. */
284 u8 noa_count[P2P_MAX_NOA_NUM]; /* Count for owner, Type of client. */
285 /* Max duration for owner, preferred or min acceptable duration for
286 * client. */
287 u32 noa_duration[P2P_MAX_NOA_NUM];
288 /* Length of interval for owner, preferred or max acceptable interval
289 * of client. */
290 u32 noa_interval[P2P_MAX_NOA_NUM];
291 /* schedule expressed in terms of the lower 4 bytes of the TSF timer. */
292 u32 noa_start_time[P2P_MAX_NOA_NUM];
293};
294
Larry Finger4218e5b2013-08-21 22:34:10 -0500295struct mlme_priv {
296 spinlock_t lock;
297 int fw_state; /* shall we protect this variable? maybe not necessarily... */
298 u8 bScanInProcess;
299 u8 to_join; /* flag */
300 u8 to_roaming; /* roaming trying times */
301
302 u8 *nic_hdl;
303
304 u8 not_indic_disco;
305 struct list_head *pscanned;
306 struct __queue free_bss_pool;
307 struct __queue scanned_queue;
308 u8 *free_bss_buf;
309 u32 num_of_scanned;
310
311 struct ndis_802_11_ssid assoc_ssid;
312 u8 assoc_bssid[6];
313
314 struct wlan_network cur_network;
315
316 u32 scan_interval;
317
318 struct timer_list assoc_timer;
319
320 uint assoc_by_bssid;
321 uint assoc_by_rssi;
322
323 struct timer_list scan_to_timer; /* driver itself handles scan_timeout status. */
324 u32 scan_start_time; /* used to evaluate the time spent in scanning */
325
326 struct qos_priv qospriv;
327
328 /* Number of non-HT AP/stations */
329 int num_sta_no_ht;
330
331 /* Number of HT AP/stations 20 MHz */
332 /* int num_sta_ht_20mhz; */
333
334 int num_FortyMHzIntolerant;
335 struct ht_priv htpriv;
336 struct rt_link_detect LinkDetectInfo;
337 struct timer_list dynamic_chk_timer; /* dynamic/periodic check timer */
338
339 u8 key_mask; /* use for ips to set wep key after ips_leave */
340 u8 acm_mask; /* for wmm acm mask */
341 u8 ChannelPlan;
342 enum rt_scan_type scan_mode; /* active: 1, passive: 0 */
343
344 /* u8 probereq_wpsie[MAX_WPS_IE_LEN];added in probe req */
345 /* int probereq_wpsie_len; */
346 u8 *wps_probe_req_ie;
347 u32 wps_probe_req_ie_len;
348
349 u8 *assoc_req;
350 u32 assoc_req_len;
351 u8 *assoc_rsp;
352 u32 assoc_rsp_len;
353
Tim Jester-Pfadt1f4c0952014-01-10 23:57:59 +0100354#if defined(CONFIG_88EU_AP_MODE)
Larry Finger4218e5b2013-08-21 22:34:10 -0500355 /* Number of associated Non-ERP stations (i.e., stations using 802.11b
356 * in 802.11g BSS) */
357 int num_sta_non_erp;
358
359 /* Number of associated stations that do not support Short Slot Time */
360 int num_sta_no_short_slot_time;
361
362 /* Number of associated stations that do not support Short Preamble */
363 int num_sta_no_short_preamble;
364
365 int olbc; /* Overlapping Legacy BSS Condition */
366
367 /* Number of HT assoc sta that do not support greenfield */
368 int num_sta_ht_no_gf;
369
370 /* Number of associated non-HT stations */
371 /* int num_sta_no_ht; */
372
373 /* Number of HT associated stations 20 MHz */
374 int num_sta_ht_20mhz;
375
376 /* Overlapping BSS information */
377 int olbc_ht;
378
379 u16 ht_op_mode;
380
381 u8 *wps_beacon_ie;
382 /* u8 *wps_probe_req_ie; */
383 u8 *wps_probe_resp_ie;
384 u8 *wps_assoc_resp_ie;
385
386 u32 wps_beacon_ie_len;
387 u32 wps_probe_resp_ie_len;
388 u32 wps_assoc_resp_ie_len;
389
390 u8 *p2p_beacon_ie;
391 u8 *p2p_probe_req_ie;
392 u8 *p2p_probe_resp_ie;
393 u8 *p2p_go_probe_resp_ie; /* for GO */
394 u8 *p2p_assoc_req_ie;
395
396 u32 p2p_beacon_ie_len;
397 u32 p2p_probe_req_ie_len;
398 u32 p2p_probe_resp_ie_len;
399 u32 p2p_go_probe_resp_ie_len; /* for GO */
400 u32 p2p_assoc_req_ie_len;
401 spinlock_t bcn_update_lock;
402 u8 update_bcn;
403#endif /* if defined (CONFIG_88EU_AP_MODE) */
404};
405
406#ifdef CONFIG_88EU_AP_MODE
407
408struct hostapd_priv {
409 struct adapter *padapter;
410};
411
412int hostapd_mode_init(struct adapter *padapter);
413void hostapd_mode_unload(struct adapter *padapter);
414#endif
415
416extern unsigned char WPA_TKIP_CIPHER[4];
417extern unsigned char RSN_TKIP_CIPHER[4];
418extern unsigned char REALTEK_96B_IE[];
419extern unsigned char MCS_rate_2R[16];
420extern unsigned char MCS_rate_1R[16];
421
422void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf);
423void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf);
424void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf);
425void rtw_joinbss_event_callback(struct adapter *adapter, u8 *pbuf);
426void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf);
427void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf);
428void rtw_atimdone_event_callback(struct adapter *adapter, u8 *pbuf);
429void rtw_cpwm_event_callback(struct adapter *adapter, u8 *pbuf);
430void indicate_wx_scan_complete_event(struct adapter *padapter);
431void rtw_indicate_wx_assoc_event(struct adapter *padapter);
432void rtw_indicate_wx_disassoc_event(struct adapter *padapter);
433int event_thread(void *context);
Larry Finger4218e5b2013-08-21 22:34:10 -0500434void rtw_free_network_queue(struct adapter *adapter, u8 isfreeall);
435int rtw_init_mlme_priv(struct adapter *adapter);
Tim Jester-Pfadt1f4c0952014-01-10 23:57:59 +0100436void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv);
Larry Finger4218e5b2013-08-21 22:34:10 -0500437int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv);
438int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv,
439 int keyid, u8 set_tx);
440int rtw_set_auth(struct adapter *adapter, struct security_priv *psecuritypriv);
441
442static inline u8 *get_bssid(struct mlme_priv *pmlmepriv)
443{ /* if sta_mode:pmlmepriv->cur_network.network.MacAddress=> bssid */
444 /* if adhoc_mode:pmlmepriv->cur_network.network.MacAddress=> ibss mac address */
445 return pmlmepriv->cur_network.network.MacAddress;
446}
447
448static inline int check_fwstate(struct mlme_priv *pmlmepriv, int state)
449{
450 if (pmlmepriv->fw_state & state)
451 return true;
452
453 return false;
454}
455
456static inline int get_fwstate(struct mlme_priv *pmlmepriv)
457{
458 return pmlmepriv->fw_state;
459}
460
461/*
462 * No Limit on the calling context,
463 * therefore set it to be the critical section...
464 *
465 * ### NOTE:#### (!!!!)
466 * MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock
467 */
468static inline void set_fwstate(struct mlme_priv *pmlmepriv, int state)
469{
470 pmlmepriv->fw_state |= state;
471 /* FOR HW integration */
Tim Jester-Pfadt3f35c7f2014-01-12 00:55:25 +0100472 if (_FW_UNDER_SURVEY == state)
Larry Finger4218e5b2013-08-21 22:34:10 -0500473 pmlmepriv->bScanInProcess = true;
474}
475
476static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state)
477{
478 pmlmepriv->fw_state &= ~state;
479 /* FOR HW integration */
Tim Jester-Pfadt3f35c7f2014-01-12 00:55:25 +0100480 if (_FW_UNDER_SURVEY == state)
Larry Finger4218e5b2013-08-21 22:34:10 -0500481 pmlmepriv->bScanInProcess = false;
482}
483
484/*
485 * No Limit on the calling context,
486 * therefore set it to be the critical section...
487 */
488static inline void clr_fwstate(struct mlme_priv *pmlmepriv, int state)
489{
Larry Finger7057dcb2013-12-19 22:38:34 -0600490 spin_lock_bh(&pmlmepriv->lock);
Larry Finger4218e5b2013-08-21 22:34:10 -0500491 if (check_fwstate(pmlmepriv, state) == true)
492 pmlmepriv->fw_state ^= state;
Larry Fingere02bcf62013-12-19 22:38:35 -0600493 spin_unlock_bh(&pmlmepriv->lock);
Larry Finger4218e5b2013-08-21 22:34:10 -0500494}
495
496static inline void clr_fwstate_ex(struct mlme_priv *pmlmepriv, int state)
497{
Larry Finger7057dcb2013-12-19 22:38:34 -0600498 spin_lock_bh(&pmlmepriv->lock);
Larry Finger4218e5b2013-08-21 22:34:10 -0500499 _clr_fwstate_(pmlmepriv, state);
Larry Fingere02bcf62013-12-19 22:38:35 -0600500 spin_unlock_bh(&pmlmepriv->lock);
Larry Finger4218e5b2013-08-21 22:34:10 -0500501}
502
503static inline void up_scanned_network(struct mlme_priv *pmlmepriv)
504{
Larry Finger7057dcb2013-12-19 22:38:34 -0600505 spin_lock_bh(&pmlmepriv->lock);
Larry Finger4218e5b2013-08-21 22:34:10 -0500506 pmlmepriv->num_of_scanned++;
Larry Fingere02bcf62013-12-19 22:38:35 -0600507 spin_unlock_bh(&pmlmepriv->lock);
Larry Finger4218e5b2013-08-21 22:34:10 -0500508}
509
510static inline void down_scanned_network(struct mlme_priv *pmlmepriv)
511{
Larry Finger7057dcb2013-12-19 22:38:34 -0600512 spin_lock_bh(&pmlmepriv->lock);
Larry Finger4218e5b2013-08-21 22:34:10 -0500513 pmlmepriv->num_of_scanned--;
Larry Fingere02bcf62013-12-19 22:38:35 -0600514 spin_unlock_bh(&pmlmepriv->lock);
Larry Finger4218e5b2013-08-21 22:34:10 -0500515}
516
517static inline void set_scanned_network_val(struct mlme_priv *pmlmepriv, int val)
518{
Larry Finger7057dcb2013-12-19 22:38:34 -0600519 spin_lock_bh(&pmlmepriv->lock);
Larry Finger4218e5b2013-08-21 22:34:10 -0500520 pmlmepriv->num_of_scanned = val;
Larry Fingere02bcf62013-12-19 22:38:35 -0600521 spin_unlock_bh(&pmlmepriv->lock);
Larry Finger4218e5b2013-08-21 22:34:10 -0500522}
523
524u16 rtw_get_capability(struct wlan_bssid_ex *bss);
525void rtw_update_scanned_network(struct adapter *adapter,
526 struct wlan_bssid_ex *target);
527void rtw_disconnect_hdl_under_linked(struct adapter *adapter,
528 struct sta_info *psta, u8 free_assoc);
529void rtw_generate_random_ibss(u8 *pibss);
530struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr);
531struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue);
532
BuĊ£iu Alexandru Octavianb4ba3b52015-07-24 00:13:27 +0300533void rtw_free_assoc_resources(struct adapter *adapter);
534void rtw_free_assoc_resources_locked(struct adapter *adapter);
Larry Finger4218e5b2013-08-21 22:34:10 -0500535void rtw_indicate_disconnect(struct adapter *adapter);
536void rtw_indicate_connect(struct adapter *adapter);
Tim Jester-Pfadt1f4c0952014-01-10 23:57:59 +0100537void rtw_indicate_scan_done(struct adapter *padapter, bool aborted);
Larry Finger4218e5b2013-08-21 22:34:10 -0500538void rtw_scan_abort(struct adapter *adapter);
539
540int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie,
541 uint in_len);
542int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie,
543 uint in_len, uint initial_out_len);
544void rtw_init_registrypriv_dev_network(struct adapter *adapter);
545
546void rtw_update_registrypriv_dev_network(struct adapter *adapter);
547
548void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter *adapter);
549
Vaishali Thakkar28af7ea2015-03-11 11:41:24 +0530550void _rtw_join_timeout_handler(unsigned long data);
551void rtw_scan_timeout_handler(unsigned long data);
Larry Finger4218e5b2013-08-21 22:34:10 -0500552
Vaishali Thakkar28af7ea2015-03-11 11:41:24 +0530553void rtw_dynamic_check_timer_handlder(unsigned long data);
Larry Finger4218e5b2013-08-21 22:34:10 -0500554#define rtw_is_scan_deny(adapter) false
555#define rtw_clear_scan_deny(adapter) do {} while (0)
556#define rtw_set_scan_deny_timer_hdl(adapter) do {} while (0)
557#define rtw_set_scan_deny(adapter, ms) do {} while (0)
558
Larry Finger4218e5b2013-08-21 22:34:10 -0500559void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv);
560
Tim Jester-Pfadt1f4c0952014-01-10 23:57:59 +0100561struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv);
Larry Finger4218e5b2013-08-21 22:34:10 -0500562
Larry Finger4218e5b2013-08-21 22:34:10 -0500563void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv,
564 struct wlan_network *pnetwork);
565
Larry Finger4218e5b2013-08-21 22:34:10 -0500566int rtw_if_up(struct adapter *padapter);
567
Larry Finger4218e5b2013-08-21 22:34:10 -0500568u8 *rtw_get_capability_from_ie(u8 *ie);
Larry Finger4218e5b2013-08-21 22:34:10 -0500569u8 *rtw_get_beacon_interval_from_ie(u8 *ie);
570
Larry Finger4218e5b2013-08-21 22:34:10 -0500571void rtw_joinbss_reset(struct adapter *padapter);
572
573unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie,
574 u8 *out_ie, uint in_len, uint *pout_len);
575void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len);
576void rtw_issue_addbareq_cmd(struct adapter *padapter,
577 struct xmit_frame *pxmitframe);
578
579int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork);
580int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst);
581
582void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network);
583void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network);
584
Tim Jester-Pfadt3f35c7f2014-01-12 00:55:25 +0100585void rtw_stassoc_hw_rpt(struct adapter *adapter, struct sta_info *psta);
Larry Finger4218e5b2013-08-21 22:34:10 -0500586
587#endif /* __RTL871X_MLME_H_ */