Skip to content

Commit 598da38

Browse files
LorenzoBianconinbd168
authored andcommitted
mt76: dma: add skb check for dummy pointer
Introduce skb check for dummy address in mt76_dma_tx_cleanup_idx. This is a preliminary patch to add support for new chipsets (e.g. 7615) Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
1 parent 6ca6672 commit 598da38

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

drivers/net/wireless/mediatek/mt76/dma.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include "mt76.h"
1919
#include "dma.h"
2020

21-
#define DMA_DUMMY_TXWI ((void *) ~0)
22-
2321
static int
2422
mt76_dma_alloc_queue(struct mt76_dev *dev, struct mt76_queue *q,
2523
int idx, int n_desc, int bufsize,
@@ -67,7 +65,7 @@ mt76_dma_add_buf(struct mt76_dev *dev, struct mt76_queue *q,
6765
int i, idx = -1;
6866

6967
if (txwi)
70-
q->entry[q->head].txwi = DMA_DUMMY_TXWI;
68+
q->entry[q->head].txwi = DMA_DUMMY_DATA;
7169

7270
for (i = 0; i < nbufs; i += 2, buf += 2) {
7371
u32 buf0 = buf[0].addr, buf1 = 0;
@@ -126,9 +124,12 @@ mt76_dma_tx_cleanup_idx(struct mt76_dev *dev, struct mt76_queue *q, int idx,
126124
DMA_TO_DEVICE);
127125
}
128126

129-
if (e->txwi == DMA_DUMMY_TXWI)
127+
if (e->txwi == DMA_DUMMY_DATA)
130128
e->txwi = NULL;
131129

130+
if (e->skb == DMA_DUMMY_DATA)
131+
e->skb = NULL;
132+
132133
*prev_e = *e;
133134
memset(e, 0, sizeof(*e));
134135
}

drivers/net/wireless/mediatek/mt76/dma.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#ifndef __MT76_DMA_H
1717
#define __MT76_DMA_H
1818

19+
#define DMA_DUMMY_DATA ((void *)~0)
20+
1921
#define MT_RING_SIZE 0x10
2022

2123
#define MT_DMA_CTL_SD_LEN1 GENMASK(13, 0)

0 commit comments

Comments
 (0)