aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-12-02 14:25:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-12-02 14:25:38 -0500
commit4b074b07625f603d40d4d04937f8874a00415dc4 (patch)
tree2dffdc46e3fea0320524f483cf5ac2c058ab59f2 /drivers/net
parent7d68849f40cd9169088249cc889d95c8998c3fb8 (diff)
parentddcc347b70f298f9d624cd0e250581d831d915fb (diff)
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath10k/mac.c4
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c11
-rw-r--r--drivers/net/wireless/ath/regd.c52
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/p2p.c2
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c19
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/channel.c35
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c66
-rw-r--r--drivers/net/wireless/cw1200/scan.c10
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c4
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c8
-rw-r--r--drivers/net/wireless/iwlegacy/3945-mac.c8
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c8
-rw-r--r--drivers/net/wireless/iwlegacy/common.c4
-rw-r--r--drivers/net/wireless/iwlegacy/debug.c8
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/debugfs.c8
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/mac80211.c6
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/scan.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-nvm-parse.c4
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c6
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/scan.c4
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c101
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c25
-rw-r--r--drivers/net/wireless/mwifiex/scan.c4
-rw-r--r--drivers/net/wireless/rtlwifi/regd.c54
-rw-r--r--drivers/net/wireless/ti/wl12xx/scan.c2
-rw-r--r--drivers/net/wireless/ti/wlcore/cmd.c2
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c3
-rw-r--r--drivers/net/wireless/ti/wlcore/scan.c12
29 files changed, 246 insertions, 230 deletions
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 97ac8c87cba2..06fe2b8fa22d 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1351,12 +1351,12 @@ static int ath10k_update_channel_list(struct ath10k *ar)
1351 ch->allow_vht = true; 1351 ch->allow_vht = true;
1352 1352
1353 ch->allow_ibss = 1353 ch->allow_ibss =
1354 !(channel->flags & IEEE80211_CHAN_NO_IBSS); 1354 !(channel->flags & IEEE80211_CHAN_NO_IR);
1355 1355
1356 ch->ht40plus = 1356 ch->ht40plus =
1357 !(channel->flags & IEEE80211_CHAN_NO_HT40PLUS); 1357 !(channel->flags & IEEE80211_CHAN_NO_HT40PLUS);
1358 1358
1359 passive = channel->flags & IEEE80211_CHAN_PASSIVE_SCAN; 1359 passive = channel->flags & IEEE80211_CHAN_NO_IR;
1360 ch->passive = passive; 1360 ch->passive = passive;
1361 1361
1362 ch->freq = channel->center_freq; 1362 ch->freq = channel->center_freq;
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 2437ad26949d..fd4c89df67e1 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1109,7 +1109,9 @@ void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
1109 (mode == WMI_11G_HT20) ? 1109 (mode == WMI_11G_HT20) ?
1110 NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT); 1110 NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT);
1111 1111
1112 mutex_lock(&vif->wdev.mtx);
1112 cfg80211_ch_switch_notify(vif->ndev, &chandef); 1113 cfg80211_ch_switch_notify(vif->ndev, &chandef);
1114 mutex_unlock(&vif->wdev.mtx);
1113} 1115}
1114 1116
1115static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, 1117static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
@@ -3169,12 +3171,15 @@ static bool ath6kl_is_p2p_go_ssid(const u8 *buf, size_t len)
3169} 3171}
3170 3172
3171static int ath6kl_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, 3173static int ath6kl_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
3172 struct ieee80211_channel *chan, bool offchan, 3174 struct cfg80211_mgmt_tx_params *params, u64 *cookie)
3173 unsigned int wait, const u8 *buf, size_t len,
3174 bool no_cck, bool dont_wait_for_ack, u64 *cookie)
3175{ 3175{
3176 struct ath6kl_vif *vif = ath6kl_vif_from_wdev(wdev); 3176 struct ath6kl_vif *vif = ath6kl_vif_from_wdev(wdev);
3177 struct ath6kl *ar = ath6kl_priv(vif->ndev); 3177 struct ath6kl *ar = ath6kl_priv(vif->ndev);
3178 struct ieee80211_channel *chan = params->chan;
3179 const u8 *buf = params->buf;
3180 size_t len = params->len;
3181 unsigned int wait = params->wait;
3182 bool no_cck = params->no_cck;
3178 u32 id, freq; 3183 u32 id, freq;
3179 const struct ieee80211_mgmt *mgmt; 3184 const struct ieee80211_mgmt *mgmt;
3180 bool more_data, queued; 3185 bool more_data, queued;
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 1217c52ab28e..d3bbf48522b6 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -37,17 +37,18 @@ static int __ath_regd_init(struct ath_regulatory *reg);
37 37
38/* We enable active scan on these a case by case basis by regulatory domain */ 38/* We enable active scan on these a case by case basis by regulatory domain */
39#define ATH9K_2GHZ_CH12_13 REG_RULE(2467-10, 2472+10, 40, 0, 20,\ 39#define ATH9K_2GHZ_CH12_13 REG_RULE(2467-10, 2472+10, 40, 0, 20,\
40 NL80211_RRF_PASSIVE_SCAN) 40 NL80211_RRF_NO_IR)
41#define ATH9K_2GHZ_CH14 REG_RULE(2484-10, 2484+10, 40, 0, 20,\ 41#define ATH9K_2GHZ_CH14 REG_RULE(2484-10, 2484+10, 40, 0, 20,\
42 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM) 42 NL80211_RRF_NO_IR | \
43 NL80211_RRF_NO_OFDM)
43 44
44/* We allow IBSS on these on a case by case basis by regulatory domain */ 45/* We allow IBSS on these on a case by case basis by regulatory domain */
45#define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\ 46#define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\
46 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) 47 NL80211_RRF_NO_IR)
47#define ATH9K_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\ 48#define ATH9K_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\
48 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) 49 NL80211_RRF_NO_IR)
49#define ATH9K_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 80, 0, 30,\ 50#define ATH9K_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 80, 0, 30,\
50 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) 51 NL80211_RRF_NO_IR)
51 52
52#define ATH9K_2GHZ_ALL ATH9K_2GHZ_CH01_11, \ 53#define ATH9K_2GHZ_ALL ATH9K_2GHZ_CH01_11, \
53 ATH9K_2GHZ_CH12_13, \ 54 ATH9K_2GHZ_CH12_13, \
@@ -223,18 +224,11 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
223 * default during init, prior to calling our 224 * default during init, prior to calling our
224 * regulatory_hint(). 225 * regulatory_hint().
225 */ 226 */
226 if (!(reg_rule->flags & 227 if (!(reg_rule->flags & NL80211_RRF_NO_IR))
227 NL80211_RRF_NO_IBSS)) 228 ch->flags &= ~IEEE80211_CHAN_NO_IR;
228 ch->flags &=
229 ~IEEE80211_CHAN_NO_IBSS;
230 if (!(reg_rule->flags &
231 NL80211_RRF_PASSIVE_SCAN))
232 ch->flags &=
233 ~IEEE80211_CHAN_PASSIVE_SCAN;
234 } else { 229 } else {
235 if (ch->beacon_found) 230 if (ch->beacon_found)
236 ch->flags &= ~(IEEE80211_CHAN_NO_IBSS | 231 ch->flags &= ~IEEE80211_CHAN_NO_IR;
237 IEEE80211_CHAN_PASSIVE_SCAN);
238 } 232 }
239 } 233 }
240 } 234 }
@@ -260,11 +254,11 @@ ath_reg_apply_active_scan_flags(struct wiphy *wiphy,
260 */ 254 */
261 if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) { 255 if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) {
262 ch = &sband->channels[11]; /* CH 12 */ 256 ch = &sband->channels[11]; /* CH 12 */
263 if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) 257 if (ch->flags & IEEE80211_CHAN_NO_IR)
264 ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; 258 ch->flags &= ~IEEE80211_CHAN_NO_IR;
265 ch = &sband->channels[12]; /* CH 13 */ 259 ch = &sband->channels[12]; /* CH 13 */
266 if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) 260 if (ch->flags & IEEE80211_CHAN_NO_IR)
267 ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; 261 ch->flags &= ~IEEE80211_CHAN_NO_IR;
268 return; 262 return;
269 } 263 }
270 264
@@ -278,17 +272,17 @@ ath_reg_apply_active_scan_flags(struct wiphy *wiphy,
278 ch = &sband->channels[11]; /* CH 12 */ 272 ch = &sband->channels[11]; /* CH 12 */
279 reg_rule = freq_reg_info(wiphy, ch->center_freq); 273 reg_rule = freq_reg_info(wiphy, ch->center_freq);
280 if (!IS_ERR(reg_rule)) { 274 if (!IS_ERR(reg_rule)) {
281 if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) 275 if (!(reg_rule->flags & NL80211_RRF_NO_IR))
282 if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) 276 if (ch->flags & IEEE80211_CHAN_NO_IR)
283 ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; 277 ch->flags &= ~IEEE80211_CHAN_NO_IR;
284 } 278 }
285 279
286 ch = &sband->channels[12]; /* CH 13 */ 280 ch = &sband->channels[12]; /* CH 13 */
287 reg_rule = freq_reg_info(wiphy, ch->center_freq); 281 reg_rule = freq_reg_info(wiphy, ch->center_freq);
288 if (!IS_ERR(reg_rule)) { 282 if (!IS_ERR(reg_rule)) {
289 if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) 283 if (!(reg_rule->flags & NL80211_RRF_NO_IR))
290 if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) 284 if (ch->flags & IEEE80211_CHAN_NO_IR)
291 ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; 285 ch->flags &= ~IEEE80211_CHAN_NO_IR;
292 } 286 }
293} 287}
294 288
@@ -320,8 +314,7 @@ static void ath_reg_apply_radar_flags(struct wiphy *wiphy)
320 */ 314 */
321 if (!(ch->flags & IEEE80211_CHAN_DISABLED)) 315 if (!(ch->flags & IEEE80211_CHAN_DISABLED))
322 ch->flags |= IEEE80211_CHAN_RADAR | 316 ch->flags |= IEEE80211_CHAN_RADAR |
323 IEEE80211_CHAN_NO_IBSS | 317 IEEE80211_CHAN_NO_IR;
324 IEEE80211_CHAN_PASSIVE_SCAN;
325 } 318 }
326} 319}
327 320
@@ -609,7 +602,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
609 const struct ieee80211_regdomain *regd; 602 const struct ieee80211_regdomain *regd;
610 603
611 wiphy->reg_notifier = reg_notifier; 604 wiphy->reg_notifier = reg_notifier;
612 wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; 605 wiphy->regulatory_flags |= REGULATORY_STRICT_REG;
613 606
614 if (ath_is_world_regd(reg)) { 607 if (ath_is_world_regd(reg)) {
615 /* 608 /*
@@ -617,7 +610,8 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
617 * saved on the wiphy orig_* parameters 610 * saved on the wiphy orig_* parameters
618 */ 611 */
619 regd = ath_world_regdomain(reg); 612 regd = ath_world_regdomain(reg);
620 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 613 wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG |
614 REGULATORY_COUNTRY_IE_FOLLOW_POWER;
621 } else { 615 } else {
622 /* 616 /*
623 * This gets applied in the case of the absence of CRDA, 617 * This gets applied in the case of the absence of CRDA,
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
index 4a2293041821..d31803607259 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
@@ -812,7 +812,7 @@ static s32 brcmf_p2p_run_escan(struct brcmf_cfg80211_info *cfg,
812 struct ieee80211_channel *chan = request->channels[i]; 812 struct ieee80211_channel *chan = request->channels[i];
813 813
814 if (chan->flags & (IEEE80211_CHAN_RADAR | 814 if (chan->flags & (IEEE80211_CHAN_RADAR |
815 IEEE80211_CHAN_PASSIVE_SCAN)) 815 IEEE80211_CHAN_NO_IR))
816 continue; 816 continue;
817 817
818 chanspecs[i] = channel_to_chanspec(&p2p->cfg->d11inf, 818 chanspecs[i] = channel_to_chanspec(&p2p->cfg->d11inf,
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 470a47f2b384..3966fe0fcfd9 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -202,9 +202,9 @@ static struct ieee80211_supported_band __wl_band_5ghz_a = {
202 202
203/* This is to override regulatory domains defined in cfg80211 module (reg.c) 203/* This is to override regulatory domains defined in cfg80211 module (reg.c)
204 * By default world regulatory domain defined in reg.c puts the flags 204 * By default world regulatory domain defined in reg.c puts the flags
205 * NL80211_RRF_PASSIVE_SCAN and NL80211_RRF_NO_IBSS for 5GHz channels (for 205 * NL80211_RRF_NO_IR for 5GHz channels (for * 36..48 and 149..165).
206 * 36..48 and 149..165). With respect to these flags, wpa_supplicant doesn't 206 * With respect to these flags, wpa_supplicant doesn't * start p2p
207 * start p2p operations on 5GHz channels. All the changes in world regulatory 207 * operations on 5GHz channels. All the changes in world regulatory
208 * domain are to be done here. 208 * domain are to be done here.
209 */ 209 */
210static const struct ieee80211_regdomain brcmf_regdom = { 210static const struct ieee80211_regdomain brcmf_regdom = {
@@ -3973,11 +3973,12 @@ brcmf_cfg80211_mgmt_frame_register(struct wiphy *wiphy,
3973 3973
3974static int 3974static int
3975brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, 3975brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
3976 struct ieee80211_channel *chan, bool offchan, 3976 struct cfg80211_mgmt_tx_params *params, u64 *cookie)
3977 unsigned int wait, const u8 *buf, size_t len,
3978 bool no_cck, bool dont_wait_for_ack, u64 *cookie)
3979{ 3977{
3980 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 3978 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
3979 struct ieee80211_channel *chan = params->chan;
3980 const u8 *buf = params->buf;
3981 size_t len = params->len;
3981 const struct ieee80211_mgmt *mgmt; 3982 const struct ieee80211_mgmt *mgmt;
3982 struct brcmf_cfg80211_vif *vif; 3983 struct brcmf_cfg80211_vif *vif;
3983 s32 err = 0; 3984 s32 err = 0;
@@ -4341,7 +4342,7 @@ static struct wiphy *brcmf_setup_wiphy(struct device *phydev)
4341 wiphy->max_remain_on_channel_duration = 5000; 4342 wiphy->max_remain_on_channel_duration = 5000;
4342 brcmf_wiphy_pno_params(wiphy); 4343 brcmf_wiphy_pno_params(wiphy);
4343 brcmf_dbg(INFO, "Registering custom regulatory\n"); 4344 brcmf_dbg(INFO, "Registering custom regulatory\n");
4344 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 4345 wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
4345 wiphy_apply_custom_regulatory(wiphy, &brcmf_regdom); 4346 wiphy_apply_custom_regulatory(wiphy, &brcmf_regdom);
4346 err = wiphy_register(wiphy); 4347 err = wiphy_register(wiphy);
4347 if (err < 0) { 4348 if (err < 0) {
@@ -5197,10 +5198,10 @@ static s32 brcmf_construct_reginfo(struct brcmf_cfg80211_info *cfg, u32 bw_cap)
5197 if (channel & WL_CHAN_RADAR) 5198 if (channel & WL_CHAN_RADAR)
5198 band_chan_arr[index].flags |= 5199 band_chan_arr[index].flags |=
5199 (IEEE80211_CHAN_RADAR | 5200 (IEEE80211_CHAN_RADAR |
5200 IEEE80211_CHAN_NO_IBSS); 5201 IEEE80211_CHAN_NO_IR);
5201 if (channel & WL_CHAN_PASSIVE) 5202 if (channel & WL_CHAN_PASSIVE)
5202 band_chan_arr[index].flags |= 5203 band_chan_arr[index].flags |=
5203 IEEE80211_CHAN_PASSIVE_SCAN; 5204 IEEE80211_CHAN_NO_IR;
5204 } 5205 }
5205 } 5206 }
5206 if (!update) 5207 if (!update)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index cc87926f5055..ef05df04136b 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
@@ -59,23 +59,18 @@
59 59
60#define BRCM_2GHZ_2412_2462 REG_RULE(2412-10, 2462+10, 40, 0, 19, 0) 60#define BRCM_2GHZ_2412_2462 REG_RULE(2412-10, 2462+10, 40, 0, 19, 0)
61#define BRCM_2GHZ_2467_2472 REG_RULE(2467-10, 2472+10, 20, 0, 19, \ 61#define BRCM_2GHZ_2467_2472 REG_RULE(2467-10, 2472+10, 20, 0, 19, \
62 NL80211_RRF_PASSIVE_SCAN | \ 62 NL80211_RRF_NO_IR)
63 NL80211_RRF_NO_IBSS)
64 63
65#define BRCM_5GHZ_5180_5240 REG_RULE(5180-10, 5240+10, 40, 0, 21, \ 64#define BRCM_5GHZ_5180_5240 REG_RULE(5180-10, 5240+10, 40, 0, 21, \
66 NL80211_RRF_PASSIVE_SCAN | \ 65 NL80211_RRF_NO_IR)
67 NL80211_RRF_NO_IBSS)
68#define BRCM_5GHZ_5260_5320 REG_RULE(5260-10, 5320+10, 40, 0, 21, \ 66#define BRCM_5GHZ_5260_5320 REG_RULE(5260-10, 5320+10, 40, 0, 21, \
69 NL80211_RRF_PASSIVE_SCAN | \
70 NL80211_RRF_DFS | \ 67 NL80211_RRF_DFS | \
71 NL80211_RRF_NO_IBSS) 68 NL80211_RRF_NO_IR)
72#define BRCM_5GHZ_5500_5700 REG_RULE(5500-10, 5700+10, 40, 0, 21, \ 69#define BRCM_5GHZ_5500_5700 REG_RULE(5500-10, 5700+10, 40, 0, 21, \
73 NL80211_RRF_PASSIVE_SCAN | \
74 NL80211_RRF_DFS | \ 70 NL80211_RRF_DFS | \
75 NL80211_RRF_NO_IBSS) 71 NL80211_RRF_NO_IR)
76#define BRCM_5GHZ_5745_5825 REG_RULE(5745-10, 5825+10, 40, 0, 21, \ 72#define BRCM_5GHZ_5745_5825 REG_RULE(5745-10, 5825+10, 40, 0, 21, \
77 NL80211_RRF_PASSIVE_SCAN | \ 73 NL80211_RRF_NO_IR)
78 NL80211_RRF_NO_IBSS)
79 74
80static const struct ieee80211_regdomain brcms_regdom_x2 = { 75static const struct ieee80211_regdomain brcms_regdom_x2 = {
81 .n_reg_rules = 6, 76 .n_reg_rules = 6,
@@ -395,7 +390,7 @@ brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, u16 chanspec,
395 brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false); 390 brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false);
396 391
397 brcms_b_set_chanspec(wlc->hw, chanspec, 392 brcms_b_set_chanspec(wlc->hw, chanspec,
398 !!(ch->flags & IEEE80211_CHAN_PASSIVE_SCAN), 393 !!(ch->flags & IEEE80211_CHAN_NO_IR),
399 &txpwr); 394 &txpwr);
400} 395}
401 396
@@ -657,8 +652,8 @@ static void brcms_reg_apply_radar_flags(struct wiphy *wiphy)
657 */ 652 */
658 if (!(ch->flags & IEEE80211_CHAN_DISABLED)) 653 if (!(ch->flags & IEEE80211_CHAN_DISABLED))
659 ch->flags |= IEEE80211_CHAN_RADAR | 654 ch->flags |= IEEE80211_CHAN_RADAR |
660 IEEE80211_CHAN_NO_IBSS | 655 IEEE80211_CHAN_NO_IR |
661 IEEE80211_CHAN_PASSIVE_SCAN; 656 IEEE80211_CHAN_NO_IR;
662 } 657 }
663} 658}
664 659
@@ -688,14 +683,10 @@ brcms_reg_apply_beaconing_flags(struct wiphy *wiphy,
688 if (IS_ERR(rule)) 683 if (IS_ERR(rule))
689 continue; 684 continue;
690 685
691 if (!(rule->flags & NL80211_RRF_NO_IBSS)) 686 if (!(rule->flags & NL80211_RRF_NO_IR))
692 ch->flags &= ~IEEE80211_CHAN_NO_IBSS; 687 ch->flags &= ~IEEE80211_CHAN_NO_IR;
693 if (!(rule->flags & NL80211_RRF_PASSIVE_SCAN))
694 ch->flags &=
695 ~IEEE80211_CHAN_PASSIVE_SCAN;
696 } else if (ch->beacon_found) { 688 } else if (ch->beacon_found) {
697 ch->flags &= ~(IEEE80211_CHAN_NO_IBSS | 689 ch->flags &= ~IEEE80211_CHAN_NO_IR;
698 IEEE80211_CHAN_PASSIVE_SCAN);
699 } 690 }
700 } 691 }
701 } 692 }
@@ -775,8 +766,8 @@ void brcms_c_regd_init(struct brcms_c_info *wlc)
775 } 766 }
776 767
777 wlc->wiphy->reg_notifier = brcms_reg_notifier; 768 wlc->wiphy->reg_notifier = brcms_reg_notifier;
778 wlc->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY | 769 wlc->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG |
779 WIPHY_FLAG_STRICT_REGULATORY; 770 REGULATORY_STRICT_REG;
780 wiphy_apply_custom_regulatory(wlc->wiphy, regd->regdomain); 771 wiphy_apply_custom_regulatory(wlc->wiphy, regd->regdomain);
781 brcms_reg_apply_beaconing_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER); 772 brcms_reg_apply_beaconing_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER);
782} 773}
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index edc5d105ff98..e71ce8c842a2 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -125,13 +125,13 @@ static struct ieee80211_channel brcms_2ghz_chantable[] = {
125 CHAN2GHZ(10, 2457, IEEE80211_CHAN_NO_HT40PLUS), 125 CHAN2GHZ(10, 2457, IEEE80211_CHAN_NO_HT40PLUS),
126 CHAN2GHZ(11, 2462, IEEE80211_CHAN_NO_HT40PLUS), 126 CHAN2GHZ(11, 2462, IEEE80211_CHAN_NO_HT40PLUS),
127 CHAN2GHZ(12, 2467, 127 CHAN2GHZ(12, 2467,
128 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS | 128 IEEE80211_CHAN_NO_IR |
129 IEEE80211_CHAN_NO_HT40PLUS), 129 IEEE80211_CHAN_NO_HT40PLUS),
130 CHAN2GHZ(13, 2472, 130 CHAN2GHZ(13, 2472,
131 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS | 131 IEEE80211_CHAN_NO_IR |
132 IEEE80211_CHAN_NO_HT40PLUS), 132 IEEE80211_CHAN_NO_HT40PLUS),
133 CHAN2GHZ(14, 2484, 133 CHAN2GHZ(14, 2484,
134 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS | 134 IEEE80211_CHAN_NO_IR |
135 IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS | 135 IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS |
136 IEEE80211_CHAN_NO_OFDM) 136 IEEE80211_CHAN_NO_OFDM)
137}; 137};
@@ -144,51 +144,51 @@ static struct ieee80211_channel brcms_5ghz_nphy_chantable[] = {
144 CHAN5GHZ(48, IEEE80211_CHAN_NO_HT40PLUS), 144 CHAN5GHZ(48, IEEE80211_CHAN_NO_HT40PLUS),
145 /* UNII-2 */ 145 /* UNII-2 */
146 CHAN5GHZ(52, 146 CHAN5GHZ(52,
147 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 147 IEEE80211_CHAN_RADAR |
148 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS), 148 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
149 CHAN5GHZ(56, 149 CHAN5GHZ(56,
150 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 150 IEEE80211_CHAN_RADAR |
151 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS), 151 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
152 CHAN5GHZ(60, 152 CHAN5GHZ(60,
153 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 153 IEEE80211_CHAN_RADAR |
154 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS), 154 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
155 CHAN5GHZ(64, 155 CHAN5GHZ(64,
156 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 156 IEEE80211_CHAN_RADAR |
157 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS), 157 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
158 /* MID */ 158 /* MID */
159 CHAN5GHZ(100, 159 CHAN5GHZ(100,
160 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 160 IEEE80211_CHAN_RADAR |
161 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS), 161 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
162 CHAN5GHZ(104, 162 CHAN5GHZ(104,
163 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 163 IEEE80211_CHAN_RADAR |
164 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS), 164 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
165 CHAN5GHZ(108, 165 CHAN5GHZ(108,
166 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 166 IEEE80211_CHAN_RADAR |
167 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS), 167 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
168 CHAN5GHZ(112, 168 CHAN5GHZ(112,
169 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 169 IEEE80211_CHAN_RADAR |
170 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS), 170 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
171 CHAN5GHZ(116, 171 CHAN5GHZ(116,
172 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 172 IEEE80211_CHAN_RADAR |
173 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS), 173 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
174 CHAN5GHZ(120, 174 CHAN5GHZ(120,
175 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 175 IEEE80211_CHAN_RADAR |
176 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS), 176 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
177 CHAN5GHZ(124, 177 CHAN5GHZ(124,
178 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 178 IEEE80211_CHAN_RADAR |
179 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS), 179 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
180 CHAN5GHZ(128, 180 CHAN5GHZ(128,
181 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 181 IEEE80211_CHAN_RADAR |
182 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS), 182 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
183 CHAN5GHZ(132, 183 CHAN5GHZ(132,
184 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 184 IEEE80211_CHAN_RADAR |
185 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS), 185 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
186 CHAN5GHZ(136, 186 CHAN5GHZ(136,
187 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 187 IEEE80211_CHAN_RADAR |
188 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS), 188 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
189 CHAN5GHZ(140, 189 CHAN5GHZ(140,
190 IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS | 190 IEEE80211_CHAN_RADAR |
191 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS | 191 IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS |
192 IEEE80211_CHAN_NO_HT40MINUS), 192 IEEE80211_CHAN_NO_HT40MINUS),
193 /* UNII-3 */ 193 /* UNII-3 */
194 CHAN5GHZ(149, IEEE80211_CHAN_NO_HT40MINUS), 194 CHAN5GHZ(149, IEEE80211_CHAN_NO_HT40MINUS),
diff --git a/drivers/net/wireless/cw1200/scan.c b/drivers/net/wireless/cw1200/scan.c
index ee3c19037aac..8c017bfd2ffc 100644
--- a/drivers/net/wireless/cw1200/scan.c
+++ b/drivers/net/wireless/cw1200/scan.c
@@ -197,9 +197,9 @@ void cw1200_scan_work(struct work_struct *work)
197 if ((*it)->band != first->band) 197 if ((*it)->band != first->band)
198 break; 198 break;
199 if (((*it)->flags ^ first->flags) & 199 if (((*it)->flags ^ first->flags) &
200 IEEE80211_CHAN_PASSIVE_SCAN) 200 IEEE80211_CHAN_NO_IR)
201 break; 201 break;
202 if (!(first->flags & IEEE80211_CHAN_PASSIVE_SCAN) && 202 if (!(first->flags & IEEE80211_CHAN_NO_IR) &&
203 (*it)->max_power != first->max_power) 203 (*it)->max_power != first->max_power)
204 break; 204 break;
205 } 205 }
@@ -210,7 +210,7 @@ void cw1200_scan_work(struct work_struct *work)
210 else 210 else
211 scan.max_tx_rate = WSM_TRANSMIT_RATE_1; 211 scan.max_tx_rate = WSM_TRANSMIT_RATE_1;
212 scan.num_probes = 212 scan.num_probes =
213 (first->flags & IEEE80211_CHAN_PASSIVE_SCAN) ? 0 : 2; 213 (first->flags & IEEE80211_CHAN_NO_IR) ? 0 : 2;
214 scan.num_ssids = priv->scan.n_ssids; 214 scan.num_ssids = priv->scan.n_ssids;
215 scan.ssids = &priv->scan.ssids[0]; 215 scan.ssids = &priv->scan.ssids[0];
216 scan.num_channels = it - priv->scan.curr; 216 scan.num_channels = it - priv->scan.curr;
@@ -233,7 +233,7 @@ void cw1200_scan_work(struct work_struct *work)
233 } 233 }
234 for (i = 0; i < scan.num_channels; ++i) { 234 for (i = 0; i < scan.num_channels; ++i) {
235 scan.ch[i].number = priv->scan.curr[i]->hw_value; 235 scan.ch[i].number = priv->scan.curr[i]->hw_value;
236 if (priv->scan.curr[i]->flags & IEEE80211_CHAN_PASSIVE_SCAN) { 236 if (priv->scan.curr[i]->flags & IEEE80211_CHAN_NO_IR) {
237 scan.ch[i].min_chan_time = 50; 237 scan.ch[i].min_chan_time = 50;
238 scan.ch[i].max_chan_time = 100; 238 scan.ch[i].max_chan_time = 100;
239 } else { 239 } else {
@@ -241,7 +241,7 @@ void cw1200_scan_work(struct work_struct *work)
241 scan.ch[i].max_chan_time = 25; 241 scan.ch[i].max_chan_time = 25;
242 } 242 }
243 } 243 }
244 if (!(first->flags & IEEE80211_CHAN_PASSIVE_SCAN) && 244 if (!(first->flags & IEEE80211_CHAN_NO_IR) &&
245 priv->scan.output_power != first->max_power) { 245 priv->scan.output_power != first->max_power) {
246 priv->scan.output_power = first->max_power; 246 priv->scan.output_power = first->max_power;
247 wsm_set_output_power(priv, 247 wsm_set_output_power(priv,
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index f8ab193009cd..813c9af0ebd6 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1930,10 +1930,10 @@ static int ipw2100_wdev_init(struct net_device *dev)
1930 bg_band->channels[i].max_power = geo->bg[i].max_power; 1930 bg_band->channels[i].max_power = geo->bg[i].max_power;
1931 if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY) 1931 if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY)
1932 bg_band->channels[i].flags |= 1932 bg_band->channels[i].flags |=
1933 IEEE80211_CHAN_PASSIVE_SCAN; 1933 IEEE80211_CHAN_NO_IR;
1934 if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS) 1934 if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS)
1935 bg_band->channels[i].flags |= 1935 bg_band->channels[i].flags |=
1936 IEEE80211_CHAN_NO_IBSS; 1936 IEEE80211_CHAN_NO_IR;
1937 if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT) 1937 if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT)
1938 bg_band->channels[i].flags |= 1938 bg_band->channels[i].flags |=
1939 IEEE80211_CHAN_RADAR; 1939 IEEE80211_CHAN_RADAR;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 81903e33d5b1..9244b3661d34 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -11472,10 +11472,10 @@ static int ipw_wdev_init(struct net_device *dev)
11472 bg_band->channels[i].max_power = geo->bg[i].max_power; 11472 bg_band->channels[i].max_power = geo->bg[i].max_power;
11473 if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY) 11473 if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY)
11474 bg_band->channels[i].flags |= 11474 bg_band->channels[i].flags |=
11475 IEEE80211_CHAN_PASSIVE_SCAN; 11475 IEEE80211_CHAN_NO_IR;
11476 if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS) 11476 if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS)
11477 bg_band->channels[i].flags |= 11477 bg_band->channels[i].flags |=
11478 IEEE80211_CHAN_NO_IBSS; 11478 IEEE80211_CHAN_NO_IR;
11479 if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT) 11479 if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT)
11480 bg_band->channels[i].flags |= 11480 bg_band->channels[i].flags |=
11481 IEEE80211_CHAN_RADAR; 11481 IEEE80211_CHAN_RADAR;
@@ -11511,10 +11511,10 @@ static int ipw_wdev_init(struct net_device *dev)
11511 a_band->channels[i].max_power = geo->a[i].max_power; 11511 a_band->channels[i].max_power = geo->a[i].max_power;
11512 if (geo->a[i].flags & LIBIPW_CH_PASSIVE_ONLY) 11512 if (geo->a[i].flags & LIBIPW_CH_PASSIVE_ONLY)
11513 a_band->channels[i].flags |= 11513 a_band->channels[i].flags |=
11514 IEEE80211_CHAN_PASSIVE_SCAN; 11514 IEEE80211_CHAN_NO_IR;
11515 if (geo->a[i].flags & LIBIPW_CH_NO_IBSS) 11515 if (geo->a[i].flags & LIBIPW_CH_NO_IBSS)
11516 a_band->channels[i].flags |= 11516 a_band->channels[i].flags |=
11517 IEEE80211_CHAN_NO_IBSS; 11517 IEEE80211_CHAN_NO_IR;
11518 if (geo->a[i].flags & LIBIPW_CH_RADAR_DETECT) 11518 if (geo->a[i].flags & LIBIPW_CH_RADAR_DETECT)
11519 a_band->channels[i].flags |= 11519 a_band->channels[i].flags |=
11520 IEEE80211_CHAN_RADAR; 11520 IEEE80211_CHAN_RADAR;
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index dea3b50d68b9..5c3bcedd679b 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -1595,7 +1595,7 @@ il3945_get_channels_for_scan(struct il_priv *il, enum ieee80211_band band,
1595 * and use long active_dwell time. 1595 * and use long active_dwell time.
1596 */ 1596 */
1597 if (!is_active || il_is_channel_passive(ch_info) || 1597 if (!is_active || il_is_channel_passive(ch_info) ||
1598 (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)) { 1598 (chan->flags & IEEE80211_CHAN_NO_IR)) {
1599 scan_ch->type = 0; /* passive */ 1599 scan_ch->type = 0; /* passive */
1600 if (IL_UCODE_API(il->ucode_ver) == 1) 1600 if (IL_UCODE_API(il->ucode_ver) == 1)
1601 scan_ch->active_dwell = 1601 scan_ch->active_dwell =
@@ -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 3982ab76f375..43f488a8cda2 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -805,7 +805,7 @@ il4965_get_channels_for_scan(struct il_priv *il, struct ieee80211_vif *vif,
805 } 805 }
806 806
807 if (!is_active || il_is_channel_passive(ch_info) || 807 if (!is_active || il_is_channel_passive(ch_info) ||
808 (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)) 808 (chan->flags & IEEE80211_CHAN_NO_IR))
809 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE; 809 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
810 else 810 else
811 scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE; 811 scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE;
@@ -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/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index b03e22ef5462..a27b14cfeaec 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -3445,10 +3445,10 @@ il_init_geos(struct il_priv *il)
3445 3445
3446 if (il_is_channel_valid(ch)) { 3446 if (il_is_channel_valid(ch)) {
3447 if (!(ch->flags & EEPROM_CHANNEL_IBSS)) 3447 if (!(ch->flags & EEPROM_CHANNEL_IBSS))
3448 geo_ch->flags |= IEEE80211_CHAN_NO_IBSS; 3448 geo_ch->flags |= IEEE80211_CHAN_NO_IR;
3449 3449
3450 if (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) 3450 if (!(ch->flags & EEPROM_CHANNEL_ACTIVE))
3451 geo_ch->flags |= IEEE80211_CHAN_PASSIVE_SCAN; 3451 geo_ch->flags |= IEEE80211_CHAN_NO_IR;
3452 3452
3453 if (ch->flags & EEPROM_CHANNEL_RADAR) 3453 if (ch->flags & EEPROM_CHANNEL_RADAR)
3454 geo_ch->flags |= IEEE80211_CHAN_RADAR; 3454 geo_ch->flags |= IEEE80211_CHAN_RADAR;
diff --git a/drivers/net/wireless/iwlegacy/debug.c b/drivers/net/wireless/iwlegacy/debug.c
index eff26501d60a..3a487a3bb5de 100644
--- a/drivers/net/wireless/iwlegacy/debug.c
+++ b/drivers/net/wireless/iwlegacy/debug.c
@@ -567,12 +567,12 @@ il_dbgfs_channels_read(struct file *file, char __user *user_buf, size_t count,
567 flags & IEEE80211_CHAN_RADAR ? 567 flags & IEEE80211_CHAN_RADAR ?
568 " (IEEE 802.11h required)" : "", 568 " (IEEE 802.11h required)" : "",
569 ((channels[i]. 569 ((channels[i].
570 flags & IEEE80211_CHAN_NO_IBSS) || 570 flags & IEEE80211_CHAN_NO_IR) ||
571 (channels[i]. 571 (channels[i].
572 flags & IEEE80211_CHAN_RADAR)) ? "" : 572 flags & IEEE80211_CHAN_RADAR)) ? "" :
573 ", IBSS", 573 ", IBSS",
574 channels[i]. 574 channels[i].
575 flags & IEEE80211_CHAN_PASSIVE_SCAN ? 575 flags & IEEE80211_CHAN_NO_IR ?
576 "passive only" : "active/passive"); 576 "passive only" : "active/passive");
577 } 577 }
578 supp_band = il_get_hw_mode(il, IEEE80211_BAND_5GHZ); 578 supp_band = il_get_hw_mode(il, IEEE80211_BAND_5GHZ);
@@ -594,12 +594,12 @@ il_dbgfs_channels_read(struct file *file, char __user *user_buf, size_t count,
594 flags & IEEE80211_CHAN_RADAR ? 594 flags & IEEE80211_CHAN_RADAR ?
595 " (IEEE 802.11h required)" : "", 595 " (IEEE 802.11h required)" : "",
596 ((channels[i]. 596 ((channels[i].
597 flags & IEEE80211_CHAN_NO_IBSS) || 597 flags & IEEE80211_CHAN_NO_IR) ||
598 (channels[i]. 598 (channels[i].
599 flags & IEEE80211_CHAN_RADAR)) ? "" : 599 flags & IEEE80211_CHAN_RADAR)) ? "" :
600 ", IBSS", 600 ", IBSS",
601 channels[i]. 601 channels[i].
602 flags & IEEE80211_CHAN_PASSIVE_SCAN ? 602 flags & IEEE80211_CHAN_NO_IR ?
603 "passive only" : "active/passive"); 603 "passive only" : "active/passive");
604 } 604 }
605 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); 605 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
index d94f8ab15004..f69301e505ee 100644
--- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
@@ -352,12 +352,12 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf,
352 channels[i].max_power, 352 channels[i].max_power,
353 channels[i].flags & IEEE80211_CHAN_RADAR ? 353 channels[i].flags & IEEE80211_CHAN_RADAR ?
354 " (IEEE 802.11h required)" : "", 354 " (IEEE 802.11h required)" : "",
355 ((channels[i].flags & IEEE80211_CHAN_NO_IBSS) 355 ((channels[i].flags & IEEE80211_CHAN_NO_IR)
356 || (channels[i].flags & 356 || (channels[i].flags &
357 IEEE80211_CHAN_RADAR)) ? "" : 357 IEEE80211_CHAN_RADAR)) ? "" :
358 ", IBSS", 358 ", IBSS",
359 channels[i].flags & 359 channels[i].flags &
360 IEEE80211_CHAN_PASSIVE_SCAN ? 360 IEEE80211_CHAN_NO_IR ?
361 "passive only" : "active/passive"); 361 "passive only" : "active/passive");
362 } 362 }
363 supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_5GHZ); 363 supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_5GHZ);
@@ -375,12 +375,12 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf,
375 channels[i].max_power, 375 channels[i].max_power,
376 channels[i].flags & IEEE80211_CHAN_RADAR ? 376 channels[i].flags & IEEE80211_CHAN_RADAR ?
377 " (IEEE 802.11h required)" : "", 377 " (IEEE 802.11h required)" : "",
378 ((channels[i].flags & IEEE80211_CHAN_NO_IBSS) 378 ((channels[i].flags & IEEE80211_CHAN_NO_IR)
379 || (channels[i].flags & 379 || (channels[i].flags &
380 IEEE80211_CHAN_RADAR)) ? "" : 380 IEEE80211_CHAN_RADAR)) ? "" :
381 ", IBSS", 381 ", IBSS",
382 channels[i].flags & 382 channels[i].flags &
383 IEEE80211_CHAN_PASSIVE_SCAN ? 383 IEEE80211_CHAN_NO_IR ?
384 "passive only" : "active/passive"); 384 "passive only" : "active/passive");
385 } 385 }
386 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); 386 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
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/dvm/scan.c b/drivers/net/wireless/iwlwifi/dvm/scan.c
index 35e0ee8b4e5b..928f8640a0a7 100644
--- a/drivers/net/wireless/iwlwifi/dvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/dvm/scan.c
@@ -544,7 +544,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
544 channel = chan->hw_value; 544 channel = chan->hw_value;
545 scan_ch->channel = cpu_to_le16(channel); 545 scan_ch->channel = cpu_to_le16(channel);
546 546
547 if (!is_active || (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)) 547 if (!is_active || (chan->flags & IEEE80211_CHAN_NO_IR))
548 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE; 548 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
549 else 549 else
550 scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE; 550 scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE;
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c
index 4c887f365908..f4a6d317a023 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c
@@ -614,10 +614,10 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
614 channel->flags = IEEE80211_CHAN_NO_HT40; 614 channel->flags = IEEE80211_CHAN_NO_HT40;
615 615
616 if (!(eeprom_ch->flags & EEPROM_CHANNEL_IBSS)) 616 if (!(eeprom_ch->flags & EEPROM_CHANNEL_IBSS))
617 channel->flags |= IEEE80211_CHAN_NO_IBSS; 617 channel->flags |= IEEE80211_CHAN_NO_IR;
618 618
619 if (!(eeprom_ch->flags & EEPROM_CHANNEL_ACTIVE)) 619 if (!(eeprom_ch->flags & EEPROM_CHANNEL_ACTIVE))
620 channel->flags |= IEEE80211_CHAN_PASSIVE_SCAN; 620 channel->flags |= IEEE80211_CHAN_NO_IR;
621 621
622 if (eeprom_ch->flags & EEPROM_CHANNEL_RADAR) 622 if (eeprom_ch->flags & EEPROM_CHANNEL_RADAR)
623 channel->flags |= IEEE80211_CHAN_RADAR; 623 channel->flags |= IEEE80211_CHAN_RADAR;
diff --git a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
index b76a9a8fc0b3..2fab203d3027 100644
--- a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
@@ -223,10 +223,10 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
223 channel->flags |= IEEE80211_CHAN_NO_160MHZ; 223 channel->flags |= IEEE80211_CHAN_NO_160MHZ;
224 224
225 if (!(ch_flags & NVM_CHANNEL_IBSS)) 225 if (!(ch_flags & NVM_CHANNEL_IBSS))
226 channel->flags |= IEEE80211_CHAN_NO_IBSS; 226 channel->flags |= IEEE80211_CHAN_NO_IR;
227 227
228 if (!(ch_flags & NVM_CHANNEL_ACTIVE)) 228 if (!(ch_flags & NVM_CHANNEL_ACTIVE))
229 channel->flags |= IEEE80211_CHAN_PASSIVE_SCAN; 229 channel->flags |= IEEE80211_CHAN_NO_IR;
230 230
231 if (ch_flags & NVM_CHANNEL_RADAR) 231 if (ch_flags & NVM_CHANNEL_RADAR)
232 channel->flags |= IEEE80211_CHAN_RADAR; 232 channel->flags |= IEEE80211_CHAN_RADAR;
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/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index dff7592e1ff8..e0cd100b40cd 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -192,7 +192,7 @@ static void iwl_mvm_scan_fill_channels(struct iwl_scan_cmd *cmd,
192 for (i = 0; i < cmd->channel_count; i++) { 192 for (i = 0; i < cmd->channel_count; i++) {
193 chan->channel = cpu_to_le16(req->channels[i]->hw_value); 193 chan->channel = cpu_to_le16(req->channels[i]->hw_value);
194 chan->type = cpu_to_le32(type); 194 chan->type = cpu_to_le32(type);
195 if (req->channels[i]->flags & IEEE80211_CHAN_PASSIVE_SCAN) 195 if (req->channels[i]->flags & IEEE80211_CHAN_NO_IR)
196 chan->type &= cpu_to_le32(~SCAN_CHANNEL_TYPE_ACTIVE); 196 chan->type &= cpu_to_le32(~SCAN_CHANNEL_TYPE_ACTIVE);
197 chan->active_dwell = cpu_to_le16(active_dwell); 197 chan->active_dwell = cpu_to_le16(active_dwell);
198 chan->passive_dwell = cpu_to_le16(passive_dwell); 198 chan->passive_dwell = cpu_to_le16(passive_dwell);
@@ -642,7 +642,7 @@ static void iwl_build_channel_cfg(struct iwl_mvm *mvm,
642 channels->iter_count[index] = cpu_to_le16(1); 642 channels->iter_count[index] = cpu_to_le16(1);
643 channels->iter_interval[index] = 0; 643 channels->iter_interval[index] = 0;
644 644
645 if (!(s_band->channels[i].flags & IEEE80211_CHAN_PASSIVE_SCAN)) 645 if (!(s_band->channels[i].flags & IEEE80211_CHAN_NO_IR))
646 channels->type[index] |= 646 channels->type[index] |=
647 cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE); 647 cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE);
648 648
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 9df7bc91a26f..3f9a4c9ad77a 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -159,7 +159,7 @@ static const struct ieee80211_regdomain hwsim_world_regdom_custom_02 = {
159 .reg_rules = { 159 .reg_rules = {
160 REG_RULE(2412-10, 2462+10, 40, 0, 20, 0), 160 REG_RULE(2412-10, 2462+10, 40, 0, 20, 0),
161 REG_RULE(5725-10, 5850+10, 40, 0, 30, 161 REG_RULE(5725-10, 5850+10, 40, 0, 30,
162 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS), 162 NL80211_RRF_NO_IR),
163 } 163 }
164}; 164};
165 165
@@ -353,7 +353,6 @@ struct mac80211_hwsim_data {
353 } ps; 353 } ps;
354 bool ps_poll_pending; 354 bool ps_poll_pending;
355 struct dentry *debugfs; 355 struct dentry *debugfs;
356 struct dentry *debugfs_ps;
357 356
358 struct sk_buff_head pending; /* packets pending */ 357 struct sk_buff_head pending; /* packets pending */
359 /* 358 /*
@@ -362,7 +361,6 @@ struct mac80211_hwsim_data {
362 * radio can be in more then one group. 361 * radio can be in more then one group.
363 */ 362 */
364 u64 group; 363 u64 group;
365 struct dentry *debugfs_group;
366 364
367 int power_level; 365 int power_level;
368 366
@@ -1485,7 +1483,7 @@ static void hw_scan_work(struct work_struct *work)
1485 req->channels[hwsim->scan_chan_idx]->center_freq); 1483 req->channels[hwsim->scan_chan_idx]->center_freq);
1486 1484
1487 hwsim->tmp_chan = req->channels[hwsim->scan_chan_idx]; 1485 hwsim->tmp_chan = req->channels[hwsim->scan_chan_idx];
1488 if (hwsim->tmp_chan->flags & IEEE80211_CHAN_PASSIVE_SCAN || 1486 if (hwsim->tmp_chan->flags & IEEE80211_CHAN_NO_IR ||
1489 !req->n_ssids) { 1487 !req->n_ssids) {
1490 dwell = 120; 1488 dwell = 120;
1491 } else { 1489 } else {
@@ -1734,9 +1732,7 @@ static void mac80211_hwsim_free(void)
1734 spin_unlock_bh(&hwsim_radio_lock); 1732 spin_unlock_bh(&hwsim_radio_lock);
1735 1733
1736 list_for_each_entry_safe(data, tmpdata, &tmplist, list) { 1734 list_for_each_entry_safe(data, tmpdata, &tmplist, list) {
1737 debugfs_remove(data->debugfs_group); 1735 debugfs_remove_recursive(data->debugfs);
1738 debugfs_remove(data->debugfs_ps);
1739 debugfs_remove(data->debugfs);
1740 ieee80211_unregister_hw(data->hw); 1736 ieee80211_unregister_hw(data->hw);
1741 device_release_driver(data->dev); 1737 device_release_driver(data->dev);
1742 device_unregister(data->dev); 1738 device_unregister(data->dev);
@@ -1893,6 +1889,17 @@ static int hwsim_fops_ps_write(void *dat, u64 val)
1893DEFINE_SIMPLE_ATTRIBUTE(hwsim_fops_ps, hwsim_fops_ps_read, hwsim_fops_ps_write, 1889DEFINE_SIMPLE_ATTRIBUTE(hwsim_fops_ps, hwsim_fops_ps_read, hwsim_fops_ps_write,
1894 "%llu\n"); 1890 "%llu\n");
1895 1891
1892static int hwsim_write_simulate_radar(void *dat, u64 val)
1893{
1894 struct mac80211_hwsim_data *data = dat;
1895
1896 ieee80211_radar_detected(data->hw);
1897
1898 return 0;
1899}
1900
1901DEFINE_SIMPLE_ATTRIBUTE(hwsim_simulate_radar, NULL,
1902 hwsim_write_simulate_radar, "%llu\n");
1896 1903
1897static int hwsim_fops_group_read(void *dat, u64 *val) 1904static int hwsim_fops_group_read(void *dat, u64 *val)
1898{ 1905{
@@ -2193,11 +2200,28 @@ static const struct ieee80211_iface_limit hwsim_if_limits[] = {
2193 { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) }, 2200 { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) },
2194}; 2201};
2195 2202
2196static struct ieee80211_iface_combination hwsim_if_comb = { 2203static const struct ieee80211_iface_limit hwsim_if_dfs_limits[] = {
2197 .limits = hwsim_if_limits, 2204 { .max = 8, .types = BIT(NL80211_IFTYPE_AP) },
2198 .n_limits = ARRAY_SIZE(hwsim_if_limits), 2205};
2199 .max_interfaces = 2048, 2206
2200 .num_different_channels = 1, 2207static struct ieee80211_iface_combination hwsim_if_comb[] = {
2208 {
2209 .limits = hwsim_if_limits,
2210 .n_limits = ARRAY_SIZE(hwsim_if_limits),
2211 .max_interfaces = 2048,
2212 .num_different_channels = 1,
2213 },
2214 {
2215 .limits = hwsim_if_dfs_limits,
2216 .n_limits = ARRAY_SIZE(hwsim_if_dfs_limits),
2217 .max_interfaces = 8,
2218 .num_different_channels = 1,
2219 .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
2220 BIT(NL80211_CHAN_WIDTH_20) |
2221 BIT(NL80211_CHAN_WIDTH_40) |
2222 BIT(NL80211_CHAN_WIDTH_80) |
2223 BIT(NL80211_CHAN_WIDTH_160),
2224 }
2201}; 2225};
2202 2226
2203static int __init init_mac80211_hwsim(void) 2227static int __init init_mac80211_hwsim(void)
@@ -2215,7 +2239,7 @@ static int __init init_mac80211_hwsim(void)
2215 return -EINVAL; 2239 return -EINVAL;
2216 2240
2217 if (channels > 1) { 2241 if (channels > 1) {
2218 hwsim_if_comb.num_different_channels = channels; 2242 hwsim_if_comb[0].num_different_channels = channels;
2219 mac80211_hwsim_ops.hw_scan = mac80211_hwsim_hw_scan; 2243 mac80211_hwsim_ops.hw_scan = mac80211_hwsim_hw_scan;
2220 mac80211_hwsim_ops.cancel_hw_scan = 2244 mac80211_hwsim_ops.cancel_hw_scan =
2221 mac80211_hwsim_cancel_hw_scan; 2245 mac80211_hwsim_cancel_hw_scan;
@@ -2295,13 +2319,15 @@ static int __init init_mac80211_hwsim(void)
2295 hw->wiphy->n_addresses = 2; 2319 hw->wiphy->n_addresses = 2;
2296 hw->wiphy->addresses = data->addresses; 2320 hw->wiphy->addresses = data->addresses;
2297 2321
2298 hw->wiphy->iface_combinations = &hwsim_if_comb; 2322 hw->wiphy->iface_combinations = hwsim_if_comb;
2299 hw->wiphy->n_iface_combinations = 1; 2323 hw->wiphy->n_iface_combinations = ARRAY_SIZE(hwsim_if_comb);
2300 2324
2301 if (channels > 1) { 2325 if (channels > 1) {
2302 hw->wiphy->max_scan_ssids = 255; 2326 hw->wiphy->max_scan_ssids = 255;
2303 hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; 2327 hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
2304 hw->wiphy->max_remain_on_channel_duration = 1000; 2328 hw->wiphy->max_remain_on_channel_duration = 1000;
2329 /* For channels > 1 DFS is not allowed */
2330 hw->wiphy->n_iface_combinations = 1;
2305 } 2331 }
2306 2332
2307 INIT_DELAYED_WORK(&data->roc_done, hw_roc_done); 2333 INIT_DELAYED_WORK(&data->roc_done, hw_roc_done);
@@ -2325,7 +2351,8 @@ static int __init init_mac80211_hwsim(void)
2325 IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | 2351 IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
2326 IEEE80211_HW_AMPDU_AGGREGATION | 2352 IEEE80211_HW_AMPDU_AGGREGATION |
2327 IEEE80211_HW_WANT_MONITOR_VIF | 2353 IEEE80211_HW_WANT_MONITOR_VIF |
2328 IEEE80211_HW_QUEUE_CONTROL; 2354 IEEE80211_HW_QUEUE_CONTROL |
2355 IEEE80211_HW_SUPPORTS_HT_CCK_RATES;
2329 if (rctbl) 2356 if (rctbl)
2330 hw->flags |= IEEE80211_HW_SUPPORTS_RC_TABLE; 2357 hw->flags |= IEEE80211_HW_SUPPORTS_RC_TABLE;
2331 2358
@@ -2385,6 +2412,7 @@ static int __init init_mac80211_hwsim(void)
2385 sband->vht_cap.cap = 2412 sband->vht_cap.cap =
2386 IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 | 2413 IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 |
2387 IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ | 2414 IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ |
2415 IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ |
2388 IEEE80211_VHT_CAP_RXLDPC | 2416 IEEE80211_VHT_CAP_RXLDPC |
2389 IEEE80211_VHT_CAP_SHORT_GI_80 | 2417 IEEE80211_VHT_CAP_SHORT_GI_80 |
2390 IEEE80211_VHT_CAP_SHORT_GI_160 | 2418 IEEE80211_VHT_CAP_SHORT_GI_160 |
@@ -2427,46 +2455,53 @@ static int __init init_mac80211_hwsim(void)
2427 break; 2455 break;
2428 case HWSIM_REGTEST_WORLD_ROAM: 2456 case HWSIM_REGTEST_WORLD_ROAM:
2429 if (i == 0) { 2457 if (i == 0) {
2430 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2458 hw->wiphy->regulatory_flags |=
2459 REGULATORY_CUSTOM_REG;
2431 wiphy_apply_custom_regulatory(hw->wiphy, 2460 wiphy_apply_custom_regulatory(hw->wiphy,
2432 &hwsim_world_regdom_custom_01); 2461 &hwsim_world_regdom_custom_01);
2433 } 2462 }
2434 break; 2463 break;
2435 case HWSIM_REGTEST_CUSTOM_WORLD: 2464 case HWSIM_REGTEST_CUSTOM_WORLD:
2436 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2465 hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
2437 wiphy_apply_custom_regulatory(hw->wiphy, 2466 wiphy_apply_custom_regulatory(hw->wiphy,
2438 &hwsim_world_regdom_custom_01); 2467 &hwsim_world_regdom_custom_01);
2439 break; 2468 break;
2440 case HWSIM_REGTEST_CUSTOM_WORLD_2: 2469 case HWSIM_REGTEST_CUSTOM_WORLD_2:
2441 if (i == 0) { 2470 if (i == 0) {
2442 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2471 hw->wiphy->regulatory_flags |=
2472 REGULATORY_CUSTOM_REG;
2443 wiphy_apply_custom_regulatory(hw->wiphy, 2473 wiphy_apply_custom_regulatory(hw->wiphy,
2444 &hwsim_world_regdom_custom_01); 2474 &hwsim_world_regdom_custom_01);
2445 } else if (i == 1) { 2475 } else if (i == 1) {
2446 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2476 hw->wiphy->regulatory_flags |=
2477 REGULATORY_CUSTOM_REG;
2447 wiphy_apply_custom_regulatory(hw->wiphy, 2478 wiphy_apply_custom_regulatory(hw->wiphy,
2448 &hwsim_world_regdom_custom_02); 2479 &hwsim_world_regdom_custom_02);
2449 } 2480 }
2450 break; 2481 break;
2451 case HWSIM_REGTEST_STRICT_ALL: 2482 case HWSIM_REGTEST_STRICT_ALL:
2452 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; 2483 hw->wiphy->regulatory_flags |= REGULATORY_STRICT_REG;
2453 break; 2484 break;
2454 case HWSIM_REGTEST_STRICT_FOLLOW: 2485 case HWSIM_REGTEST_STRICT_FOLLOW:
2455 case HWSIM_REGTEST_STRICT_AND_DRIVER_REG: 2486 case HWSIM_REGTEST_STRICT_AND_DRIVER_REG:
2456 if (i == 0) 2487 if (i == 0)
2457 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; 2488 hw->wiphy->regulatory_flags |=
2489 REGULATORY_STRICT_REG;
2458 break; 2490 break;
2459 case HWSIM_REGTEST_ALL: 2491 case HWSIM_REGTEST_ALL:
2460 if (i == 0) { 2492 if (i == 0) {
2461 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2493 hw->wiphy->regulatory_flags |=
2494 REGULATORY_CUSTOM_REG;
2462 wiphy_apply_custom_regulatory(hw->wiphy, 2495 wiphy_apply_custom_regulatory(hw->wiphy,
2463 &hwsim_world_regdom_custom_01); 2496 &hwsim_world_regdom_custom_01);
2464 } else if (i == 1) { 2497 } else if (i == 1) {
2465 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 2498 hw->wiphy->regulatory_flags |=
2499 REGULATORY_CUSTOM_REG;
2466 wiphy_apply_custom_regulatory(hw->wiphy, 2500 wiphy_apply_custom_regulatory(hw->wiphy,
2467 &hwsim_world_regdom_custom_02); 2501 &hwsim_world_regdom_custom_02);
2468 } else if (i == 4) 2502 } else if (i == 4)
2469 hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; 2503 hw->wiphy->regulatory_flags |=
2504 REGULATORY_STRICT_REG;
2470 break; 2505 break;
2471 default: 2506 default:
2472 break; 2507 break;
@@ -2533,16 +2568,18 @@ static int __init init_mac80211_hwsim(void)
2533 2568
2534 data->debugfs = debugfs_create_dir("hwsim", 2569 data->debugfs = debugfs_create_dir("hwsim",
2535 hw->wiphy->debugfsdir); 2570 hw->wiphy->debugfsdir);
2536 data->debugfs_ps = debugfs_create_file("ps", 0666, 2571 debugfs_create_file("ps", 0666, data->debugfs, data,
2537 data->debugfs, data, 2572 &hwsim_fops_ps);
2538 &hwsim_fops_ps); 2573 debugfs_create_file("group", 0666, data->debugfs, data,
2539 data->debugfs_group = debugfs_create_file("group", 0666, 2574 &hwsim_fops_group);
2540 data->debugfs, data, 2575 if (channels == 1)
2541 &hwsim_fops_group); 2576 debugfs_create_file("dfs_simulate_radar", 0222,
2577 data->debugfs,
2578 data, &hwsim_simulate_radar);
2542 2579
2543 tasklet_hrtimer_init(&data->beacon_timer, 2580 tasklet_hrtimer_init(&data->beacon_timer,
2544 mac80211_hwsim_beacon, 2581 mac80211_hwsim_beacon,
2545 CLOCK_REALTIME, HRTIMER_MODE_ABS); 2582 CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS);
2546 2583
2547 list_add_tail(&data->list, &hwsim_radios); 2584 list_add_tail(&data->list, &hwsim_radios);
2548 } 2585 }
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index aeaea0e3b4c4..d9b7330c902f 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -50,24 +50,24 @@ static const struct ieee80211_regdomain mwifiex_world_regdom_custom = {
50 REG_RULE(2412-10, 2462+10, 40, 3, 20, 0), 50 REG_RULE(2412-10, 2462+10, 40, 3, 20, 0),
51 /* Channel 12 - 13 */ 51 /* Channel 12 - 13 */
52 REG_RULE(2467-10, 2472+10, 20, 3, 20, 52 REG_RULE(2467-10, 2472+10, 20, 3, 20,
53 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS), 53 NL80211_RRF_NO_IR),
54 /* Channel 14 */ 54 /* Channel 14 */
55 REG_RULE(2484-10, 2484+10, 20, 3, 20, 55 REG_RULE(2484-10, 2484+10, 20, 3, 20,
56 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS | 56 NL80211_RRF_NO_IR |
57 NL80211_RRF_NO_OFDM), 57 NL80211_RRF_NO_OFDM),
58 /* Channel 36 - 48 */ 58 /* Channel 36 - 48 */
59 REG_RULE(5180-10, 5240+10, 40, 3, 20, 59 REG_RULE(5180-10, 5240+10, 40, 3, 20,
60 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS), 60 NL80211_RRF_NO_IR),
61 /* Channel 149 - 165 */ 61 /* Channel 149 - 165 */
62 REG_RULE(5745-10, 5825+10, 40, 3, 20, 62 REG_RULE(5745-10, 5825+10, 40, 3, 20,
63 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS), 63 NL80211_RRF_NO_IR),
64 /* Channel 52 - 64 */ 64 /* Channel 52 - 64 */
65 REG_RULE(5260-10, 5320+10, 40, 3, 30, 65 REG_RULE(5260-10, 5320+10, 40, 3, 30,
66 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS | 66 NL80211_RRF_NO_IR |
67 NL80211_RRF_DFS), 67 NL80211_RRF_DFS),
68 /* Channel 100 - 140 */ 68 /* Channel 100 - 140 */
69 REG_RULE(5500-10, 5700+10, 40, 3, 30, 69 REG_RULE(5500-10, 5700+10, 40, 3, 30,
70 NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS | 70 NL80211_RRF_NO_IR |
71 NL80211_RRF_DFS), 71 NL80211_RRF_DFS),
72 } 72 }
73}; 73};
@@ -184,10 +184,10 @@ mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len)
184 */ 184 */
185static int 185static int
186mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, 186mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
187 struct ieee80211_channel *chan, bool offchan, 187 struct cfg80211_mgmt_tx_params *params, u64 *cookie)
188 unsigned int wait, const u8 *buf, size_t len,
189 bool no_cck, bool dont_wait_for_ack, u64 *cookie)
190{ 188{
189 const u8 *buf = params->buf;
190 size_t len = params->len;
191 struct sk_buff *skb; 191 struct sk_buff *skb;
192 u16 pkt_len; 192 u16 pkt_len;
193 const struct ieee80211_mgmt *mgmt; 193 const struct ieee80211_mgmt *mgmt;
@@ -1968,7 +1968,7 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy,
1968 user_scan_cfg->chan_list[i].chan_number = chan->hw_value; 1968 user_scan_cfg->chan_list[i].chan_number = chan->hw_value;
1969 user_scan_cfg->chan_list[i].radio_type = chan->band; 1969 user_scan_cfg->chan_list[i].radio_type = chan->band;
1970 1970
1971 if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) 1971 if (chan->flags & IEEE80211_CHAN_NO_IR)
1972 user_scan_cfg->chan_list[i].scan_type = 1972 user_scan_cfg->chan_list[i].scan_type =
1973 MWIFIEX_SCAN_TYPE_PASSIVE; 1973 MWIFIEX_SCAN_TYPE_PASSIVE;
1974 else 1974 else
@@ -2702,9 +2702,10 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
2702 wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME | 2702 wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME |
2703 WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | 2703 WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD |
2704 WIPHY_FLAG_AP_UAPSD | 2704 WIPHY_FLAG_AP_UAPSD |
2705 WIPHY_FLAG_CUSTOM_REGULATORY |
2706 WIPHY_FLAG_STRICT_REGULATORY |
2707 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; 2705 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
2706 wiphy->regulatory_flags |=
2707 REGULATORY_CUSTOM_REG |
2708 REGULATORY_STRICT_REG;
2708 2709
2709 wiphy_apply_custom_regulatory(wiphy, &mwifiex_world_regdom_custom); 2710 wiphy_apply_custom_regulatory(wiphy, &mwifiex_world_regdom_custom);
2710 2711
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 8cf7d50a7603..0ed06646f19a 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -515,14 +515,14 @@ mwifiex_scan_create_channel_list(struct mwifiex_private *priv,
515 scan_chan_list[chan_idx].max_scan_time = 515 scan_chan_list[chan_idx].max_scan_time =
516 cpu_to_le16((u16) user_scan_in-> 516 cpu_to_le16((u16) user_scan_in->
517 chan_list[0].scan_time); 517 chan_list[0].scan_time);
518 else if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) 518 else if (ch->flags & IEEE80211_CHAN_NO_IR)
519 scan_chan_list[chan_idx].max_scan_time = 519 scan_chan_list[chan_idx].max_scan_time =
520 cpu_to_le16(adapter->passive_scan_time); 520 cpu_to_le16(adapter->passive_scan_time);
521 else 521 else
522 scan_chan_list[chan_idx].max_scan_time = 522 scan_chan_list[chan_idx].max_scan_time =
523 cpu_to_le16(adapter->active_scan_time); 523 cpu_to_le16(adapter->active_scan_time);
524 524
525 if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) 525 if (ch->flags & IEEE80211_CHAN_NO_IR)
526 scan_chan_list[chan_idx].chan_scan_mode_bitmap 526 scan_chan_list[chan_idx].chan_scan_mode_bitmap
527 |= MWIFIEX_PASSIVE_SCAN; 527 |= MWIFIEX_PASSIVE_SCAN;
528 else 528 else
diff --git a/drivers/net/wireless/rtlwifi/regd.c b/drivers/net/wireless/rtlwifi/regd.c
index d7d0d4948b01..89e36568e70f 100644
--- a/drivers/net/wireless/rtlwifi/regd.c
+++ b/drivers/net/wireless/rtlwifi/regd.c
@@ -59,30 +59,26 @@ static struct country_code_to_enum_rd allCountries[] = {
59 */ 59 */
60#define RTL819x_2GHZ_CH12_13 \ 60#define RTL819x_2GHZ_CH12_13 \
61 REG_RULE(2467-10, 2472+10, 40, 0, 20,\ 61 REG_RULE(2467-10, 2472+10, 40, 0, 20,\
62 NL80211_RRF_PASSIVE_SCAN) 62 NL80211_RRF_NO_IR)
63 63
64#define RTL819x_2GHZ_CH14 \ 64#define RTL819x_2GHZ_CH14 \
65 REG_RULE(2484-10, 2484+10, 40, 0, 20, \ 65 REG_RULE(2484-10, 2484+10, 40, 0, 20, \
66 NL80211_RRF_PASSIVE_SCAN | \ 66 NL80211_RRF_NO_IR | NL80211_RRF_NO_OFDM)
67 NL80211_RRF_NO_OFDM)
68 67
69/* 5G chan 36 - chan 64*/ 68/* 5G chan 36 - chan 64*/
70#define RTL819x_5GHZ_5150_5350 \ 69#define RTL819x_5GHZ_5150_5350 \
71 REG_RULE(5150-10, 5350+10, 40, 0, 30, \ 70 REG_RULE(5150-10, 5350+10, 40, 0, 30, \
72 NL80211_RRF_PASSIVE_SCAN | \ 71 NL80211_RRF_NO_IR)
73 NL80211_RRF_NO_IBSS)
74 72
75/* 5G chan 100 - chan 165*/ 73/* 5G chan 100 - chan 165*/
76#define RTL819x_5GHZ_5470_5850 \ 74#define RTL819x_5GHZ_5470_5850 \
77 REG_RULE(5470-10, 5850+10, 40, 0, 30, \ 75 REG_RULE(5470-10, 5850+10, 40, 0, 30, \
78 NL80211_RRF_PASSIVE_SCAN | \ 76 NL80211_RRF_NO_IR)
79 NL80211_RRF_NO_IBSS)
80 77
81/* 5G chan 149 - chan 165*/ 78/* 5G chan 149 - chan 165*/
82#define RTL819x_5GHZ_5725_5850 \ 79#define RTL819x_5GHZ_5725_5850 \
83 REG_RULE(5725-10, 5850+10, 40, 0, 30, \ 80 REG_RULE(5725-10, 5850+10, 40, 0, 30, \
84 NL80211_RRF_PASSIVE_SCAN | \ 81 NL80211_RRF_NO_IR)
85 NL80211_RRF_NO_IBSS)
86 82
87#define RTL819x_5GHZ_ALL \ 83#define RTL819x_5GHZ_ALL \
88 (RTL819x_5GHZ_5150_5350, RTL819x_5GHZ_5470_5850) 84 (RTL819x_5GHZ_5150_5350, RTL819x_5GHZ_5470_5850)
@@ -185,16 +181,11 @@ static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy,
185 *regulatory_hint(). 181 *regulatory_hint().
186 */ 182 */
187 183
188 if (!(reg_rule->flags & NL80211_RRF_NO_IBSS)) 184 if (!(reg_rule->flags & NL80211_RRF_NO_IR))
189 ch->flags &= ~IEEE80211_CHAN_NO_IBSS; 185 ch->flags &= ~IEEE80211_CHAN_NO_IR;
190 if (!(reg_rule->
191 flags & NL80211_RRF_PASSIVE_SCAN))
192 ch->flags &=
193 ~IEEE80211_CHAN_PASSIVE_SCAN;
194 } else { 186 } else {
195 if (ch->beacon_found) 187 if (ch->beacon_found)
196 ch->flags &= ~(IEEE80211_CHAN_NO_IBSS | 188 ch->flags &= ~IEEE80211_CHAN_NO_IR;
197 IEEE80211_CHAN_PASSIVE_SCAN);
198 } 189 }
199 } 190 }
200 } 191 }
@@ -219,11 +210,11 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
219 */ 210 */
220 if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) { 211 if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) {
221 ch = &sband->channels[11]; /* CH 12 */ 212 ch = &sband->channels[11]; /* CH 12 */
222 if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) 213 if (ch->flags & IEEE80211_CHAN_NO_IR)
223 ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; 214 ch->flags &= ~IEEE80211_CHAN_NO_IR;
224 ch = &sband->channels[12]; /* CH 13 */ 215 ch = &sband->channels[12]; /* CH 13 */
225 if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) 216 if (ch->flags & IEEE80211_CHAN_NO_IR)
226 ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; 217 ch->flags &= ~IEEE80211_CHAN_NO_IR;
227 return; 218 return;
228 } 219 }
229 220
@@ -237,17 +228,17 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
237 ch = &sband->channels[11]; /* CH 12 */ 228 ch = &sband->channels[11]; /* CH 12 */
238 reg_rule = freq_reg_info(wiphy, ch->center_freq); 229 reg_rule = freq_reg_info(wiphy, ch->center_freq);
239 if (!IS_ERR(reg_rule)) { 230 if (!IS_ERR(reg_rule)) {
240 if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) 231 if (!(reg_rule->flags & NL80211_RRF_NO_IR))
241 if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) 232 if (ch->flags & IEEE80211_CHAN_NO_IR)
242 ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; 233 ch->flags &= ~IEEE80211_CHAN_NO_IR;
243 } 234 }
244 235
245 ch = &sband->channels[12]; /* CH 13 */ 236 ch = &sband->channels[12]; /* CH 13 */
246 reg_rule = freq_reg_info(wiphy, ch->center_freq); 237 reg_rule = freq_reg_info(wiphy, ch->center_freq);
247 if (!IS_ERR(reg_rule)) { 238 if (!IS_ERR(reg_rule)) {
248 if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) 239 if (!(reg_rule->flags & NL80211_RRF_NO_IR))
249 if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) 240 if (ch->flags & IEEE80211_CHAN_NO_IR)
250 ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; 241 ch->flags &= ~IEEE80211_CHAN_NO_IR;
251 } 242 }
252} 243}
253 244
@@ -284,8 +275,7 @@ static void _rtl_reg_apply_radar_flags(struct wiphy *wiphy)
284 */ 275 */
285 if (!(ch->flags & IEEE80211_CHAN_DISABLED)) 276 if (!(ch->flags & IEEE80211_CHAN_DISABLED))
286 ch->flags |= IEEE80211_CHAN_RADAR | 277 ch->flags |= IEEE80211_CHAN_RADAR |
287 IEEE80211_CHAN_NO_IBSS | 278 IEEE80211_CHAN_NO_IR;
288 IEEE80211_CHAN_PASSIVE_SCAN;
289 } 279 }
290} 280}
291 281
@@ -354,9 +344,9 @@ static int _rtl_regd_init_wiphy(struct rtl_regulatory *reg,
354 344
355 wiphy->reg_notifier = reg_notifier; 345 wiphy->reg_notifier = reg_notifier;
356 346
357 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 347 wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
358 wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY; 348 wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG;
359 wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS; 349 wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
360 350
361 regd = _rtl_regdomain_select(reg); 351 regd = _rtl_regdomain_select(reg);
362 wiphy_apply_custom_regulatory(wiphy, regd); 352 wiphy_apply_custom_regulatory(wiphy, regd);
diff --git a/drivers/net/wireless/ti/wl12xx/scan.c b/drivers/net/wireless/ti/wl12xx/scan.c
index 4a0bbb13806b..7541bd1a4a4b 100644
--- a/drivers/net/wireless/ti/wl12xx/scan.c
+++ b/drivers/net/wireless/ti/wl12xx/scan.c
@@ -47,7 +47,7 @@ static int wl1271_get_scan_channels(struct wl1271 *wl,
47 * In active scans, we only scan channels not 47 * In active scans, we only scan channels not
48 * marked as passive. 48 * marked as passive.
49 */ 49 */
50 (passive || !(flags & IEEE80211_CHAN_PASSIVE_SCAN))) { 50 (passive || !(flags & IEEE80211_CHAN_NO_IR))) {
51 wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ", 51 wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
52 req->channels[i]->band, 52 req->channels[i]->band,
53 req->channels[i]->center_freq); 53 req->channels[i]->center_freq);
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 34d9dfff2ad3..9b2ecf52449f 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -1688,7 +1688,7 @@ int wlcore_cmd_regdomain_config_locked(struct wl1271 *wl)
1688 1688
1689 if (channel->flags & (IEEE80211_CHAN_DISABLED | 1689 if (channel->flags & (IEEE80211_CHAN_DISABLED |
1690 IEEE80211_CHAN_RADAR | 1690 IEEE80211_CHAN_RADAR |
1691 IEEE80211_CHAN_PASSIVE_SCAN)) 1691 IEEE80211_CHAN_NO_IR))
1692 continue; 1692 continue;
1693 1693
1694 ch_bit_idx = wlcore_get_reg_conf_ch_idx(b, ch); 1694 ch_bit_idx = wlcore_get_reg_conf_ch_idx(b, ch);
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 0368b9cbfb89..e9da47cead58 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -91,8 +91,7 @@ static void wl1271_reg_notify(struct wiphy *wiphy,
91 continue; 91 continue;
92 92
93 if (ch->flags & IEEE80211_CHAN_RADAR) 93 if (ch->flags & IEEE80211_CHAN_RADAR)
94 ch->flags |= IEEE80211_CHAN_NO_IBSS | 94 ch->flags |= IEEE80211_CHAN_NO_IR;
95 IEEE80211_CHAN_PASSIVE_SCAN;
96 95
97 } 96 }
98 97
diff --git a/drivers/net/wireless/ti/wlcore/scan.c b/drivers/net/wireless/ti/wlcore/scan.c
index 7ed86203304b..1e3d51cd673a 100644
--- a/drivers/net/wireless/ti/wlcore/scan.c
+++ b/drivers/net/wireless/ti/wlcore/scan.c
@@ -188,16 +188,14 @@ wlcore_scan_get_channels(struct wl1271 *wl,
188 flags = req_channels[i]->flags; 188 flags = req_channels[i]->flags;
189 189
190 if (force_passive) 190 if (force_passive)
191 flags |= IEEE80211_CHAN_PASSIVE_SCAN; 191 flags |= IEEE80211_CHAN_NO_IR;
192 192
193 if ((req_channels[i]->band == band) && 193 if ((req_channels[i]->band == band) &&
194 !(flags & IEEE80211_CHAN_DISABLED) && 194 !(flags & IEEE80211_CHAN_DISABLED) &&
195 (!!(flags & IEEE80211_CHAN_RADAR) == radar) && 195 (!!(flags & IEEE80211_CHAN_RADAR) == radar) &&
196 /* if radar is set, we ignore the passive flag */ 196 /* if radar is set, we ignore the passive flag */
197 (radar || 197 (radar ||
198 !!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive)) { 198 !!(flags & IEEE80211_CHAN_NO_IR) == passive)) {
199
200
201 if (flags & IEEE80211_CHAN_RADAR) { 199 if (flags & IEEE80211_CHAN_RADAR) {
202 channels[j].flags |= SCAN_CHANNEL_FLAGS_DFS; 200 channels[j].flags |= SCAN_CHANNEL_FLAGS_DFS;
203 201
@@ -220,7 +218,7 @@ wlcore_scan_get_channels(struct wl1271 *wl,
220 (band == IEEE80211_BAND_2GHZ) && 218 (band == IEEE80211_BAND_2GHZ) &&
221 (channels[j].channel >= 12) && 219 (channels[j].channel >= 12) &&
222 (channels[j].channel <= 14) && 220 (channels[j].channel <= 14) &&
223 (flags & IEEE80211_CHAN_PASSIVE_SCAN) && 221 (flags & IEEE80211_CHAN_NO_IR) &&
224 !force_passive) { 222 !force_passive) {
225 /* pactive channels treated as DFS */ 223 /* pactive channels treated as DFS */
226 channels[j].flags = SCAN_CHANNEL_FLAGS_DFS; 224 channels[j].flags = SCAN_CHANNEL_FLAGS_DFS;
@@ -243,8 +241,8 @@ wlcore_scan_get_channels(struct wl1271 *wl,
243 max_dwell_time_active, 241 max_dwell_time_active,
244 flags & IEEE80211_CHAN_RADAR ? 242 flags & IEEE80211_CHAN_RADAR ?
245 ", DFS" : "", 243 ", DFS" : "",
246 flags & IEEE80211_CHAN_PASSIVE_SCAN ? 244 flags & IEEE80211_CHAN_NO_IR ?
247 ", PASSIVE" : ""); 245 ", NO-IR" : "");
248 j++; 246 j++;
249 } 247 }
250 } 248 }