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 /net/wireless/reg.c | |
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 'net/wireless/reg.c')
-rw-r--r-- | net/wireless/reg.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 7da67fd0b418..e4e3337ba296 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -163,35 +163,29 @@ static const struct ieee80211_regdomain world_regdom = { | |||
163 | REG_RULE(2412-10, 2462+10, 40, 6, 20, 0), | 163 | REG_RULE(2412-10, 2462+10, 40, 6, 20, 0), |
164 | /* IEEE 802.11b/g, channels 12..13. */ | 164 | /* IEEE 802.11b/g, channels 12..13. */ |
165 | REG_RULE(2467-10, 2472+10, 40, 6, 20, | 165 | REG_RULE(2467-10, 2472+10, 40, 6, 20, |
166 | NL80211_RRF_PASSIVE_SCAN | | 166 | NL80211_RRF_NO_IR), |
167 | NL80211_RRF_NO_IBSS), | ||
168 | /* IEEE 802.11 channel 14 - Only JP enables | 167 | /* IEEE 802.11 channel 14 - Only JP enables |
169 | * this and for 802.11b only */ | 168 | * this and for 802.11b only */ |
170 | REG_RULE(2484-10, 2484+10, 20, 6, 20, | 169 | REG_RULE(2484-10, 2484+10, 20, 6, 20, |
171 | NL80211_RRF_PASSIVE_SCAN | | 170 | NL80211_RRF_NO_IR | |
172 | NL80211_RRF_NO_IBSS | | ||
173 | NL80211_RRF_NO_OFDM), | 171 | NL80211_RRF_NO_OFDM), |
174 | /* IEEE 802.11a, channel 36..48 */ | 172 | /* IEEE 802.11a, channel 36..48 */ |
175 | REG_RULE(5180-10, 5240+10, 160, 6, 20, | 173 | REG_RULE(5180-10, 5240+10, 160, 6, 20, |
176 | NL80211_RRF_PASSIVE_SCAN | | 174 | NL80211_RRF_NO_IR), |
177 | NL80211_RRF_NO_IBSS), | ||
178 | 175 | ||
179 | /* IEEE 802.11a, channel 52..64 - DFS required */ | 176 | /* IEEE 802.11a, channel 52..64 - DFS required */ |
180 | REG_RULE(5260-10, 5320+10, 160, 6, 20, | 177 | REG_RULE(5260-10, 5320+10, 160, 6, 20, |
181 | NL80211_RRF_PASSIVE_SCAN | | 178 | NL80211_RRF_NO_IR | |
182 | NL80211_RRF_NO_IBSS | | ||
183 | NL80211_RRF_DFS), | 179 | NL80211_RRF_DFS), |
184 | 180 | ||
185 | /* IEEE 802.11a, channel 100..144 - DFS required */ | 181 | /* IEEE 802.11a, channel 100..144 - DFS required */ |
186 | REG_RULE(5500-10, 5720+10, 160, 6, 20, | 182 | REG_RULE(5500-10, 5720+10, 160, 6, 20, |
187 | NL80211_RRF_PASSIVE_SCAN | | 183 | NL80211_RRF_NO_IR | |
188 | NL80211_RRF_NO_IBSS | | ||
189 | NL80211_RRF_DFS), | 184 | NL80211_RRF_DFS), |
190 | 185 | ||
191 | /* IEEE 802.11a, channel 149..165 */ | 186 | /* IEEE 802.11a, channel 149..165 */ |
192 | REG_RULE(5745-10, 5825+10, 80, 6, 20, | 187 | REG_RULE(5745-10, 5825+10, 80, 6, 20, |
193 | NL80211_RRF_PASSIVE_SCAN | | 188 | NL80211_RRF_NO_IR), |
194 | NL80211_RRF_NO_IBSS), | ||
195 | 189 | ||
196 | /* IEEE 802.11ad (60gHz), channels 1..3 */ | 190 | /* IEEE 802.11ad (60gHz), channels 1..3 */ |
197 | REG_RULE(56160+2160*1-1080, 56160+2160*3+1080, 2160, 0, 0, 0), | 191 | REG_RULE(56160+2160*1-1080, 56160+2160*3+1080, 2160, 0, 0, 0), |
@@ -698,10 +692,8 @@ regdom_intersect(const struct ieee80211_regdomain *rd1, | |||
698 | static u32 map_regdom_flags(u32 rd_flags) | 692 | static u32 map_regdom_flags(u32 rd_flags) |
699 | { | 693 | { |
700 | u32 channel_flags = 0; | 694 | u32 channel_flags = 0; |
701 | if (rd_flags & NL80211_RRF_PASSIVE_SCAN) | 695 | if (rd_flags & NL80211_RRF_NO_IR_ALL) |
702 | channel_flags |= IEEE80211_CHAN_PASSIVE_SCAN; | 696 | channel_flags |= IEEE80211_CHAN_NO_IR; |
703 | if (rd_flags & NL80211_RRF_NO_IBSS) | ||
704 | channel_flags |= IEEE80211_CHAN_NO_IBSS; | ||
705 | if (rd_flags & NL80211_RRF_DFS) | 697 | if (rd_flags & NL80211_RRF_DFS) |
706 | channel_flags |= IEEE80211_CHAN_RADAR; | 698 | channel_flags |= IEEE80211_CHAN_RADAR; |
707 | if (rd_flags & NL80211_RRF_NO_OFDM) | 699 | if (rd_flags & NL80211_RRF_NO_OFDM) |
@@ -1066,13 +1058,8 @@ static void handle_reg_beacon(struct wiphy *wiphy, unsigned int chan_idx, | |||
1066 | chan_before.center_freq = chan->center_freq; | 1058 | chan_before.center_freq = chan->center_freq; |
1067 | chan_before.flags = chan->flags; | 1059 | chan_before.flags = chan->flags; |
1068 | 1060 | ||
1069 | if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) { | 1061 | if (chan->flags & IEEE80211_CHAN_NO_IR) { |
1070 | chan->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; | 1062 | chan->flags &= ~IEEE80211_CHAN_NO_IR; |
1071 | channel_changed = true; | ||
1072 | } | ||
1073 | |||
1074 | if (chan->flags & IEEE80211_CHAN_NO_IBSS) { | ||
1075 | chan->flags &= ~IEEE80211_CHAN_NO_IBSS; | ||
1076 | channel_changed = true; | 1063 | channel_changed = true; |
1077 | } | 1064 | } |
1078 | 1065 | ||