mac80211: stop queues across suspend/resume
authorJohannes Berg <johannes@sipsolutions.net>
Fri, 13 Mar 2009 10:43:36 +0000 (11:43 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Sat, 28 Mar 2009 00:12:52 +0000 (20:12 -0400)
Even though userland probably cannot submit packets, there might
still be some coming, and that's no good when the driver doesn't
expect them. Stop the queues across suspend/resume.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/ieee80211_i.h
net/mac80211/pm.c

index fbb91f1aebb2a9775a5093937bfde9091c27c078..ad12c2a03a955674ecf92d68decaa82d1b871315 100644 (file)
@@ -598,6 +598,7 @@ enum queue_stop_reason {
        IEEE80211_QUEUE_STOP_REASON_PS,
        IEEE80211_QUEUE_STOP_REASON_CSA,
        IEEE80211_QUEUE_STOP_REASON_AGGREGATION,
+       IEEE80211_QUEUE_STOP_REASON_SUSPEND,
 };
 
 struct ieee80211_master_priv {
index 44525f51707733f47ed10704828387690e023ca9..c923ceb089a36f81fa296220565d700768cbef65 100644 (file)
@@ -11,6 +11,9 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
        struct ieee80211_if_init_conf conf;
        struct sta_info *sta;
 
+       ieee80211_stop_queues_by_reason(hw,
+                       IEEE80211_QUEUE_STOP_REASON_SUSPEND);
+
        flush_workqueue(local->hw.workqueue);
 
        /* disable keys */
@@ -113,5 +116,8 @@ int __ieee80211_resume(struct ieee80211_hw *hw)
        ieee80211_configure_filter(local);
        netif_addr_unlock_bh(local->mdev);
 
+       ieee80211_wake_queues_by_reason(hw,
+                       IEEE80211_QUEUE_STOP_REASON_SUSPEND);
+
        return 0;
 }