wifi: iwlwifi: mvm: Stop processing MCC update if there was no change
authorIlan Peer <ilan.peer@intel.com>
Thu, 8 Aug 2024 20:22:44 +0000 (23:22 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 27 Aug 2024 08:28:54 +0000 (10:28 +0200)
When processing a MCC update notification from the firmware, if
the firmware indicates that the regulatory configuration didn't
change, abort the flow and do not notify higher layers.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240808232017.60dd273d00e0.I985b3bc61ca4a6cac7c1d1365b5c0afba04f3031@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c

index 836ca22597bc1e7211d09a3bd02e9a482c8fa37a..80ec59c58ae4d2513ebe66d1c670f47a0e3fe4d5 100644 (file)
@@ -611,6 +611,7 @@ void iwl_mvm_rx_chub_update_mcc(struct iwl_mvm *mvm,
        char mcc[3];
        struct ieee80211_regdomain *regd;
        int wgds_tbl_idx;
+       bool changed = false;
 
        lockdep_assert_held(&mvm->mutex);
 
@@ -630,10 +631,15 @@ void iwl_mvm_rx_chub_update_mcc(struct iwl_mvm *mvm,
        IWL_DEBUG_LAR(mvm,
                      "RX: received chub update mcc cmd (mcc '%s' src %d)\n",
                      mcc, src);
-       regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, mcc, src, NULL);
+       regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, mcc, src, &changed);
        if (IS_ERR_OR_NULL(regd))
                return;
 
+       if (!changed) {
+               IWL_DEBUG_LAR(mvm, "RX: No change in the regulatory data\n");
+               goto out;
+       }
+
        wgds_tbl_idx = iwl_mvm_get_sar_geo_profile(mvm);
        if (wgds_tbl_idx < 1)
                IWL_DEBUG_INFO(mvm,
@@ -644,5 +650,7 @@ void iwl_mvm_rx_chub_update_mcc(struct iwl_mvm *mvm,
                               wgds_tbl_idx);
 
        regulatory_set_wiphy_regd(mvm->hw->wiphy, regd);
+
+out:
        kfree(regd);
 }