wifi: mt76: mt7925: fix the wrong header translation config
authorMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Fri, 29 Dec 2023 03:09:34 +0000 (11:09 +0800)
committerFelix Fietkau <nbd@nbd.name>
Thu, 22 Feb 2024 08:55:17 +0000 (09:55 +0100)
The header translation config should set to broadcast and unicast
cases correctly, not only unicast case. And also remove the cmds
of wtbl (wlan table) series, because these MCU commands have
already been replaced by other commands in mt7925.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index 8c32331..932ecf3 100644 (file)
@@ -814,6 +814,7 @@ mt7925_mcu_sta_hdr_trans_tlv(struct sk_buff *skb,
                             struct ieee80211_vif *vif,
                             struct ieee80211_sta *sta)
 {
+       struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
        struct sta_rec_hdr_trans *hdr_trans;
        struct mt76_wcid *wcid;
        struct tlv *tlv;
@@ -827,7 +828,11 @@ mt7925_mcu_sta_hdr_trans_tlv(struct sk_buff *skb,
        else
                hdr_trans->from_ds = true;
 
-       wcid = (struct mt76_wcid *)sta->drv_priv;
+       if (sta)
+               wcid = (struct mt76_wcid *)sta->drv_priv;
+       else
+               wcid = &mvif->sta.wcid;
+
        if (!wcid)
                return;
 
@@ -1577,8 +1582,6 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
 {
        struct mt76_vif *mvif = (struct mt76_vif *)info->vif->drv_priv;
        struct mt76_dev *dev = phy->dev;
-       struct wtbl_req_hdr *wtbl_hdr;
-       struct tlv *sta_wtbl;
        struct sk_buff *skb;
 
        skb = __mt76_connac_mcu_alloc_sta_req(dev, mvif, info->wcid,
@@ -1602,30 +1605,11 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
                mt7925_mcu_sta_state_v2_tlv(phy, skb, info->sta,
                                            info->vif, info->rcpi,
                                            info->state);
-               mt7925_mcu_sta_hdr_trans_tlv(skb, info->vif, info->sta);
                mt7925_mcu_sta_mld_tlv(skb, info->vif, info->sta);
        }
 
-       sta_wtbl = mt76_connac_mcu_add_tlv(skb, STA_REC_WTBL,
-                                          sizeof(struct tlv));
-
-       wtbl_hdr = mt76_connac_mcu_alloc_wtbl_req(dev, info->wcid,
-                                                 WTBL_RESET_AND_SET,
-                                                 sta_wtbl, &skb);
-       if (IS_ERR(wtbl_hdr))
-               return PTR_ERR(wtbl_hdr);
-
-       if (info->enable) {
-               mt76_connac_mcu_wtbl_generic_tlv(dev, skb, info->vif,
-                                                info->sta, sta_wtbl,
-                                                wtbl_hdr);
-               mt76_connac_mcu_wtbl_hdr_trans_tlv(skb, info->vif, info->wcid,
-                                                  sta_wtbl, wtbl_hdr);
-               if (info->sta)
-                       mt76_connac_mcu_wtbl_ht_tlv(dev, skb, info->sta,
-                                                   sta_wtbl, wtbl_hdr,
-                                                   true, true);
-       }
+       if (info->enable)
+               mt7925_mcu_sta_hdr_trans_tlv(skb, info->vif, info->sta);
 
        return mt76_mcu_skb_send_msg(dev, skb, info->cmd, true);
 }