ipv6: fib: fix crash when changing large fib while dumping it
[safe/jmp/linux-2.6] / net / mac80211 / pm.c
index 5e3d476..47f8189 100644 (file)
@@ -10,7 +10,6 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
 {
        struct ieee80211_local *local = hw_to_local(hw);
        struct ieee80211_sub_if_data *sdata;
-       struct ieee80211_if_init_conf conf;
        struct sta_info *sta;
        unsigned long flags;
 
@@ -26,7 +25,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
        /* make quiescing visible to timers everywhere */
        mb();
 
-       flush_workqueue(local->hw.workqueue);
+       flush_workqueue(local->workqueue);
 
        /* Don't try to run timers while suspended. */
        del_timer_sync(&local->sta_cleanup);
@@ -65,7 +64,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
                                             struct ieee80211_sub_if_data,
                                             u.ap);
 
-                       drv_sta_notify(local, &sdata->vif, STA_NOTIFY_REMOVE,
+                       drv_sta_notify(local, sdata, STA_NOTIFY_REMOVE,
                                       &sta->sta);
                }
 
@@ -93,27 +92,19 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
                        break;
                }
 
-               if (!netif_running(sdata->dev))
+               if (!ieee80211_sdata_running(sdata))
                        continue;
 
-               conf.vif = &sdata->vif;
-               conf.type = sdata->vif.type;
-               conf.mac_addr = sdata->dev->dev_addr;
-               drv_remove_interface(local, &conf);
-       }
+               /* disable beaconing */
+               ieee80211_bss_info_change_notify(sdata,
+                       BSS_CHANGED_BEACON_ENABLED);
 
-       /* stop hardware - this must stop RX */
-       if (local->open_count) {
-               ieee80211_led_radio(local, false);
-               drv_stop(local);
+               drv_remove_interface(local, &sdata->vif);
        }
 
-       /*
-        * flush again, in case driver queued work -- it
-        * shouldn't be doing (or cancel everything in the
-        * stop callback) that but better safe than sorry.
-        */
-       flush_workqueue(local->hw.workqueue);
+       /* stop hardware - this must stop RX */
+       if (local->open_count)
+               ieee80211_stop_device(local);
 
        local->suspended = true;
        /* need suspended to be visible before quiescing is false */