aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-11-11 16:15:29 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 14:51:46 -0500
commita2f73b6c5db3c272d87eaebb5bed355d75a0f25f (patch)
tree1cf299d0c5b2287afe742430d7e15cb3c1d43b4f /drivers/net/wireless
parentca91dc97b8a0ffd05721806654eaff2cf13ba5cb (diff)
cfg80211: move regulatory flags to their own variable
We'll expand this later, this will make it easier to classify and review what things are related to regulatory or not. Coccinelle only missed 4 hits, which I had to do manually, supplying the SmPL in case of merge conflicts. @@ struct wiphy *wiphy; @@ -wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY +wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG @@ expression e; @@ -e->flags |= WIPHY_FLAG_CUSTOM_REGULATORY +e->regulatory_flags |= REGULATORY_CUSTOM_REG @@ struct wiphy *wiphy; @@ -wiphy->flags &= ~WIPHY_FLAG_CUSTOM_REGULATORY +wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG @@ struct wiphy *wiphy; @@ -wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY +wiphy->regulatory_flags & REGULATORY_CUSTOM_REG @@ struct wiphy *wiphy; @@ -wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY +wiphy->regulatory_flags |= REGULATORY_STRICT_REG @@ expression e; @@ -e->flags |= WIPHY_FLAG_STRICT_REGULATORY +e->regulatory_flags |= REGULATORY_STRICT_REG @@ struct wiphy *wiphy; @@ -wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY +wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG @@ struct wiphy *wiphy; @@ -wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY +wiphy->regulatory_flags & REGULATORY_STRICT_REG @@ struct wiphy *wiphy; @@ -wiphy->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS +wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS @@ expression e; @@ -e->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS +e->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS @@ struct wiphy *wiphy; @@ -wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS +wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS @@ struct wiphy *wiphy; @@ -wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS +wiphy->regulatory_flags & REGULATORY_DISABLE_BEACON_HINTS Generated-by: Coccinelle SmPL Cc: Julia Lawall <julia.lawall@lip6.fr> Cc: Peter Senna Tschudin <peter.senna@gmail.com> Cc: Mihir Shete <smihir@qti.qualcomm.com> Cc: Henri Bahini <hbahini@qca.qualcomm.com> Cc: Tushnim Bhattacharyya <tushnimb@qca.qualcomm.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> [fix up whitespace damage, overly long lines] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/regd.c4
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c2
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/channel.c4
-rw-r--r--drivers/net/wireless/iwlegacy/3945-mac.c6
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c6
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/mac80211.c6
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c6
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c25
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c5
-rw-r--r--drivers/net/wireless/rtlwifi/regd.c6
10 files changed, 39 insertions, 31 deletions
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index e93e517a699f..aba782cd09a2 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -601,7 +601,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
601 const struct ieee80211_regdomain *regd; 601 const struct ieee80211_regdomain *regd;
602 602
603 wiphy->reg_notifier = reg_notifier; 603 wiphy->reg_notifier = reg_notifier;
604 wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; 604 wiphy->regulatory_flags |= REGULATORY_STRICT_REG;
605 605
606 if (ath_is_world_regd(reg)) { 606 if (ath_is_world_regd(reg)) {
607 /* 607 /*
@@ -609,7 +609,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
609 * saved on the wiphy orig_* parameters 609 * saved on the wiphy orig_* parameters
610 */ 610 */
611 regd = ath_world_regdomain(reg); 611 regd = ath_world_regdomain(reg);
612 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 612 wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
613 } else { 613 } else {
614 /* 614 /*
615 * This gets applied in the case of the absence of CRDA, 615 * This gets applied in the case of the absence of CRDA,
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index b6a09f97f9a3..1850efa83cf8 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -4341,7 +4341,7 @@ static struct wiphy *brcmf_setup_wiphy(struct device *phydev)
4341 wiphy->max_remain_on_channel_duration = 5000; 4341 wiphy->max_remain_on_channel_duration = 5000;
4342 brcmf_wiphy_pno_params(wiphy); 4342 brcmf_wiphy_pno_params(wiphy);
4343 brcmf_dbg(INFO, "Registering custom regulatory\n"); 4343 brcmf_dbg(INFO, "Registering custom regulatory\n");
4344 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 4344 wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
4345 wiphy_apply_custom_regulatory(wiphy, &brcmf_regdom); 4345 wiphy_apply_custom_regulatory(wiphy, &brcmf_regdom);
4346 err = wiphy_register(wiphy); 4346 err = wiphy_register(wiphy);
4347 if (err < 0) { 4347 if (err < 0) {
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index 7d8f3fd69a87..ef05df04136b 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
@@ -766,8 +766,8 @@ void brcms_c_regd_init(struct brcms_c_info *wlc)
766 } 766 }
767 767
768 wlc->wiphy->reg_notifier = brcms_reg_notifier; 768 wlc->wiphy->reg_notifier = brcms_reg_notifier;
769 wlc->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY | 769 wlc->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG |
770 WIPHY_FLAG_STRICT_REGULATORY; 770 REGULATORY_STRICT_REG;
771 wiphy_apply_custom_regulatory(wlc->wiphy, regd->regdomain); 771 wiphy_apply_custom_regulatory(wlc->wiphy, regd->regdomain);
772 brcms_reg_apply_beaconing_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER); 772 brcms_reg_apply_beaconing_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER);
773} 773}
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 5a66595b0faf..5c3bcedd679b 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3575,9 +3575,9 @@ il3945_setup_mac(struct il_priv *il)
3575 hw->wiphy->interface_modes = 3575 hw->wiphy->interface_modes =
3576 BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); 3576 BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
3577 3577
3578 hw->wiphy->flags |= 3578 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
3579 WIPHY_FLAG_CUSTOM_REGULATORY | WIPHY_FLAG_DISABLE_BEACON_HINTS | 3579 hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG |
3580 WIPHY_FLAG_IBSS_RSN; 3580 REGULATORY_DISABLE_BEACON_HINTS;
3581 3581
3582 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 3582 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
3583 3583
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 1c5f8cdbd3a5..43f488a8cda2 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -5778,9 +5778,9 @@ il4965_mac_setup_register(struct il_priv *il, u32 max_probe_length)
5778 hw->wiphy->interface_modes = 5778 hw->wiphy->interface_modes =
5779 BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); 5779 BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
5780 5780
5781 hw->wiphy->flags |= 5781 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
5782 WIPHY_FLAG_CUSTOM_REGULATORY | WIPHY_FLAG_DISABLE_BEACON_HINTS | 5782 hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG |
5783 WIPHY_FLAG_IBSS_RSN; 5783 REGULATORY_DISABLE_BEACON_HINTS;
5784 5784
5785 /* 5785 /*
5786 * For now, disable PS by default because it affects 5786 * For now, disable PS by default because it affects
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index cae4d3182e33..217f1ca321a0 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -155,9 +155,9 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
155 ARRAY_SIZE(iwlagn_iface_combinations_dualmode); 155 ARRAY_SIZE(iwlagn_iface_combinations_dualmode);
156 } 156 }
157 157
158 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY | 158 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
159 WIPHY_FLAG_DISABLE_BEACON_HINTS | 159 hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG |
160 WIPHY_FLAG_IBSS_RSN; 160 REGULATORY_DISABLE_BEACON_HINTS;
161 161
162#ifdef CONFIG_PM_SLEEP 162#ifdef CONFIG_PM_SLEEP
163 if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len && 163 if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len &&
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 74bc2c8af06d..b56c989ad784 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -199,9 +199,9 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
199 if (IWL_UCODE_API(mvm->fw->ucode_ver) >= 8) 199 if (IWL_UCODE_API(mvm->fw->ucode_ver) >= 8)
200 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC); 200 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC);
201 201
202 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY | 202 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
203 WIPHY_FLAG_DISABLE_BEACON_HINTS | 203 hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG |
204 WIPHY_FLAG_IBSS_RSN; 204 REGULATORY_DISABLE_BEACON_HINTS;
205 205
206 hw->wiphy->iface_combinations = iwl_mvm_iface_combinations; 206 hw->wiphy->iface_combinations = iwl_mvm_iface_combinations;
207 hw->wiphy->n_iface_combinations = 207 hw->wiphy->n_iface_combinations =
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 8c7f4ab70d29..bcc7d8208f23 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2456,46 +2456,53 @@ static int __init init_mac80211_hwsim(void)
2456 break; 2456 break;
2457 case HWSIM_REGTEST_WORLD_ROAM: 2457 case HWSIM_REGTEST_WORLD_ROAM:
2458 if (i == 0) { 2458 if (i == 0) {
2459 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2459 hw->wiphy->regulatory_flags |=
2460 REGULATORY_CUSTOM_REG;
2460 wiphy_apply_custom_regulatory(hw->wiphy, 2461 wiphy_apply_custom_regulatory(hw->wiphy,
2461 &hwsim_world_regdom_custom_01); 2462 &hwsim_world_regdom_custom_01);
2462 } 2463 }
2463 break; 2464 break;
2464 case HWSIM_REGTEST_CUSTOM_WORLD: 2465 case HWSIM_REGTEST_CUSTOM_WORLD:
2465 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2466 hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
2466 wiphy_apply_custom_regulatory(hw->wiphy, 2467 wiphy_apply_custom_regulatory(hw->wiphy,
2467 &hwsim_world_regdom_custom_01); 2468 &hwsim_world_regdom_custom_01);
2468 break; 2469 break;
2469 case HWSIM_REGTEST_CUSTOM_WORLD_2: 2470 case HWSIM_REGTEST_CUSTOM_WORLD_2:
2470 if (i == 0) { 2471 if (i == 0) {
2471 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2472 hw->wiphy->regulatory_flags |=
2473 REGULATORY_CUSTOM_REG;
2472 wiphy_apply_custom_regulatory(hw->wiphy, 2474 wiphy_apply_custom_regulatory(hw->wiphy,
2473 &hwsim_world_regdom_custom_01); 2475 &hwsim_world_regdom_custom_01);
2474 } else if (i == 1) { 2476 } else if (i == 1) {
2475 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2477 hw->wiphy->regulatory_flags |=
2478 REGULATORY_CUSTOM_REG;
2476 wiphy_apply_custom_regulatory(hw->wiphy, 2479 wiphy_apply_custom_regulatory(hw->wiphy,
2477 &hwsim_world_regdom_custom_02); 2480 &hwsim_world_regdom_custom_02);
2478 } 2481 }
2479 break; 2482 break;
2480 case HWSIM_REGTEST_STRICT_ALL: 2483 case HWSIM_REGTEST_STRICT_ALL:
2481 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; 2484 hw->wiphy->regulatory_flags |= REGULATORY_STRICT_REG;
2482 break; 2485 break;
2483 case HWSIM_REGTEST_STRICT_FOLLOW: 2486 case HWSIM_REGTEST_STRICT_FOLLOW:
2484 case HWSIM_REGTEST_STRICT_AND_DRIVER_REG: 2487 case HWSIM_REGTEST_STRICT_AND_DRIVER_REG:
2485 if (i == 0) 2488 if (i == 0)
2486 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; 2489 hw->wiphy->regulatory_flags |=
2490 REGULATORY_STRICT_REG;
2487 break; 2491 break;
2488 case HWSIM_REGTEST_ALL: 2492 case HWSIM_REGTEST_ALL:
2489 if (i == 0) { 2493 if (i == 0) {
2490 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2494 hw->wiphy->regulatory_flags |=
2495 REGULATORY_CUSTOM_REG;
2491 wiphy_apply_custom_regulatory(hw->wiphy, 2496 wiphy_apply_custom_regulatory(hw->wiphy,
2492 &hwsim_world_regdom_custom_01); 2497 &hwsim_world_regdom_custom_01);
2493 } else if (i == 1) { 2498 } else if (i == 1) {
2494 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2499 hw->wiphy->regulatory_flags |=
2500 REGULATORY_CUSTOM_REG;
2495 wiphy_apply_custom_regulatory(hw->wiphy, 2501 wiphy_apply_custom_regulatory(hw->wiphy,
2496 &hwsim_world_regdom_custom_02); 2502 &hwsim_world_regdom_custom_02);
2497 } else if (i == 4) 2503 } else if (i == 4)
2498 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; 2504 hw->wiphy->regulatory_flags |=
2505 REGULATORY_STRICT_REG;
2499 break; 2506 break;
2500 default: 2507 default:
2501 break; 2508 break;
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 7f68943f02c2..d6d1d91a26dc 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2687,9 +2687,10 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
2687 wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME | 2687 wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME |
2688 WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | 2688 WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD |
2689 WIPHY_FLAG_AP_UAPSD | 2689 WIPHY_FLAG_AP_UAPSD |
2690 WIPHY_FLAG_CUSTOM_REGULATORY |
2691 WIPHY_FLAG_STRICT_REGULATORY |
2692 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; 2690 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
2691 wiphy->regulatory_flags |=
2692 REGULATORY_CUSTOM_REG |
2693 REGULATORY_STRICT_REG;
2693 2694
2694 wiphy_apply_custom_regulatory(wiphy, &mwifiex_world_regdom_custom); 2695 wiphy_apply_custom_regulatory(wiphy, &mwifiex_world_regdom_custom);
2695 2696
diff --git a/drivers/net/wireless/rtlwifi/regd.c b/drivers/net/wireless/rtlwifi/regd.c
index 8453c53143f5..89e36568e70f 100644
--- a/drivers/net/wireless/rtlwifi/regd.c
+++ b/drivers/net/wireless/rtlwifi/regd.c
@@ -344,9 +344,9 @@ static int _rtl_regd_init_wiphy(struct rtl_regulatory *reg,
344 344
345 wiphy->reg_notifier = reg_notifier; 345 wiphy->reg_notifier = reg_notifier;
346 346
347 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 347 wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
348 wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY; 348 wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG;
349 wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS; 349 wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
350 350
351 regd = _rtl_regdomain_select(reg); 351 regd = _rtl_regdomain_select(reg);
352 wiphy_apply_custom_regulatory(wiphy, regd); 352 wiphy_apply_custom_regulatory(wiphy, regd);