blob: b71dbccfee342efd35d6ffbba7cc96354ab7f5e8 [file] [log] [blame]
developer78848c62023-04-06 13:44:00 +08001From 3c5f2f053c8115e1a0a818c9f8ba270b30d69c88 Mon Sep 17 00:00:00 2001
developerf8871e82023-03-08 17:22:32 +08002From: Bo Jiao <Bo.Jiao@mediatek.com>
3Date: Mon, 6 Feb 2023 10:40:33 +0800
developerd5789dc2023-03-27 11:22:06 +08004Subject: [PATCH 11/29] wifi: mt76: mt7996: set txd v1
developerf8871e82023-03-08 17:22:32 +08005
6---
7 mt7996/mac.c | 3 +++
8 mt7996/mac.h | 3 ++-
9 2 files changed, 5 insertions(+), 1 deletion(-)
10
11diff --git a/mt7996/mac.c b/mt7996/mac.c
developer78848c62023-04-06 13:44:00 +080012index 198eb71..40ef5e4 100644
developerf8871e82023-03-08 17:22:32 +080013--- a/mt7996/mac.c
14+++ b/mt7996/mac.c
15@@ -1096,6 +1096,7 @@ int mt7996_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
16 struct mt76_txwi_cache *t;
17 int id, i, pid, nbuf = tx_info->nbuf - 1;
18 bool is_8023 = info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP;
19+ __le32 *txd = (__le32 *)txwi_ptr;
20 u8 *txwi = (u8 *)txwi_ptr;
21
22 if (unlikely(tx_info->skb->len <= ETH_HLEN))
23@@ -1127,6 +1128,8 @@ int mt7996_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
24 mt7996_mac_write_txwi(dev, txwi_ptr, tx_info->skb, wcid, qid,
25 pid, key, 0);
26
27+ txd[0] |= le32_encode_bits(1, MT_TXD0_VER);
28+
29 txp = (struct mt76_connac_txp_common *)(txwi + MT_TXD_SIZE);
30 for (i = 0; i < nbuf; i++) {
31 txp->fw.buf[i] = cpu_to_le32(tx_info->buf[i + 1].addr);
32diff --git a/mt7996/mac.h b/mt7996/mac.h
developer78848c62023-04-06 13:44:00 +080033index 2cc218f..4914d3e 100644
developerf8871e82023-03-08 17:22:32 +080034--- a/mt7996/mac.h
35+++ b/mt7996/mac.h
36@@ -183,7 +183,8 @@ enum tx_mgnt_type {
37
38 #define MT_TXD0_Q_IDX GENMASK(31, 25)
39 #define MT_TXD0_PKT_FMT GENMASK(24, 23)
40-#define MT_TXD0_ETH_TYPE_OFFSET GENMASK(22, 16)
41+#define MT_TXD0_VER GENMASK(22, 19)
42+#define MT_TXD0_ETH_TYPE_OFFSET GENMASK(18, 16)
43 #define MT_TXD0_TX_BYTES GENMASK(15, 0)
44
45 #define MT_TXD1_FIXED_RATE BIT(31)
46--
developer78848c62023-04-06 13:44:00 +0800472.18.0
developerf8871e82023-03-08 17:22:32 +080048