aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-11-18 18:56:28 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-19 11:08:50 -0500
commit5be83de54c16944dea9c16c6a5a53c1fa75ed304 (patch)
treedd251d9331a07ec73c7a4992c79ce30f0553db40
parent9bd568a50c446433038dec2a5186c5c57c3dbd23 (diff)
cfg80211: convert bools into flags
We've accumulated a number of options for wiphys which make more sense as flags as we keep adding more. Convert the existing ones. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/regd.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c6
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c18
-rw-r--r--drivers/net/wireless/p54/main.c2
-rw-r--r--include/net/cfg80211.h62
-rw-r--r--net/mac80211/main.c2
-rw-r--r--net/wireless/Kconfig6
-rw-r--r--net/wireless/core.c13
-rw-r--r--net/wireless/nl80211.c2
-rw-r--r--net/wireless/reg.c13
11 files changed, 70 insertions, 67 deletions
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 077bcc142cde..039ac490465c 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -450,7 +450,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
450 const struct ieee80211_regdomain *regd; 450 const struct ieee80211_regdomain *regd;
451 451
452 wiphy->reg_notifier = reg_notifier; 452 wiphy->reg_notifier = reg_notifier;
453 wiphy->strict_regulatory = true; 453 wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
454 454
455 if (ath_is_world_regd(reg)) { 455 if (ath_is_world_regd(reg)) {
456 /* 456 /*
@@ -458,8 +458,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
458 * saved on the wiphy orig_* parameters 458 * saved on the wiphy orig_* parameters
459 */ 459 */
460 regd = ath_world_regdomain(reg); 460 regd = ath_world_regdomain(reg);
461 wiphy->custom_regulatory = true; 461 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
462 wiphy->strict_regulatory = false;
463 } else { 462 } else {
464 /* 463 /*
465 * This gets applied in the case of the absense of CRDA, 464 * This gets applied in the case of the absense of CRDA,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index b80cd0bc5845..e8f405a01e3d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2400,16 +2400,14 @@ static int iwl_setup_mac(struct iwl_priv *priv)
2400 BIT(NL80211_IFTYPE_STATION) | 2400 BIT(NL80211_IFTYPE_STATION) |
2401 BIT(NL80211_IFTYPE_ADHOC); 2401 BIT(NL80211_IFTYPE_ADHOC);
2402 2402
2403 hw->wiphy->custom_regulatory = true; 2403 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY |
2404 2404 WIPHY_FLAG_DISABLE_BEACON_HINTS;
2405 /* Firmware does not support this */
2406 hw->wiphy->disable_beacon_hints = true;
2407 2405
2408 /* 2406 /*
2409 * For now, disable PS by default because it affects 2407 * For now, disable PS by default because it affects
2410 * RX performance significantly. 2408 * RX performance significantly.
2411 */ 2409 */
2412 hw->wiphy->ps_default = false; 2410 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
2413 2411
2414 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX; 2412 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX;
2415 /* we create the 802.11 header and a zero-length SSID element */ 2413 /* we create the 802.11 header and a zero-length SSID element */
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 31f3c42b835c..5b7e80e5bab4 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3904,10 +3904,8 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)
3904 BIT(NL80211_IFTYPE_STATION) | 3904 BIT(NL80211_IFTYPE_STATION) |
3905 BIT(NL80211_IFTYPE_ADHOC); 3905 BIT(NL80211_IFTYPE_ADHOC);
3906 3906
3907 hw->wiphy->custom_regulatory = true; 3907 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY |
3908 3908 WIPHY_FLAG_DISABLE_BEACON_HINTS;
3909 /* Firmware does not support this */
3910 hw->wiphy->disable_beacon_hints = true;
3911 3909
3912 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945; 3910 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945;
3913 /* we create the 802.11 header and a zero-length SSID element */ 3911 /* we create the 802.11 header and a zero-length SSID element */
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index fc4ec48eda12..88e41176e7fd 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1146,46 +1146,46 @@ static int __init init_mac80211_hwsim(void)
1146 break; 1146 break;
1147 case HWSIM_REGTEST_WORLD_ROAM: 1147 case HWSIM_REGTEST_WORLD_ROAM:
1148 if (i == 0) { 1148 if (i == 0) {
1149 hw->wiphy->custom_regulatory = true; 1149 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
1150 wiphy_apply_custom_regulatory(hw->wiphy, 1150 wiphy_apply_custom_regulatory(hw->wiphy,
1151 &hwsim_world_regdom_custom_01); 1151 &hwsim_world_regdom_custom_01);
1152 } 1152 }
1153 break; 1153 break;
1154 case HWSIM_REGTEST_CUSTOM_WORLD: 1154 case HWSIM_REGTEST_CUSTOM_WORLD:
1155 hw->wiphy->custom_regulatory = true; 1155 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
1156 wiphy_apply_custom_regulatory(hw->wiphy, 1156 wiphy_apply_custom_regulatory(hw->wiphy,
1157 &hwsim_world_regdom_custom_01); 1157 &hwsim_world_regdom_custom_01);
1158 break; 1158 break;
1159 case HWSIM_REGTEST_CUSTOM_WORLD_2: 1159 case HWSIM_REGTEST_CUSTOM_WORLD_2:
1160 if (i == 0) { 1160 if (i == 0) {
1161 hw->wiphy->custom_regulatory = true; 1161 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
1162 wiphy_apply_custom_regulatory(hw->wiphy, 1162 wiphy_apply_custom_regulatory(hw->wiphy,
1163 &hwsim_world_regdom_custom_01); 1163 &hwsim_world_regdom_custom_01);
1164 } else if (i == 1) { 1164 } else if (i == 1) {
1165 hw->wiphy->custom_regulatory = true; 1165 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
1166 wiphy_apply_custom_regulatory(hw->wiphy, 1166 wiphy_apply_custom_regulatory(hw->wiphy,
1167 &hwsim_world_regdom_custom_02); 1167 &hwsim_world_regdom_custom_02);
1168 } 1168 }
1169 break; 1169 break;
1170 case HWSIM_REGTEST_STRICT_ALL: 1170 case HWSIM_REGTEST_STRICT_ALL:
1171 hw->wiphy->strict_regulatory = true; 1171 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
1172 break; 1172 break;
1173 case HWSIM_REGTEST_STRICT_FOLLOW: 1173 case HWSIM_REGTEST_STRICT_FOLLOW:
1174 case HWSIM_REGTEST_STRICT_AND_DRIVER_REG: 1174 case HWSIM_REGTEST_STRICT_AND_DRIVER_REG:
1175 if (i == 0) 1175 if (i == 0)
1176 hw->wiphy->strict_regulatory = true; 1176 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
1177 break; 1177 break;
1178 case HWSIM_REGTEST_ALL: 1178 case HWSIM_REGTEST_ALL:
1179 if (i == 0) { 1179 if (i == 0) {
1180 hw->wiphy->custom_regulatory = true; 1180 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
1181 wiphy_apply_custom_regulatory(hw->wiphy, 1181 wiphy_apply_custom_regulatory(hw->wiphy,
1182 &hwsim_world_regdom_custom_01); 1182 &hwsim_world_regdom_custom_01);
1183 } else if (i == 1) { 1183 } else if (i == 1) {
1184 hw->wiphy->custom_regulatory = true; 1184 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
1185 wiphy_apply_custom_regulatory(hw->wiphy, 1185 wiphy_apply_custom_regulatory(hw->wiphy,
1186 &hwsim_world_regdom_custom_02); 1186 &hwsim_world_regdom_custom_02);
1187 } else if (i == 4) 1187 } else if (i == 4)
1188 hw->wiphy->strict_regulatory = true; 1188 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
1189 break; 1189 break;
1190 default: 1190 default:
1191 break; 1191 break;
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index 4d486bf9f725..18012dbfb45d 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -579,7 +579,7 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len)
579 * For now, disable PS by default because it affects 579 * For now, disable PS by default because it affects
580 * link stability significantly. 580 * link stability significantly.
581 */ 581 */
582 dev->wiphy->ps_default = false; 582 dev->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
583 583
584 mutex_init(&priv->conf_mutex); 584 mutex_init(&priv->conf_mutex);
585 mutex_init(&priv->eeprom_mutex); 585 mutex_init(&priv->eeprom_mutex);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 21710fc17eaf..eca36abca8f5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1108,27 +1108,45 @@ struct cfg80211_ops {
1108 */ 1108 */
1109 1109
1110/** 1110/**
1111 * struct wiphy - wireless hardware description 1111 * enum wiphy_flags - wiphy capability flags
1112 * @idx: the wiphy index assigned to this item 1112 *
1113 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 1113 * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device
1114 * @custom_regulatory: tells us the driver for this device
1115 * has its own custom regulatory domain and cannot identify the 1114 * has its own custom regulatory domain and cannot identify the
1116 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled 1115 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
1117 * we will disregard the first regulatory hint (when the 1116 * we will disregard the first regulatory hint (when the
1118 * initiator is %REGDOM_SET_BY_CORE). 1117 * initiator is %REGDOM_SET_BY_CORE).
1119 * @strict_regulatory: tells us the driver for this device will ignore 1118 * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
1120 * regulatory domain settings until it gets its own regulatory domain 1119 * ignore regulatory domain settings until it gets its own regulatory
1121 * via its regulatory_hint(). After its gets its own regulatory domain 1120 * domain via its regulatory_hint(). After its gets its own regulatory
1122 * it will only allow further regulatory domain settings to further 1121 * domain it will only allow further regulatory domain settings to
1123 * enhance compliance. For example if channel 13 and 14 are disabled 1122 * further enhance compliance. For example if channel 13 and 14 are
1124 * by this regulatory domain no user regulatory domain can enable these 1123 * disabled by this regulatory domain no user regulatory domain can
1125 * channels at a later time. This can be used for devices which do not 1124 * enable these channels at a later time. This can be used for devices
1126 * have calibration information gauranteed for frequencies or settings 1125 * which do not have calibration information gauranteed for frequencies
1127 * outside of its regulatory domain. 1126 * or settings outside of its regulatory domain.
1128 * @disable_beacon_hints: enable this if your driver needs to ensure that 1127 * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
1129 * passive scan flags and beaconing flags may not be lifted by cfg80211 1128 * that passive scan flags and beaconing flags may not be lifted by
1130 * due to regulatory beacon hints. For more information on beacon 1129 * cfg80211 due to regulatory beacon hints. For more information on beacon
1131 * hints read the documenation for regulatory_hint_found_beacon() 1130 * hints read the documenation for regulatory_hint_found_beacon()
1131 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
1132 * wiphy at all
1133 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
1134 * by default -- this flag will be set depending on the kernel's default
1135 * on wiphy_new(), but can be changed by the driver if it has a good
1136 * reason to override the default
1137 */
1138enum wiphy_flags {
1139 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
1140 WIPHY_FLAG_STRICT_REGULATORY = BIT(1),
1141 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2),
1142 WIPHY_FLAG_NETNS_OK = BIT(3),
1143 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
1144};
1145
1146/**
1147 * struct wiphy - wireless hardware description
1148 * @idx: the wiphy index assigned to this item
1149 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
1132 * @reg_notifier: the driver's regulatory notification callback 1150 * @reg_notifier: the driver's regulatory notification callback
1133 * @regd: the driver's regulatory domain, if one was requested via 1151 * @regd: the driver's regulatory domain, if one was requested via
1134 * the regulatory_hint() API. This can be used by the driver 1152 * the regulatory_hint() API. This can be used by the driver
@@ -1143,11 +1161,6 @@ struct cfg80211_ops {
1143 * -1 = fragmentation disabled, only odd values >= 256 used 1161 * -1 = fragmentation disabled, only odd values >= 256 used
1144 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled 1162 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
1145 * @net: the network namespace this wiphy currently lives in 1163 * @net: the network namespace this wiphy currently lives in
1146 * @netnsok: if set to false, do not allow changing the netns of this
1147 * wiphy at all
1148 * @ps_default: default for powersave, will be set depending on the
1149 * kernel's default on wiphy_new(), but can be changed by the
1150 * driver if it has a good reason to override the default
1151 */ 1164 */
1152struct wiphy { 1165struct wiphy {
1153 /* assign these fields before you register the wiphy */ 1166 /* assign these fields before you register the wiphy */
@@ -1158,12 +1171,7 @@ struct wiphy {
1158 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 1171 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
1159 u16 interface_modes; 1172 u16 interface_modes;
1160 1173
1161 bool custom_regulatory; 1174 u32 flags;
1162 bool strict_regulatory;
1163 bool disable_beacon_hints;
1164
1165 bool netnsok;
1166 bool ps_default;
1167 1175
1168 enum cfg80211_signal_type signal_type; 1176 enum cfg80211_signal_type signal_type;
1169 1177
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index e843a912849c..8084b622e97e 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -328,7 +328,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
328 if (!wiphy) 328 if (!wiphy)
329 return NULL; 329 return NULL;
330 330
331 wiphy->netnsok = true; 331 wiphy->flags |= WIPHY_FLAG_NETNS_OK;
332 wiphy->privid = mac80211_wiphy_privid; 332 wiphy->privid = mac80211_wiphy_privid;
333 333
334 /* Yes, putting cfg80211_bss into ieee80211_bss is a hack */ 334 /* Yes, putting cfg80211_bss into ieee80211_bss is a hack */
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index 614bdcec1c80..90e93a5701aa 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -74,12 +74,6 @@ config CFG80211_REG_DEBUG
74 74
75 If unsure, say N. 75 If unsure, say N.
76 76
77config CFG80211_DEFAULT_PS_VALUE
78 int
79 default 1 if CFG80211_DEFAULT_PS
80 default 0
81 depends on CFG80211
82
83config CFG80211_DEFAULT_PS 77config CFG80211_DEFAULT_PS
84 bool "enable powersave by default" 78 bool "enable powersave by default"
85 depends on CFG80211 79 depends on CFG80211
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 02835172b227..e2cc6e7522dd 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -230,7 +230,7 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
230 struct wireless_dev *wdev; 230 struct wireless_dev *wdev;
231 int err = 0; 231 int err = 0;
232 232
233 if (!rdev->wiphy.netnsok) 233 if (!(rdev->wiphy.flags & WIPHY_FLAG_NETNS_OK))
234 return -EOPNOTSUPP; 234 return -EOPNOTSUPP;
235 235
236 list_for_each_entry(wdev, &rdev->netdev_list, list) { 236 list_for_each_entry(wdev, &rdev->netdev_list, list) {
@@ -367,7 +367,9 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
367 rdev->wiphy.dev.class = &ieee80211_class; 367 rdev->wiphy.dev.class = &ieee80211_class;
368 rdev->wiphy.dev.platform_data = rdev; 368 rdev->wiphy.dev.platform_data = rdev;
369 369
370 rdev->wiphy.ps_default = CONFIG_CFG80211_DEFAULT_PS_VALUE; 370#ifdef CONFIG_CFG80211_DEFAULT_PS
371 rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT;
372#endif
371 373
372 wiphy_net_set(&rdev->wiphy, &init_net); 374 wiphy_net_set(&rdev->wiphy, &init_net);
373 375
@@ -482,7 +484,7 @@ int wiphy_register(struct wiphy *wiphy)
482 if (IS_ERR(rdev->wiphy.debugfsdir)) 484 if (IS_ERR(rdev->wiphy.debugfsdir))
483 rdev->wiphy.debugfsdir = NULL; 485 rdev->wiphy.debugfsdir = NULL;
484 486
485 if (wiphy->custom_regulatory) { 487 if (wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) {
486 struct regulatory_request request; 488 struct regulatory_request request;
487 489
488 request.wiphy_idx = get_wiphy_idx(wiphy); 490 request.wiphy_idx = get_wiphy_idx(wiphy);
@@ -680,7 +682,10 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
680 wdev->wext.default_key = -1; 682 wdev->wext.default_key = -1;
681 wdev->wext.default_mgmt_key = -1; 683 wdev->wext.default_mgmt_key = -1;
682 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; 684 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
683 wdev->wext.ps = wdev->wiphy->ps_default; 685 if (wdev->wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT)
686 wdev->wext.ps = true;
687 else
688 wdev->wext.ps = false;
684 wdev->wext.ps_timeout = 100; 689 wdev->wext.ps_timeout = 100;
685 if (rdev->ops->set_power_mgmt) 690 if (rdev->ops->set_power_mgmt)
686 if (rdev->ops->set_power_mgmt(wdev->wiphy, dev, 691 if (rdev->ops->set_power_mgmt(wdev->wiphy, dev,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 37264d56bace..6634188f9453 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -561,7 +561,7 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
561 CMD(deauth, DEAUTHENTICATE); 561 CMD(deauth, DEAUTHENTICATE);
562 CMD(disassoc, DISASSOCIATE); 562 CMD(disassoc, DISASSOCIATE);
563 CMD(join_ibss, JOIN_IBSS); 563 CMD(join_ibss, JOIN_IBSS);
564 if (dev->wiphy.netnsok) { 564 if (dev->wiphy.flags & WIPHY_FLAG_NETNS_OK) {
565 i++; 565 i++;
566 NLA_PUT_U32(msg, i, NL80211_CMD_SET_WIPHY_NETNS); 566 NLA_PUT_U32(msg, i, NL80211_CMD_SET_WIPHY_NETNS);
567 } 567 }
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index f256dfffbf46..1f33017737fd 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1008,7 +1008,7 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band,
1008 1008
1009 if (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER && 1009 if (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER &&
1010 request_wiphy && request_wiphy == wiphy && 1010 request_wiphy && request_wiphy == wiphy &&
1011 request_wiphy->strict_regulatory) { 1011 request_wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) {
1012 /* 1012 /*
1013 * This gaurantees the driver's requested regulatory domain 1013 * This gaurantees the driver's requested regulatory domain
1014 * will always be used as a base for further regulatory 1014 * will always be used as a base for further regulatory
@@ -1051,13 +1051,13 @@ static bool ignore_reg_update(struct wiphy *wiphy,
1051 if (!last_request) 1051 if (!last_request)
1052 return true; 1052 return true;
1053 if (initiator == NL80211_REGDOM_SET_BY_CORE && 1053 if (initiator == NL80211_REGDOM_SET_BY_CORE &&
1054 wiphy->custom_regulatory) 1054 wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY)
1055 return true; 1055 return true;
1056 /* 1056 /*
1057 * wiphy->regd will be set once the device has its own 1057 * wiphy->regd will be set once the device has its own
1058 * desired regulatory domain set 1058 * desired regulatory domain set
1059 */ 1059 */
1060 if (wiphy->strict_regulatory && !wiphy->regd && 1060 if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd &&
1061 !is_world_regdom(last_request->alpha2)) 1061 !is_world_regdom(last_request->alpha2))
1062 return true; 1062 return true;
1063 return false; 1063 return false;
@@ -1093,7 +1093,7 @@ static void handle_reg_beacon(struct wiphy *wiphy,
1093 1093
1094 chan->beacon_found = true; 1094 chan->beacon_found = true;
1095 1095
1096 if (wiphy->disable_beacon_hints) 1096 if (wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS)
1097 return; 1097 return;
1098 1098
1099 chan_before.center_freq = chan->center_freq; 1099 chan_before.center_freq = chan->center_freq;
@@ -1164,7 +1164,7 @@ static bool reg_is_world_roaming(struct wiphy *wiphy)
1164 return true; 1164 return true;
1165 if (last_request && 1165 if (last_request &&
1166 last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && 1166 last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
1167 wiphy->custom_regulatory) 1167 wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY)
1168 return true; 1168 return true;
1169 return false; 1169 return false;
1170} 1170}
@@ -1591,7 +1591,8 @@ static void reg_process_hint(struct regulatory_request *reg_request)
1591 1591
1592 r = __regulatory_hint(wiphy, reg_request); 1592 r = __regulatory_hint(wiphy, reg_request);
1593 /* This is required so that the orig_* parameters are saved */ 1593 /* This is required so that the orig_* parameters are saved */
1594 if (r == -EALREADY && wiphy && wiphy->strict_regulatory) 1594 if (r == -EALREADY && wiphy &&
1595 wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY)
1595 wiphy_update_regulatory(wiphy, reg_request->initiator); 1596 wiphy_update_regulatory(wiphy, reg_request->initiator);
1596out: 1597out:
1597 mutex_unlock(&reg_mutex); 1598 mutex_unlock(&reg_mutex);