From 4d8d6e2e7710d4a32793dc3dd5457ad09b42c097 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 4 Jan 2025 08:11:26 +0100 Subject: [PATCH] wifi: mt76: scan: set vif offchannel link for scanning/roc The driver needs to know what vif link to use Signed-off-by: Felix Fietkau --- channel.c | 3 +++ mt76.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/channel.c b/channel.c index 455c3070..ef55c4b9 100644 --- a/channel.c +++ b/channel.c @@ -265,6 +265,7 @@ struct mt76_vif_link *mt76_get_vif_phy_link(struct mt76_phy *phy, kfree(mlink); return ERR_PTR(ret); } + rcu_assign_pointer(mvif->offchannel_link, mlink); return mlink; } @@ -273,10 +274,12 @@ void mt76_put_vif_phy_link(struct mt76_phy *phy, struct ieee80211_vif *vif, struct mt76_vif_link *mlink) { struct mt76_dev *dev = phy->dev; + struct mt76_vif_data *mvif = mlink->mvif; if (IS_ERR_OR_NULL(mlink) || !mlink->offchannel) return; + rcu_assign_pointer(mvif->offchannel_link, NULL); dev->drv->vif_link_remove(phy, vif, &vif->bss_conf, mlink); kfree(mlink); } diff --git a/mt76.h b/mt76.h index cdefe6c5..e5a5881e 100644 --- a/mt76.h +++ b/mt76.h @@ -356,6 +356,7 @@ struct mt76_wcid { u8 hw_key_idx; u8 hw_key_idx2; + u8 offchannel:1; u8 sta:1; u8 sta_disabled:1; u8 amsdu:1; @@ -791,6 +792,7 @@ struct mt76_vif_link { struct mt76_vif_data { struct mt76_vif_link __rcu *link[IEEE80211_MLD_MAX_NUM_LINKS]; + struct mt76_vif_link __rcu *offchannel_link; struct mt76_phy *roc_phy; u16 valid_links;