summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2023-10-11 13:07:24 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-10-23 12:26:27 +0200
commitf3276ff0d498a364dfdff74cc1825b5f6e27f472 (patch)
tree1b00a7a8ec8cc15d01751053dddc6a0cfe8c4501 /drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
parentdf7e30980cb5250604a15f8861c251779ab8bc12 (diff)
wifi: iwlwifi: mvm: don't add dummy phy context
From its very first stages of development, iwlmvm added all the PHY context immediately upon firmware boot. Then, all we needed to do is to modify the contexts. This was fine if the addition of a PHY context that we don't need is free. This was true until now. Newer devices will run calibrations upon the addition of a PHY context. Change the way we work with PHY context in iwlmvm. Fortunately, we already have all the ref counting in place so that it is not very hard to do. Also, since we now remove the PHY context before the link is removed (but after it has been de-activated of course), it'll confuse the firmware if we put the late phy_id into the LINK command that removes the link. Change this to put an invalid phy_id just like we do when we add a link that has no PHY context yet. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20231011130030.55a1a78719be.I2032a7d227b57f4fc4370a2793476d47538404fd@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index ce65d74413fb..0d78a9efbe2f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -4693,6 +4693,9 @@ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
}
}
+ /* Configure the PHY context */
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
+
/* If the currently used PHY context is configured with a matching
* channel use it
*/
@@ -4707,12 +4710,16 @@ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
}
mvmvif->deflink.phy_ctxt = phy_ctxt;
+ ret = iwl_mvm_phy_ctxt_add(mvm, phy_ctxt, &chandef, 1, 1);
+ if (ret) {
+ IWL_ERR(mvm, "Failed to change PHY context\n");
+ goto out_unlock;
+ }
+
iwl_mvm_phy_ctxt_ref(mvm, mvmvif->deflink.phy_ctxt);
+ goto link_and_start_p2p_roc;
}
- /* Configure the PHY context */
- cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
-
ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &chandef,
1, 1);
if (ret) {
@@ -4797,9 +4804,9 @@ static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm,
goto out;
}
- ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, def,
- ctx->rx_chains_static,
- ctx->rx_chains_dynamic);
+ ret = iwl_mvm_phy_ctxt_add(mvm, phy_ctxt, def,
+ ctx->rx_chains_static,
+ ctx->rx_chains_dynamic);
if (ret) {
IWL_ERR(mvm, "Failed to add PHY context\n");
goto out;