Skip to contentSkip to conversation

mac80211: stop queues across suspend/resume

PATCH New Johannes Berg 1 participant 1 message Mar 13, 2009 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: stop queues across suspend/resume

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.

---
 net/mac80211/ieee80211_i.h |    1 +
 net/mac80211/pm.c          |    6 ++++++
 2 files changed, 7 insertions(+)
net/mac80211/ieee80211_i.h +1 -0
@@ -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 {
net/mac80211/pm.c +6 -0
@@ -11,6 +11,9 @@ int __ieee80211_suspend(struct ieee80211
 	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_
 	ieee80211_configure_filter(local);
 	netif_addr_unlock_bh(local->mdev);
 
+	ieee80211_wake_queues_by_reason(hw,
+			IEEE80211_QUEUE_STOP_REASON_SUSPEND);
+
 	return 0;
 }