Skip to content

Commit

Permalink
wifi: iwlwifi: mvm: handle link-STA allocation in restart
Browse files Browse the repository at this point in the history
During HW restart, STA link changes happen while the link-sta is
already allocated (had been prior to the restart). Adjust the
allocation and checks to handle that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230921110726.99b7cc754b00.Iaa0503a3100250489fed8b4bdcf60e24a96d3392@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Sep 25, 2023
1 parent 5f809ba commit 89dc0a2
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,15 +1104,26 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm,
link_sta_dereference_protected(sta, link_id);
mvm_vif_link = mvm_vif->link[link_id];

if (WARN_ON(!mvm_vif_link || !link_conf || !link_sta ||
mvm_sta->link[link_id])) {
if (WARN_ON(!mvm_vif_link || !link_conf || !link_sta)) {
ret = -EINVAL;
goto err;
}

ret = iwl_mvm_mld_alloc_sta_link(mvm, vif, sta, link_id);
if (WARN_ON(ret))
goto err;
if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) {
if (WARN_ON(!mvm_sta->link[link_id])) {
ret = -EINVAL;
goto err;
}
} else {
if (WARN_ON(mvm_sta->link[link_id])) {
ret = -EINVAL;
goto err;
}
ret = iwl_mvm_mld_alloc_sta_link(mvm, vif, sta,
link_id);
if (WARN_ON(ret))
goto err;
}

link_sta->agg.max_rc_amsdu_len = 1;
ieee80211_sta_recalc_aggregates(sta);
Expand Down

0 comments on commit 89dc0a2

Please sign in to comment.