Skip to content

Commit

Permalink
wifi: iwlwifi: mvm: select STA mask only for active links
Browse files Browse the repository at this point in the history
During reconfig, we might send keys, but those should be only
sent to already active link stations. Iterate only active ones
to fix that issue.

Fixes: aea9965 ("wifi: iwlwifi: mvm: set STA mask for keys in MLO")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320232419.c6818d1c6033.I6357f05c55ef111002ddc169287eb356ca0c1b21@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Mar 25, 2024
1 parent b97b0c0 commit 2783ab5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,37 @@
u32 iwl_mvm_sta_fw_id_mask(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
int filter_link_id)
{
struct ieee80211_link_sta *link_sta;
struct iwl_mvm_sta *mvmsta;
struct ieee80211_vif *vif;
unsigned int link_id;
u32 result = 0;

if (!sta)
return 0;

mvmsta = iwl_mvm_sta_from_mac80211(sta);
vif = mvmsta->vif;

/* it's easy when the STA is not an MLD */
if (!sta->valid_links)
return BIT(mvmsta->deflink.sta_id);

/* but if it is an MLD, get the mask of all the FW STAs it has ... */
for (link_id = 0; link_id < ARRAY_SIZE(mvmsta->link); link_id++) {
struct iwl_mvm_link_sta *link_sta;
for_each_sta_active_link(vif, sta, link_sta, link_id) {
struct iwl_mvm_link_sta *mvm_link_sta;

/* unless we have a specific link in mind */
if (filter_link_id >= 0 && link_id != filter_link_id)
continue;

link_sta =
mvm_link_sta =
rcu_dereference_check(mvmsta->link[link_id],
lockdep_is_held(&mvm->mutex));
if (!link_sta)
continue;

result |= BIT(link_sta->sta_id);
result |= BIT(mvm_link_sta->sta_id);
}

return result;
Expand Down

0 comments on commit 2783ab5

Please sign in to comment.