nl80211: Pass center frequency in kHz instead of MHz
authorHaim Dreyfuss <haim.dreyfuss@intel.com>
Tue, 21 Aug 2018 06:22:20 +0000 (09:22 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 28 Aug 2018 09:41:23 +0000 (11:41 +0200)
freq_reg_info expects to get the frequency in kHz. Instead we
accidently pass it in MHz.  Thus, currently the function always
return ERR rule. Fix that.

Fixes: 50f32718e125 ("nl80211: Add wmm rule attribute to NL80211_CMD_GET_WIPHY dump command")
Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
[fix kHz/MHz in commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index 3f7ffbe6c63499a0be2d4f4b989b5a954b1b62e2..ce0149a86c1394c3ae796949fe65e77d77bd2794 100644 (file)
@@ -764,7 +764,7 @@ static int nl80211_msg_put_channel(struct sk_buff *msg, struct wiphy *wiphy,
 
        if (large) {
                const struct ieee80211_reg_rule *rule =
-                       freq_reg_info(wiphy, chan->center_freq);
+                       freq_reg_info(wiphy, MHZ_TO_KHZ(chan->center_freq));
 
                if (!IS_ERR_OR_NULL(rule) && rule->has_wmm) {
                        if (nl80211_msg_put_wmm_rules(msg, rule))