aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-27 03:23:48 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-27 11:55:11 -0400
commitdfb89c56add259b72a9c68d6b2846c1cd8c4e4b6 (patch)
tree02a9c8a2995cb7f13b4461837cdf1e14648b1afb /net/mac80211
parentcc45ae547b960b805ee0b201b3807e93a0060472 (diff)
cfg80211: don't allow WoWLAN support without CONFIG_PM
When CONFIG_PM is disabled, no device can possibly support WoWLAN since it can't go to sleep to start with. Due to this, mac80211 had even rejected the hardware registration. By making all the code and data for WoWLAN depend on CONFIG_PM we can promote this runtime error to a compile-time error. Add #ifdef around all WoWLAN code to remove it in systems that don't need it as they never suspend. Cc: Kalle Valo <kvalo@qca.qualcomm.com> Acked-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 0b040fb73673..aded0018f6f3 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -706,12 +706,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
706 local->hw.offchannel_tx_hw_queue >= local->hw.queues)) 706 local->hw.offchannel_tx_hw_queue >= local->hw.queues))
707 return -EINVAL; 707 return -EINVAL;
708 708
709 if ((hw->wiphy->wowlan.flags || hw->wiphy->wowlan.n_patterns)
710#ifdef CONFIG_PM 709#ifdef CONFIG_PM
711 && (!local->ops->suspend || !local->ops->resume) 710 if ((hw->wiphy->wowlan.flags || hw->wiphy->wowlan.n_patterns) &&
712#endif 711 (!local->ops->suspend || !local->ops->resume))
713 )
714 return -EINVAL; 712 return -EINVAL;
713#endif
715 714
716 if ((hw->flags & IEEE80211_HW_SCAN_WHILE_IDLE) && !local->ops->hw_scan) 715 if ((hw->flags & IEEE80211_HW_SCAN_WHILE_IDLE) && !local->ops->hw_scan)
717 return -EINVAL; 716 return -EINVAL;