Skip to content

Commit 4387428

Browse files
committed
wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta()
When I implemented iwl_mvm_mac_flush_sta() I completely botched it; it basically always happens after the iwl_mvm_sta_pre_rcu_remove() call, and that already clears mvm->fw_id_to_mac_id[] entries, so we cannot rely on those at iwl_mvm_mac_flush_sta() time. This means it never did anything. Fix this by just going through the station IDs and now with the new API for iwl_mvm_flush_sta(), call those. Fixes: a6cc6cc ("wifi: iwlwifi: mvm: support new flush_sta method") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20231011130030.0b5878e93118.I1093e60163052e7be64d2b01424097cd6a272979@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 3917629 commit 4387428

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5697,22 +5697,20 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
56975697
void iwl_mvm_mac_flush_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
56985698
struct ieee80211_sta *sta)
56995699
{
5700+
struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
57005701
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
5701-
int i;
5702+
struct iwl_mvm_link_sta *mvm_link_sta;
5703+
struct ieee80211_link_sta *link_sta;
5704+
int link_id;
57025705

57035706
mutex_lock(&mvm->mutex);
5704-
for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) {
5705-
struct iwl_mvm_sta *mvmsta;
5706-
struct ieee80211_sta *tmp;
5707-
5708-
tmp = rcu_dereference_protected(mvm->fw_id_to_mac_id[i],
5709-
lockdep_is_held(&mvm->mutex));
5710-
if (tmp != sta)
5707+
for_each_sta_active_link(vif, sta, link_sta, link_id) {
5708+
mvm_link_sta = rcu_dereference_protected(mvmsta->link[link_id],
5709+
lockdep_is_held(&mvm->mutex));
5710+
if (!mvm_link_sta)
57115711
continue;
57125712

5713-
mvmsta = iwl_mvm_sta_from_mac80211(sta);
5714-
5715-
if (iwl_mvm_flush_sta(mvm, mvmsta->deflink.sta_id,
5713+
if (iwl_mvm_flush_sta(mvm, mvm_link_sta->sta_id,
57165714
mvmsta->tfd_queue_msk))
57175715
IWL_ERR(mvm, "flush request fail\n");
57185716
}

0 commit comments

Comments
 (0)