]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
2 months agowifi: mt76: mt7996: fix struct mt7996_mcu_uni_event
StanleyYP Wang [Tue, 3 Feb 2026 15:55:30 +0000 (23:55 +0800)] 
wifi: mt76: mt7996: fix struct mt7996_mcu_uni_event

The cid field is defined as a two-byte value in the firmware.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20260203155532.1098290-2-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: fix wrong DMAD length when using MAC TXP
Shayne Chen [Tue, 3 Feb 2026 15:55:29 +0000 (23:55 +0800)] 
wifi: mt76: mt7996: fix wrong DMAD length when using MAC TXP

The struct mt76_connac_fw_txp is used for HIF TXP. Change to use the
struct mt76_connac_hw_txp to fix the wrong DMAD length for MAC TXP.

Fixes: cb6ebbdffef2 ("wifi: mt76: mt7996: support writing MAC TXD for AddBA Request")
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20260203155532.1098290-1-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: add MT7902 SDIO device support
Sean Wang [Thu, 19 Feb 2026 00:40:07 +0000 (18:40 -0600)] 
wifi: mt76: mt7921: add MT7902 SDIO device support

Register the MT7902 SDIO device ID in the mt7921 driver and add its
corresponding firmware and ROM patch names.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-11-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: add MT7902 PCIe device support
Sean Wang [Thu, 19 Feb 2026 00:40:06 +0000 (18:40 -0600)] 
wifi: mt76: mt7921: add MT7902 PCIe device support

Register the MT7902 PCI device ID in the mt7921 driver and add its
corresponding firmware and ROM patch names.

Co-developed-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-10-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt792x: add MT7902 WFDMA prefetch configuration
Sean Wang [Thu, 19 Feb 2026 00:40:05 +0000 (18:40 -0600)] 
wifi: mt76: mt792x: add MT7902 WFDMA prefetch configuration

Configure the RX/TX ring prefetch setting for MT7902 PCIe device.

This is a prerequisite patch before enabling MT7902 PCIe support.

Co-developed-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-9-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: add MT7902 MCU support
Sean Wang [Thu, 19 Feb 2026 00:40:04 +0000 (18:40 -0600)] 
wifi: mt76: mt7921: add MT7902 MCU support

Add MCU support for the MT7902 chipset.

runtime pm is not yet supported by the driver, but normal mac80211
operation is unaffected.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-8-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt792x: ensure MCU ready before ROM patch download
Sean Wang [Thu, 19 Feb 2026 00:40:03 +0000 (18:40 -0600)] 
wifi: mt76: mt792x: ensure MCU ready before ROM patch download

Restart the MCU and poll FW state to ensure correct MCU status
before downloading the ROM patch.

This is a prerequisite for enabling MT7902 PCIe and has been
validated on MT7921 and MT7925 since they share the common code path.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-7-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt792x: add PSE handling barrier for the large MCU cmd
Sean Wang [Thu, 19 Feb 2026 00:40:02 +0000 (18:40 -0600)] 
wifi: mt76: mt792x: add PSE handling barrier for the large MCU cmd

Add a dummy register read in mt76_connac_mcu_rate_txpower_band() to act as
a PSE barrier. This would release PSE pages and prevents buffer underflow
issues when handling MCU commands with larger payloads without the response
in mt76_connac_mcu_set_rate_txpower().

This is a prerequisite patch before enabling MT7902 PCIe and SDIO support.

Co-developed-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-6-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: connac: mark MT7902 as hw txp devices
Sean Wang [Thu, 19 Feb 2026 00:40:01 +0000 (18:40 -0600)] 
wifi: mt76: connac: mark MT7902 as hw txp devices

Add MT7902 to is_mt76_fw_txp() so it follows the legacy TX descriptor
path like the other connac2 chips that return false.

This is a prerequisite patch before enabling MT7902 pcie support.

Co-developed-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-5-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: add MT7902e DMA layout support
Sean Wang [Thu, 19 Feb 2026 00:40:00 +0000 (18:40 -0600)] 
wifi: mt76: mt7921: add MT7902e DMA layout support

Add MT7902 PCIe specific DMA layout overrides for MCU TXQ index, RX ring
size, and MCU_WA usage. Common layout remains the default for other chips.

This is a prerequisite patch before enabling MT7902 PCIe support.

Co-developed-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-4-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: handle MT7902 irq_map quirk with mutable copy
Sean Wang [Thu, 19 Feb 2026 00:39:59 +0000 (18:39 -0600)] 
wifi: mt76: mt7921: handle MT7902 irq_map quirk with mutable copy

MT7902 PCIe requires a different wm2_complete_mask value, so introduce a
mutable per-device copy of the default irq_map and override the field
only for this chip. Other devices continue using the shared const
template.

This is a prerequisite patch before enabling MT7902 PCIe support.

Co-developed-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-3-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: use mt76_for_each_q_rx() in reset path
Sean Wang [Thu, 19 Feb 2026 00:39:58 +0000 (18:39 -0600)] 
wifi: mt76: mt7921: use mt76_for_each_q_rx() in reset path

Replace explicit napi_disable() calls for RX queues with
mt76_for_each_q_rx() in mt7921e_mac_reset().

This removes hardcoded queue indices and disables all configured
RX queues during reset.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-2-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: connac: use is_connac2() to replace is_mt7921() checks
Sean Wang [Thu, 19 Feb 2026 00:39:57 +0000 (18:39 -0600)] 
wifi: mt76: connac: use is_connac2() to replace is_mt7921() checks

Unify all per-chip conditionals under the new is_connac2() helper. This
avoids confusion caused by the previous is_mt7921() check, which
implicitly covered multiple connac2 chipsets and no longer reflected its
actual scope. This is a clean-up only change with no functional impact.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-1-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: apply calibration-free data from OTP
StanleyYP Wang [Thu, 12 Feb 2026 09:03:10 +0000 (17:03 +0800)] 
wifi: mt76: mt7996: apply calibration-free data from OTP

Before sending the current EEPROM data to the firmware, read the
calibration-free data (FT data) from the efuse and merge it with
the existing EEPROM data.

Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Link: https://patch.msgid.link/20260212090310.3335392-3-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: add variant for MT7992 chipsets
Shayne Chen [Thu, 12 Feb 2026 09:03:09 +0000 (17:03 +0800)] 
wifi: mt76: mt7996: add variant for MT7992 chipsets

Introduce VAR_TYPE_24 for the MT7992 chipsets, a dual-band variant
supporting 3T3R/2SS on the 2 GHz band and 5T5R/4SS on the 5GHz band.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20260212090310.3335392-2-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: add external EEPROM support for mt799x chipsets
StanleyYP Wang [Thu, 12 Feb 2026 09:03:08 +0000 (17:03 +0800)] 
wifi: mt76: add external EEPROM support for mt799x chipsets

For the MT7992 and MT7990 chipsets, efuse mode is not supported because
there is insufficient space in the efuse to store the calibration data.
Therefore, an additional on-chip EEPROM is added to address this
limitation.

Co-developed-by: Elwin Huang <s09289728096@gmail.com>
Signed-off-by: Elwin Huang <s09289728096@gmail.com>
Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Link: https://patch.msgid.link/20260212090310.3335392-1-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: fix backoff fields and max_power calculation
Allen Ye [Thu, 19 Feb 2026 00:30:27 +0000 (16:30 -0800)] 
wifi: mt76: fix backoff fields and max_power calculation

The maximum power value may exist in either the data or backoff field.
Previously, backoff power limits were not considered in txpower reporting.
This patch ensures mt76 also considers backoff values in the SKU table.

