Skip to content

Commit

Permalink
wifi: mac80211_hwsim: skip inactive links on TX
Browse files Browse the repository at this point in the history
With the link activation handling in mac80211, skip
any inactive links on TX.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Sep 6, 2022
1 parent ffa9598 commit 6521ee7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,6 +1734,9 @@ mac80211_hwsim_select_tx_link(struct mac80211_hwsim_data *data,
/* round-robin the available link IDs */
link_id = (sp->last_link + i + 1) % ARRAY_SIZE(vif->link_conf);

if (!(vif->active_links & BIT(link_id)))
continue;

*link_sta = rcu_dereference(sta->link[link_id]);
if (!*link_sta)
continue;
Expand All @@ -1742,6 +1745,10 @@ mac80211_hwsim_select_tx_link(struct mac80211_hwsim_data *data,
if (WARN_ON_ONCE(!bss_conf))
continue;

/* can happen while switching links */
if (!rcu_access_pointer(bss_conf->chanctx_conf))
continue;

sp->last_link = link_id;
return bss_conf;
}
Expand Down

0 comments on commit 6521ee7

Please sign in to comment.