mac80211: allow station add/remove to sleep
[safe/jmp/linux-2.6] / net / mac80211 / pm.c
index 47f8189..0e64484 100644 (file)
@@ -11,7 +11,6 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
        struct ieee80211_local *local = hw_to_local(hw);
        struct ieee80211_sub_if_data *sdata;
        struct sta_info *sta;
-       unsigned long flags;
 
        ieee80211_scan_cancel(local);
 
@@ -55,22 +54,21 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
        rcu_read_unlock();
 
        /* remove STAs */
-       spin_lock_irqsave(&local->sta_lock, flags);
+       mutex_lock(&local->sta_mtx);
        list_for_each_entry(sta, &local->sta_list, list) {
-               if (local->ops->sta_notify) {
+               if (sta->uploaded) {
                        sdata = sta->sdata;
                        if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
                                sdata = container_of(sdata->bss,
                                             struct ieee80211_sub_if_data,
                                             u.ap);
 
-                       drv_sta_notify(local, sdata, STA_NOTIFY_REMOVE,
-                                      &sta->sta);
+                       drv_sta_remove(local, sdata, &sta->sta);
                }
 
                mesh_plink_quiesce(sta);
        }
-       spin_unlock_irqrestore(&local->sta_lock, flags);
+       mutex_unlock(&local->sta_mtx);
 
        /* remove all interfaces */
        list_for_each_entry(sdata, &local->interfaces, list) {