Revert "wifi: mt76: mt7996: fill txd by host driver"
authorShayne Chen <shayne.chen@mediatek.com>
Fri, 28 Mar 2025 02:28:47 +0000 (10:28 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 21 May 2025 12:49:38 +0000 (14:49 +0200)
This reverts commit 3b522cadedfe6e9e0e8193d7d4ab5aa8d0c73209.

The MTK connac3 has introduced new hardware, SDO (Software Defined
Offload), to offload the process of filling the TX descriptor. Initially,
there were some issues, but after several fixes, it should now be stable,
allowing us to revert this commit.

Additionally, activating SDO is essential for the proper functioning of
features like TX checksum offload.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20250328022847.1612082-1-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7996/mac.c

index 8c35236624266d28823fdf6539d7ba71bb9d6897..771c16e8d10c46bd2cfafd5f2d2298a0325d9047 100644 (file)
@@ -1040,8 +1040,11 @@ int mt7996_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
                return id;
 
        pid = mt76_tx_status_skb_add(mdev, wcid, tx_info->skb);
-       mt7996_mac_write_txwi(dev, txwi_ptr, tx_info->skb, wcid, key,
-                             pid, qid, 0);
+       memset(txwi_ptr, 0, MT_TXD_SIZE);
+       /* Transmit non qos data by 802.11 header and need to fill txd by host*/
+       if (!is_8023 || pid >= MT_PACKET_ID_FIRST)
+               mt7996_mac_write_txwi(dev, txwi_ptr, tx_info->skb, wcid, key,
+                                     pid, qid, 0);
 
        txp = (struct mt76_connac_txp_common *)(txwi + MT_TXD_SIZE);
        for (i = 0; i < nbuf; i++) {
@@ -1058,8 +1061,10 @@ int mt7996_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
        }
        txp->fw.nbuf = nbuf;
 
-       txp->fw.flags =
-               cpu_to_le16(MT_CT_INFO_FROM_HOST | MT_CT_INFO_APPLY_TXD);
+       txp->fw.flags = cpu_to_le16(MT_CT_INFO_FROM_HOST);
+
+       if (!is_8023 || pid >= MT_PACKET_ID_FIRST)
+               txp->fw.flags |= cpu_to_le16(MT_CT_INFO_APPLY_TXD);
 
        if (!key)
                txp->fw.flags |= cpu_to_le16(MT_CT_INFO_NONE_CIPHER_FRAME);