Skip to content

Commit 3ba20af

Browse files
committed
wifi: mt76: scan: set vif offchannel link for scanning/roc
The driver needs to know what vif link to use Link: https://patch.msgid.link/20250311103646.43346-4-nbd@nbd.name Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 0337355 commit 3ba20af

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

drivers/net/wireless/mediatek/mt76/channel.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ struct mt76_vif_link *mt76_get_vif_phy_link(struct mt76_phy *phy,
293293
kfree(mlink);
294294
return ERR_PTR(ret);
295295
}
296+
rcu_assign_pointer(mvif->offchannel_link, mlink);
296297

297298
return mlink;
298299
}
@@ -301,10 +302,12 @@ void mt76_put_vif_phy_link(struct mt76_phy *phy, struct ieee80211_vif *vif,
301302
struct mt76_vif_link *mlink)
302303
{
303304
struct mt76_dev *dev = phy->dev;
305+
struct mt76_vif_data *mvif = mlink->mvif;
304306

305307
if (IS_ERR_OR_NULL(mlink) || !mlink->offchannel)
306308
return;
307309

310+
rcu_assign_pointer(mvif->offchannel_link, NULL);
308311
dev->drv->vif_link_remove(phy, vif, &vif->bss_conf, mlink);
309312
kfree(mlink);
310313
}

drivers/net/wireless/mediatek/mt76/mt76.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ struct mt76_wcid {
351351
u8 hw_key_idx;
352352
u8 hw_key_idx2;
353353

354+
u8 offchannel:1;
354355
u8 sta:1;
355356
u8 sta_disabled:1;
356357
u8 amsdu:1;
@@ -787,6 +788,7 @@ struct mt76_vif_link {
787788

788789
struct mt76_vif_data {
789790
struct mt76_vif_link __rcu *link[IEEE80211_MLD_MAX_NUM_LINKS];
791+
struct mt76_vif_link __rcu *offchannel_link;
790792

791793
struct mt76_phy *roc_phy;
792794
u16 valid_links;

0 commit comments

Comments
 (0)