diff mbox series

[2/2] nl80211: Pass center frequency in KHZ instead of MHZ

Message ID 20180821062220.29813-3-luca@coelho.fi (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series nl80211: a couple of fixes for WMM reporting | expand

Commit Message

Luca Coelho Aug. 21, 2018, 6:22 a.m. UTC
From: Haim Dreyfuss <haim.dreyfuss@intel.com>

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>
---
 net/wireless/nl80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1760f38295d5..fbe9e0d98e1b 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -766,7 +766,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(rule) && rule->wmm_rule) {
 			if (nl80211_msg_put_wmm_rules(msg, rule))