[PATCH] wifi: ath12k: Initialize regulatory frequency ranges to avoid filtering all channels
Baochen Qiang
baochen.qiang at oss.qualcomm.com
Sun Jan 25 21:26:47 PST 2026
On 1/23/2026 11:57 PM, Saikiran wrote:
> Commit 657b0c72c4ad ("wifi: ath12k: Fix frequency range in driver")
> added reg_freq_2ghz/5ghz/6ghz structures to intersect regulatory
> frequency ranges with hardware capabilities. However, these structures
> are never initialized for devices with self-managed regulatory (like
> WCN7850).
>
> The WCN7850 firmware manages its own regulatory domain and never calls
> ath12k_reg_build_regd() which updates these structures. This leaves
> them at {0, 0}, causing this logic in mac.c:
No. That function indeed would be called for WCN7850.
>
> freq_high = min(reg_cap->high_5ghz_chan, ab->reg_freq_5ghz.end_freq);
> // freq_high = min(6000MHz, 0) = 0
>
> Result: ALL 5GHz channels are filtered out and 5GHz WiFi is broken.
>
> Fix: Initialize reg_freq_* structures to full frequency ranges in
> ath12k_core_alloc(). For devices with proper regulatory domain
> updates, these will be overwritten by ath12k_reg_build_regd().
> For WCN7850 with self-managed regulatory, these defaults allow
> channels to work.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302
> Fixes: 657b0c72c4ad ("wifi: ath12k: Fix frequency range in driver")
>
> Signed-off-by: Saikiran <bjsaikiran at gmail.com>
> ---
> drivers/net/wireless/ath/ath12k/core.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
> index 4121dd14bbcc..99c26ba01304 100644
> --- a/drivers/net/wireless/ath/ath12k/core.c
> +++ b/drivers/net/wireless/ath/ath12k/core.c
> @@ -2290,6 +2290,19 @@ struct ath12k_base *ath12k_core_alloc(struct device *dev, size_t priv_size,
> ab->qmi.num_radios = U8_MAX;
> ab->single_chip_mlo_support = false;
>
> + /* Initialize regulatory frequency ranges to full range.
> + * These will be updated by ath12k_reg_build_regd() when
> + * regulatory domain is set. For WCN7850 with self-managed
> + * regulatory, firmware doesn't call reg_build_regd so we
> + * need sane defaults to avoid filtering out all channels.
> + */
> + ab->reg_freq_2ghz.start_freq = 2312000; /* 2.312 GHz */
> + ab->reg_freq_2ghz.end_freq = 2732000; /* 2.732 GHz */
> + ab->reg_freq_5ghz.start_freq = 5150000; /* 5.150 GHz */
> + ab->reg_freq_5ghz.end_freq = 5945000; /* 5.945 GHz */
> + ab->reg_freq_6ghz.start_freq = 5945000; /* 5.945 GHz */
> + ab->reg_freq_6ghz.end_freq = 7125000; /* 7.125 GHz */
> +
> /* Device index used to identify the devices in a group.
> *
> * In Intra-device MLO, only one device present in a group,
More information about the ath12k
mailing list