Also, each RU entry (RU26, RU52, RU106, BW20, ...) in the DTS corresponds
to 10 stream combinations (1T1ss, 2T1ss, 3T1ss, 4T1ss, 2T2ss, 3T2ss,
4T2ss, 3T3ss, 4T3ss, 4T4ss).

For beamforming tables:
- In connac2, beamforming entries for BW20~BW160, and OFDM do not include
  1T1ss.
- In connac3, beamforming entries for BW20~BW160, and RU include 1T1ss,
  but OFDM beamforming does not include 1T1ss.

Non-beamforming and RU entries for both connac2 and connac3 include 1T1ss.

Fixes: b05ab4be9fd7 ("wifi: mt76: mt7915: add bf backoff limit table support")
Signed-off-by: Allen Ye <allen.ye@mediatek.com>
Co-developed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Link: https://patch.msgid.link/8fa8ec500b3d4de7b1966c6887f1dfbe5c46a54c.1771205424.git.ryder.lee@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: Replace deprecated PCI function
Madhur Kumar [Mon, 8 Dec 2025 17:23:31 +0000 (22:53 +0530)] 
wifi: mt76: mt7921: Replace deprecated PCI function

pcim_iomap_table() and pcim_iomap_regions() have been
deprecated.
Replace them with pcim_iomap_region().

Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com>
Link: https://patch.msgid.link/20251208172331.89705-1-madhurkumar004@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: increase txq memory limit to 32 MiB
Chad Monroe [Mon, 8 Dec 2025 14:14:50 +0000 (14:14 +0000)] 
wifi: mt76: mt7996: increase txq memory limit to 32 MiB

Prior to this change, both 2G and 6G radios would fall back to the
mac80211 default of 4MB which is not enough for high data rates.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://patch.msgid.link/acfe2e25768b414518be2db22b1d3ba6f5db6fa1.1765203249.git.chad@monroe.io
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: reset device after MCU message timeout
Chad Monroe [Mon, 8 Dec 2025 14:24:00 +0000 (14:24 +0000)] 
wifi: mt76: mt7996: reset device after MCU message timeout

Trigger a full reset after MCU message timeout.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://patch.msgid.link/6e05ed063f3763ad3457633c56b60a728a49a6f0.1765203753.git.chad@monroe.io
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: fix deadlock in remain-on-channel
Chad Monroe [Mon, 8 Dec 2025 14:31:32 +0000 (14:31 +0000)] 
wifi: mt76: fix deadlock in remain-on-channel

mt76_remain_on_channel() and mt76_roc_complete() call mt76_set_channel()
while already holding dev->mutex. Since mt76_set_channel() also acquires
dev->mutex, this results in a deadlock.

Use __mt76_set_channel() instead of mt76_set_channel().
Add cancel_delayed_work_sync() for mac_work before acquiring the mutex
in mt76_remain_on_channel() to prevent a secondary deadlock with the
mac_work workqueue.

Fixes: a8f424c1287c ("wifi: mt76: add multi-radio remain_on_channel functions")
Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://patch.msgid.link/ace737e7b621af7c2adb33b0188011a5c1de2166.1765204256.git.chad@monroe.io
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: fix potential deadlock in mt7921_roc_abort_sync
Sean Wang [Mon, 26 Jan 2026 18:00:13 +0000 (12:00 -0600)] 
wifi: mt76: mt7921: fix potential deadlock in mt7921_roc_abort_sync

roc_abort_sync() can deadlock with roc_work(). roc_work() holds
dev->mt76.mutex, while cancel_work_sync() waits for roc_work()
to finish. If the caller already owns the same mutex, both
sides block and no progress is possible.

This deadlock can occur during station removal when
mt76_sta_state() -> mt76_sta_remove() -> mt7921_mac_sta_remove() ->
mt7921_roc_abort_sync() invokes cancel_work_sync() while
roc_work() is still running and holding dev->mt76.mutex.

This avoids the mutex deadlock and preserves exactly-once
work ownership.

Fixes: 352d966126e6 ("wifi: mt76: mt7921: fix a potential association failure upon resuming")
Co-developed-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260126180013.8167-1-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: fix ROC abort flow interruption in mt7921_roc_work
Quan Zhou [Fri, 23 Jan 2026 02:16:25 +0000 (10:16 +0800)] 
wifi: mt76: mt7921: fix ROC abort flow interruption in mt7921_roc_work

The mt7921_set_roc API may be executed concurrently with mt7921_roc_work,
specifically between the following code paths:

- The check and clear of MT76_STATE_ROC in mt7921_roc_work:
    if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
        return;

- The execution of ieee80211_iterate_active_interfaces.

This race condition can interrupt the ROC abort flow, resulting in
the ROC process failing to abort as expected.

To address this defect, the modification of MT76_STATE_ROC is now
protected by mt792x_mutex_acquire(phy->dev). This ensures that
changes to the ROC state are properly synchronized, preventing
race conditions and ensuring the ROC abort flow is not interrupted.

Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support")
Cc: stable@vger.kernel.org
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/2568ece8b557e5dda79391414c834ef3233049b6.1769133724.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7925: fix tx power setting failure after chip reset
Leon Yen [Tue, 20 Jan 2026 16:31:52 +0000 (00:31 +0800)] 
wifi: mt76: mt7925: fix tx power setting failure after chip reset

After the chip reset, the procedure to set the tx power will not be
successful because the previous region setting is still remains.
Clear the region setting during MAC initialization and allow it to be
reset to finalize the TX power setting.

Fixes: 3bc62aa4484d ("wifi: mt76: mt7925: add auto regdomain switch support")
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Link: https://patch.msgid.link/20260120163152.3694116-1-leon.yen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: Fix memory leak after mt76_connac_mcu_alloc_sta_req()
Zilin Guan [Fri, 16 Jan 2026 14:49:19 +0000 (14:49 +0000)] 
wifi: mt76: Fix memory leak after mt76_connac_mcu_alloc_sta_req()

mt76_connac_mcu_alloc_sta_req() allocates an skb which is expected to
be freed eventually by mt76_mcu_skb_send_msg(). However, currently if
an intermediate function fails before sending, the allocated skb is
leaked.

Specifically, mt76_connac_mcu_sta_wed_update() and
mt76_connac_mcu_sta_key_tlv() may fail, leading to an immediate memory
leak in the error path.

