summaryrefslogtreecommitdiff
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2024-06-12 20:02:37 -0700
committerFelix Fietkau <nbd@nbd.name>2024-07-09 23:01:59 +0200
commit89397bccc882a446373874cd8c4164e1612d8494 (patch)
tree39754bce33f484d1978b2a5726d5c142df62c386 /drivers/net/wireless
parent5029871583c3cf42f3320b7709820ad44a1313fc (diff)
downloadlwn-89397bccc882a446373874cd8c4164e1612d8494.tar.gz
lwn-89397bccc882a446373874cd8c4164e1612d8494.zip
wifi: mt76: mt7925: add mt7925_mac_link_sta_assoc to associate per-link STA
The mt7925_mac_link_sta_add function currently associates the per-link STA. We will extend this function when we implement the MLO functionality. This patch only includes structural changes and does not involve any logic changes. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-44-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7925/main.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 3872b5debdd8..202bd84716ab 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -767,32 +767,43 @@ int mt7925_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
}
EXPORT_SYMBOL_GPL(mt7925_mac_sta_add);
-void mt7925_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
- struct ieee80211_sta *sta)
+static void mt7925_mac_link_sta_assoc(struct mt76_dev *mdev,
+ struct ieee80211_vif *vif,
+ struct ieee80211_link_sta *link_sta)
{
struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
- struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
struct ieee80211_bss_conf *link_conf;
+ struct mt792x_link_sta *mlink;
+ struct mt792x_sta *msta;
+
+ msta = (struct mt792x_sta *)link_sta->sta->drv_priv;
+ mlink = mt792x_sta_to_link(msta, link_sta->link_id);
mt792x_mutex_acquire(dev);
link_conf = mt792x_vif_to_bss_conf(vif, vif->bss_conf.link_id);
- if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
+ if (vif->type == NL80211_IFTYPE_STATION && !link_sta->sta->tdls)
mt7925_mcu_add_bss_info(&dev->phy, mvif->bss_conf.mt76.ctx,
- link_conf, &sta->deflink, true);
+ link_conf, link_sta, true);
- ewma_avg_signal_init(&msta->deflink.avg_ack_signal);
+ ewma_avg_signal_init(&mlink->avg_ack_signal);
- mt7925_mac_wtbl_update(dev, msta->deflink.wcid.idx,
+ mt7925_mac_wtbl_update(dev, mlink->wcid.idx,
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
- memset(msta->deflink.airtime_ac, 0, sizeof(msta->deflink.airtime_ac));
+ memset(mlink->airtime_ac, 0, sizeof(mlink->airtime_ac));
- mt7925_mcu_sta_update(dev, &sta->deflink, vif, true, MT76_STA_INFO_STATE_ASSOC);
+ mt7925_mcu_sta_update(dev, link_sta, vif, true, MT76_STA_INFO_STATE_ASSOC);
mt792x_mutex_release(dev);
}
+
+void mt7925_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta)
+{
+ mt7925_mac_link_sta_assoc(mdev, vif, &sta->deflink);
+}
EXPORT_SYMBOL_GPL(mt7925_mac_sta_assoc);
void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,