@@ -662,16 +662,16 @@ mt7615_txp_skb_unmap_hw(struct mt76_dev *dev, struct mt7615_hw_txp *txp)
u16 len;
len = le16_to_cpu(ptr->len0);
- last = len & MT_TXD_LEN_MSDU_LAST;
- len &= ~MT_TXD_LEN_MSDU_LAST;
+ last = len & MT_TXD_LAST_MASK;
+ len &= ~MT_TXD_LAST_MASK;
dma_unmap_single(dev->dev, le32_to_cpu(ptr->buf0), len,
DMA_TO_DEVICE);
if (last)
break;
len = le16_to_cpu(ptr->len1);
- last = len & MT_TXD_LEN_MSDU_LAST;
- len &= ~MT_TXD_LEN_MSDU_LAST;
+ last = len & MT_TXD_LAST_MASK;
+ len &= ~MT_TXD_LAST_MASK;
dma_unmap_single(dev->dev, le32_to_cpu(ptr->buf1), len,
DMA_TO_DEVICE);
if (last)
@@ -258,6 +258,7 @@ enum tx_phy_bandwidth {
#define MT_TXD_LEN_MSDU_LAST BIT(14)
#define MT_TXD_LEN_AMSDU_LAST BIT(15)
+#define MT_TXD_LAST_MASK GENMASK(15, 14)
struct mt7615_txp_ptr {
__le32 buf0;
@@ -67,8 +67,7 @@ mt7615_write_hw_txp(struct mt7615_dev *dev, struct mt76_tx_info *tx_info,
u16 len = tx_info->buf[i + 1].len;
if (i == nbuf - 1)
- len |= MT_TXD_LEN_MSDU_LAST |
- MT_TXD_LEN_AMSDU_LAST;
+ len |= MT_TXD_LAST_MASK;
if (i & 1) {
ptr->buf1 = cpu_to_le32(addr);
Fix DMA unmap length estimation in mt7615_txp_skb_unmap_hw for mt7622 chipset Fixes: 6aa4ed7927f1 ("mt76: mt7615: implement DMA support for MT7622") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> --- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 8 ++++---- drivers/net/wireless/mediatek/mt76/mt7615/mac.h | 1 + drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-)