Skip to content

Commit 849ee6a

Browse files
LorenzoBianconinbd168
authored andcommitted
mt76: mt7921: fix mt7921_queues_acq implementation
Fix mt7921_queues_acq implementation according to the vendor sdk. Fixes: 474a9f2 ("mt76: mt7921: add debugfs support") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent e907341 commit 849ee6a

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,22 @@ mt7921_queues_acq(struct seq_file *s, void *data)
129129

130130
mt7921_mutex_acquire(dev);
131131

132-
for (i = 0; i < 16; i++) {
133-
int j, acs = i / 4, index = i % 4;
132+
for (i = 0; i < 4; i++) {
134133
u32 ctrl, val, qlen = 0;
134+
int j;
135135

136-
val = mt76_rr(dev, MT_PLE_AC_QEMPTY(acs, index));
137-
ctrl = BIT(31) | BIT(15) | (acs << 8);
136+
val = mt76_rr(dev, MT_PLE_AC_QEMPTY(i));
137+
ctrl = BIT(31) | BIT(11) | (i << 24);
138138

139139
for (j = 0; j < 32; j++) {
140140
if (val & BIT(j))
141141
continue;
142142

143-
mt76_wr(dev, MT_PLE_FL_Q0_CTRL,
144-
ctrl | (j + (index << 5)));
143+
mt76_wr(dev, MT_PLE_FL_Q0_CTRL, ctrl | j);
145144
qlen += mt76_get_field(dev, MT_PLE_FL_Q3_CTRL,
146145
GENMASK(11, 0));
147146
}
148-
seq_printf(s, "AC%d%d: queued=%d\n", acs, index, qlen);
147+
seq_printf(s, "AC%d: queued=%d\n", i, qlen);
149148
}
150149

151150
mt7921_mutex_release(dev);

drivers/net/wireless/mediatek/mt76/mt7921/regs.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
#define MT_PLE_BASE 0x820c0000
1818
#define MT_PLE(ofs) (MT_PLE_BASE + (ofs))
1919

20-
#define MT_PLE_FL_Q0_CTRL MT_PLE(0x1b0)
21-
#define MT_PLE_FL_Q1_CTRL MT_PLE(0x1b4)
22-
#define MT_PLE_FL_Q2_CTRL MT_PLE(0x1b8)
23-
#define MT_PLE_FL_Q3_CTRL MT_PLE(0x1bc)
20+
#define MT_PLE_FL_Q0_CTRL MT_PLE(0x3e0)
21+
#define MT_PLE_FL_Q1_CTRL MT_PLE(0x3e4)
22+
#define MT_PLE_FL_Q2_CTRL MT_PLE(0x3e8)
23+
#define MT_PLE_FL_Q3_CTRL MT_PLE(0x3ec)
2424

25-
#define MT_PLE_AC_QEMPTY(ac, n) MT_PLE(0x300 + 0x10 * (ac) + \
26-
((n) << 2))
25+
#define MT_PLE_AC_QEMPTY(_n) MT_PLE(0x500 + 0x40 * (_n))
2726
#define MT_PLE_AMSDU_PACK_MSDU_CNT(n) MT_PLE(0x10e0 + ((n) << 2))
2827

2928
#define MT_MDP_BASE 0x820cd000

0 commit comments

Comments
 (0)