Commit 064a5955 authored by Sean Wang's avatar Sean Wang Committed by Felix Fietkau
Browse files

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: 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/20240613030241.5771-40-sean.wang@kernel.org


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 612004dd
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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) {
+1 −1
Original line number Diff line number Diff line
@@ -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);