Fix this by explicitly freeing the skb in these error paths.
Commit 7c0f63fe37a5 ("wifi: mt76: mt7996: fix memory leak on
mt7996_mcu_sta_key_tlv error") made a similar change.

Compile tested only. Issue found using a prototype static analysis tool
and code review.

Fixes: d1369e515efe ("wifi: mt76: connac: introduce mt76_connac_mcu_sta_wed_update utility routine")
Fixes: 6683d988089c ("mt76: connac: move mt76_connac_mcu_add_key in connac module")
Fixes: 4f831d18d12d ("wifi: mt76: mt7915: enable WED RX support")
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Link: https://patch.msgid.link/20260116144919.1482558-1-zilin@seu.edu.cn
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7925: fix potential deadlock in mt7925_roc_abort_sync
Sean Wang [Tue, 16 Dec 2025 01:38:49 +0000 (19:38 -0600)] 
wifi: mt76: mt7925: fix potential deadlock in mt7925_roc_abort_sync

roc_abort_sync() can deadlock with roc_work(). roc_work() holds
dev->mt76.mutex, while cancel_work_sync() waits for roc_work()
to finish. If the caller already owns the same mutex, both
sides block and no progress is possible.

This deadlock can occur during station removal when
mt76_sta_state() -> mt76_sta_remove() ->
mt7925_mac_sta_remove_link() -> mt7925_mac_link_sta_remove() ->
mt7925_roc_abort_sync() invokes cancel_work_sync() while
roc_work() is still running and holding dev->mt76.mutex.

This avoids the mutex deadlock and preserves exactly-once
work ownership.

Fixes: 45064d19fd3a ("wifi: mt76: mt7925: fix a potential association failure upon resuming")
Co-developed-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20251216013849.17976-1-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7925: Skip scan process during suspend.
Michael Lo [Mon, 12 Jan 2026 11:40:07 +0000 (19:40 +0800)] 
wifi: mt76: mt7925: Skip scan process during suspend.

We are experiencing command timeouts because an upper layer triggers
an unexpected scan while the system/device is in suspend.
The upper layer should not initiate scans until the NIC has fully resumed.
We want to prevent scans during suspend and avoid timeouts without harming
power management or user experience.

Signed-off-by: Michael Lo <michael.lo@mediatek.com>
Link: https://patch.msgid.link/20260112114007.2115873-1-leon.yen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7925: drop puncturing handling from BSS change path
Sean Wang [Tue, 16 Dec 2025 02:20:17 +0000 (20:20 -0600)] 
wifi: mt76: mt7925: drop puncturing handling from BSS change path

IEEE80211_CHANCTX_CHANGE_PUNCTURING is a channel context change
flag and should not be checked in the BSS change handler, where
the changed mask represents enum ieee80211_bss_change.

Remove the puncturing handling from the BSS path and rely on
mt7925_change_chanctx() to update puncturing configuration.

Fixes: cadebdad959b ("wifi: mt76: mt7925: add EHT preamble puncturing")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20251216022017.23870-1-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: Enable NPU support for MT7996 devices
Lorenzo Bianconi [Thu, 22 Jan 2026 10:40:01 +0000 (11:40 +0100)] 
wifi: mt76: Enable NPU support for MT7996 devices

Enable NPU offloading for MT7990 chipset.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-17-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Store DMA mapped buffer addresses in mt7996_npu_hw_init()
Lorenzo Bianconi [Thu, 22 Jan 2026 10:40:00 +0000 (11:40 +0100)] 
wifi: mt76: mt7996: Store DMA mapped buffer addresses in mt7996_npu_hw_init()

In order to not always reallocate them during NPU reset, store the DMA
mapped buffer addresses allocated by mt7996_npu_hw_init routine in
mt7996 structure.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-16-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Do not schedule RRO and TxFree queues during reset for NPU
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:59 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Do not schedule RRO and TxFree queues during reset for NPU

This is a preliminary patch to properly manage reset procedure when NPU
offloading is enabled.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-15-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: Do not reset idx for NPU tx queues during reset
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:58 +0000 (11:39 +0100)] 
wifi: mt76: Do not reset idx for NPU tx queues during reset

Do not run reset_q callaback with reset_idx set to true for NPU Tx
queues. This is a preliminary patch to properly manage reset procedure
when NPU offloading is enabled.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-14-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Move RRO dma start in a dedicated routine
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:57 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Move RRO dma start in a dedicated routine

This is a preliminary patch to properly enable NPU offloading for MT7996
chipset since NPU initialization must be completed before kicking rx
queues.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-13-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Add __mt7996_npu_hw_init routine
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:56 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Add __mt7996_npu_hw_init routine

Introduce __mt7996_npu_hw_init utility routine in order to run it
holding mt76 mutex and move NPU hw re-initialization before restarting
the NAPIs during device reset.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-12-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Integrate MT7990 dma configuration for NPU
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:55 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Integrate MT7990 dma configuration for NPU

Add NPU integration in MT7996 dma codebase for MT7990 chipset.
This is a preliminary patch to enable NPU offload for MT7996 (Eagle)
chipset.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-11-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Integrate MT7990 init configuration for NPU
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:54 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Integrate MT7990 init configuration for NPU

Add NPU integration in MT7996 init codebase for MT7990 chipset.
This is a preliminary patch to enable NPU offload for MT7996 (Eagle)
chipset.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-10-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Integrate NPU in RRO session management
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:53 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Integrate NPU in RRO session management

Add NPU integration in RRO 3.0 session management.
This is a preliminary patch to enable NPU offload for MT7996 (Eagle)
chipset.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-9-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Add NPU support for MT7990 chipset
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:52 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Add NPU support for MT7990 chipset

Introduce support for MT7990 chipset in MT7996 npu configuration
codebase.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-8-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Rename mt7996_npu_rxd_init() in mt7992_npu_rxd_init()
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:51 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Rename mt7996_npu_rxd_init() in mt7992_npu_rxd_init()

This is a preliminary patch to enable NPU offload for MT7996 (Eagle)
chipset.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-7-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Add mt7992_npu_txrx_offload_init routine
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:50 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Add mt7992_npu_txrx_offload_init routine

Introduce mt7992_npu_txrx_offload_init utility routine.
This is a preliminary patch to enable NPU offload for MT7996 (Eagle)
chipset.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-6-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Fix wdma_idx for MT7996 device if NPU is enabled
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:49 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Fix wdma_idx for MT7996 device if NPU is enabled

This is a preliminary patch to enable NPU offload for MT7996 (Eagle)
chipset.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-5-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Fix BAND2 tx queues initialization when NPU is enabled
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:48 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Fix BAND2 tx queues initialization when NPU is enabled

Fix BAND2 tx queues initialization for MT7990 chipset when NPU is
enabled. This is a preliminary patch to enable NPU offload for MT7996
(Eagle) chipset.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-4-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: always enable RRO queues for non-MT7992 chipset
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:47 +0000 (11:39 +0100)] 
wifi: mt76: always enable RRO queues for non-MT7992 chipset

MT7990 NPU binary requires to initialize NPU desc_base after configuring
ring_size. This is a preliminary patch to enable NPU offload for MT7996
(Eagle) chipset.

Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-3-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: npu: Add missing rx_token_size initialization
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:46 +0000 (11:39 +0100)] 
wifi: mt76: npu: Add missing rx_token_size initialization

Add missing rx_token_size initialization for NPU offloading.

Fixes: 7fb554b1b623 ("wifi: mt76: Introduce the NPU generic layer")
Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-2-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Fix NPU stop procedure
Lorenzo Bianconi [Thu, 22 Jan 2026 10:39:45 +0000 (11:39 +0100)] 
wifi: mt76: mt7996: Fix NPU stop procedure

Move mt7996_npu_hw_stop routine before disabling rx NAPIs in order to
fix NPU stop procedure used during device L1 SER recovery.
Add missing usleep_range in mt7996_npu_hw_stop().

Fixes: 377aa17d2aedc ("wifi: mt76: mt7996: Add NPU offload support to MT7996 driver")
Tested-by: Kang Yang <kang.yang@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260122-mt76-npu-eagle-offload-v2-1-2374614c0de6@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: Fix memory leak destroying device
Lorenzo Bianconi [Mon, 8 Dec 2025 18:54:08 +0000 (19:54 +0100)] 
wifi: mt76: Fix memory leak destroying device

All MT76 rx queues have an associated page_pool even if the queue is not
associated to a NAPI (e.g. WED RRO queues with WED enabled). Destroy the
page_pool running mt76_dma_cleanup routine during module unload.
Moreover returns pages to the page pool if WED is not enabled for WED RRO
queues.

