Some WCN7850 firmware versions (e.g. WLAN.HMT.1.1.c5-00284.1) report alpha2 "00" (world domain) during initialization instead of a valid country code. When ath12k applies this via regulatory_set_wiphy_regd(), cfg80211 marks all 5 GHz channels as no-IR, which prevents active scanning and makes 5 GHz networks completely invisible to userspace. Without CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS, the reg_notifier unconditionally rejects user hints, leaving no way to recover from the broken world domain without reverting to an older firmware. Fix this by allowing user hints when the current regulatory domain is "00". If the firmware has not provided a valid country code, accepting a user hint via iw reg set lets the driver send a WMI set-country command to the firmware. The firmware then responds with a proper WMI_REG_CHAN_LIST_CC event, restoring 5 GHz channel availability. Once the firmware acknowledges a valid country code, ath12k_regdom_changes() returns true for "00" and subsequent user hints are blocked again, preserving the original security intent of the CONFIG guard. Tested on WCN7850 hw2.0 (ath12k_pci) with linux-firmware 20240318.git3b128b60-0ubuntu2.25 under Ubuntu 24.04 / kernel 6.17. Signed-off-by: Luis Assisted-by: Claude:claude-sonnet-4-6 --- drivers/net/wireless/ath/ath12k/reg.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/reg.c b/drivers/net/wireless/ath/ath12k/reg.c index 7898f6981..0c52d559d 100644 --- a/drivers/net/wireless/ath/ath12k/reg.c +++ b/drivers/net/wireless/ath/ath12k/reg.c @@ -87,9 +87,20 @@ ath12k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) } if (!IS_ENABLED(CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS)) { - ath12k_dbg(ar->ab, ATH12K_DBG_REG, - "Country Setting is not allowed\n"); - return; + /* Allow user hints when firmware reports world domain ("00"). + * Some firmware versions default to alpha2 "00" on init, which + * causes cfg80211 to mark all 5 GHz channels as no-IR, blocking + * active scanning and making 5 GHz networks invisible. When the + * firmware has not provided a valid country code, accept a user + * hint so the correct regulatory domain can be applied. + * Once the firmware responds with a valid country, subsequent + * user hints are blocked again as usual. + */ + if (ath12k_regdom_changes(hw, "00")) { + ath12k_dbg(ar->ab, ATH12K_DBG_REG, + "Country Setting is not allowed\n"); + return; + } } if (!ath12k_regdom_changes(hw, request->alpha2)) { -- 2.43.0