]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/mac80211/iface.c
mac80211: use common skb queue
[mv-sheeva.git] / net / mac80211 / iface.c
index 50deb017fd6e771c923f91b9e46264017a4e1cf0..56167a3d872dd2127f20ec13d8711b493d09c546 100644 (file)
@@ -268,7 +268,6 @@ static int ieee80211_open(struct net_device *dev)
 
                changed |= ieee80211_reset_erp_info(sdata);
                ieee80211_bss_info_change_notify(sdata, changed);
-               ieee80211_enable_keys(sdata);
 
                if (sdata->vif.type == NL80211_IFTYPE_STATION)
                        netif_carrier_off(dev);
@@ -321,15 +320,6 @@ static int ieee80211_open(struct net_device *dev)
 
        ieee80211_recalc_ps(local, -1);
 
-       /*
-        * ieee80211_sta_work is disabled while network interface
-        * is down. Therefore, some configuration changes may not
-        * yet be effective. Trigger execution of ieee80211_sta_work
-        * to fix this.
-        */
-       if (sdata->vif.type == NL80211_IFTYPE_STATION)
-               ieee80211_queue_work(&local->hw, &sdata->u.mgd.work);
-
        netif_tx_start_all_queues(dev);
 
        return 0;
@@ -349,7 +339,6 @@ static int ieee80211_stop(struct net_device *dev)
 {
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        struct ieee80211_local *local = sdata->local;
-       struct sta_info *sta;
        unsigned long flags;
        struct sk_buff *skb, *tmp;
        u32 hw_reconf_flags = 0;
@@ -365,18 +354,6 @@ static int ieee80211_stop(struct net_device *dev)
         */
        ieee80211_work_purge(sdata);
 
-       /*
-        * Now delete all active aggregation sessions.
-        */
-       rcu_read_lock();
-
-       list_for_each_entry_rcu(sta, &local->sta_list, list) {
-               if (sta->sdata == sdata)
-                       ieee80211_sta_tear_down_BA_sessions(sta);
-       }
-
-       rcu_read_unlock();
-
        /*
         * Remove all stations associated with this interface.
         *
@@ -488,21 +465,11 @@ static int ieee80211_stop(struct net_device *dev)
                cancel_work_sync(&sdata->u.mgd.monitor_work);
                cancel_work_sync(&sdata->u.mgd.beacon_connection_loss_work);
 
-               /*
-                * When we get here, the interface is marked down.
-                * Call synchronize_rcu() to wait for the RX path
-                * should it be using the interface and enqueuing
-                * frames at this very time on another CPU.
-                */
-               synchronize_rcu();
-               skb_queue_purge(&sdata->u.mgd.skb_queue);
                /* fall through */
        case NL80211_IFTYPE_ADHOC:
                if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
                        del_timer_sync(&sdata->u.ibss.timer);
                        cancel_work_sync(&sdata->u.ibss.work);
-                       synchronize_rcu();
-                       skb_queue_purge(&sdata->u.ibss.skb_queue);
                }
                /* fall through */
        case NL80211_IFTYPE_MESH_POINT:
@@ -518,6 +485,15 @@ static int ieee80211_stop(struct net_device *dev)
                }
                /* fall through */
        default:
+               /*
+                * When we get here, the interface is marked down.
+                * Call synchronize_rcu() to wait for the RX path
+                * should it be using the interface and enqueuing
+                * frames at this very time on another CPU.
+                */
+               synchronize_rcu();
+               skb_queue_purge(&sdata->skb_queue);
+
                if (local->scan_sdata == sdata)
                        ieee80211_scan_cancel(local);
 
@@ -531,8 +507,8 @@ static int ieee80211_stop(struct net_device *dev)
                                BSS_CHANGED_BEACON_ENABLED);
                }
 
-               /* disable all keys for as long as this netdev is down */
-               ieee80211_disable_keys(sdata);
+               /* free all remaining keys, there shouldn't be any */
+               ieee80211_free_keys(sdata);
                drv_remove_interface(local, &sdata->vif);
        }
 
@@ -744,6 +720,8 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
        /* only monitor differs */
        sdata->dev->type = ARPHRD_ETHER;
 
+       skb_queue_head_init(&sdata->skb_queue);
+
        switch (type) {
        case NL80211_IFTYPE_AP:
                skb_queue_head_init(&sdata->u.ap.ps_bc_buf);