aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2015-07-08 08:41:47 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-07-17 09:40:46 -0400
commitb0485e9f3defbed6effcde595df9b9fdbdb2524e (patch)
tree3c171cd36db7d7efca194599463bd91b059c6966 /net/mac80211/util.c
parent42d8d789615d539cb13733e516b94e874a34f775 (diff)
mac80211: clear local->suspended before calling drv_resume()
Currently, mac80211 calls drv_resume() on wowlan resume, but drops any incoming frame until local->suspended is cleared later on. This requires the low-level driver to support a new state, in which it is expected to fully work (as it was resumed) but not passing rx frames yet (as they will be dropped). iwlwifi (and probably other drivers as well) has issues supporting such mode. Since in the wowlan case we already short-circuit ieee80211_reconfig, there's nothing that prevents us from clearing local->suspend before calling drv_resume(), and letting the low-level driver work normally. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index e54596f95663..1104421bc525 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1716,16 +1716,24 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1716 struct ieee80211_sub_if_data *sched_scan_sdata; 1716 struct ieee80211_sub_if_data *sched_scan_sdata;
1717 struct cfg80211_sched_scan_request *sched_scan_req; 1717 struct cfg80211_sched_scan_request *sched_scan_req;
1718 bool sched_scan_stopped = false; 1718 bool sched_scan_stopped = false;
1719 bool suspended = local->suspended;
1719 1720
1720 /* nothing to do if HW shouldn't run */ 1721 /* nothing to do if HW shouldn't run */
1721 if (!local->open_count) 1722 if (!local->open_count)
1722 goto wake_up; 1723 goto wake_up;
1723 1724
1724#ifdef CONFIG_PM 1725#ifdef CONFIG_PM
1725 if (local->suspended) 1726 if (suspended)
1726 local->resuming = true; 1727 local->resuming = true;
1727 1728
1728 if (local->wowlan) { 1729 if (local->wowlan) {
1730 /*
1731 * In the wowlan case, both mac80211 and the device
1732 * are functional when the resume op is called, so
1733 * clear local->suspended so the device could operate
1734 * normally (e.g. pass rx frames).
1735 */
1736 local->suspended = false;
1729 res = drv_resume(local); 1737 res = drv_resume(local);
1730 local->wowlan = false; 1738 local->wowlan = false;
1731 if (res < 0) { 1739 if (res < 0) {
@@ -1738,8 +1746,10 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1738 /* 1746 /*
1739 * res is 1, which means the driver requested 1747 * res is 1, which means the driver requested
1740 * to go through a regular reset on wakeup. 1748 * to go through a regular reset on wakeup.
1749 * restore local->suspended in this case.
1741 */ 1750 */
1742 reconfig_due_to_wowlan = true; 1751 reconfig_due_to_wowlan = true;
1752 local->suspended = true;
1743 } 1753 }
1744#endif 1754#endif
1745 1755
@@ -1751,7 +1761,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1751 */ 1761 */
1752 res = drv_start(local); 1762 res = drv_start(local);
1753 if (res) { 1763 if (res) {
1754 if (local->suspended) 1764 if (suspended)
1755 WARN(1, "Hardware became unavailable upon resume. This could be a software issue prior to suspend or a hardware issue.\n"); 1765 WARN(1, "Hardware became unavailable upon resume. This could be a software issue prior to suspend or a hardware issue.\n");
1756 else 1766 else
1757 WARN(1, "Hardware became unavailable during restart.\n"); 1767 WARN(1, "Hardware became unavailable during restart.\n");
@@ -2045,10 +2055,10 @@ int ieee80211_reconfig(struct ieee80211_local *local)
2045 * If this is for hw restart things are still running. 2055 * If this is for hw restart things are still running.
2046 * We may want to change that later, however. 2056 * We may want to change that later, however.
2047 */ 2057 */
2048 if (local->open_count && (!local->suspended || reconfig_due_to_wowlan)) 2058 if (local->open_count && (!suspended || reconfig_due_to_wowlan))
2049 drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART); 2059 drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART);
2050 2060
2051 if (!local->suspended) 2061 if (!suspended)
2052 return 0; 2062 return 0;
2053 2063
2054#ifdef CONFIG_PM 2064#ifdef CONFIG_PM