aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-10-21 13:14:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-12-05 15:42:21 -0500
commit6c3af5888eb1df139c81bf74024f5d63ab336b04 (patch)
tree15f4332818e72a38a80dbde04729e108939dbb4a
parentf33cbc4f4350003a0cfb12be07750f3a95965867 (diff)
ath: simplify ath_reg_apply_beaconing_flags()
Simplify ath_reg_apply_beaconing_flags() by making use of thew new no-ir helper. Cc: smihir@qti.qualcomm.com Cc: tushnimb@qca.qualcomm.com Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/regd.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index a5cbaca41b7b..817340acfb53 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -220,13 +220,11 @@ static void ath_force_no_ir_freq(struct wiphy *wiphy, u16 center_freq)
220} 220}
221 221
222/* 222/*
223 * N.B: These exception rules do not apply radar freqs. 223 * These exception rules do not apply radar frequencies.
224 * 224 *
225 * - We enable adhoc (or beaconing) if allowed by 11d 225 * - We enable initiating radiation if the country IE says its fine:
226 * - We enable active scan if the channel is allowed by 11d
227 * - If no country IE has been processed and a we determine we have 226 * - If no country IE has been processed and a we determine we have
228 * received a beacon on a channel we can enable active scan and 227 * received a beacon on a channel we can enable initiating radiation.
229 * adhoc (or beaconing).
230 */ 228 */
231static void 229static void
232ath_reg_apply_beaconing_flags(struct wiphy *wiphy, 230ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
@@ -234,7 +232,6 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
234{ 232{
235 enum ieee80211_band band; 233 enum ieee80211_band band;
236 struct ieee80211_supported_band *sband; 234 struct ieee80211_supported_band *sband;
237 const struct ieee80211_reg_rule *reg_rule;
238 struct ieee80211_channel *ch; 235 struct ieee80211_channel *ch;
239 unsigned int i; 236 unsigned int i;
240 237
@@ -253,21 +250,13 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
253 (ch->flags & IEEE80211_CHAN_RADAR)) 250 (ch->flags & IEEE80211_CHAN_RADAR))
254 continue; 251 continue;
255 252
256 if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) { 253 /*
257 reg_rule = freq_reg_info(wiphy, ch->center_freq); 254 * If the country IE says initiating radiation
258 if (IS_ERR(reg_rule)) 255 * is OK we trust that.
259 continue; 256 */
260 /* 257 if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)
261 * If 11d had a rule for this channel ensure 258 ath_force_clear_no_ir_chan(wiphy, ch);
262 * we enable adhoc/beaconing if it allows us to 259 else {
263 * use it. Note that we would have disabled it
264 * by applying our static world regdomain by
265 * default during init, prior to calling our
266 * regulatory_hint().
267 */
268 if (!(reg_rule->flags & NL80211_RRF_NO_IR))
269 ch->flags &= ~IEEE80211_CHAN_NO_IR;
270 } else {
271 if (ch->beacon_found) 260 if (ch->beacon_found)
272 ch->flags &= ~IEEE80211_CHAN_NO_IR; 261 ch->flags &= ~IEEE80211_CHAN_NO_IR;
273 } 262 }