diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index baaa860..7a3d675 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -748,8 +748,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, sdata->dev->addr_len); spin_unlock_bh(&local->filter_lock); netif_addr_unlock_bh(sdata->dev); - - ieee80211_configure_filter(local); + /* configure filter latter (if not suspended) */ } del_timer_sync(&local->dynamic_ps_timer); @@ -814,10 +813,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, } ieee80211_adjust_monitor_flags(sdata, -1); - ieee80211_configure_filter(local); - mutex_lock(&local->mtx); - ieee80211_recalc_idle(local); - mutex_unlock(&local->mtx); + /* tell driver latter (if not suspended) */ break; case NL80211_IFTYPE_P2P_DEVICE: /* relies on synchronize_rcu() below */ @@ -848,28 +844,31 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, drv_remove_interface_debugfs(local, sdata); - if (going_down) + if (going_down && !local->suspended) drv_remove_interface(local, sdata); } sdata->bss = NULL; - ieee80211_recalc_ps(local, -1); - - if (local->open_count == 0) { - if (local->ops->napi_poll) - napi_disable(&local->napi); - ieee80211_clear_tx_pending(local); - ieee80211_stop_device(local); - - /* no reconfiguring after stop! */ - hw_reconf_flags = 0; + if (!local->suspended) { + if (local->open_count == 0) { + if (local->ops->napi_poll) + napi_disable(&local->napi); + ieee80211_clear_tx_pending(local); + ieee80211_stop_device(local); + } else { + ieee80211_configure_filter(local); + ieee80211_recalc_ps(local, -1); + + mutex_lock(&local->mtx); + ieee80211_recalc_idle(local); + mutex_unlock(&local->mtx); + + if (hw_reconf_flags) + ieee80211_hw_config(local, hw_reconf_flags); + } } - /* do after stop to avoid reconfiguring when we stop anyway */ - if (hw_reconf_flags) - ieee80211_hw_config(local, hw_reconf_flags); - spin_lock_irqsave(&local->queue_stop_reason_lock, flags); for (i = 0; i < IEEE80211_MAX_QUEUES; i++) { skb_queue_walk_safe(&local->pending[i], skb, tmp) {