summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2024-06-12 20:02:33 -0700
committerFelix Fietkau <nbd@nbd.name>2024-07-09 23:01:57 +0200
commit064a5955aa2732844ca1e30b93d66c9ce179e811 (patch)
treeeaf2b56f1796b376d7a37d2a832d9abbc483b77e /drivers/net/wireless/mediatek/mt76
parent612004dd7480b0a039909f3959a73cbc59523f65 (diff)
downloadlinux-064a5955aa2732844ca1e30b93d66c9ce179e811.tar.gz
linux-064a5955aa2732844ca1e30b93d66c9ce179e811.tar.bz2
linux-064a5955aa2732844ca1e30b93d66c9ce179e811.zip
wifi: mt76: mt7925: extend mt7925_mcu_add_bss_info for per-link STA
Extend mt7925_mcu_add_bss_info with the per-link STA configuration. The patch we created is a prerequisite to enable the MLO function in the driver. It is purely a refactoring patch so the functionality should remain unchanged. Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-40-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7925/main.c9
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7925/mcu.c6
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7925/mcu.h2
3 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index f3a32fe9a754..e701d40569fb 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -489,6 +489,7 @@ static int mt7925_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
struct mt792x_sta *msta = sta ? (struct mt792x_sta *)sta->drv_priv :
&mvif->sta;
+ struct ieee80211_link_sta *link_sta = sta ? &sta->deflink : NULL;
struct mt76_wcid *wcid = &msta->deflink.wcid;
struct ieee80211_bss_conf *link_conf;
u8 *wcid_keyidx = &wcid->hw_key_idx;
@@ -535,7 +536,7 @@ static int mt7925_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
mvif->bss_conf.mt76.cipher = mt7925_mcu_get_cipher(key->cipher);
mt7925_mcu_add_bss_info(phy, mvif->bss_conf.mt76.ctx, link_conf,
- sta, true);
+ link_sta, true);
}
if (cmd == SET_KEY)
@@ -738,7 +739,7 @@ int mt7925_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
/* should update bss info before STA add */
if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
mt7925_mcu_add_bss_info(&dev->phy, mvif->bss_conf.mt76.ctx,
- link_conf, sta, false);
+ link_conf, &sta->deflink, false);
ret = mt7925_mcu_sta_update(dev, &sta->deflink, vif, true,
MT76_STA_INFO_STATE_NONE);
@@ -765,7 +766,7 @@ void mt7925_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
mt7925_mcu_add_bss_info(&dev->phy, mvif->bss_conf.mt76.ctx,
- link_conf, sta, true);
+ link_conf, &sta->deflink, true);
ewma_avg_signal_init(&msta->deflink.avg_ack_signal);
@@ -802,7 +803,7 @@ void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
ewma_rssi_init(&mvif->bss_conf.rssi);
if (!sta->tdls)
mt7925_mcu_add_bss_info(&dev->phy, mvif->bss_conf.mt76.ctx,
- link_conf, sta, false);
+ link_conf, &sta->deflink, false);
}
spin_lock_bh(&mdev->sta_poll_lock);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index 901a5d1f4f04..03cce9fca0c3 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -2338,7 +2338,7 @@ int mt7925_mcu_set_timing(struct mt792x_phy *phy,
int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,
struct ieee80211_chanctx_conf *ctx,
struct ieee80211_bss_conf *link_conf,
- struct ieee80211_sta *sta,
+ struct ieee80211_link_sta *link_sta,
int enable)
{
struct mt792x_vif *mvif = (struct mt792x_vif *)link_conf->vif->drv_priv;
@@ -2353,13 +2353,13 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,
return PTR_ERR(skb);
/* bss_basic must be first */
- mt7925_mcu_bss_basic_tlv(skb, link_conf, sta, ctx, phy->mt76,
+ mt7925_mcu_bss_basic_tlv(skb, link_conf, link_sta->sta, ctx, phy->mt76,
mvif->sta.deflink.wcid.idx, enable);
mt7925_mcu_bss_sec_tlv(skb, link_conf);
mt7925_mcu_bss_bmc_tlv(skb, phy, ctx, link_conf);
mt7925_mcu_bss_qos_tlv(skb, link_conf);
- mt7925_mcu_bss_mld_tlv(skb, link_conf, sta);
+ mt7925_mcu_bss_mld_tlv(skb, link_conf, link_sta->sta);
mt7925_mcu_bss_ifs_tlv(skb, link_conf);
if (link_conf->he_support) {
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
index c5197577cdc8..da4e84f468d2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
@@ -595,7 +595,7 @@ int mt7925_mcu_sched_scan_enable(struct mt76_phy *phy,
int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,
struct ieee80211_chanctx_conf *ctx,
struct ieee80211_bss_conf *link_conf,
- struct ieee80211_sta *sta,
+ struct ieee80211_link_sta *link_sta,
int enable);
int mt7925_mcu_set_timing(struct mt792x_phy *phy,
struct ieee80211_bss_conf *link_conf);