Skip to contentSkip to conversation

wifi: rtlwifi: correct unit of center_freq as KHZ passing to freq_reg_info()

PATCH In review Ping-Ke Shih 1 participant 2 messages Oct 13 – Nov 3 Realtek wireless driver (rtlwifi family)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 wifi: rtlwifi: correct unit of center_freq as KHZ passing to freq_reg_info()

The unit of argument center_freq of freq_reg_info() should be KHz, but it wrongly passes ch->center_freq in unit of MHz to freq_reg_info(). Correct the unit.

---
 drivers/net/wireless/realtek/rtlwifi/regd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtlwifi/regd.c +3 -3
index 503625b50fc3..2e4c60886c1e 100644
@@ -153,7 +153,7 @@ static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy,
 				guard(rcu)();
 
 				reg_rule = freq_reg_info(wiphy,
-							 ch->center_freq);
+							 MHZ_TO_KHZ(ch->center_freq));
 				if (IS_ERR(reg_rule))
 					continue;
 				/*
@@ -217,7 +217,7 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
 	guard(rcu)();
 
 	ch = &sband->channels[11];	/* CH 12 */
-	reg_rule = freq_reg_info(wiphy, ch->center_freq);
+	reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
 	if (!IS_ERR(reg_rule)) {
 		if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
 			if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
@@ -225,7 +225,7 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
 	}
 
 	ch = &sband->channels[12];	/* CH 13 */
-	reg_rule = freq_reg_info(wiphy, ch->center_freq);
+	reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
 	if (!IS_ERR(reg_rule)) {
 		if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
 			if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)

base-commit: fbfa27d9b06f025c5f2cfa79d0e01e6400eeff2a

Signature · 1 line
2.25.1
author maintainer
#1 lore raw
Quoted 5 lines · Ping-Ke Shih

The unit of argument center_freq of freq_reg_info() should be KHz, but it wrongly passes ch->center_freq in unit of MHz to freq_reg_info(). Correct the unit.

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

58729ada8f5d wifi: rtlwifi: correct unit of center_freq as KHZ passing to freq_reg_info()

---
https://github.com/pkshih/rtw.git