summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
diff options
context:
space:
mode:
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>2024-04-16 13:53:59 +0300
committerJohannes Berg <johannes.berg@intel.com>2024-04-19 11:16:32 +0300
commit9c6921121961cc0cecccb95652be6d98116f854b (patch)
tree51bdc5713dffd7c1b3d6a1918fb2e0702049c77f /drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
parent2887af4d22f90bcddd3ff9a6eb93ecdaab3acd94 (diff)
downloadlinux-9c6921121961cc0cecccb95652be6d98116f854b.tar.xz
wifi: iwlwifi: mvm: calculate EMLSR mode after connection
The function iwl_mvm_can_enter_esr() is (among others) calculating if EMLSR mode is disabled due to BT coex by calling iwl_mvm_bt_coex_calculate_esr_mode(), then stores the decision in mvmvif::esr_disable_reason. But there is no need to calculate this every time iwl_mvm_can_enter_esr is called. Fix this by calculating it once after authorization, and in iwl_mvm_can_enter_esr only check mvmvif::esr_disable_reason. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240416134215.a767e243366e.I3b32d36cda23f67dc103a28a9bdccb0039d22574@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
index bcf2fd23300f..25d98ea6db44 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
@@ -1344,13 +1344,13 @@ static bool iwl_mvm_can_enter_esr(struct iwl_mvm *mvm,
unsigned long desired_links)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
- int primary_link = iwl_mvm_mld_get_primary_link(mvm, vif,
- desired_links);
+ u16 usable_links = ieee80211_vif_usable_links(vif);
const struct wiphy_iftype_ext_capab *ext_capa;
bool ret = true;
int link_id;
- if (primary_link < 0)
+ if (!ieee80211_vif_is_mld(vif) || !vif->cfg.assoc ||
+ hweight16(usable_links) <= 1)
return false;
if (!(vif->cfg.eml_cap & IEEE80211_EML_CAP_EMLSR_SUPP))
@@ -1373,12 +1373,7 @@ static bool iwl_mvm_can_enter_esr(struct iwl_mvm *mvm,
if (link_conf->chanreq.oper.chan->band != NL80211_BAND_2GHZ)
continue;
- ret = iwl_mvm_bt_coex_calculate_esr_mode(mvm, vif, link_id,
- primary_link);
- // Mark eSR as disabled for the next time
- if (!ret)
- mvmvif->esr_disable_reason |= IWL_MVM_ESR_DISABLE_COEX;
- break;
+ return !(mvmvif->esr_disable_reason & IWL_MVM_ESR_DISABLE_COEX);
}
return ret;