From 8125696991194aacb1173b6e8196d19098b44e17 Mon Sep 17 00:00:00 2001 From: Stanislaw Gruszka Date: Thu, 28 Feb 2013 10:55:25 +0100 Subject: cfg80211/mac80211: disconnect on suspend If possible that after suspend, cfg80211 will receive request to disconnect what require action on interface that was removed during suspend. Problem can manifest itself by various warnings similar to below one: WARNING: at net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211]() wlan0: Failed check-sdata-in-driver check, flags: 0x4 Call Trace: [] warn_slowpath_fmt+0x33/0x40 [] ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211] [] ieee80211_recalc_ps_vif+0x2a/0x30 [mac80211] [] ieee80211_set_disassoc+0xf6/0x500 [mac80211] [] ieee80211_mgd_deauth+0x1f1/0x280 [mac80211] [] ieee80211_deauth+0x16/0x20 [mac80211] [] cfg80211_mlme_down+0x70/0xc0 [cfg80211] [] __cfg80211_disconnect+0x1b1/0x1d0 [cfg80211] To fix the problem disconnect from any associated network before suspend. User space is responsible to establish connection again after resume. This basically need to be done by user space anyway, because associated stations can go away during suspend (for example NetworkManager disconnects on suspend and connect on resume by default). Patch also handle situation when driver refuse to suspend with wowlan configured and try to suspend again without it. Signed-off-by: Stanislaw Gruszka Signed-off-by: Johannes Berg --- net/wireless/rdev-ops.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'net/wireless/rdev-ops.h') diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h index 8c8b26f574e8..d77e1c1d3a0e 100644 --- a/net/wireless/rdev-ops.h +++ b/net/wireless/rdev-ops.h @@ -6,11 +6,12 @@ #include "core.h" #include "trace.h" -static inline int rdev_suspend(struct cfg80211_registered_device *rdev) +static inline int rdev_suspend(struct cfg80211_registered_device *rdev, + struct cfg80211_wowlan *wowlan) { int ret; - trace_rdev_suspend(&rdev->wiphy, rdev->wowlan); - ret = rdev->ops->suspend(&rdev->wiphy, rdev->wowlan); + trace_rdev_suspend(&rdev->wiphy, wowlan); + ret = rdev->ops->suspend(&rdev->wiphy, wowlan); trace_rdev_return_int(&rdev->wiphy, ret); return ret; } -- cgit