blob: acd013924d13f3b0ce1fd71a667930e0bd6b0e92 [file] [log] [blame]
From d6998e58f199c6f7bef7022ccae96d6679ef264f Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
Date: Mon, 6 Feb 2023 10:40:33 +0800
Subject: [PATCH 11/29] wifi: mt76: mt7996: set txd v1
---
mt7996/mac.c | 3 +++
mt7996/mac.h | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/mt7996/mac.c b/mt7996/mac.c
index 198eb711..40ef5e4b 100644
--- a/mt7996/mac.c
+++ b/mt7996/mac.c
@@ -1096,6 +1096,7 @@ int mt7996_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
struct mt76_txwi_cache *t;
int id, i, pid, nbuf = tx_info->nbuf - 1;
bool is_8023 = info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP;
+ __le32 *txd = (__le32 *)txwi_ptr;
u8 *txwi = (u8 *)txwi_ptr;
if (unlikely(tx_info->skb->len <= ETH_HLEN))
@@ -1127,6 +1128,8 @@ int mt7996_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
mt7996_mac_write_txwi(dev, txwi_ptr, tx_info->skb, wcid, qid,
pid, key, 0);
+ txd[0] |= le32_encode_bits(1, MT_TXD0_VER);
+
txp = (struct mt76_connac_txp_common *)(txwi + MT_TXD_SIZE);
for (i = 0; i < nbuf; i++) {
txp->fw.buf[i] = cpu_to_le32(tx_info->buf[i + 1].addr);
diff --git a/mt7996/mac.h b/mt7996/mac.h
index 2cc218f7..4914d3e5 100644
--- a/mt7996/mac.h
+++ b/mt7996/mac.h
@@ -183,7 +183,8 @@ enum tx_mgnt_type {
#define MT_TXD0_Q_IDX GENMASK(31, 25)
#define MT_TXD0_PKT_FMT GENMASK(24, 23)
-#define MT_TXD0_ETH_TYPE_OFFSET GENMASK(22, 16)
+#define MT_TXD0_VER GENMASK(22, 19)
+#define MT_TXD0_ETH_TYPE_OFFSET GENMASK(18, 16)
#define MT_TXD0_TX_BYTES GENMASK(15, 0)
#define MT_TXD1_FIXED_RATE BIT(31)
--
2.39.2