brcm80211: fix usage of freq_reg_info()
authorLuis R. Rodriguez <[email protected]>
Tue, 29 Oct 2013 18:34:25 +0000 (19:34 +0100)
committerJohn W. Linville <[email protected]>
Thu, 5 Dec 2013 19:54:49 +0000 (14:54 -0500)
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 <[email protected]>
Cc: Peter Senna Tschudin <[email protected]>
Cc: Seth Forshee <[email protected]>
Cc: Arend van Spriel <[email protected]>
Reported-by: Mihir Shete <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
Acked-by: Arend van Spriel <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
drivers/net/wireless/brcm80211/brcmsmac/channel.c

index ef05df04136b0ed26a3f80abd0a9591e8de9ec44..635ae034c7e5d8d149cec933b55d7405678fa6ba 100644 (file)
@@ -679,7 +679,8 @@ brcms_reg_apply_beaconing_flags(struct wiphy *wiphy,
                                continue;
 
                        if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) {
-                               rule = freq_reg_info(wiphy, ch->center_freq);
+                               rule = freq_reg_info(wiphy,
+                                                    MHZ_TO_KHZ(ch->center_freq));
                                if (IS_ERR(rule))
                                        continue;