aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-07-30 22:26:55 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-30 22:26:55 -0400
commit2f6d7c1b34403b97fa57473edcb6749d1db5ace3 (patch)
tree97da33c077b08b72a361ff5a4542b86d190b0164 /net/mac80211/mlme.c
parentdf597efb5737063497f1a4f7c996cc9aec294230 (diff)
parent1e4247d457c6a42e4a05cb7dfa4e6ea1fa65c112 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 0b3551da8f43..ee83125ed179 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -581,7 +581,7 @@ void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
581 if (!ifmgd->associated) 581 if (!ifmgd->associated)
582 return; 582 return;
583 583
584 if (sdata->local->sw_scanning || sdata->local->hw_scanning) 584 if (sdata->local->scanning)
585 return; 585 return;
586 586
587 /* Disregard subsequent beacons if we are already running a timer 587 /* Disregard subsequent beacons if we are already running a timer
@@ -639,7 +639,7 @@ static void ieee80211_enable_ps(struct ieee80211_local *local,
639 * If we are scanning right now then the parameters will 639 * If we are scanning right now then the parameters will
640 * take effect when scan finishes. 640 * take effect when scan finishes.
641 */ 641 */
642 if (local->hw_scanning || local->sw_scanning) 642 if (local->scanning)
643 return; 643 return;
644 644
645 if (conf->dynamic_ps_timeout > 0 && 645 if (conf->dynamic_ps_timeout > 0 &&
@@ -1166,6 +1166,9 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata,
1166 if (!netif_running(sdata->dev)) 1166 if (!netif_running(sdata->dev))
1167 return; 1167 return;
1168 1168
1169 if (sdata->local->scanning)
1170 return;
1171
1169 mutex_lock(&ifmgd->mtx); 1172 mutex_lock(&ifmgd->mtx);
1170 1173
1171 if (!ifmgd->associated) 1174 if (!ifmgd->associated)
@@ -2000,6 +2003,9 @@ static void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
2000 case RX_MGMT_CFG80211_ASSOC: 2003 case RX_MGMT_CFG80211_ASSOC:
2001 cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, skb->len); 2004 cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, skb->len);
2002 break; 2005 break;
2006 case RX_MGMT_CFG80211_DEAUTH:
2007 cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len, NULL);
2008 break;
2003 default: 2009 default:
2004 WARN(1, "unexpected: %d", rma); 2010 WARN(1, "unexpected: %d", rma);
2005 } 2011 }
@@ -2038,7 +2044,7 @@ static void ieee80211_sta_work(struct work_struct *work)
2038 if (!netif_running(sdata->dev)) 2044 if (!netif_running(sdata->dev))
2039 return; 2045 return;
2040 2046
2041 if (local->sw_scanning || local->hw_scanning) 2047 if (local->scanning)
2042 return; 2048 return;
2043 2049
2044 if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION)) 2050 if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION))
@@ -2213,9 +2219,6 @@ static void ieee80211_sta_monitor_work(struct work_struct *work)
2213 container_of(work, struct ieee80211_sub_if_data, 2219 container_of(work, struct ieee80211_sub_if_data,
2214 u.mgd.monitor_work); 2220 u.mgd.monitor_work);
2215 2221
2216 if (sdata->local->sw_scanning || sdata->local->hw_scanning)
2217 return;
2218
2219 ieee80211_mgd_probe_ap(sdata, false); 2222 ieee80211_mgd_probe_ap(sdata, false);
2220} 2223}
2221 2224
@@ -2377,6 +2380,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
2377 2380
2378 wk->state = IEEE80211_MGD_STATE_PROBE; 2381 wk->state = IEEE80211_MGD_STATE_PROBE;
2379 wk->auth_alg = auth_alg; 2382 wk->auth_alg = auth_alg;
2383 wk->timeout = jiffies; /* run right away */
2380 2384
2381 /* 2385 /*
2382 * XXX: if still associated need to tell AP that we're going 2386 * XXX: if still associated need to tell AP that we're going
@@ -2448,6 +2452,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
2448 2452
2449 wk->state = IEEE80211_MGD_STATE_ASSOC; 2453 wk->state = IEEE80211_MGD_STATE_ASSOC;
2450 wk->tries = 0; 2454 wk->tries = 0;
2455 wk->timeout = jiffies; /* run right away */
2451 2456
2452 if (req->use_mfp) { 2457 if (req->use_mfp) {
2453 ifmgd->mfp = IEEE80211_MFP_REQUIRED; 2458 ifmgd->mfp = IEEE80211_MFP_REQUIRED;
@@ -2496,8 +2501,13 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
2496 } 2501 }
2497 } 2502 }
2498 2503
2499 /* cfg80211 should catch this... */ 2504 /*
2500 if (WARN_ON(!bssid)) { 2505 * cfg80211 should catch this ... but it's racy since
2506 * we can receive a deauth frame, process it, hand it
2507 * to cfg80211 while that's in a locked section already
2508 * trying to tell us that the user wants to disconnect.
2509 */
2510 if (!bssid) {
2501 mutex_unlock(&ifmgd->mtx); 2511 mutex_unlock(&ifmgd->mtx);
2502 return -ENOLINK; 2512 return -ENOLINK;
2503 } 2513 }
@@ -2522,8 +2532,13 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
2522 2532
2523 mutex_lock(&ifmgd->mtx); 2533 mutex_lock(&ifmgd->mtx);
2524 2534
2525 /* cfg80211 should catch that */ 2535 /*
2526 if (WARN_ON(&ifmgd->associated->cbss != req->bss)) { 2536 * cfg80211 should catch this ... but it's racy since
2537 * we can receive a disassoc frame, process it, hand it
2538 * to cfg80211 while that's in a locked section already
2539 * trying to tell us that the user wants to disconnect.
2540 */
2541 if (&ifmgd->associated->cbss != req->bss) {
2527 mutex_unlock(&ifmgd->mtx); 2542 mutex_unlock(&ifmgd->mtx);
2528 return -ENOLINK; 2543 return -ENOLINK;
2529 } 2544 }