Commit b1d21403 authored by Sean Wang's avatar Sean Wang Committed by Felix Fietkau

wifi: mt76: add def_wcid to struct mt76_wcid

add def_wcid to struct mt76_wcid to allow per-link wcid to retrieve the
struct ieee80211_sta structure.
Co-developed-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Co-developed-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/d5188ca633666eaad7e90a8061d1a0585487e128.1720248331.git.sean.wang@kernel.orgSigned-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 4f0f33d2
......@@ -368,6 +368,8 @@ struct mt76_wcid {
struct mt76_sta_stats stats;
struct list_head poll_list;
struct mt76_wcid *def_wcid;
};
struct mt76_txq {
......@@ -1258,6 +1260,9 @@ wcid_to_sta(struct mt76_wcid *wcid)
if (!wcid || !wcid->sta)
return NULL;
if (wcid->def_wcid)
ptr = wcid->def_wcid;
return container_of(ptr, struct ieee80211_sta, drv_priv);
}
......
......@@ -892,6 +892,7 @@ mt7925_mac_sta_add_links(struct mt792x_dev *dev, struct ieee80211_vif *vif,
rcu_assign_pointer(msta->link[link_id], mlink);
mlink->sta = msta;
mlink->pri_link = &sta->deflink;
mlink->wcid.def_wcid = &msta->deflink.wcid;
link_sta = mt792x_sta_to_link_sta(vif, sta, link_id);
mt7925_mac_link_sta_add(&dev->mt76, vif, link_sta);
......@@ -1900,6 +1901,7 @@ mt7925_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
mconf->vif = mvif;
mlink->wcid.link_id = link_id;
mlink->wcid.link_valid = !!vif->valid_links;
mlink->wcid.def_wcid = &mvif->sta.deflink.wcid;
}
if (hweight16(mvif->valid_links) == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment