aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Wang <[email protected]>2024-06-12 20:02:32 -0700
committerFelix Fietkau <[email protected]>2024-07-09 23:01:57 +0200
commit612004dd7480b0a039909f3959a73cbc59523f65 (patch)
tree3da6a8d71182b7d6473e21ee2209bf6025666f26
parent6e226666efc06dadc0fc92c63c8fe9fa17898b8b (diff)
wifi: mt76: mt7925: extend mt7925_mcu_sta_hdr_trans_tlv for per-link STA
Extend mt7925_mcu_sta_hdr_trans_tlv with 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 <[email protected]> Signed-off-by: Ming Yen Hsieh <[email protected]> Co-developed-by: Deren Wu <[email protected]> Signed-off-by: Deren Wu <[email protected]> Signed-off-by: Sean Wang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7925/mcu.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index bf2afaf4c0dc..901a5d1f4f04 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -847,7 +847,7 @@ EXPORT_SYMBOL_GPL(mt7925_run_firmware);
static void
mt7925_mcu_sta_hdr_trans_tlv(struct sk_buff *skb,
struct ieee80211_vif *vif,
- struct ieee80211_sta *sta)
+ struct ieee80211_link_sta *link_sta)
{
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
struct sta_rec_hdr_trans *hdr_trans;
@@ -863,8 +863,8 @@ mt7925_mcu_sta_hdr_trans_tlv(struct sk_buff *skb,
else
hdr_trans->from_ds = true;
- if (sta)
- wcid = (struct mt76_wcid *)sta->drv_priv;
+ if (link_sta)
+ wcid = (struct mt76_wcid *)link_sta->sta->drv_priv;
else
wcid = &mvif->sta.deflink.wcid;
@@ -883,6 +883,7 @@ int mt7925_mcu_wtbl_update_hdr_trans(struct mt792x_dev *dev,
struct ieee80211_sta *sta)
{
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
+ struct ieee80211_link_sta *link_sta = sta ? &sta->deflink : NULL;
struct mt792x_sta *msta;
struct sk_buff *skb;
@@ -895,7 +896,7 @@ int mt7925_mcu_wtbl_update_hdr_trans(struct mt792x_dev *dev,
return PTR_ERR(skb);
/* starec hdr trans */
- mt7925_mcu_sta_hdr_trans_tlv(skb, vif, sta);
+ mt7925_mcu_sta_hdr_trans_tlv(skb, vif, link_sta);
return mt76_mcu_skb_send_msg(&dev->mt76, skb,
MCU_WMWA_UNI_CMD(STA_REC_UPDATE), true);
}
@@ -1664,12 +1665,8 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
mt7925_mcu_sta_mld_tlv(skb, info->vif, info->link_sta->sta);
}
- if (info->enable) {
- struct ieee80211_sta *sta = info->link_sta ?
- info->link_sta->sta : NULL;
-
- mt7925_mcu_sta_hdr_trans_tlv(skb, info->vif, sta);
- }
+ if (info->enable)
+ mt7925_mcu_sta_hdr_trans_tlv(skb, info->vif, info->link_sta);
return mt76_mcu_skb_send_msg(dev, skb, info->cmd, true);
}