aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/ieee80211_i.h4
-rw-r--r--net/mac80211/mlme.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 747814f319af..c6de3156930c 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -361,7 +361,9 @@ struct ieee80211_if_sta {
361 361
362 struct sk_buff_head skb_queue; 362 struct sk_buff_head skb_queue;
363 363
364 int auth_tries, assoc_tries; 364 int assoc_scan_tries; /* number of scans done pre-association */
365 int auth_tries; /* retries for auth req */
366 int assoc_tries; /* retries for assoc req */
365 367
366 unsigned long request; 368 unsigned long request;
367 369
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f05519d1c2c6..e821d1ac5b00 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -34,6 +34,7 @@
34#include "led.h" 34#include "led.h"
35#include "mesh.h" 35#include "mesh.h"
36 36
37#define IEEE80211_ASSOC_SCANS_MAX_TRIES 2
37#define IEEE80211_AUTH_TIMEOUT (HZ / 5) 38#define IEEE80211_AUTH_TIMEOUT (HZ / 5)
38#define IEEE80211_AUTH_MAX_TRIES 3 39#define IEEE80211_AUTH_MAX_TRIES 3
39#define IEEE80211_ASSOC_TIMEOUT (HZ / 5) 40#define IEEE80211_ASSOC_TIMEOUT (HZ / 5)
@@ -596,6 +597,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
596{ 597{
597 if (deauth) 598 if (deauth)
598 ifsta->auth_tries = 0; 599 ifsta->auth_tries = 0;
600 ifsta->assoc_scan_tries = 0;
599 ifsta->assoc_tries = 0; 601 ifsta->assoc_tries = 0;
600 ieee80211_set_associated(sdata, ifsta, 0); 602 ieee80211_set_associated(sdata, ifsta, 0);
601} 603}
@@ -3405,7 +3407,9 @@ static void ieee80211_sta_reset_auth(struct ieee80211_sub_if_data *sdata,
3405 ifsta->auth_alg = WLAN_AUTH_OPEN; 3407 ifsta->auth_alg = WLAN_AUTH_OPEN;
3406 ifsta->auth_transaction = -1; 3408 ifsta->auth_transaction = -1;
3407 ifsta->flags &= ~IEEE80211_STA_ASSOCIATED; 3409 ifsta->flags &= ~IEEE80211_STA_ASSOCIATED;
3408 ifsta->auth_tries = ifsta->assoc_tries = 0; 3410 ifsta->assoc_scan_tries = 0;
3411 ifsta->auth_tries = 0;
3412 ifsta->assoc_tries = 0;
3409 netif_carrier_off(sdata->dev); 3413 netif_carrier_off(sdata->dev);
3410} 3414}
3411 3415
@@ -3510,7 +3514,8 @@ static int ieee80211_sta_config_auth(struct ieee80211_sub_if_data *sdata,
3510 ieee80211_sta_reset_auth(sdata, ifsta); 3514 ieee80211_sta_reset_auth(sdata, ifsta);
3511 return 0; 3515 return 0;
3512 } else { 3516 } else {
3513 if (ifsta->state != IEEE80211_STA_MLME_AUTHENTICATE) { 3517 if (ifsta->assoc_scan_tries < IEEE80211_ASSOC_SCANS_MAX_TRIES) {
3518 ifsta->assoc_scan_tries++;
3514 if (ifsta->flags & IEEE80211_STA_AUTO_SSID_SEL) 3519 if (ifsta->flags & IEEE80211_STA_AUTO_SSID_SEL)
3515 ieee80211_sta_start_scan(sdata, NULL, 0); 3520 ieee80211_sta_start_scan(sdata, NULL, 0);
3516 else 3521 else