Skip to content

Commit 734a377

Browse files
egrumbachjmberg-intel
authored andcommitted
wifi: iwlwifi: mvm: don't add default link in fw restart flow
When we add the vif (and its default link) in fw restart we may override the link that already exists. We take care of this but if link 0 is a valid MLO link, then we will re-create a default link on mvmvif->link[0] and we'll loose the real link we had there. In non-MLO, we need to re-create the default link upon the interface creation, this is fine. In MLO, we'll just wait for change_vif_links() to re-build the links. Fixes: bf976c8 ("wifi: iwlwifi: mvm: implement link change ops") Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20241010140328.385bfea1b2e9.I4a127312285ccb529cc95cc4edf6fbe1e0a136ad@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 07a6e3b commit 734a377

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw,
4141
/* reset deflink MLO parameters */
4242
mvmvif->deflink.fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
4343
mvmvif->deflink.active = 0;
44-
/* the first link always points to the default one */
45-
mvmvif->link[0] = &mvmvif->deflink;
4644

4745
ret = iwl_mvm_mld_mac_ctxt_add(mvm, vif);
4846
if (ret)
@@ -60,9 +58,19 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw,
6058
IEEE80211_VIF_SUPPORTS_CQM_RSSI;
6159
}
6260

63-
ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf);
64-
if (ret)
65-
goto out_free_bf;
61+
/* We want link[0] to point to the default link, unless we have MLO and
62+
* in this case this will be modified later by .change_vif_links()
63+
* If we are in the restart flow with an MLD connection, we will wait
64+
* to .change_vif_links() to setup the links.
65+
*/
66+
if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) ||
67+
!ieee80211_vif_is_mld(vif)) {
68+
mvmvif->link[0] = &mvmvif->deflink;
69+
70+
ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf);
71+
if (ret)
72+
goto out_free_bf;
73+
}
6674

6775
/* Save a pointer to p2p device vif, so it can later be used to
6876
* update the p2p device MAC when a GO is started/stopped
@@ -1194,7 +1202,11 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw,
11941202

11951203
mutex_lock(&mvm->mutex);
11961204

1197-
if (old_links == 0) {
1205+
/* If we're in RESTART flow, the default link wasn't added in
1206+
* drv_add_interface(), and link[0] doesn't point to it.
1207+
*/
1208+
if (old_links == 0 && !test_bit(IWL_MVM_STATUS_IN_HW_RESTART,
1209+
&mvm->status)) {
11981210
err = iwl_mvm_disable_link(mvm, vif, &vif->bss_conf);
11991211
if (err)
12001212
goto out_err;

0 commit comments

Comments
 (0)