From 5ed926a34538a8b0cbd59884ff2c22e9615ec1e9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 17 Jul 2026 16:59:50 +0200 Subject: [PATCH] wifi: mt76: mt7915: fix VoW per-station DRR field layout The per-station DRR config value packs the BSS group into bits 0-3; the bit 4-5 AC priority and bit 6-7 WMM ID fields follow. The group mask covered bits 0-5, overlapping the AC priority field, and the BWC group value was written as a bare constant that ignored the station's group. Narrow the group mask and derive the BWC group from it. Signed-off-by: Felix Fietkau --- mt76_connac.h | 3 ++- mt7915/mcu.c | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/mt76_connac.h b/mt76_connac.h index d3bc5f2c..d4b21081 100644 --- a/mt76_connac.h +++ b/mt76_connac.h @@ -112,11 +112,12 @@ enum { /* Layout of the per-station DRR config value (VOW_DRR_CTRL_STA_ALL). The AC * quantum fields are in hardware (LMAC) order, i.e. AC0 = BK ... AC3 = VO. */ -#define VOW_DRR_STA_BSS_GRP_MASK GENMASK(5, 0) +#define VOW_DRR_STA_BSS_GRP_MASK GENMASK(3, 0) #define VOW_DRR_STA_AC0_QNTM_MASK GENMASK(10, 8) #define VOW_DRR_STA_AC1_QNTM_MASK GENMASK(14, 12) #define VOW_DRR_STA_AC2_QNTM_MASK GENMASK(18, 16) #define VOW_DRR_STA_AC3_QNTM_MASK GENMASK(22, 20) +#define VOW_DRR_STA_BWC_GRP_MASK GENMASK(29, 24) /* A station references one of the global DWRR quantum levels per AC. The * mac80211 airtime weight spans a wider, finer range than the eight hardware diff --git a/mt7915/mcu.c b/mt7915/mcu.c index 14ca636a..a8a7287a 100644 --- a/mt7915/mcu.c +++ b/mt7915/mcu.c @@ -3706,9 +3706,10 @@ int mt7915_mcu_set_vow_drr_ctrl(struct mt7915_dev *dev, struct mt7915_sta *msta, }; switch (id) { - case VOW_DRR_CTRL_STA_ALL: - setting |= FIELD_PREP(VOW_DRR_STA_BSS_GRP_MASK, - mt7915_vow_sta_bss_grp(&msta->vif->mt76)); + case VOW_DRR_CTRL_STA_ALL: { + u8 grp = mt7915_vow_sta_bss_grp(&msta->vif->mt76); + + setting |= FIELD_PREP(VOW_DRR_STA_BSS_GRP_MASK, grp); setting |= FIELD_PREP(VOW_DRR_STA_AC0_QNTM_MASK, mt76_connac_vow_dwrr_quantum(weight, IEEE80211_AC_BK)); setting |= FIELD_PREP(VOW_DRR_STA_AC1_QNTM_MASK, @@ -3717,9 +3718,11 @@ int mt7915_mcu_set_vow_drr_ctrl(struct mt7915_dev *dev, struct mt7915_sta *msta, mt76_connac_vow_dwrr_quantum(weight, IEEE80211_AC_VI)); setting |= FIELD_PREP(VOW_DRR_STA_AC3_QNTM_MASK, mt76_connac_vow_dwrr_quantum(weight, IEEE80211_AC_VO)); - setting |= UMAC_BWC_GROUP_MIN << 24; + setting |= FIELD_PREP(VOW_DRR_STA_BWC_GRP_MASK, + grp + UMAC_BWC_GROUP_MIN); req.air_time_ctrl.com_value = cpu_to_le32(setting); break; + } case VOW_DRR_CTRL_STA_PAUSE: /* com_value 0 keeps the station unpaused */ break;