Fixes: 950d0abb5cd94 ("wifi: mt76: mt7996: add wed rx support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20251208-mt76-fix-memory-leak-v1-1-cba813fc62b8@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: fix a potential clc buffer length underflow
Leon Yen [Thu, 9 Oct 2025 02:01:58 +0000 (10:01 +0800)] 
wifi: mt76: mt7921: fix a potential clc buffer length underflow

The buf_len is used to limit the iterations for retrieving the country
power setting and may underflow under certain conditions due to changes
in the power table in CLC.

This underflow leads to an almost infinite loop or an invalid power
setting resulting in driver initialization failure.

Cc: stable@vger.kernel.org
Fixes: fa6ad88e023d ("wifi: mt76: mt7921: fix country count limitation for CLC")
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20251009020158.1923429-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: Place upper limit on station AID
Rory Little [Thu, 4 Sep 2025 00:07:11 +0000 (17:07 -0700)] 
wifi: mt76: mt7921: Place upper limit on station AID

Any station configured with an AID over 20 causes a firmware crash.
This situation occurred in our testing using an AP interface on 7922
hardware, with a modified hostapd, sourced from Mediatek's OpenWRT
feeds.

In stock hostapd, station AIDs begin counting at 1, and this
configuration is prevented with an upper limit on associated stations.
However, the modified hostapd began allocation at 65, which caused the
firmware to crash. This fix does not allow these AIDs to work, but will
prevent the firmware crash.

This crash was only seen on IFTYPE_AP interfaces, and the fix does not
appear to have an effect on IFTYPE_STATION behavior.

Fixes: 5c14a5f944b9 ("mt76: mt7921: introduce mt7921e support")
Signed-off-by: Rory Little <rory@candelatech.com>
Link: https://patch.msgid.link/20250904000711.3033860-1-rory@candelatech.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: fix FCS error flag check in RX descriptor
Alok Tiwari [Mon, 13 Oct 2025 09:08:24 +0000 (02:08 -0700)] 
wifi: mt76: mt7996: fix FCS error flag check in RX descriptor

The mt7996 driver currently checks the MT_RXD3_NORMAL_FCS_ERR bit in
rxd1 whereas other Connac3-based drivers(mt7925) correctly check this
bit in rxd3.

Since the MT_RXD3_NORMAL_FCS_ERR bit is defined in the fourth RX
descriptor word (rxd3), update mt7996 to use the proper descriptor
field. This change aligns mt7996 with mt7925 and the rest of the
Connac3 family.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20251013090826.753992-1-alok.a.tiwari@oracle.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7925: prevent NULL vif dereference in mt7925_mac_write_txwi
Ming Yen Hsieh [Thu, 4 Sep 2025 03:06:47 +0000 (11:06 +0800)] 
wifi: mt76: mt7925: prevent NULL vif dereference in mt7925_mac_write_txwi

Check for a NULL `vif` before accessing `ieee80211_vif_is_mld(vif)` to
avoid a potential kernel panic in scenarios where `vif` might not be
initialized.

Fixes: ebb1406813c6 ("wifi: mt76: mt7925: add link handling to txwi")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250904030649.655436-3-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7925: prevent NULL pointer dereference in mt7925_tx_check_aggr()
Ming Yen Hsieh [Thu, 4 Sep 2025 03:06:48 +0000 (11:06 +0800)] 
wifi: mt76: mt7925: prevent NULL pointer dereference in mt7925_tx_check_aggr()

Move the NULL check for 'sta' before dereferencing it to prevent a
possible crash.

Fixes: 44eb173bdd4f ("wifi: mt76: mt7925: add link handling in mt7925_txwi_free")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250904030649.655436-4-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: fix list corruption in mt76_wcid_cleanup
Zac Bowling [Tue, 20 Jan 2026 20:10:32 +0000 (12:10 -0800)] 
wifi: mt76: fix list corruption in mt76_wcid_cleanup

mt76_wcid_cleanup() was not removing wcid entries from sta_poll_list
before mt76_reset_device() reinitializes the master list. This leaves
stale pointers in wcid->poll_list, causing list corruption when
mt76_wcid_add_poll() later checks list_empty() and tries to add the
entry back.

The fix adds proper cleanup of poll_list in mt76_wcid_cleanup(),
matching how tx_list is already handled. This is similar to what
mt7996_mac_sta_deinit_link() already does correctly.

Fixes list corruption warnings like:
  list_add corruption. prev->next should be next (ffffffff...)

Signed-off-by: Zac Bowling <zac@zacbowling.com>
Link: https://patch.msgid.link/20260120201043.38225-3-zac@zacbowling.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7925: fix incorrect length field in txpower command
Ming Yen Hsieh [Mon, 8 Sep 2025 07:25:26 +0000 (15:25 +0800)] 
wifi: mt76: mt7925: fix incorrect length field in txpower command

Set `tx_power_tlv->len` to `msg_len` instead of `sizeof(*tx_power_tlv)`
to ensure the correct message length is sent to firmware.

Cc: stable@vger.kernel.org
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250908072526.1833938-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: add support for ERP CTS & HT protection
Ryder Lee [Wed, 21 Jan 2026 17:41:58 +0000 (09:41 -0800)] 
wifi: mt76: mt7996: add support for ERP CTS & HT protection

This patch adds support for handling BSS_CHANGED_ERP_CTS_PROT and
BSS_CHANGED_HT.

With this change, when the Wi-Fi driver needs to adjust its behavior for
compatibility or performance, especially concerning older 11g/n devices,
by enabling or disabling CTS protection frames, often for hidden SSIDs or
to manage legacy clients.

It also introduces debugfs options to manually control protection mode,
allowing users to select betweenno protection, RTS/CTS, and CTS-to-self.

Reviewed-by: Money Wang <money.wang@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Link: https://patch.msgid.link/942ddb5777d5c201930d6609e9ba877a6ba6714a.1768879119.git.ryder.lee@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7915: fix use_cts_prot support
Ryder Lee [Wed, 21 Jan 2026 17:41:57 +0000 (09:41 -0800)] 
wifi: mt76: mt7915: fix use_cts_prot support

With this fix, when driver needs to adjust its behavior for compatibility,
especially concerning older 11g/n devices, by enabling or disabling CTS
protection frames, often for hidden SSIDs or to manage legacy clients.

Fixes: 150b91419d3d ("wifi: mt76: mt7915: enable use_cts_prot support")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Link: https://patch.msgid.link/eb8db4d0bf1c89b7486e89facb788ae3e510dd8b.1768879119.git.ryder.lee@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7615: fix use_cts_prot support
Ryder Lee [Wed, 21 Jan 2026 17:41:56 +0000 (09:41 -0800)] 
wifi: mt76: mt7615: fix use_cts_prot support

Driver should not directly write WTBL to prevent overwritten issues.

With this fix, when driver needs to adjust its behavior for compatibility,
especially concerning older 11g/n devices, by enabling or disabling CTS
protection frames, often for hidden SSIDs or to manage legacy clients.

Fixes: e34235ccc5e3 ("wifi: mt76: mt7615: enable use_cts_prot support")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Link: https://patch.msgid.link/edb87088b0111b32fafc6c4179f54a5286dd37d8.1768879119.git.ryder.lee@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt7601u: check multiple firmware paths
Christian Hewitt [Sat, 27 Dec 2025 11:22:19 +0000 (11:22 +0000)] 
wifi: mt7601u: check multiple firmware paths

The linux-firmware repo moved mt7601u.bin from its root folder to
the mediatek sub-folder some time ago, but the driver still tries
to load firmware from the old location. Users might have firmware
in either location so update the driver to check both.

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Link: https://patch.msgid.link/20251227112219.2768439-1-christianshewitt@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt792x: Fix a potential deadlock in high-load situations
Leon Yen [Mon, 15 Dec 2025 12:22:31 +0000 (20:22 +0800)] 
wifi: mt76: mt792x: Fix a potential deadlock in high-load situations

A deadlock may occur between two works, ps_work and mac_work, if their work
functions run simultaneously as they attempt to cancel each other by
calling cancel_delayed_work_sync().

mt792x_mac_work() ->   ...  -> cancel_delayed_work_sync(&pm->ps_work);
mt792x_pm_power_save_work() -> cancel_delayed_work_sync(&mphy->mac_work);

In high-load situations, they are queued but may not have chance to be
executed until the CPUs are released. Once the CPUs are available, there
is a high possibility that the ps_work function and mac_work function will
be executed simultaneously, resulting in a possible deadlock.

This patch replaces cancel_delayed_work_sync() with cancel_delayed_work()
in ps_work to eliminate the deadlock and make the code easier to maintain.

Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Tested-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Link: https://patch.msgid.link/20251215122231.3180648-1-leon.yen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7925: Fix incorrect MLO mode in firmware control
Leon Yen [Thu, 11 Dec 2025 12:38:36 +0000 (20:38 +0800)] 
wifi: mt76: mt7925: Fix incorrect MLO mode in firmware control

The selection of MLO mode should depend on the capabilities of the STA
rather than those of the peer AP to avoid compatibility issues with
certain APs, such as Xiaomi BE5000 WiFi7 router.

Fixes: 69acd6d910b0c ("wifi: mt76: mt7925: add mt7925_change_vif_links")
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Link: https://patch.msgid.link/20251211123836.4169436-1-leon.yen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7921: Reset ampdu_state state in case of failure in mt76_connac2_tx_che...
Sean Wang [Tue, 16 Dec 2025 00:59:30 +0000 (18:59 -0600)] 
wifi: mt76: mt7921: Reset ampdu_state state in case of failure in mt76_connac2_tx_check_aggr()

Reset ampdu_state if ieee80211_start_tx_ba_session() fails in
mt76_connac2_tx_check_aggr(), otherwise the driver may incorrectly
assume aggregation is active and skip future BA setup attempts.

Fixes: 163f4d22c118 ("mt76: mt7921: add MAC support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20251216005930.9412-1-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Reset ampdu_state state in case of failure in mt7996_tx_check_aggr()
Lorenzo Bianconi [Sun, 14 Dec 2025 09:55:30 +0000 (10:55 +0100)] 
wifi: mt76: mt7996: Reset ampdu_state state in case of failure in mt7996_tx_check_aggr()

Reset the ampdu_state configured state if ieee80211_start_tx_ba_session
routine fails in mt7996_tx_check_aggr()

Fixes: 98686cd21624c ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20251214-mt7996-aggr-check-fix-v1-1-33a8b62ec0fc@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Clear wcid pointer in mt7996_mac_sta_deinit_link()
Lorenzo Bianconi [Fri, 5 Dec 2025 10:24:39 +0000 (11:24 +0100)] 
wifi: mt76: mt7996: Clear wcid pointer in mt7996_mac_sta_deinit_link()

Clear WCID pointer removing the sta link in mt7996_mac_sta_deinit_link
routine.

Fixes: dd82a9e02c054 ("wifi: mt76: mt7996: Rely on mt7996_sta_link in sta_add/sta_remove callbacks")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20251205-mt76-txq-wicd-fix-v2-4-f19ba48af7c1@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Switch to the secondary link if the default one is removed
Lorenzo Bianconi [Fri, 5 Dec 2025 10:24:38 +0000 (11:24 +0100)] 
wifi: mt76: mt7996: Switch to the secondary link if the default one is removed

Switch to the secondary link if available in mt7996_mac_sta_remove_links
routine if the primary one is removed.
Moreover reset secondary link index for single link scenario.

Fixes: 85cd5534a3f2e ("wifi: mt76: mt7996: use correct link_id when filling TXD and TXP")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20251205-mt76-txq-wicd-fix-v2-3-f19ba48af7c1@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Reset mtxq->idx if primary link is removed in mt7996_vif_link_rem...
Lorenzo Bianconi [Fri, 5 Dec 2025 10:24:37 +0000 (11:24 +0100)] 
wifi: mt76: mt7996: Reset mtxq->idx if primary link is removed in mt7996_vif_link_remove()

Reset WCID index in mt76_txq struct if primary link is removed in
mt7996_vif_link_remove routine.

Fixes: a3316d2fc669f ("wifi: mt76: mt7996: set vif default link_id adding/removing vif links")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20251205-mt76-txq-wicd-fix-v2-2-f19ba48af7c1@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Set mtxq->wcid just for primary link
Lorenzo Bianconi [Fri, 5 Dec 2025 10:24:36 +0000 (11:24 +0100)] 
wifi: mt76: mt7996: Set mtxq->wcid just for primary link

Set WCID index in mt76_txq struct just for the primary link in
mt7996_vif_link_add routine.

Fixes: 69d54ce7491d0 ("wifi: mt76: mt7996: switch to single multi-radio wiphy")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20251205-mt76-txq-wicd-fix-v2-1-f19ba48af7c1@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: Fix spelling mistake "retriving" -> "retrieving"
Colin Ian King [Fri, 28 Nov 2025 17:44:30 +0000 (17:44 +0000)] 
wifi: mt76: mt7996: Fix spelling mistake "retriving" -> "retrieving"

There are a handful of spelling mistakes in various warning messages.
Fix them.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20251128174430.318838-1-colin.i.king@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7925: introduce CSA support in non-MLO mode
Leon Yen [Fri, 26 Sep 2025 05:34:47 +0000 (13:34 +0800)] 
wifi: mt76: mt7925: introduce CSA support in non-MLO mode

Add CSA (Channel Switch Announcement) related implementation
in collaboration with mac80211 to deal with dynamic channel
switching.

Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250926053447.4036650-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt76x02: wake queues after reconfig
David Bauer [Sat, 29 Nov 2025 02:39:02 +0000 (03:39 +0100)] 
wifi: mt76: mt76x02: wake queues after reconfig

The shared reset procedure of MT7610 and MT7612 stop all queues before
starting the reset sequence.

They however never restart these like other supported mt76 chips
do in the reconfig_complete call. This leads to TX not continuing
after the reset.

Restart queues in the reconfig_complete callback to restore
functionality after the reset.

Signed-off-by: David Bauer <mail@david-bauer.net>
Link: https://patch.msgid.link/20251129023904.288484-1-mail@david-bauer.net
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7925: fix AMPDU state handling in mt7925_tx_check_aggr
Quan Zhou [Thu, 27 Nov 2025 07:49:11 +0000 (15:49 +0800)] 
wifi: mt76: mt7925: fix AMPDU state handling in mt7925_tx_check_aggr

Previously, the AMPDU state bit for a given TID was set before attempting
to start a BA session, which could result in the AMPDU state being marked
active even if ieee80211_start_tx_ba_session() failed. This patch changes
the logic to only set the AMPDU state bit after successfully starting a BA
session, ensuring proper synchronization between AMPDU state and BA session
status.

This fixes potential issues with aggregation state tracking and improves
compatibility with mac80211 BA session management.

Fixes: 44eb173bdd4f ("wifi: mt76: mt7925: add link handling in mt7925_txwi_free")
Cc: stable@vger.kernel.org
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/d5960fbced0beaf33c30203f7f8fb91d0899c87b.1764228973.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: fix iface combination for different chipsets
Shayne Chen [Mon, 15 Dec 2025 06:37:28 +0000 (14:37 +0800)] 
wifi: mt76: mt7996: fix iface combination for different chipsets

MT7992 and MT7990 support up to 19 interfaces per band and 32 in total.

Fixes: 8df63a4bbe3d ("wifi: mt76: mt7996: adjust interface num and wtbl size for mt7992")
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20251215063728.3013365-7-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: add duplicated WTBL command
Shayne Chen [Mon, 15 Dec 2025 06:37:27 +0000 (14:37 +0800)] 
wifi: mt76: mt7996: add duplicated WTBL command

This is a firmware mechanism to improve packet loss issues for mt7996 and
mt7992 chipsets.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20251215063728.3013365-6-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: offload radar threshold initialization
StanleyYP Wang [Mon, 15 Dec 2025 06:37:26 +0000 (14:37 +0800)] 
wifi: mt76: mt7996: offload radar threshold initialization

Since some radar specifications maintained by the driver are incorrect
and are now also maintained by the firmware, offload the initialization
procedure to the firmware.
This fixes issues for radar detection rate testings.

Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20251215063728.3013365-5-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: abort CCA when CSA is starting
StanleyYP Wang [Mon, 15 Dec 2025 06:37:25 +0000 (14:37 +0800)] 
wifi: mt76: mt7996: abort CCA when CSA is starting

When CSA countdown is going to start, carry UNI_BSS_INFO_BCN_BCC tag to
abort any CCA countdown.

Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20251215063728.3013365-4-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: set specific BSSINFO and STAREC commands after channel switch
StanleyYP Wang [Mon, 15 Dec 2025 06:37:24 +0000 (14:37 +0800)] 
wifi: mt76: mt7996: set specific BSSINFO and STAREC commands after channel switch

After channel switch, some tags of BSSINFO (rfch) and STAREC (bfer,
rate_ctrl) commands should also be updated. Otherwise, a BSS might not be
able to transmit with its peer using correct bandwidth.

Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Link: https://patch.msgid.link/20251215063728.3013365-3-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: fix the behavior of radar detection
StanleyYP Wang [Mon, 15 Dec 2025 06:37:23 +0000 (14:37 +0800)] 
wifi: mt76: mt7996: fix the behavior of radar detection

RDD_DET_MODE is a firmware command intended for testing and does not
pause TX after radar detection, so remove it from the normal flow;
instead, use the MAC_ENABLE_CTRL firmware command to resume TX after
the radar-triggered channel switch completes.

Fixes: 1529e335f93d ("wifi: mt76: mt7996: rework radar HWRDD idx")
Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Link: https://patch.msgid.link/20251215063728.3013365-2-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agowifi: mt76: mt7996: extend CSA and CCA support for MLO
Shayne Chen [Mon, 15 Dec 2025 06:37:22 +0000 (14:37 +0800)] 
wifi: mt76: mt7996: extend CSA and CCA support for MLO

Use correct link_id to report CSA and CCA countdown events, and also
modify mt7996_channel_switch_beacon() to set beacon with the correct
link_id.

Co-developed-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Co-developed-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20251215063728.3013365-1-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agoMerge tag 'wireless-next-2026-03-19' of https://git.kernel.org/pub/scm/linux/kernel...
Paolo Abeni [Thu, 19 Mar 2026 14:30:19 +0000 (15:30 +0100)] 
Merge tag 'wireless-next-2026-03-19' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next

Johannes Berg says:

====================
Aside from various small improvements/cleanups, not much:
 - cfg80211/mac80211: S1G and UHR improvements
 - hwsim: incumbent signal report test support

* tag 'wireless-next-2026-03-19' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (31 commits)
  qtnfmac: use alloc_netdev macro for single queue devices
  wifi: libertas: don't kill URBs in interrupt context
  wifi: libertas: use USB anchors for tracking in-flight URBs
  wifi: nl80211: use int for band coming from netlink
  wifi: rsi_91x_usb: do not pause rfkill polling when stopping mac80211
  wifi: mac80211: fix STA link removal during link removal
  wifi: nl80211: reject S1G/60G with HT chantype
  wifi: ieee80211: fix definition of EHT-MCS 15 in MRU
  wifi: cfg80211: check non-S1G width with S1G chandef
  wifi: cfg80211: restrict cfg80211_chandef_create() to only HT-based bands
  wifi: mac80211: don't use cfg80211_chandef_create() for default chandef
  wifi: mac80211: Remove deleted sta links in ieee80211_ml_reconf_work()
  wifi: b43: use register definitions in nphy_op_software_rfkill
  wifi: cfg80211: split control freq check from chandef check
  wifi: mac80211: always use full chanctx compatible check
  wifi: mac80211: refactor chandef tracing macros
  wifi: mac80211: validate HE 6 GHz operation when EHT is used
  wifi: nl80211: split out UHR operation information
  wifi: mwifiex: drop redundant device reference
  wifi: rt2x00: drop redundant device reference
  ...
====================

Link: https://patch.msgid.link/20260319082439.79875-3-johannes@sipsolutions.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agobridge: No DEV_PATH_BR_VLAN_UNTAG_HW for dsa foreign
Eric Woudstra [Tue, 17 Mar 2026 11:03:47 +0000 (12:03 +0100)] 
bridge: No DEV_PATH_BR_VLAN_UNTAG_HW for dsa foreign

In network setup as below:

             fastpath bypass
 .----------------------------------------.
/                                          \
|                        IP - forwarding    |
|                       /                \  v
|                      /                  wan ...
|                     /
|                     |
|                     |
|                   brlan.1
|                     |
|    +-------------------------------+
|    |           vlan 1              |
|    |                               |
|    |     brlan (vlan-filtering)    |
|    |               +---------------+
|    |               |  DSA-SWITCH   |
|    |    vlan 1     |               |
|    |      to       |               |
|    |   untagged    1     vlan 1    |
|    +---------------+---------------+
.         /                   \
 ----->wlan1                 lan0
       .                       .
       .                       ^
       ^                     vlan 1 tagged packets
     untagged packets

br_vlan_fill_forward_path_mode() sets DEV_PATH_BR_VLAN_UNTAG_HW when
filling in from brlan.1 towards wlan1. But it should be set to
DEV_PATH_BR_VLAN_UNTAG in this case. Using BR_VLFLAG_ADDED_BY_SWITCHDEV
is not correct. The dsa switchdev adds it as a foreign port.

The same problem for all foreignly added dsa vlans on the bridge.

First add the vlan, trying only native devices.
If this fails, we know this may be a vlan from a foreign device.

Use BR_VLFLAG_TAGGING_BY_SWITCHDEV to make sure DEV_PATH_BR_VLAN_UNTAG_HW
is set only when there if no foreign device involved.

Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Eric Woudstra <ericwouds@gmail.com>
Link: https://patch.msgid.link/20260317110347.363875-1-ericwouds@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agoMerge tag 'ovpn-net-next-20260317' of https://github.com/OpenVPN/ovpn-net-next
Paolo Abeni [Thu, 19 Mar 2026 11:50:42 +0000 (12:50 +0100)] 
Merge tag 'ovpn-net-next-20260317' of https://github.com/OpenVPN/ovpn-net-next

Antonio Quartulli says:

====================
Included features:
* use bitops.h API when possible
* send netlink notification in case of client float event
* implement support for asymmetric peer IDs
* consolidate memory allocations during crypto operations
* add netlink notification check in selftests
* add FW mark check in selftest

* tag 'ovpn-net-next-20260317' of https://github.com/OpenVPN/ovpn-net-next:
  ovpn: consolidate crypto allocations in one chunk
  selftests: ovpn: add test for the FW mark feature
  selftests: ovpn: check asymmetric peer-id
  ovpn: add support for asymmetric peer IDs
  selftests: ovpn: add notification parsing and matching
  ovpn: notify userspace on client float event
  ovpn: pktid: use bitops.h API
  ovpn: use correct array size to parse nested attributes in ovpn_nl_key_swap_doit
  selftests: ovpn: allow compiling ovpn-cli.c with mbedtls3
====================

Link: https://patch.msgid.link/20260317104023.192548-1-antonio@openvpn.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agol2tp: ppp: use max L2TP header size for PPP channel hdrlen
Qingfang Deng [Tue, 17 Mar 2026 05:41:40 +0000 (13:41 +0800)] 
l2tp: ppp: use max L2TP header size for PPP channel hdrlen

chan.hdrlen is read once at channel registration by
ppp_register_net_channel(), and used to set the PPP net device's
hard_header_len. It was set to PPPOL2TP_L2TP_HDR_SIZE_NOSEQ (6), which
is 4 bytes too small if sequence numbers are later enabled via
setsockopt(PPPOL2TP_SO_SENDSEQ), causing unnecessary skb reallocations
on the TX path.

The setsockopt handler attempted to change netdev's hard_header_len by
updating chan.hdrlen, but the PPP layer never re-reads it after the
registration, so the update had no effect.

To avoid the unnecessary reallocations, set chan.hdrlen to
PPPOL2TP_L2TP_HDR_SIZE_SEQ (10) unconditionally at registration and
remove the ineffective update in the setsockopt callback.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://patch.msgid.link/20260317054141.524879-1-dqfext@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agoselftests/net: packetdrill: improve tcp_rcv_neg_window.pkt
Simon Baatz [Mon, 16 Mar 2026 18:51:10 +0000 (19:51 +0100)] 
selftests/net: packetdrill: improve tcp_rcv_neg_window.pkt

The test depends on accepting a packet that is larger than the
advertised window and that does not trigger an immediate ACK.

Previously, the test might still pass even if kernel behavior changed
unexpectedly. Add assertions verifying that the large packet was
accepted and no ACK was sent.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Link: https://patch.msgid.link/20260316-improve_tcp_neg_usable_wnd_test-v1-1-f16d5e365107@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agoqtnfmac: use alloc_netdev macro for single queue devices
Roi L [Sat, 14 Mar 2026 16:08:49 +0000 (18:08 +0200)] 
qtnfmac: use alloc_netdev macro for single queue devices

alloc_netdev is a macro for single queue devices, so there's no need to
call alloc_netdev_mqs with a single tx/rx queue.

Signed-off-by: Roi L <roeilev321_@outlook.com>
Link: https://patch.msgid.link/SN6PR05MB58064E57FE979CE7B2BF7EF3DD42A@SN6PR05MB5806.namprd05.prod.outlook.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: libertas: don't kill URBs in interrupt context
Heitor Alves de Siqueira [Fri, 13 Mar 2026 21:27:58 +0000 (18:27 -0300)] 
wifi: libertas: don't kill URBs in interrupt context

Serialization for the TX path was enforced by calling
usb_kill_urb()/usb_kill_anchored_urbs(), to prevent transmission before
a previous URB was completed. usb_tx_block() can be called from
interrupt context (e.g. in the HCD giveback path), so we can't always
use it to kill in-flight URBs.

Prevent sleeping during interrupt context by checking the tx_submitted
anchor for existing URBs. We now return -EBUSY, to indicate there's
a pending request.

Reported-by: syzbot+74afbb6355826ffc2239@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=74afbb6355826ffc2239
Fixes: d66676e6ca96 ("wifi: libertas: fix WARNING in usb_tx_block")
Signed-off-by: Heitor Alves de Siqueira <halves@igalia.com>
Link: https://patch.msgid.link/20260313-libertas-usb-anchors-v1-2-915afbe988d7@igalia.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: libertas: use USB anchors for tracking in-flight URBs
Heitor Alves de Siqueira [Fri, 13 Mar 2026 21:27:57 +0000 (18:27 -0300)] 
wifi: libertas: use USB anchors for tracking in-flight URBs

The libertas driver currently handles URB lifecycles manually, which
makes it non-trivial to check if specific URBs are pending or not. Add
anchors for TX/RX URBs, and use those to track in-flight requests.

Signed-off-by: Heitor Alves de Siqueira <halves@igalia.com>
Link: https://patch.msgid.link/20260313-libertas-usb-anchors-v1-1-915afbe988d7@igalia.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: nl80211: use int for band coming from netlink
Johannes Berg [Mon, 16 Mar 2026 11:30:50 +0000 (12:30 +0100)] 
wifi: nl80211: use int for band coming from netlink

This was pointed out before, but there are issues with just
removing the <0 check since enum representation isn't fixed,
nla_type() returns int but really can only return small
non-negative values, etc. Now newer versions of sparse are
also starting to warn on it. Just use int for the band var.

Link: https://patch.msgid.link/20260316123050.8c2d9f3426a0.I86acfa785982993fbffd148cc59049991bd6158f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: rsi_91x_usb: do not pause rfkill polling when stopping mac80211
Ville Nummela [Wed, 18 Mar 2026 08:19:12 +0000 (10:19 +0200)] 
wifi: rsi_91x_usb: do not pause rfkill polling when stopping mac80211

Removing rsi_91x USB adapter could cause rtnetlink to lock up.
When rsi_mac80211_stop is called, wiphy_lock is locked. Call to
wiphy_rfkill_stop_polling would wait until the work queue has
finished, but because the work queue waits for wiphy_lock, that
would never happen.

Moving the call to rsi_disconnect avoids the lock up.

Signed-off-by: Ville Nummela <ville.nummela@kempower.com>
Link: https://patch.msgid.link/20260318081912.87744-1-ville.nummela@kempower.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: mac80211: fix STA link removal during link removal
Johannes Berg [Wed, 18 Mar 2026 17:06:22 +0000 (18:06 +0100)] 
wifi: mac80211: fix STA link removal during link removal

ieee80211_sta_free_link() only frees the link and doesn't
unhash it, so it can't be used here. Instead this needs
to use ieee80211_sta_remove_link(), which unhashes it. An
argument against it was that it also calls the driver and
that already happened, but calls to the driver removing a
link that's already removed are suppressed, so that's not
actually an issue. Use it to fix the hashtable.

Reported-and-tested-by: Jouni Malinen <j@w1.fi>
Fixes: 84674b03d8bf ("wifi: mac80211: Remove deleted sta links in ieee80211_ml_reconf_work()")
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260318180622.9240067117e9.I45fb2b7f04d75e48d2f3e9c6650ef9f54a314f5b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agoMerge branch 'add-ethtool-coalesce_rx_cqe_frames-nsecs-and-use-it-in-mana-driver'
Jakub Kicinski [Thu, 19 Mar 2026 03:01:14 +0000 (20:01 -0700)] 
Merge branch 'add-ethtool-coalesce_rx_cqe_frames-nsecs-and-use-it-in-mana-driver'

Haiyang Zhang says:

====================
add ethtool COALESCE_RX_CQE_FRAMES/NSECS and use it in MANA driver

Add two parameters for drivers supporting Rx CQE Coalescing.

ETHTOOL_A_COALESCE_RX_CQE_FRAMES:
Maximum number of frames that can be coalesced into a CQE or
writeback.

ETHTOOL_A_COALESCE_RX_CQE_NSECS:
Max time in nanoseconds after the first packet arrival in a
coalesced CQE or writeback to be sent.

Also implement it in MANA driver with the new parameter and
counters.
====================

Link: https://patch.msgid.link/20260317191826.1346111-1-haiyangz@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agonet: mana: Add ethtool counters for RX CQEs in coalesced type
Haiyang Zhang [Tue, 17 Mar 2026 19:18:07 +0000 (12:18 -0700)] 
net: mana: Add ethtool counters for RX CQEs in coalesced type

For RX CQEs with type CQE_RX_COALESCED_4, to measure the coalescing
efficiency, add counters to count how many contains 2, 3, 4 packets
respectively.
Also, add a counter for the error case of first packet with length == 0.

Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://patch.msgid.link/20260317191826.1346111-4-haiyangz@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agonet: mana: Add support for RX CQE Coalescing
Haiyang Zhang [Tue, 17 Mar 2026 19:18:06 +0000 (12:18 -0700)] 
net: mana: Add support for RX CQE Coalescing

Our NIC can have up to 4 RX packets on 1 CQE. To support this feature,
check and process the type CQE_RX_COALESCED_4. The default setting is
disabled, to avoid possible regression on latency.

And, add ethtool handler to switch this feature. To turn it on, run:
  ethtool -C <nic> rx-cqe-frames 4
To turn it off:
  ethtool -C <nic> rx-cqe-frames 1

The rx-cqe-nsec is the time out value in nanoseconds after the first
packet arrival in a coalesced CQE to be sent. It's read-only for this
NIC.

Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://patch.msgid.link/20260317191826.1346111-3-haiyangz@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agonet: ethtool: add ethtool COALESCE_RX_CQE_FRAMES/NSECS
Haiyang Zhang [Tue, 17 Mar 2026 19:18:05 +0000 (12:18 -0700)] 
net: ethtool: add ethtool COALESCE_RX_CQE_FRAMES/NSECS

Add two parameters for drivers supporting Rx CQE coalescing /
descriptor writeback.

ETHTOOL_A_COALESCE_RX_CQE_FRAMES:
Maximum number of frames that can be coalesced into a CQE or
writeback.

ETHTOOL_A_COALESCE_RX_CQE_NSECS:
Max time in nanoseconds after the first packet arrival in a
coalesced CQE or writeback to be sent.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://patch.msgid.link/20260317191826.1346111-2-haiyangz@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agonet/mlx5e: Remove unused field in mlx5e_flow_steering struct
Saeed Mahameed [Tue, 17 Mar 2026 10:45:48 +0000 (12:45 +0200)] 
net/mlx5e: Remove unused field in mlx5e_flow_steering struct

Not used in mlx5e, clean it up.

Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260317104548.15697-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agoselftests/vsock: auto-detect kernel for guest VMs
Bobby Eshleman [Tue, 17 Mar 2026 00:56:15 +0000 (17:56 -0700)] 
selftests/vsock: auto-detect kernel for guest VMs

When running vmtest.sh inside a nested VM the running kernel may not be
installed on the filesystem at the standard /boot/ or /usr/lib/modules/
paths.

Previously, this would cause vng to fail with "does not exist" since it
could not find the kernel image. Instead, this patch uses --dry-run to
detect if the kernel is available. If not, then we fall back to the
kernel in the kernel source tree. If that fails, then we die.

This way runners, like NIPA, can use vng --run arch/x86/boot/bzImage to
setup an outer VM, and vmtest.sh will still do the right thing setting
up the inner VM.

Due to job control issues in vng, a workaround is used to prevent 'make
kselftest TARGETS=vsock' from hanging until test timeout. A PR has been
placed upstream to solve the issue in vng:

https://github.com/arighi/virtme-ng/pull/453

Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/20260316-vsock-vmtest-autodetect-kernel-v2-1-5eec7b4831f8@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agoMerge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox...
Jakub Kicinski [Thu, 19 Mar 2026 02:08:49 +0000 (19:08 -0700)] 
Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux

Tariq Toukan says:

====================
mlx5-next updates 2026-03-17

The following pull-request contains common mlx5 updates

* 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux:
  net/mlx5: Expose MLX5_UMR_ALIGN definition
  {net/RDMA}/mlx5: Add LAG demux table API and vport demux rules
  net/mlx5: Add VHCA RX flow destination support for FW steering
  net/mlx5: LAG, replace mlx5_get_dev_index with LAG sequence number
  net/mlx5: E-switch, modify peer miss rule index to vhca_id
  net/mlx5: LAG, use xa_alloc to manage LAG device indices
  net/mlx5: LAG, replace pf array with xarray
  net/mlx5: Add silent mode set/query and VHCA RX IFC bits
  net/mlx5: Add IFC bits for shared headroom pool PBMC support
  net/mlx5: Expose TLP emulation capabilities
  net/mlx5: Add TLP emulation device capabilities
====================

Link: https://patch.msgid.link/20260317075844.12066-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agoqed: Reimplement qed_mcast_bin_from_mac() using library functions
Eric Biggers [Mon, 16 Mar 2026 22:14:53 +0000 (15:14 -0700)] 
qed: Reimplement qed_mcast_bin_from_mac() using library functions

The calculation done by qed_calc_crc32c() is the standard
least-significant-bit-first CRC-32C except it uses
most-significant-bit-first order for the actual CRC variable.  That is
equivalent to bit-reflecting the input and output CRC.  Replace it with
equivalent calls to the corresponding library functions.

Tested with a simple userspace program which tested that the old and new
implementations of qed_mcast_bin_from_mac() produce the same outputs.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Link: https://patch.msgid.link/20260316221453.66078-1-ebiggers@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agoMerge branch 'net-mlx5-support-ptm-on-arm-architecture'
Jakub Kicinski [Thu, 19 Mar 2026 02:05:16 +0000 (19:05 -0700)] 
Merge branch 'net-mlx5-support-ptm-on-arm-architecture'

Tariq Toukan says:

====================
net/mlx5: Support PTM on ARM architecture

This series by Carolina refactors mlx5 crosststamp initialization and
enables cross-timestamp support on ARM.
====================

Link: https://patch.msgid.link/20260316133607.8738-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agonet/mlx5: Support cross-timestamping on ARM architectures
Carolina Jubran [Mon, 16 Mar 2026 13:36:07 +0000 (15:36 +0200)] 
net/mlx5: Support cross-timestamping on ARM architectures

Extend cross-timestamp support for ARM systems that implement the ARM
architected timer.

Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Shahar Shitrit <shshitrit@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260316133607.8738-3-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agonet/mlx5: Move crosststamp setup into helper function
Carolina Jubran [Mon, 16 Mar 2026 13:36:06 +0000 (15:36 +0200)] 
net/mlx5: Move crosststamp setup into helper function

Move the crosststamp registration logic into a dedicated helper,
mlx5_init_crosststamp().

This prepares the code for a follow-up patch around PTM handling.

Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Shahar Shitrit <shshitrit@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260316133607.8738-2-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agoMerge branch 'net-mdio-gpio-remove-unneeded-headers'
Jakub Kicinski [Thu, 19 Mar 2026 01:30:00 +0000 (18:30 -0700)] 
Merge branch 'net-mdio-gpio-remove-unneeded-headers'

Bartosz Golaszewski says:

====================
net: mdio-gpio: remove unneeded headers

This removes linux/mdio-gpio.h and linux/platform_data/mdio-gpio.h as
they are not needed due to the symbols either being used by the
mdio-gpio module alone or not used at all.
====================

Link: https://patch.msgid.link/20260316-gpio-mdio-hdr-cleanup-v1-0-2df696f74728@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agonet: mdio-gpio: remove linux/platform_data/mdio-gpio.h
Bartosz Golaszewski [Mon, 16 Mar 2026 10:04:04 +0000 (11:04 +0100)] 
net: mdio-gpio: remove linux/platform_data/mdio-gpio.h

Nobody defines struct mdio_gpio_platform_data. Remove platform data
support from mdio-gpio and drop the header.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260316-gpio-mdio-hdr-cleanup-v1-2-2df696f74728@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>