* [PATCH ath-next] wifi: ath12k: update unsupported bandwidth flags in reg rules
@ 2025-07-01 13:59 Amith A
2025-07-08 3:57 ` Vasanthakumar Thiagarajan
2025-07-10 14:36 ` Jeff Johnson
0 siblings, 2 replies; 3+ messages in thread
From: Amith A @ 2025-07-01 13:59 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, quic_amitajit, Harshitha Prem
From: Harshitha Prem <quic_hprem@quicinc.com>
The maximum bandwidth an interface can operate in is defined by the
configured country. However, currently, it is able to operate in
bandwidths greater than the allowed bandwidth. For example,
the Central African Republic (CF) supports a maximum bandwidth of 40 MHz
in both the 2 GHz and 5 GHz bands, but an interface is still able to
operate in bandwidths higher than 40 MHz. This issue arises because the
regulatory rules in the regd are not updated with these restrictions
received from firmware on the maximum bandwidth.
Hence, update the regulatory rules with unsupported bandwidth flags based
on the maximum bandwidth to ensure compliance with country-specific
regulations.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00284-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
Signed-off-by: Amith A <quic_amitajit@quicinc.com>
---
drivers/net/wireless/ath/ath12k/reg.c | 31 ++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/reg.c b/drivers/net/wireless/ath/ath12k/reg.c
index 96254d6fc675..7898f6981e5a 100644
--- a/drivers/net/wireless/ath/ath12k/reg.c
+++ b/drivers/net/wireless/ath/ath12k/reg.c
@@ -426,6 +426,29 @@ ath12k_map_fw_dfs_region(enum ath12k_dfs_region dfs_region)
}
}
+static u32 ath12k_get_bw_reg_flags(u16 max_bw)
+{
+ switch (max_bw) {
+ case 20:
+ return NL80211_RRF_NO_HT40 |
+ NL80211_RRF_NO_80MHZ |
+ NL80211_RRF_NO_160MHZ |
+ NL80211_RRF_NO_320MHZ;
+ case 40:
+ return NL80211_RRF_NO_80MHZ |
+ NL80211_RRF_NO_160MHZ |
+ NL80211_RRF_NO_320MHZ;
+ case 80:
+ return NL80211_RRF_NO_160MHZ |
+ NL80211_RRF_NO_320MHZ;
+ case 160:
+ return NL80211_RRF_NO_320MHZ;
+ case 320:
+ default:
+ return 0;
+ }
+}
+
static u32 ath12k_map_fw_reg_flags(u16 reg_flags)
{
u32 flags = 0;
@@ -704,7 +727,7 @@ ath12k_reg_build_regd(struct ath12k_base *ab,
reg_rule = reg_info->reg_rules_2g_ptr + i;
max_bw = min_t(u16, reg_rule->max_bw,
reg_info->max_bw_2g);
- flags = 0;
+ flags = ath12k_get_bw_reg_flags(reg_info->max_bw_2g);
ath12k_reg_update_freq_range(&ab->reg_freq_2ghz, reg_rule);
} else if (reg_info->num_5g_reg_rules &&
(j < reg_info->num_5g_reg_rules)) {
@@ -718,13 +741,15 @@ ath12k_reg_build_regd(struct ath12k_base *ab,
* BW correction if required and applies flags as
* per other BW rule flags we pass from here
*/
- flags = NL80211_RRF_AUTO_BW;
+ flags = NL80211_RRF_AUTO_BW |
+ ath12k_get_bw_reg_flags(reg_info->max_bw_5g);
ath12k_reg_update_freq_range(&ab->reg_freq_5ghz, reg_rule);
} else if (reg_info->is_ext_reg_event && reg_6ghz_number &&
(k < reg_6ghz_number)) {
reg_rule = reg_rule_6ghz + k++;
max_bw = min_t(u16, reg_rule->max_bw, max_bw_6ghz);
- flags = NL80211_RRF_AUTO_BW;
+ flags = NL80211_RRF_AUTO_BW |
+ ath12k_get_bw_reg_flags(max_bw_6ghz);
if (reg_rule->psd_flag)
flags |= NL80211_RRF_PSD;
ath12k_reg_update_freq_range(&ab->reg_freq_6ghz, reg_rule);
base-commit: 6e17bbb5a86e6c68d65e38dfc850699e7a0706cb
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH ath-next] wifi: ath12k: update unsupported bandwidth flags in reg rules
2025-07-01 13:59 [PATCH ath-next] wifi: ath12k: update unsupported bandwidth flags in reg rules Amith A
@ 2025-07-08 3:57 ` Vasanthakumar Thiagarajan
2025-07-10 14:36 ` Jeff Johnson
1 sibling, 0 replies; 3+ messages in thread
From: Vasanthakumar Thiagarajan @ 2025-07-08 3:57 UTC (permalink / raw)
To: Amith A, ath12k; +Cc: linux-wireless, Harshitha Prem
On 7/1/2025 7:29 PM, Amith A wrote:
> From: Harshitha Prem <quic_hprem@quicinc.com>
>
> The maximum bandwidth an interface can operate in is defined by the
> configured country. However, currently, it is able to operate in
> bandwidths greater than the allowed bandwidth. For example,
> the Central African Republic (CF) supports a maximum bandwidth of 40 MHz
> in both the 2 GHz and 5 GHz bands, but an interface is still able to
> operate in bandwidths higher than 40 MHz. This issue arises because the
> regulatory rules in the regd are not updated with these restrictions
> received from firmware on the maximum bandwidth.
>
> Hence, update the regulatory rules with unsupported bandwidth flags based
> on the maximum bandwidth to ensure compliance with country-specific
> regulations.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00284-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
> Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
> Signed-off-by: Amith A <quic_amitajit@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH ath-next] wifi: ath12k: update unsupported bandwidth flags in reg rules
2025-07-01 13:59 [PATCH ath-next] wifi: ath12k: update unsupported bandwidth flags in reg rules Amith A
2025-07-08 3:57 ` Vasanthakumar Thiagarajan
@ 2025-07-10 14:36 ` Jeff Johnson
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Johnson @ 2025-07-10 14:36 UTC (permalink / raw)
To: ath12k, Amith A; +Cc: linux-wireless, Harshitha Prem
On Tue, 01 Jul 2025 19:29:02 +0530, Amith A wrote:
> The maximum bandwidth an interface can operate in is defined by the
> configured country. However, currently, it is able to operate in
> bandwidths greater than the allowed bandwidth. For example,
> the Central African Republic (CF) supports a maximum bandwidth of 40 MHz
> in both the 2 GHz and 5 GHz bands, but an interface is still able to
> operate in bandwidths higher than 40 MHz. This issue arises because the
> regulatory rules in the regd are not updated with these restrictions
> received from firmware on the maximum bandwidth.
>
> [...]
Applied, thanks!
[1/1] wifi: ath12k: update unsupported bandwidth flags in reg rules
commit: 2109e98503bc1c01c399feac68cc8b7faf6d0a4a
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-10 14:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-01 13:59 [PATCH ath-next] wifi: ath12k: update unsupported bandwidth flags in reg rules Amith A
2025-07-08 3:57 ` Vasanthakumar Thiagarajan
2025-07-10 14:36 ` Jeff Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).