Kernel patch fixing incorrect txpower reporting in the Linux mt76 driver for MT7921-based WiFi adapters (MT7921U, MT7922, and related chipsets).
v4 was superseded on 2026-03-21 when MediaTek kernel engineer Sean Wang took over the rework, consolidating the fix into shared mt76_connac code so MT7921, MT7922, and MT7925 all benefit from a single patch rather than per-chip duplication.
Sean Wang's v2 series (3 patches) was posted to linux-wireless on 2026-04-01 (1/3 title: wifi: mt76: connac: use a helper to cache txpower_cur). Trailers carried forward from this repo's work:
- All 3 patches:
Reported-by: Devin Wittmayer <lucid_duck@justthetip.ca>andTested-by: Devin Wittmayer <lucid_duck@justthetip.ca> - Patches 1 and 2: additionally
Co-developed-by: Devin Wittmayer <lucid_duck@justthetip.ca>andSigned-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Series is awaiting merge by Felix Fietkau into the mt76 tree, then forward to wireless-next and mainline.
Everything below documents the v1-v4 local history that led to Sean's rework. The technical analysis of the root bug (rate power loop discarding txpower_cur, and mt7921's add_chanctx not updating phy->chandef) is what Sean's v2 builds on.
The mt7921 driver never updates phy->txpower_cur from the rate power configuration sent to firmware. mt76_get_txpower() reports bogus values via nl80211 -- typically 3 dBm regardless of actual regulatory or SAR limits:
$ iw dev wlan0 info | grep txpower
txpower 3.00 dBm # Wrong
This affects all MT7921/MT7922 devices on all bands. hcxdumptool and other tools that read txpower may crash or behave incorrectly.
Two issues compound:
-
The rate power loop in
mt76_connac_mcu_rate_txpower_band()computes the correct bounded TX power per channel but discards the return value. The equivalent mt7915 code stores it tophy->txpower_cur-- the mt7921 connac path does not. -
mt7921 uses the chanctx model but its
add_chanctxcallback does not updatephy->chandef, leaving it stale after association. The rate power loop's channel comparison then fails silently.
Two changes in one patch:
-
Capture the rate power loop result in
mt76_connac_mcu_rate_txpower_band()and store totxpower_curwhen processing the current channel. Subtract the multi-chain path delta before storing, sincemt76_get_txpower()adds it back when reporting -- matching how mt7915 handles this viamt76_get_power_bound(). -
Sync
phy->chandeffrom chanctx inadd_chanctxandchange_chanctx, with a lightweightmt7921_update_txpower_cur()helper that recomputes the bounded power for the current channel without reprogramming firmware rate tables.
After applying:
$ iw dev wlan0 info | grep txpower
txpower 36.00 dBm # Correct (matches regulatory limit)
Tested on Alfa AWUS036AXML (MT7921AU), kernel 6.19.8, Canada (ISED):
| Band | Regulatory Limit | v4 Result | Stock | Status |
|---|---|---|---|---|
| 2.4 GHz | 36 dBm | 36 dBm | 3 dBm | PASS |
| 5 GHz | 23 dBm | 23 dBm | 3 dBm | PASS |
| 6 GHz | 12 dBm | 12 dBm | 3 dBm | PASS |
Independent testing by sam8641 (MT7921U USB + MT7922 PCIe, US regulatory, Debian 6.12.74):
| Device | Band | Result | Status |
|---|---|---|---|
| MT7921U USB | 2.4/5 GHz | 30 dBm | PASS |
| MT7922 PCIe | 2.4/5/6 GHz | 30/30/18 dBm | PASS |
| Version | Date | Approach | Outcome |
|---|---|---|---|
| v1 | 2026-01-25 | Store hw->conf.power_level in set_rate_txpower |
Rejected: wrong source (Felix Fietkau) |
| v2 | 2026-01-30 | Read bss_conf.txpower in bss_info_changed |
Rejected: should come from rate power loop (Sean Wang) |
| v3 | 2026-03-17 | Rate loop store + chanctx calls + BSS_CHANGED_TXPOWER | Rejected: chanctx calls too heavy, BSS_CHANGED breaks multi-vif (Sean Wang) |
| v4 | 2026-03-19 | Rate loop store + lightweight helper + path delta fix | Superseded: Sean Wang took over the rework on 2026-03-21, consolidating into shared connac code |
| Sean v2 | 2026-04-01 | Shared mt76_connac path with txpower_cur cached via helper |
Posted to linux-wireless. Reported-by + Tested-by on all 3 patches; Co-developed-by + Signed-off-by on patches 1 and 2. Awaiting Felix Fietkau merge. |
- Current (Sean Wang v2): Posted to linux-wireless 2026-04-01, awaiting Felix Fietkau merge. Lore search: mt76 txpower_cur
- Lore (all submissions): lucid_duck@justthetip.ca
- v1 patchwork (historical): Link
- Community thread: morrownr/USB-WiFi#700
0001-wifi-mt76-mt7921-fix-txpower-reporting-from-rate-pow.patch-- The v4 kernel patch (2 files changed, 41 insertions, 3 deletions)
cd /path/to/linux
git apply 0001-wifi-mt76-mt7921-fix-txpower-reporting-from-rate-pow.patchOr to build just the mt76 modules:
make -C /lib/modules/$(uname -r)/build M=drivers/net/wireless/mediatek/mt76 modulesv4 depends on commit 56e3867 which renamed mt76_tx_power_nss_delta() to mt76_tx_power_path_delta(). For kernels before ~6.18, replace mt76_tx_power_path_delta with mt76_tx_power_nss_delta -- they return identical values for 1-4 chain devices.
iw set txpower fixednot reflected in managed/station mode (BSS_CHANGED_TXPOWER dropped per reviewer feedback -- needs a multi-vif-safe approach). Works in AP mode viaIEEE80211_CONF_CHANGE_POWER.- MT7925 needs analogous changes in its own
main.c(the connac common code fix benefits it, but without the chandef sync the channel comparison never matches).
GPL-2.0 (same as the Linux kernel).