From d540538299f759b96710934416e3d39fdcac3afa Mon Sep 17 00:00:00 2001 From: Rex Lu Date: Thu, 4 Sep 2025 18:37:57 +0200 Subject: [PATCH] wifi: mt76: Differentiate between RRO data and RRO MSDU queues This is a preliminary patch to enable WED support for MT7992 Kite chipset supported by MT7996 driver. Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Co-developed-by: Benjamin Lin Signed-off-by: Benjamin Lin Signed-off-by: Rex Lu Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20250904-mt7996-rro-rework-v4-3-2cd91e7229d6@kernel.org Signed-off-by: Felix Fietkau --- dma.c | 2 +- mt76.h | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dma.c b/dma.c index 18c2a2de..68b1dd1d 100644 --- a/dma.c +++ b/dma.c @@ -477,7 +477,7 @@ mt76_dma_dequeue(struct mt76_dev *dev, struct mt76_queue *q, bool flush, if (!q->queued) return NULL; - if (mt76_queue_is_wed_rro_data(q)) + if (mt76_queue_is_wed_rro_data(q) || mt76_queue_is_wed_rro_msdu_pg(q)) return NULL; if (!mt76_queue_is_wed_rro_ind(q)) { diff --git a/mt76.h b/mt76.h index 6fdf2a61..8ee47ca4 100644 --- a/mt76.h +++ b/mt76.h @@ -1791,8 +1791,14 @@ static inline bool mt76_queue_is_wed_rro_ind(struct mt76_queue *q) static inline bool mt76_queue_is_wed_rro_data(struct mt76_queue *q) { return mt76_queue_is_wed_rro(q) && - (FIELD_GET(MT_QFLAG_WED_TYPE, q->flags) == MT76_WED_RRO_Q_DATA || - FIELD_GET(MT_QFLAG_WED_TYPE, q->flags) == MT76_WED_RRO_Q_MSDU_PG); + FIELD_GET(MT_QFLAG_WED_TYPE, q->flags) == MT76_WED_RRO_Q_DATA; +} + +static inline bool mt76_queue_is_wed_rro_msdu_pg(struct mt76_queue *q) +{ + return mt76_queue_is_wed_rro(q) && + FIELD_GET(MT_QFLAG_WED_TYPE, q->flags) == + MT76_WED_RRO_Q_MSDU_PG; } static inline bool mt76_queue_is_wed_rx(struct mt76_queue *q) @@ -1801,7 +1807,8 @@ static inline bool mt76_queue_is_wed_rx(struct mt76_queue *q) return false; return FIELD_GET(MT_QFLAG_WED_TYPE, q->flags) == MT76_WED_Q_RX || - mt76_queue_is_wed_rro_ind(q) || mt76_queue_is_wed_rro_data(q); + mt76_queue_is_wed_rro_ind(q) || mt76_queue_is_wed_rro_data(q) || + mt76_queue_is_wed_rro_msdu_pg(q); }