diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-10-21 13:22:25 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-11-25 14:49:35 -0500 |
commit | 8fe02e167efa8ed4a4503a5eedc0f49fcb7e3eb9 (patch) | |
tree | 751497c11ae0b02cd90113a379e1fc35c84783ac /drivers/net/wireless/rtlwifi | |
parent | c17bff87bed4bda1835ee41dc908e926414d8d85 (diff) |
cfg80211: consolidate passive-scan and no-ibss flags
These two flags are used for the same purpose, just
combine them into a no-ir flag to annotate no initiating
radiation is allowed.
Old userspace sending either flag will have it treated as
the no-ir flag. To be considerate to older userspace we
also send both the no-ir flag and the old no-ibss flags.
Newer userspace will have to be aware of older kernels.
Update all places in the tree using these flags with the
following semantic patch:
@@
@@
-NL80211_RRF_PASSIVE_SCAN
+NL80211_RRF_NO_IR
@@
@@
-NL80211_RRF_NO_IBSS
+NL80211_RRF_NO_IR
@@
@@
-IEEE80211_CHAN_PASSIVE_SCAN
+IEEE80211_CHAN_NO_IR
@@
@@
-IEEE80211_CHAN_NO_IBSS
+IEEE80211_CHAN_NO_IR
@@
@@
-NL80211_RRF_NO_IR | NL80211_RRF_NO_IR
+NL80211_RRF_NO_IR
@@
@@
-IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_IR
+IEEE80211_CHAN_NO_IR
@@
@@
-(NL80211_RRF_NO_IR)
+NL80211_RRF_NO_IR
@@
@@
-(IEEE80211_CHAN_NO_IR)
+IEEE80211_CHAN_NO_IR
Along with some hand-optimisations in documentation, to
remove duplicates and to fix some indentation.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
[do all the driver updates in one go]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi')
-rw-r--r-- | drivers/net/wireless/rtlwifi/regd.c | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/drivers/net/wireless/rtlwifi/regd.c b/drivers/net/wireless/rtlwifi/regd.c index d7d0d4948b01..8453c53143f5 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 | ||