From: Andrei Otcheretianski Date: Tue, 14 Jun 2022 14:20:04 +0000 (+0300) Subject: wifi: mac80211: Consider MLO links in offchannel logic X-Git-Tag: v6.0-rc1~141^2~64^2~161 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=54283409cd162fc60480df514924ed4cb313735e;p=thirdparty%2Fkernel%2Flinux.git wifi: mac80211: Consider MLO links in offchannel logic Check all the MLO links to decide whether offchannel TX is needed. Signed-off-by: Andrei Otcheretianski Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index 2ed4e2325914a..aff5d3c399027 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c @@ -842,10 +842,24 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, /* Check if the operating channel is the requested channel */ if (!need_offchan) { - struct ieee80211_chanctx_conf *chanctx_conf; + struct ieee80211_chanctx_conf *chanctx_conf = NULL; + int i; rcu_read_lock(); - chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); + /* Check all the links first */ + for (i = 0; i < ARRAY_SIZE(sdata->vif.link_conf); i++) { + if (!sdata->vif.link_conf[i]) + continue; + + chanctx_conf = rcu_dereference(sdata->vif.link_conf[i]->chanctx_conf); + if (!chanctx_conf) + continue; + + if (ether_addr_equal(sdata->vif.link_conf[i]->addr, mgmt->sa)) + break; + + chanctx_conf = NULL; + } if (chanctx_conf) { need_offchan = params->chan &&