wifi: iwlwifi: mvm: Always allow entering EMLSR from debugfs
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sun, 5 May 2024 06:19:48 +0000 (09:19 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 6 May 2024 14:33:23 +0000 (16:33 +0200)
EMLSR can't be activated from mac80211. Except for the debugfs, which is
intended for testing purposes. Currently we don't allow entering EMLSR
from debugfs if EMLSR is blocked, i.e. if mvmvif::esr_disable_reason is
not 0. But we need a way to activate EMLSR regardless of the vif being
blocked, for testing. Remove the check of esr_disable_reason

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240505091420.bc3c24d9e0e6.Iad60e22a0d7e2b2b989051e1140b6dc98bef7bcc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/link.c
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

index 32ae606..1ce52ad 100644 (file)
@@ -703,9 +703,9 @@ void iwl_mvm_select_links(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
        primary_link = best_link->link_id;
        new_active_links = BIT(best_link->link_id);
 
-       /* eSR is not supported/allowed, or only one usable link */
-       if (max_active_links == 1 || !iwl_mvm_esr_allowed_on_vif(mvm, vif) ||
-           n_data == 1)
+       /* eSR is not supported/blocked, or only one usable link */
+       if (max_active_links == 1 || !iwl_mvm_vif_has_esr_cap(mvm, vif) ||
+           mvmvif->esr_disable_reason || n_data == 1)
                goto set_active;
 
        for (u8 a = 0; a < n_data; a++)
index e16f1ee..5609b03 100644 (file)
@@ -1159,10 +1159,8 @@ iwl_mvm_mld_change_sta_links(struct ieee80211_hw *hw,
        return ret;
 }
 
-bool iwl_mvm_esr_allowed_on_vif(struct iwl_mvm *mvm,
-                               struct ieee80211_vif *vif)
+bool iwl_mvm_vif_has_esr_cap(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 {
-       struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
        const struct wiphy_iftype_ext_capab *ext_capa;
 
        lockdep_assert_held(&mvm->mutex);
@@ -1176,11 +1174,8 @@ bool iwl_mvm_esr_allowed_on_vif(struct iwl_mvm *mvm,
 
        ext_capa = cfg80211_get_iftype_ext_capa(mvm->hw->wiphy,
                                                ieee80211_vif_type_p2p(vif));
-       if (!ext_capa ||
-           !(ext_capa->eml_capabilities & IEEE80211_EML_CAP_EMLSR_SUPP))
-               return false;
-
-       return !mvmvif->esr_disable_reason;
+       return (ext_capa &&
+               (ext_capa->eml_capabilities & IEEE80211_EML_CAP_EMLSR_SUPP));
 }
 
 static bool iwl_mvm_mld_can_activate_links(struct ieee80211_hw *hw,
@@ -1204,7 +1199,7 @@ static bool iwl_mvm_mld_can_activate_links(struct ieee80211_hw *hw,
 
        /* If it is an eSR device, check that we can enter eSR */
        ret = iwl_mvm_is_esr_supported(mvm->fwrt.trans) &&
-             iwl_mvm_esr_allowed_on_vif(mvm, vif);
+             iwl_mvm_vif_has_esr_cap(mvm, vif);
 
 unlock:
        mutex_unlock(&mvm->mutex);
index fc167ed..c0e0600 100644 (file)
@@ -2873,8 +2873,7 @@ int iwl_mvm_roc_add_cmd(struct iwl_mvm *mvm,
                        int duration, u32 activity);
 
 /* EMLSR */
-bool iwl_mvm_esr_allowed_on_vif(struct iwl_mvm *mvm,
-                               struct ieee80211_vif *vif);
+bool iwl_mvm_vif_has_esr_cap(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
 void iwl_mvm_block_esr(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
                       enum iwl_mvm_esr_state reason,
                       u8 link_to_keep);