diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-10-29 14:34:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-12-05 14:54:51 -0500 |
commit | 856a4ef9f01e9f4b42c96dd70268f4864a93f72c (patch) | |
tree | 92070f916a89f3f30fe6ebff373028a72ebaf705 /drivers/net/wireless/rtlwifi/regd.c | |
parent | 685cc47174f730e68867d83b7db5e36283255e6d (diff) |
rtlwifi: fix usage of freq_reg_info()
freq_reg_info() expects KHz and not MHz, fix this. In
this case we'll now be getting the no-ir flags cleared
on channels for any channel when the country IE trusts
that channel.
@@
struct ieee80211_channel *ch;
struct wiphy *wiphy;
const struct ieee80211_reg_rule *rule;
@@
-rule = freq_reg_info(wiphy, ch->center_freq);
+rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
Generated-by: Coccinelle SmPL
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Reported-by: Mihir Shete <smihir@qti.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/regd.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/regd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/rtlwifi/regd.c b/drivers/net/wireless/rtlwifi/regd.c index 89e36568e70f..a4eb9b271438 100644 --- a/drivers/net/wireless/rtlwifi/regd.c +++ b/drivers/net/wireless/rtlwifi/regd.c | |||
@@ -168,7 +168,8 @@ static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy, | |||
168 | (ch->flags & IEEE80211_CHAN_RADAR)) | 168 | (ch->flags & IEEE80211_CHAN_RADAR)) |
169 | continue; | 169 | continue; |
170 | if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) { | 170 | if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) { |
171 | reg_rule = freq_reg_info(wiphy, ch->center_freq); | 171 | reg_rule = freq_reg_info(wiphy, |
172 | MHZ_TO_KHZ(ch->center_freq)); | ||
172 | if (IS_ERR(reg_rule)) | 173 | if (IS_ERR(reg_rule)) |
173 | continue; | 174 | continue; |
174 | 175 | ||
@@ -226,7 +227,7 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy, | |||
226 | */ | 227 | */ |
227 | 228 | ||
228 | ch = &sband->channels[11]; /* CH 12 */ | 229 | ch = &sband->channels[11]; /* CH 12 */ |
229 | reg_rule = freq_reg_info(wiphy, ch->center_freq); | 230 | reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq)); |
230 | if (!IS_ERR(reg_rule)) { | 231 | if (!IS_ERR(reg_rule)) { |
231 | if (!(reg_rule->flags & NL80211_RRF_NO_IR)) | 232 | if (!(reg_rule->flags & NL80211_RRF_NO_IR)) |
232 | if (ch->flags & IEEE80211_CHAN_NO_IR) | 233 | if (ch->flags & IEEE80211_CHAN_NO_IR) |
@@ -234,7 +235,7 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy, | |||
234 | } | 235 | } |
235 | 236 | ||
236 | ch = &sband->channels[12]; /* CH 13 */ | 237 | ch = &sband->channels[12]; /* CH 13 */ |
237 | reg_rule = freq_reg_info(wiphy, ch->center_freq); | 238 | reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq)); |
238 | if (!IS_ERR(reg_rule)) { | 239 | if (!IS_ERR(reg_rule)) { |
239 | if (!(reg_rule->flags & NL80211_RRF_NO_IR)) | 240 | if (!(reg_rule->flags & NL80211_RRF_NO_IR)) |
240 | if (ch->flags & IEEE80211_CHAN_NO_IR) | 241 | if (ch->flags & IEEE80211_CHAN_NO_IR) |