aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-06 21:45:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:02:30 -0400
commit77fdaa12cea26c204cc12c312fe40bc0f3dcdfd8 (patch)
treec28fdd28f2ca2783783adb4b5e13b7ba57a223a3 /net/mac80211/iface.c
parenta7c1cfc9616ee76213a6d4fd4c17f13fdc92ddce (diff)
mac80211: rework MLME for multiple authentications
Sit tight. This shakes up the world as you know it. Let go of your spaghetti tongs, they will no longer be required, the horrible statemachine in net/mac80211/mlme.c is no more... With the cfg80211 SME mac80211 now has much less to keep track of, but, on the other hand, for FT it needs to be able to keep track of at least one authentication being in progress while associated. So convert from a single state machine to having small ones for all the different things we need to do. For real FT it will still need work wrt. PS, but this should be a good step. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r--net/mac80211/iface.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index b87bf425f85..4839a2d97a3 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -233,9 +233,6 @@ static int ieee80211_open(struct net_device *dev)
233 ieee80211_configure_filter(local); 233 ieee80211_configure_filter(local);
234 netif_addr_unlock_bh(local->mdev); 234 netif_addr_unlock_bh(local->mdev);
235 break; 235 break;
236 case NL80211_IFTYPE_STATION:
237 sdata->u.mgd.flags &= ~IEEE80211_STA_PREV_BSSID_SET;
238 /* fall through */
239 default: 236 default:
240 conf.vif = &sdata->vif; 237 conf.vif = &sdata->vif;
241 conf.type = sdata->vif.type; 238 conf.type = sdata->vif.type;
@@ -366,18 +363,6 @@ static int ieee80211_stop(struct net_device *dev)
366 rcu_read_unlock(); 363 rcu_read_unlock();
367 364
368 /* 365 /*
369 * Announce that we are leaving the network, in case we are a
370 * station interface type. This must be done before removing
371 * all stations associated with sta_info_flush, otherwise STA
372 * information will be gone and no announce being done.
373 */
374 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
375 if (sdata->u.mgd.state != IEEE80211_STA_MLME_DISABLED)
376 ieee80211_sta_deauthenticate(sdata,
377 WLAN_REASON_DEAUTH_LEAVING);
378 }
379
380 /*
381 * Remove all stations associated with this interface. 366 * Remove all stations associated with this interface.
382 * 367 *
383 * This must be done before calling ops->remove_interface() 368 * This must be done before calling ops->remove_interface()
@@ -462,7 +447,6 @@ static int ieee80211_stop(struct net_device *dev)
462 netif_addr_unlock_bh(local->mdev); 447 netif_addr_unlock_bh(local->mdev);
463 break; 448 break;
464 case NL80211_IFTYPE_STATION: 449 case NL80211_IFTYPE_STATION:
465 memset(sdata->u.mgd.bssid, 0, ETH_ALEN);
466 del_timer_sync(&sdata->u.mgd.chswitch_timer); 450 del_timer_sync(&sdata->u.mgd.chswitch_timer);
467 del_timer_sync(&sdata->u.mgd.timer); 451 del_timer_sync(&sdata->u.mgd.timer);
468 /* 452 /*
@@ -485,10 +469,6 @@ static int ieee80211_stop(struct net_device *dev)
485 */ 469 */
486 synchronize_rcu(); 470 synchronize_rcu();
487 skb_queue_purge(&sdata->u.mgd.skb_queue); 471 skb_queue_purge(&sdata->u.mgd.skb_queue);
488
489 kfree(sdata->u.mgd.extra_ie);
490 sdata->u.mgd.extra_ie = NULL;
491 sdata->u.mgd.extra_ie_len = 0;
492 /* fall through */ 472 /* fall through */
493 case NL80211_IFTYPE_ADHOC: 473 case NL80211_IFTYPE_ADHOC:
494 if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { 474 if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
@@ -650,11 +630,6 @@ static void ieee80211_teardown_sdata(struct net_device *dev)
650 kfree_skb(sdata->u.ibss.presp); 630 kfree_skb(sdata->u.ibss.presp);
651 break; 631 break;
652 case NL80211_IFTYPE_STATION: 632 case NL80211_IFTYPE_STATION:
653 kfree(sdata->u.mgd.extra_ie);
654 kfree(sdata->u.mgd.assocreq_ies);
655 kfree(sdata->u.mgd.assocresp_ies);
656 kfree(sdata->u.mgd.sme_auth_ie);
657 break;
658 case NL80211_IFTYPE_WDS: 633 case NL80211_IFTYPE_WDS:
659 case NL80211_IFTYPE_AP_VLAN: 634 case NL80211_IFTYPE_AP_VLAN:
660 case NL80211_IFTYPE_MONITOR: 635 case NL80211_IFTYPE_MONITOR:
@@ -937,7 +912,8 @@ u32 __ieee80211_recalc_idle(struct ieee80211_local *local)
937 continue; 912 continue;
938 /* do not count disabled managed interfaces */ 913 /* do not count disabled managed interfaces */
939 if (sdata->vif.type == NL80211_IFTYPE_STATION && 914 if (sdata->vif.type == NL80211_IFTYPE_STATION &&
940 sdata->u.mgd.state == IEEE80211_STA_MLME_DISABLED) 915 !sdata->u.mgd.associated &&
916 list_empty(&sdata->u.mgd.work_list))
941 continue; 917 continue;
942 /* do not count unused IBSS interfaces */ 918 /* do not count unused IBSS interfaces */
943 if (sdata->vif.type == NL80211_IFTYPE_ADHOC && 919 if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&