diff mbox series

[06/15] wifi: iwlwifi: mvm: Add a print for invalid link pair due to bandwidth

Message ID 20240506095953.9e57ad898cf4.Id8edfd5e3774ea6475d5f4178ab7ea75a870ef95@changeid
State New
Headers show
Series wifi: iwlwifi: updates - 2024-05-06 | expand

Commit Message

Miri Korenblit May 6, 2024, 7:04 a.m. UTC
From: Yedidya Benshimol <yedidya.ben.shimol@intel.com>

When validating a link pair for EMLSR, add a print for invalid link
pair due to bandwidth

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/link.c | 31 ++++++++++++-------
 1 file changed, 20 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
index 21b5cc0413fe..b0568c74a15b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
@@ -691,12 +691,11 @@  s8 iwl_mvm_get_esr_rssi_thresh(struct iwl_mvm *mvm,
 }
 
 static u32
-iwl_mvm_esr_disallowed_with_link(struct ieee80211_vif *vif,
+iwl_mvm_esr_disallowed_with_link(struct iwl_mvm *mvm,
+				 struct ieee80211_vif *vif,
 				 const struct iwl_mvm_link_sel_data *link,
 				 bool primary)
 {
-	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-	struct iwl_mvm *mvm = mvmvif->mvm;
 	struct wiphy *wiphy = mvm->hw->wiphy;
 	struct ieee80211_bss_conf *conf;
 	enum iwl_mvm_esr_state ret = 0;
@@ -735,20 +734,30 @@  bool iwl_mvm_mld_valid_link_pair(struct ieee80211_vif *vif,
 				 const struct iwl_mvm_link_sel_data *a,
 				 const struct iwl_mvm_link_sel_data *b)
 {
-	/* Per-link considerations */
-	if (iwl_mvm_esr_disallowed_with_link(vif, a, true) ||
-	    iwl_mvm_esr_disallowed_with_link(vif, b, false))
-		return false;
+	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+	struct iwl_mvm *mvm = mvmvif->mvm;
+	enum iwl_mvm_esr_state ret = 0;
 
-	if (a->chandef->width != b->chandef->width)
+	/* Per-link considerations */
+	if (iwl_mvm_esr_disallowed_with_link(mvm, vif, a, true) ||
+	    iwl_mvm_esr_disallowed_with_link(mvm, vif, b, false))
 		return false;
 
-	if (!(a->chandef->chan->band == NL80211_BAND_6GHZ &&
+	if (a->chandef->width != b->chandef->width ||
+	    !(a->chandef->chan->band == NL80211_BAND_6GHZ &&
 	      b->chandef->chan->band == NL80211_BAND_5GHZ))
+		ret |= IWL_MVM_ESR_EXIT_BANDWIDTH;
+
+	if (ret) {
+		IWL_DEBUG_INFO(mvm,
+			       "Links %d and %d are not a valid pair for EMLSR\n",
+			       a->link_id, b->link_id);
+		iwl_mvm_print_esr_state(mvm, ret);
 		return false;
+	}
+
+	return true;
 
-	/* Per-combination considerations */
-	return a->chandef->chan->band != b->chandef->chan->band;
 }
 EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_mvm_mld_valid_link_pair);