wifi: mac80211: restore non-chanctx injection behaviour
Subsystems (2)
Johannes Berg
maintainerPATCH v2 1/1 wifi: mac80211: restore non-chanctx injection behaviour
From: Johannes Berg <[email protected]>
During the transition to use channel contexts throughout, the ability to do injection while in monitor mode concurrent with another interface was lost, since the (virtual) monitor won't have a chanctx assigned in this scenario.
We could use the local->hw.conf.chandef in the emulation case, but that wouldn't fix drivers (such as mt76) that themselves are now using channel contexts.
So instead, assume that if there's just a single chanctx that must be the one meant for injection, addressing both cases.
Reported-by Oscar Alfonso Diaz <[email protected]>
Fixes 0a44dfc07074 ("wifi: mac80211: simplify non-chanctx drivers")
Signed-off-by Johannes Berg <[email protected]>
---
v2: use the single chanctx if such a thing exists to fix both
cases of emulation and drivers that changed like mt76
--- net/mac80211/tx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
net/mac80211/tx.c +12 -0
@@ -2395,6 +2395,18 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,rcu_dereference (tmp_sdata->vif.bss_conf.chanctx_conf); } +if (!chanctx_conf) { +struct ieee80211_chanctx *ctx; +bool first = true; + +list_for_each_entry_rcu (ctx, &local->chanctx_list, list) { +if (!first) + goto fail_rcu; + chanctx_conf = &ctx->conf; + first = false; + } + } +if (chanctx_conf) chandef = &chanctx_conf->def;else
Signature · 1 line
2.52.0