@@ -696,6 +696,7 @@ static void ath12k_update_11d(struct work_struct *work)
pdev = &ab->pdevs[i];
ar = pdev->ar;
+ memcpy(&ar->alpha2, &set_current_param.alpha2, 2);
ret = ath12k_wmi_send_set_current_country_cmd(ar, &set_current_param);
if (ret)
ath12k_warn(ar->ab,
@@ -582,6 +582,7 @@ struct ath12k {
struct completion completed_11d_scan;
enum ath12k_11d_state state_11d;
bool regdom_set_by_user;
+ u8 alpha2[REG_ALPHA2_LEN + 1];
};
struct ath12k_band_cap {
@@ -6908,6 +6908,14 @@ ath12k_mac_op_reconfig_complete(struct ieee80211_hw *hw,
ar->state = ATH12K_STATE_ON;
ieee80211_wake_queues(ar->hw);
+ if (ar->ab->hw_params->current_cc_support &&
+ ar->alpha2[0] != 0 && ar->alpha2[1] != 0) {
+ struct wmi_set_current_country_params set_current_param = {};
+
+ memcpy(&set_current_param.alpha2, ar->alpha2, 2);
+ ath12k_wmi_send_set_current_country_cmd(ar, &set_current_param);
+ }
+
if (ab->is_reset) {
recovery_count = atomic_inc_return(&ab->recovery_count);
ath12k_dbg(ab, ATH12K_DBG_BOOT, "recovery count %d\n",
@@ -82,6 +82,7 @@ ath12k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
*/
if (ar->ab->hw_params->current_cc_support) {
memcpy(&set_current_param.alpha2, request->alpha2, 2);
+ memcpy(&ar->alpha2, &set_current_param.alpha2, 2);
ret = ath12k_wmi_send_set_current_country_cmd(ar, &set_current_param);
if (ret)
Currently ath12k does not send the country code to firmware after device recovery. As a result the regdomain info is reported from firmware by default. Regdomain info is important, so ath12k also need to restore it to the value which was used before recovery. This is only needed for platforms which support the current_cc_support hardware parameter. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong <quic_wgong@quicinc.com> --- drivers/net/wireless/ath/ath12k/core.c | 1 + drivers/net/wireless/ath/ath12k/core.h | 1 + drivers/net/wireless/ath/ath12k/mac.c | 8 ++++++++ drivers/net/wireless/ath/ath12k/reg.c | 1 + 4 files changed, 11 insertions(+)