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>
This commit is contained in:
@@ -421,9 +421,11 @@ int wiphy_register(struct wiphy *wiphy)
|
||||
int i;
|
||||
u16 ifmodes = wiphy->interface_modes;
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
if (WARN_ON((wiphy->wowlan.flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) &&
|
||||
!(wiphy->wowlan.flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY)))
|
||||
return -EINVAL;
|
||||
#endif
|
||||
|
||||
if (WARN_ON(wiphy->ap_sme_capa &&
|
||||
!(wiphy->flags & WIPHY_FLAG_HAVE_AP_SME)))
|
||||
@@ -500,12 +502,14 @@ int wiphy_register(struct wiphy *wiphy)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
if (rdev->wiphy.wowlan.n_patterns) {
|
||||
if (WARN_ON(!rdev->wiphy.wowlan.pattern_min_len ||
|
||||
rdev->wiphy.wowlan.pattern_min_len >
|
||||
rdev->wiphy.wowlan.pattern_max_len))
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* check and set up bitrates */
|
||||
ieee80211_set_bitrate_flags(wiphy);
|
||||
|
Reference in New Issue
Block a user