aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-06-03 11:25:34 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-06-03 12:43:34 -0400
commit964dc9e2c3aaccacacd40640964a58544fb5769a (patch)
tree3457e7dfc23df7d2477b57d346886031cb7361d9 /drivers
parente05ecccdf752122a439b03c3190458d2c8f0bac6 (diff)
cfg80211: take WoWLAN support information out of wiphy struct
There's no need to take up the space for devices that don't support WoWLAN, and most drivers can even make the support data static const (except where it's modified at runtime.) Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c24
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c20
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/dev.h3
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/mac80211.c17
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c26
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h1
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c16
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c19
8 files changed, 74 insertions, 52 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 5c9736a94e54..f7995b2b12a4 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -3679,6 +3679,20 @@ err:
3679 return NULL; 3679 return NULL;
3680} 3680}
3681 3681
3682#ifdef CONFIG_PM
3683static const struct wiphy_wowlan_support ath6kl_wowlan_support = {
3684 .flags = WIPHY_WOWLAN_MAGIC_PKT |
3685 WIPHY_WOWLAN_DISCONNECT |
3686 WIPHY_WOWLAN_GTK_REKEY_FAILURE |
3687 WIPHY_WOWLAN_SUPPORTS_GTK_REKEY |
3688 WIPHY_WOWLAN_EAP_IDENTITY_REQ |
3689 WIPHY_WOWLAN_4WAY_HANDSHAKE,
3690 .n_patterns = WOW_MAX_FILTERS_PER_LIST,
3691 .pattern_min_len = 1,
3692 .pattern_max_len = WOW_PATTERN_SIZE,
3693};
3694#endif
3695
3682int ath6kl_cfg80211_init(struct ath6kl *ar) 3696int ath6kl_cfg80211_init(struct ath6kl *ar)
3683{ 3697{
3684 struct wiphy *wiphy = ar->wiphy; 3698 struct wiphy *wiphy = ar->wiphy;
@@ -3772,15 +3786,7 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
3772 wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); 3786 wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
3773 3787
3774#ifdef CONFIG_PM 3788#ifdef CONFIG_PM
3775 wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT | 3789 wiphy->wowlan = &ath6kl_wowlan_support;
3776 WIPHY_WOWLAN_DISCONNECT |
3777 WIPHY_WOWLAN_GTK_REKEY_FAILURE |
3778 WIPHY_WOWLAN_SUPPORTS_GTK_REKEY |
3779 WIPHY_WOWLAN_EAP_IDENTITY_REQ |
3780 WIPHY_WOWLAN_4WAY_HANDSHAKE;
3781 wiphy->wowlan.n_patterns = WOW_MAX_FILTERS_PER_LIST;
3782 wiphy->wowlan.pattern_min_len = 1;
3783 wiphy->wowlan.pattern_max_len = WOW_PATTERN_SIZE;
3784#endif 3790#endif
3785 3791
3786 wiphy->max_sched_scan_ssids = MAX_PROBED_SSIDS; 3792 wiphy->max_sched_scan_ssids = MAX_PROBED_SSIDS;
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 0237b2868961..f993362e9e13 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -755,6 +755,15 @@ static const struct ieee80211_iface_combination if_comb[] = {
755 } 755 }
756}; 756};
757 757
758#ifdef CONFIG_PM
759static const struct wiphy_wowlan_support ath9k_wowlan_support = {
760 .flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT,
761 .n_patterns = MAX_NUM_USER_PATTERN,
762 .pattern_min_len = 1,
763 .pattern_max_len = MAX_PATTERN_SIZE,
764};
765#endif
766
758void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) 767void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
759{ 768{
760 struct ath_hw *ah = sc->sc_ah; 769 struct ath_hw *ah = sc->sc_ah;
@@ -797,15 +806,8 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
797#ifdef CONFIG_PM_SLEEP 806#ifdef CONFIG_PM_SLEEP
798 807
799 if ((ah->caps.hw_caps & ATH9K_HW_WOW_DEVICE_CAPABLE) && 808 if ((ah->caps.hw_caps & ATH9K_HW_WOW_DEVICE_CAPABLE) &&
800 device_can_wakeup(sc->dev)) { 809 device_can_wakeup(sc->dev))
801 810 hw->wiphy->wowlan = &ath9k_wowlan_support;
802 hw->wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT |
803 WIPHY_WOWLAN_DISCONNECT;
804 hw->wiphy->wowlan.n_patterns = MAX_NUM_USER_PATTERN;
805 hw->wiphy->wowlan.pattern_min_len = 1;
806 hw->wiphy->wowlan.pattern_max_len = MAX_PATTERN_SIZE;
807
808 }
809 811
810 atomic_set(&sc->wow_sleep_proc_intr, -1); 812 atomic_set(&sc->wow_sleep_proc_intr, -1);
811 atomic_set(&sc->wow_got_bmiss_intr, -1); 813 atomic_set(&sc->wow_got_bmiss_intr, -1);
diff --git a/drivers/net/wireless/iwlwifi/dvm/dev.h b/drivers/net/wireless/iwlwifi/dvm/dev.h
index 71ea77576d22..e71acfd344aa 100644
--- a/drivers/net/wireless/iwlwifi/dvm/dev.h
+++ b/drivers/net/wireless/iwlwifi/dvm/dev.h
@@ -870,6 +870,9 @@ struct iwl_priv {
870 __le64 replay_ctr; 870 __le64 replay_ctr;
871 __le16 last_seq_ctl; 871 __le16 last_seq_ctl;
872 bool have_rekey_data; 872 bool have_rekey_data;
873#ifdef CONFIG_PM_SLEEP
874 struct wiphy_wowlan_support wowlan_support;
875#endif
873 876
874 /* device_pointers: pointers to ucode event tables */ 877 /* device_pointers: pointers to ucode event tables */
875 struct { 878 struct {
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index cab23af0be9e..661b5e71aac8 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -208,20 +208,21 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
208 priv->trans->ops->d3_suspend && 208 priv->trans->ops->d3_suspend &&
209 priv->trans->ops->d3_resume && 209 priv->trans->ops->d3_resume &&
210 device_can_wakeup(priv->trans->dev)) { 210 device_can_wakeup(priv->trans->dev)) {
211 hw->wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT | 211 priv->wowlan_support.flags = WIPHY_WOWLAN_MAGIC_PKT |
212 WIPHY_WOWLAN_DISCONNECT | 212 WIPHY_WOWLAN_DISCONNECT |
213 WIPHY_WOWLAN_EAP_IDENTITY_REQ | 213 WIPHY_WOWLAN_EAP_IDENTITY_REQ |
214 WIPHY_WOWLAN_RFKILL_RELEASE; 214 WIPHY_WOWLAN_RFKILL_RELEASE;
215 if (!iwlwifi_mod_params.sw_crypto) 215 if (!iwlwifi_mod_params.sw_crypto)
216 hw->wiphy->wowlan.flags |= 216 priv->wowlan_support.flags |=
217 WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | 217 WIPHY_WOWLAN_SUPPORTS_GTK_REKEY |
218 WIPHY_WOWLAN_GTK_REKEY_FAILURE; 218 WIPHY_WOWLAN_GTK_REKEY_FAILURE;
219 219
220 hw->wiphy->wowlan.n_patterns = IWLAGN_WOWLAN_MAX_PATTERNS; 220 priv->wowlan_support.n_patterns = IWLAGN_WOWLAN_MAX_PATTERNS;
221 hw->wiphy->wowlan.pattern_min_len = 221 priv->wowlan_support.pattern_min_len =
222 IWLAGN_WOWLAN_MIN_PATTERN_LEN; 222 IWLAGN_WOWLAN_MIN_PATTERN_LEN;
223 hw->wiphy->wowlan.pattern_max_len = 223 priv->wowlan_support.pattern_max_len =
224 IWLAGN_WOWLAN_MAX_PATTERN_LEN; 224 IWLAGN_WOWLAN_MAX_PATTERN_LEN;
225 hw->wiphy->wowlan = &priv->wowlan_support;
225 } 226 }
226#endif 227#endif
227 228
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index dd158ec571fb..827fa641490f 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -222,20 +222,20 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
222 mvm->trans->ops->d3_suspend && 222 mvm->trans->ops->d3_suspend &&
223 mvm->trans->ops->d3_resume && 223 mvm->trans->ops->d3_resume &&
224 device_can_wakeup(mvm->trans->dev)) { 224 device_can_wakeup(mvm->trans->dev)) {
225 hw->wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT | 225 mvm->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT |
226 WIPHY_WOWLAN_DISCONNECT | 226 WIPHY_WOWLAN_DISCONNECT |
227 WIPHY_WOWLAN_EAP_IDENTITY_REQ | 227 WIPHY_WOWLAN_EAP_IDENTITY_REQ |
228 WIPHY_WOWLAN_RFKILL_RELEASE; 228 WIPHY_WOWLAN_RFKILL_RELEASE;
229 if (!iwlwifi_mod_params.sw_crypto) 229 if (!iwlwifi_mod_params.sw_crypto)
230 hw->wiphy->wowlan.flags |= 230 mvm->wowlan.flags |= WIPHY_WOWLAN_SUPPORTS_GTK_REKEY |
231 WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | 231 WIPHY_WOWLAN_GTK_REKEY_FAILURE |
232 WIPHY_WOWLAN_GTK_REKEY_FAILURE | 232 WIPHY_WOWLAN_4WAY_HANDSHAKE;
233 WIPHY_WOWLAN_4WAY_HANDSHAKE; 233
234 234 mvm->wowlan.n_patterns = IWL_WOWLAN_MAX_PATTERNS;
235 hw->wiphy->wowlan.n_patterns = IWL_WOWLAN_MAX_PATTERNS; 235 mvm->wowlan.pattern_min_len = IWL_WOWLAN_MIN_PATTERN_LEN;
236 hw->wiphy->wowlan.pattern_min_len = IWL_WOWLAN_MIN_PATTERN_LEN; 236 mvm->wowlan.pattern_max_len = IWL_WOWLAN_MAX_PATTERN_LEN;
237 hw->wiphy->wowlan.pattern_max_len = IWL_WOWLAN_MAX_PATTERN_LEN; 237 mvm->wowlan.tcp = &iwl_mvm_wowlan_tcp_support;
238 hw->wiphy->wowlan.tcp = &iwl_mvm_wowlan_tcp_support; 238 hw->wiphy->wowlan = &mvm->wowlan;
239 } 239 }
240#endif 240#endif
241 241
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 8269bc562951..b62a948658ac 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -336,6 +336,7 @@ struct iwl_mvm {
336 struct ieee80211_vif *p2p_device_vif; 336 struct ieee80211_vif *p2p_device_vif;
337 337
338#ifdef CONFIG_PM_SLEEP 338#ifdef CONFIG_PM_SLEEP
339 struct wiphy_wowlan_support wowlan;
339 int gtk_ivlen, gtk_icvlen, ptk_ivlen, ptk_icvlen; 340 int gtk_ivlen, gtk_icvlen, ptk_ivlen, ptk_icvlen;
340#endif 341#endif
341 342
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index e42b266a023a..60077895adff 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2426,6 +2426,16 @@ static struct cfg80211_ops mwifiex_cfg80211_ops = {
2426#endif 2426#endif
2427}; 2427};
2428 2428
2429#ifdef CONFIG_PM
2430static const struct wiphy_wowlan_support mwifiex_wowlan_support = {
2431 .flags = WIPHY_WOWLAN_MAGIC_PKT,
2432 .n_patterns = MWIFIEX_MAX_FILTERS,
2433 .pattern_min_len = 1,
2434 .pattern_max_len = MWIFIEX_MAX_PATTERN_LEN,
2435 .max_pkt_offset = MWIFIEX_MAX_OFFSET_LEN,
2436};
2437#endif
2438
2429/* 2439/*
2430 * This function registers the device with CFG802.11 subsystem. 2440 * This function registers the device with CFG802.11 subsystem.
2431 * 2441 *
@@ -2483,11 +2493,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
2483 wiphy_apply_custom_regulatory(wiphy, &mwifiex_world_regdom_custom); 2493 wiphy_apply_custom_regulatory(wiphy, &mwifiex_world_regdom_custom);
2484 2494
2485#ifdef CONFIG_PM 2495#ifdef CONFIG_PM
2486 wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT; 2496 wiphy->wowlan = &mwifiex_wowlan_support;
2487 wiphy->wowlan.n_patterns = MWIFIEX_MAX_FILTERS;
2488 wiphy->wowlan.pattern_min_len = 1;
2489 wiphy->wowlan.pattern_max_len = MWIFIEX_MAX_PATTERN_LEN;
2490 wiphy->wowlan.max_pkt_offset = MWIFIEX_MAX_OFFSET_LEN;
2491#endif 2497#endif
2492 2498
2493 wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | 2499 wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS |
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 953111a502ee..796928ba875f 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -6018,6 +6018,15 @@ int wlcore_free_hw(struct wl1271 *wl)
6018} 6018}
6019EXPORT_SYMBOL_GPL(wlcore_free_hw); 6019EXPORT_SYMBOL_GPL(wlcore_free_hw);
6020 6020
6021#ifdef CONFIG_PM
6022static const struct wiphy_wowlan_support wlcore_wowlan_support = {
6023 .flags = WIPHY_WOWLAN_ANY,
6024 .n_patterns = WL1271_MAX_RX_FILTERS,
6025 .pattern_min_len = 1,
6026 .pattern_max_len = WL1271_RX_FILTER_MAX_PATTERN_SIZE,
6027};
6028#endif
6029
6021static void wlcore_nvs_cb(const struct firmware *fw, void *context) 6030static void wlcore_nvs_cb(const struct firmware *fw, void *context)
6022{ 6031{
6023 struct wl1271 *wl = context; 6032 struct wl1271 *wl = context;
@@ -6071,14 +6080,8 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
6071 if (!ret) { 6080 if (!ret) {
6072 wl->irq_wake_enabled = true; 6081 wl->irq_wake_enabled = true;
6073 device_init_wakeup(wl->dev, 1); 6082 device_init_wakeup(wl->dev, 1);
6074 if (pdata->pwr_in_suspend) { 6083 if (pdata->pwr_in_suspend)
6075 wl->hw->wiphy->wowlan.flags = WIPHY_WOWLAN_ANY; 6084 wl->hw->wiphy->wowlan = &wlcore_wowlan_support;
6076 wl->hw->wiphy->wowlan.n_patterns =
6077 WL1271_MAX_RX_FILTERS;
6078 wl->hw->wiphy->wowlan.pattern_min_len = 1;
6079 wl->hw->wiphy->wowlan.pattern_max_len =
6080 WL1271_RX_FILTER_MAX_PATTERN_SIZE;
6081 }
6082 } 6085 }
6083#endif 6086#endif
6084 disable_irq(wl->irq); 6087 disable_irq(wl->irq);